* Rename variables/arguments to clarify that we are working with policy
flags, meaning that there can be multiple policies described by a
uid policy, not just one.
* When checking policies for a policy flag, do a proper flag check,
rather than a direct comparison that assumes one single policy.
* Only alter the displayed setting for the "Background network access"
and "Unrestricted mobile data usage" toggles in response to underlying
policy changes, to ensure their state represents the current reality.
* Add a couple explanatory comments.
Test: Manual: Install an app that does not have INTERNET permission.
Open the "Unrestricted mobile data" page of Settings. Try to activate
the toggle for such an app. The toggle should activate successfully
without needing to be tapped twice.
Issue: calyxos#2547
Change-Id: I9f2f028be4a21158a68c60982253d85586f60cdb
Stop removing preexisting UID policies when toggling
Background network access / unrestricted data usage.
Fetching the state of policies was not working due to an incorrect use
of Arrays.asList() - if you give it an int array, you just get a list
with that int[] as a single element, so using the contains method with
an int will always return false. This has now all been refactored.
Test: Manual: Open Settings > Network & Internet > Data Saver >
Unrestricted data. Turn it on for something. Go back, and then
return to the page. It should still show as on.
Issue: calyxos#2547
Issue: calyxos#2118
Change-Id2: I671544f6fdf9897484c6265c31c8b3cd29ad4a92
Change-Id: If54d0a0925c5da0f3d519d0a85491ff3b7b62351
Remove DynamicDenylistManager to avoid its conflicting behavior
with our firewall. This stops the resetting of firewall policies
on boot and for other reasons. The user is in control of these
policies and doesn't need them to be unexpectedly reset.
Issue: calyxos#2211
Test: Manual: Turn off Background network access for any app. Then,
in Firewall, turn off another toggle like Wi-Fi. Reboot, and check
the toggles. Background network access and Wi-Fi should still be off.
Change-Id: Ie62ddfa3a893c9adf5d4fd0c8670235a5a51e03f
*) Add options to disable all cellular, vpn and wifi data
in app data usage settings.
*) Disable the existing background data and unrestricted
data usage options when all cellular data access is
disabled.
*) The vpn data option can be selected independently from
the Wi-Fi and cellular options.
*) Prevent DataSaverBackend from overwriting uid policies
This is a replacement for the appops menu based cell/wifi data
restriction settings in cm-13.0:
Author: Danesh M <daneshm90@gmail.com>
Date: Mon Mar 7 15:17:59 2016 -0800
Settings : Add per app internet/data control
CYAN-3976
CRACKLING-834
Change-Id: I13192df837c057b5cadde8f31532e12daaf3c1b0
Change-Id: Ic087c27a5ed0bdb84bb8f297c425c6bcbffec848
(cherry picked from commit d4a2eea698cbc4636a635d60f2a52ec1bbc36ba2)
- Initiate and sync existing network policy when creating the instance
- Imple a method to suggest list of packages to set as POLICY_REJECT
- Reset/clear the policy settings once clear storage or reset
preference
Bug: 306329984
Test: make SettingsRoboTests
Change-Id: I10ba28fee08c29bc2092820fbc8d8ac0e61d30e7
Use AppListRepository instead of ApplicationsState can achieve better
performance.
Fix: 280280596
Test: Manually on Data Saver page
Test: Unit test
Change-Id: I98cbae50500b90e7e7f6101fb064003339b082c1
- Declare the service callback as static class and use WeakReference to avoid the callback link being occupied
- Use application context instead of fragment context to avoid context being occupied by external modules
Bug: 237273138
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=TetherSettingsTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest
Change-Id: Icca145b8ef08b9949feafbbd4e761f8d50c99181
Change wordings in data usage part into inclusive language.
Bug: 160707804
Test: make RunSettingsRoboTests
Change-Id: I713e52df8201413b884257a51bc1f71a0d43179d
Use ApplicationState to count number of apps using unrestricted_data.
Change-Id: I083ff50e3e516536c87afa71d786b22e83d9a498
Fixes: 69313992
Test: robotests
Add the main looper to the handler created with each
DataSaverBackend to avoid crashes when the objects are
created on background threads.
Bug: 62022517
Test: make RunSettingsRoboTests
Change-Id: I7396107e4ed06982c8cd300912ce1f4e3c63df4c
Merged-In: Ie5ffabbfbe7660761527b3ecd51e6bc5a43c1ace
Add the main looper to the handler created with each
DataSaverBackend to avoid crashes when the objects are
created on background threads.
Bug: 62022517
Test: make RunSettingsRoboTests
Change-Id: Ie5ffabbfbe7660761527b3ecd51e6bc5a43c1ace
When user blacklists an app for background data access, the
"Unrestricted data access" list should not display the whitelist toggle
option, but rather explain background access is turned off and offer the
option to open the app's data usage screen to turn it back on.
It still does not handle changed received by DataSaverBackend, so the UI
will be stale when the user removes a blacklist and navigates back to
the list.
BUG: 27481520
Change-Id: I9d0fa9f0180a69ce9bd1417921bf89ec3ba31f01