Throw caught DeadObjectException when trying to create a service.

We don't want to continue trying to start the service if the service
appliction is dead. This will lead to an NPE later on since we have
set ServiceRecord.app to null in the finally block.

Bug: 5227987
Change-Id: I3ee5111f4a20d9455fedbf41ac54d41c43aa8d76
This commit is contained in:
Wale Ogunwale
2015-04-08 14:33:21 -07:00
parent 0c43e55d2d
commit bfac468ce9
2 changed files with 2 additions and 1 deletions

View File

@@ -1519,6 +1519,7 @@ public final class ActiveServices {
} catch (DeadObjectException e) {
Slog.w(TAG, "Application dead when creating service " + r);
mAm.appDiedLocked(app);
throw e;
} finally {
if (!created) {
// Keep the executeNesting count accurate.

View File

@@ -50,7 +50,7 @@ import static com.android.server.am.ActivityManagerDebugConfig.*;
* foreground priority, and one for normal (background-priority) broadcasts.
*/
public final class BroadcastQueue {
private static final String TAG = TAG_WITH_CLASS_NAME ? "BroadcastQueue" : TAG_AM;
private static final String TAG = "BroadcastQueue";
private static final String TAG_MU = TAG + POSTFIX_MU;
private static final String TAG_BROADCAST = TAG + POSTFIX_BROADCAST;