Merge lp:~cmiller/ubuntuone-android-contacts/resume-null-pointer-bug626849 into lp:ubuntuone-android-contacts

Proposed by Chad Miller
Status: Merged
Approved by: Martin Albisetti
Approved revision: 379
Merged at revision: 379
Proposed branch: lp:~cmiller/ubuntuone-android-contacts/resume-null-pointer-bug626849
Merge into: lp:ubuntuone-android-contacts
Diff against target: 63 lines (+25/-9)
2 files modified
externals/jme-sdk/client/src/com/funambol/client/controller/SynchronizationController.java (+5/-0)
src/com/ubuntuone/android/contacts/funambol/activities/AndroidAccountScreen.java (+20/-9)
To merge this branch: bzr merge lp:~cmiller/ubuntuone-android-contacts/resume-null-pointer-bug626849
Reviewer Review Type Date Requested Status
Martin Albisetti (community) Approve
Review via email: mp+34352@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Albisetti (beuno) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'externals/jme-sdk/client/src/com/funambol/client/controller/SynchronizationController.java'
2--- externals/jme-sdk/client/src/com/funambol/client/controller/SynchronizationController.java 2010-08-11 14:31:25 +0000
3+++ externals/jme-sdk/client/src/com/funambol/client/controller/SynchronizationController.java 2010-09-01 21:30:57 +0000
4@@ -829,6 +829,11 @@
5 }
6
7 protected void setScreen(Screen screen) {
8+ if (screen == null) {
9+ Log.info(TAG_LOG, "lpbug626849, setScreen(null)");
10+ } else {
11+ Log.info(TAG_LOG, "lpbug626849, setScreen to non-null");
12+ }
13 this.screen = screen;
14 }
15
16
17=== modified file 'src/com/ubuntuone/android/contacts/funambol/activities/AndroidAccountScreen.java'
18--- src/com/ubuntuone/android/contacts/funambol/activities/AndroidAccountScreen.java 2010-08-18 00:39:55 +0000
19+++ src/com/ubuntuone/android/contacts/funambol/activities/AndroidAccountScreen.java 2010-09-01 21:30:57 +0000
20@@ -116,7 +116,15 @@
21 aren't any credentials. However, we might be being launched after
22 the browser callback has launched the HomeScreen. So get the
23 HomeScreen's Intent to check. */
24- Intent i = ((Activity)this.homeScreenController.getHomeScreen()).getIntent();
25+
26+ Activity homeScreen = (Activity) this.homeScreenController.getHomeScreen();
27+ if (homeScreen == null) {
28+ // If there is no home screen set, we can't get a callback.
29+ android.util.Log.w(TAG, "lpbug626849, onResume, there is no homeScreen set. This could be a bug.");
30+ return;
31+ }
32+
33+ Intent i = homeScreen.getIntent();
34 if (isBrowserCallback(i)) {
35 handleBrowserCallback(i);
36 }
37@@ -125,15 +133,18 @@
38 @Override
39 public boolean onKeyDown(int keyCode, KeyEvent event) {
40
41- if (keyCode == KeyEvent.KEYCODE_BACK && homeScreenController != null &&
42- homeScreenController.getHomeScreen() != null) {
43- // Close the main screen
44- ((Activity)homeScreenController.getHomeScreen()).finish();
45- finish();
46- return false;
47- } else {
48- return super.onKeyDown(keyCode, event);
49+ if (keyCode == KeyEvent.KEYCODE_BACK && homeScreenController != null) {
50+ Activity homeScreen = (Activity) this.homeScreenController.getHomeScreen();
51+ if (homeScreen == null) {
52+ android.util.Log.w(TAG, "lpbug626849, onKeyDown(back), there is no homeScreen set. This could be a bug.");
53+ } else {
54+ homeScreen.finish();
55+ finish();
56+ return false;
57+ }
58 }
59+
60+ return super.onKeyDown(keyCode, event);
61 }
62
63 @Override

Subscribers

People subscribed via source and target branches