diff options
| author | 2018-03-12 15:44:47 +0100 | |
|---|---|---|
| committer | 2018-04-20 13:14:35 -0400 | |
| commit | 33ecd1bca766416bb8e7d5bd4cdf12cc4d3d6445 (patch) | |
| tree | c5edad569e03e03ee82e475fb40818a3beca852f | |
| parent | 5e12ebfffd813fc7035c9eef60220914dc92482f (diff) | |
Catch double unbind of dead service
If a service receives onBindingDied after it has successfully connected
once, unbindService would be called once from the onBindingDied and then
again from registerServiceLocked when the service was rebound. This
second attempt would typically crash.
The first unbindService call has a try/catch, add one around the second
call as well.
Fixes: 78345567
Test: Manual. Boots and reboots without problems.
Change-Id: Ie9eabbcb6ee89c05abc565427465cfd6906f3fa3
Merged-In: Ie9eabbcb6ee89c05abc565427465cfd6906f3fa3
| -rw-r--r-- | services/core/java/com/android/server/notification/ManagedServices.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java index 4c8b91baad0a..477b062ac90f 100644 --- a/services/core/java/com/android/server/notification/ManagedServices.java +++ b/services/core/java/com/android/server/notification/ManagedServices.java @@ -926,7 +926,11 @@ abstract public class ManagedServices { Slog.v(TAG, " disconnecting old " + getCaption() + ": " + info.service); removeServiceLocked(i); if (info.connection != null) { - mContext.unbindService(info.connection); + try { + mContext.unbindService(info.connection); + } catch (IllegalArgumentException e) { + Slog.e(TAG, "failed to unbind " + name, e); + } } } } |