Skip to content
Commit 8287585b authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

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
parent 162255ae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment