OSDN Git Service

Catch double unbind of dead service
authorTobias Lindskog <tobias.lindskog@sony.com>
Mon, 12 Mar 2018 14:44:47 +0000 (15:44 +0100)
committerJulia Reynolds <juliacr@google.com>
Fri, 20 Apr 2018 17:14:35 +0000 (13:14 -0400)
commit33ecd1bca766416bb8e7d5bd4cdf12cc4d3d6445
treec5edad569e03e03ee82e475fb40818a3beca852f
parent5e12ebfffd813fc7035c9eef60220914dc92482f
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
services/core/java/com/android/server/notification/ManagedServices.java