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
This commit is contained in:
Ruben Brunk
2016-03-22 19:12:25 -07:00
parent 482c7da6ab
commit 4beb6be353

View File

@@ -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;
}
};