summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-05-06 14:53:50 -0700
committerFelipe Leme <felipeal@google.com>2016-05-06 14:53:50 -0700
commitd31a97fd83468d27d0f4c6e1455c2f6f59d5a7c9 (patch)
tree711fbac1aad9f616f9266c8f5a3e4f42f91e39b3 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentde66540fd3f73937c3cfbe1d50e575aa69acc474 (diff)
Fixed connectivity state in some restricted network scenarios.
NetworkPolicyManagerService (NMPS) keeps an internal list of uid rules (mUidRules) for network restrictions, and when these rules changes it needs to notify external listeners (such as ConnectivityService / CS). Prior to Android N, both Data Saver mode (the feature previously known as "Restrict Baground Data") and Battery Save mode used the same set of firewall rules to implement their restrictions: when Battery Saver mode NPMS would mark all networks as metered and set the proper firewall rules externally. Recently, these 2 modes were split in 2 distinct firewall rules and NMPS.updateRuleForRestrictBackgroundLocked() was changed to update the mUidRules logic based on the Data Saver firewall (since the Battery Saver firewall changes are handled externally, on updateRuleForRestrictPowerLocked()). As such, CS was not notified when the power-related changes were made, which would cause apps to get a state of CONNECTED / CONNECTED when querying its active connection. Another scenario that is not properly handled is when a UID whitelisted for Data Saver is brought back to foreground: although the proper firewall rules are set, CS is not notified, and the apps state would be DISCONNECTED / BLOCKED. This CL introduces many changes that fix this issue: - Fixed updateRuleForRestrictBackgroundLocked() to invoke onUidRulesChanged() when the Battery Saver status changed. - Fixed updateRuleForRestrictBackgroundLocked() to invoke onUidRulesChanged() when an app whitelisted for Data Saver is brought back to the foreground. - Added a new API (onRestrictPowerChanged() and getRestrictPower()) to notify external services about Battery Saver mode changes. - Fixed CS logic to properly handle the Battery Saver changes. Externally to this change, the CTS tests were also improved to verify the apps get the proper connection state; they can be verified running: cts-tradefed run commandAndExit cts -m CtsHostsideNetworkTests \ -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests BUG: 28521946 Change-Id: I8eaccd39968eb4b8c6b34f462fbc541e5daf55f1
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions