From 4beb6be3538f8da2a8206917cf17d9d5dd4d34ac Mon Sep 17 00:00:00 2001 From: Ruben Brunk Date: Tue, 22 Mar 2016 19:12:25 -0700 Subject: [PATCH] Fix crash in ManagedApplicationService. - Prevent unbindService call in case where we are calling disconnect on a service that has crashed. Bug: 27706497 Change-Id: Ibb24087685f5152b6d8e339bd1e9dfa29be2730b --- .../com/android/server/utils/ManagedApplicationService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/utils/ManagedApplicationService.java b/services/core/java/com/android/server/utils/ManagedApplicationService.java index ad8acef0c12a9..0f251fd838220 100644 --- a/services/core/java/com/android/server/utils/ManagedApplicationService.java +++ b/services/core/java/com/android/server/utils/ManagedApplicationService.java @@ -62,8 +62,6 @@ public class ManagedApplicationService { private IInterface mBoundInterface; private PendingEvent mPendingEvent; - - private ManagedApplicationService(final Context context, final ComponentName component, final int userId, int clientLabel, String settingsAction, BinderChecker binderChecker) { @@ -211,6 +209,7 @@ public class ManagedApplicationService { } else { // Service connection wasn't pending, must have been disconnected mContext.unbindService(this); + return; } try { @@ -242,6 +241,8 @@ public class ManagedApplicationService { @Override public void onServiceDisconnected(ComponentName componentName) { Slog.w(TAG, "Service disconnected: " + intent); + mConnection = null; + mBoundInterface = null; } };