summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMitsuru Oshima <oshima@google.com>2009-06-16 20:20:50 -0700
committerMitsuru Oshima <oshima@google.com>2009-06-16 20:22:12 -0700
commitd9aef73f72cb11ba7f278a0ef13c6d02ffc95851 (patch)
tree343f73ba5f36abec2c5457e85e47696ac713ed8b /core
parent5f15d151b5101fadfe6cba1e8f4aa6367e8c603e (diff)
downloadframeworks_base-d9aef73f72cb11ba7f278a0ef13c6d02ffc95851.zip
frameworks_base-d9aef73f72cb11ba7f278a0ef13c6d02ffc95851.tar.gz
frameworks_base-d9aef73f72cb11ba7f278a0ef13c6d02ffc95851.tar.bz2
Squashed commit of the following:
commit 9798cd23605c96c1d6a29202f4d31f5454079b61 Author: Mitsuru Oshima <oshima@google.com> Date: Tue Jun 16 13:50:44 2009 -0700 Made other toShortString in performDestroyActivity safe. commit 19bf973df81d9d01210effb39c99e5236f2229c1 Author: Mitsuru Oshima <oshima@google.com> Date: Fri Jun 12 15:50:03 2009 -0700 * component can be null after destory? This was causing NPE in catch block, which hides the actual exception. Conflicts: core/java/android/app/ActivityThread.java
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/ActivityThread.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 2fe6471..3676594 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -3217,7 +3217,7 @@ public final class ActivityThread {
r.activity.getComponentName().getClassName());
if (!r.activity.mCalled) {
throw new SuperNotCalledException(
- "Activity " + r.intent.getComponent().toShortString()
+ "Activity " + safeToComponentShortString(r.intent)
+ " did not call through to super.onPause()");
}
} catch (SuperNotCalledException e) {
@@ -3226,7 +3226,7 @@ public final class ActivityThread {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
"Unable to pause activity "
- + r.intent.getComponent().toShortString()
+ + safeToComponentShortString(r.intent)
+ ": " + e.toString(), e);
}
}
@@ -3241,7 +3241,7 @@ public final class ActivityThread {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
"Unable to stop activity "
- + r.intent.getComponent().toShortString()
+ + safeToComponentShortString(r.intent)
+ ": " + e.toString(), e);
}
}
@@ -3266,7 +3266,7 @@ public final class ActivityThread {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
"Unable to retain child activities "
- + r.intent.getComponent().toShortString()
+ + safeToComponentShortString(r.intent)
+ ": " + e.toString(), e);
}
}
@@ -3277,7 +3277,7 @@ public final class ActivityThread {
r.activity.onDestroy();
if (!r.activity.mCalled) {
throw new SuperNotCalledException(
- "Activity " + r.intent.getComponent().toShortString() +
+ "Activity " + safeToComponentShortString(r.intent) +
" did not call through to super.onDestroy()");
}
if (r.window != null) {
@@ -3287,10 +3287,9 @@ public final class ActivityThread {
throw e;
} catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
- ComponentName component = r.intent.getComponent();
- String name = component == null ? "[Unknown]" : component.toShortString();
throw new RuntimeException(
- "Unable to destroy activity " + name + ": " + e.toString(), e);
+ "Unable to destroy activity " + safeToComponentShortString(r.intent)
+ + ": " + e.toString(), e);
}
}
}
@@ -3299,6 +3298,11 @@ public final class ActivityThread {
return r;
}
+ private static String safeToComponentShortString(Intent intent) {
+ ComponentName component = intent.getComponent();
+ return component == null ? "[Unknown]" : component.toShortString();
+ }
+
private final void handleDestroyActivity(IBinder token, boolean finishing,
int configChanges, boolean getNonConfigInstance) {
ActivityRecord r = performDestroyActivity(token, finishing,