OSDN Git Service

Never interact with "phone" while holding locks.
authorJeff Sharkey <jsharkey@android.com>
Wed, 18 Apr 2018 21:42:57 +0000 (15:42 -0600)
committerJeff Sharkey <jsharkey@android.com>
Thu, 19 Apr 2018 20:41:35 +0000 (14:41 -0600)
commit146bb336ecb36bfa27529828172ec7593d4fb2f5
treec06982672af5279478e3c436e8b0e36f8ff779b0
parent56487413b75e09100d9aabb9a8c1cf83b39ef34c
Never interact with "phone" while holding locks.

We've seen devices where heavy communication between "system_server"
and the "phone" process can exhuast Binder threads, especially when
calling while holding locks.  To mitigate this, we now interact with
the "phone" process before acquiring any locks.

Update our internal data structures either when we see a connectivity
change, or when SubscriptionManager tells us something changed.

Fix bug in resolveSubscriptionPlan() that always picked the 0'th
SubscriptionPlan instead of looking for the currently active plan;
we now use the same logic for both NSS and NPMS.

Bug: 7790852077154412
Test: atest com.android.server.NetworkPolicyManagerServiceTest
Test: atest com.android.server.net.NetworkStatsServiceTest
Change-Id: I177d3fa6cddc78d745b35a9ede12451d458b892c
services/core/java/com/android/server/net/NetworkPolicyManagerInternal.java
services/core/java/com/android/server/net/NetworkPolicyManagerService.java
services/core/java/com/android/server/net/NetworkStatsService.java