summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-05-14 17:19:18 -0700
committerDianne Hackborn <hackbod@google.com>2012-05-14 17:19:18 -0700
commitb61a02657b9e577179c934bbb5e199ce919c4642 (patch)
tree4da2799e5a097baeda037e7c525334867888132f /core/java/android/app
parent04d3521839c90d1cccf3ee428963a0aef0088ef9 (diff)
downloadframeworks_base-b61a02657b9e577179c934bbb5e199ce919c4642.zip
frameworks_base-b61a02657b9e577179c934bbb5e199ce919c4642.tar.gz
frameworks_base-b61a02657b9e577179c934bbb5e199ce919c4642.tar.bz2
Fix issue #6020164: Settings crashed on orientation change...
...while listening to TTS example This was a nice one. What was happening is that immediately upon being created, the activity was starting another activity in a different process. The second activity would never show, just immediately exit. However the original activity had time to pause and get into stopping itself before the second activity had come back to the activity manager to say it was going away, resulting in the activity manager asking the original activity to resume. At this point the activity manager's state is that the second activity is finishing and gone, and the original activity is resumed. However in the app process the original activity is still working on stopping itself, and it eventually completes this and tells the activity manager. The activity manager now changes its state to STOPPED, even though it is actually resumed and that is the last thing it told it to be, and it is now proceeding to set itself in that state. This would result later in the activity manager sending an unnecessary state change to the application. In the case of the screen here, we next do a rotation change, the activity manager thinks the current state is STOPPED not RESUMED, so it tells the application to relaunch the activity in a new config but not in the resumed state. Now it does the whole "start a new temporary activity" thing again, at which point it tries to pause the original activity again, and we have an unbalanced onPause() call to the app and it falls over. Change-Id: I38b680746f4c61ae30e7ce831e1de187adf60902
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/ActivityThread.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index e2ebeba..5085b1e 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -275,7 +275,7 @@ public final class ActivityThread {
}
public String toString() {
- ComponentName componentName = intent.getComponent();
+ ComponentName componentName = intent != null ? intent.getComponent() : null;
return "ActivityRecord{"
+ Integer.toHexString(System.identityHashCode(this))
+ " token=" + token + " " + (componentName == null