Guard mUidBlockedState with a separate lock.
Instead of using the main 'mUidRulesFirstLock', add a granular lock for mUidBlockedState so that network state requests (which only use mUidBlockedState) doesn't get blocked on the highly contended 'mUidRulesFirstLock'. The risk with this change is that it is possible the underlying firewall rules are not consistent with the network blocked state that is returned to the apps. But technically, this is already case if there is an immediate update to network rules after app queries it's network access state. Bug: 209338078 Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: I6a913742647577256c9281dd8ebf4aa5422a49ee
Loading
Please register or sign in to comment