OSDN Git Service

Don't use transport binder with the lock held
authorBernardo Rufino <brufino@google.com>
Thu, 18 Jan 2018 15:10:41 +0000 (15:10 +0000)
committerBernardo Rufino <brufino@google.com>
Thu, 18 Jan 2018 19:20:49 +0000 (19:20 +0000)
commit070081bc4f3ed1863a917a5c2ce6aa8b813e7649
tree271080c5bcfa2b4b65cde21915cadfc9d26c56e1
parente8ffec166131d27e47fbf21c9db9f6812051b15f
Don't use transport binder with the lock held

There was a deadlock around the transport lock. We registered transports
with the transport lock held, this kicked-off transport onCreate()
synchronously, which called TransportManager
updateTransportAttributes(), which tried to acquire mentioned lock but
couldn't. This CL removes the lock for any call to the transport or
operation that triggers a call to the transport (it was
TransportClient.connect() or its variants).

Test: Load GMSCore before fix, boot, register transports, check no ANR
Test: m -j RunFrameworksServicesRoboTests
Test: adb shell bmgr transport -c <transport>, being registered & not
Bug: 72147303
Change-Id: I72ca145d7fb73c0ef29c4aa1b620fea4969481db
services/backup/java/com/android/server/backup/TransportManager.java
services/robotests/src/com/android/server/backup/TransportManagerTest.java