Commit Graph

8 Commits

Author SHA1 Message Date
Kweku Adams
a6693df48d Reset all TARE constants.
Reset all TARE constants, not just the enabled status, when a user
clicks on "Reset to defaults."

Bug: 158300259
Test: manual
Change-Id: I5328c7790729e3358751e703271a6ffd386bb33f
2022-02-23 16:03:10 +00:00
alinasuarez
9dc7f45725 Update UI when TARE settings revert to default
When the TARE revert to default button is clicked, the TARE homepage
updates to the value of the DEFAULT_ENABLE_TARE global variable with this code.

Bug: 195543827

Test: Manual (Settings -> developer options -> TARE -> click revert to
default settings and see the page disabled)

Change-Id: Ia4d126d97ebfb35fbf831bb29cee302acad92e7c
2021-08-06 15:44:41 +00:00
alinasuarez
1031bb2693 TARE Global Toggle
Add functionality to the global toggle within the TARE homepage in the
developer settings. This allows for users and developers to turn these
settings on/off.

Bug: 195552339

Test: Manual (open Settings > System > Developer Options > TARE > turn
on/off the global toggle and leave and go back and make sure it is being
kept track of correctly)

Change-Id: Ifb8dee1aeb04d2b6883ee9e449ed8ab0493dc27a
2021-08-05 15:33:52 +00:00
alinasuarez
e2d2f44888 Revert to Default Settings
Add functionality to the revert default settings button. This currently
writes a null value to the ENABLE_TARE constant. In the future this will
also make the AlarmManager and JobScheduler constants null so that the
default values are used instead of custom config values.

Bug: 195543827

Test: Click on revert to default settings button, check that the value
for ENABLE_TARE is null by running "adb shell settings get global
enable_tare" in the command line

Change-Id: I558e8f1121021eca3224e4bc9b26bbe0dd2467c7
2021-08-04 20:39:09 +00:00
alinasuarez
8073d4eb92 Job Scheduler TARE page implementation
A Job Scheduler policy page is needed in the TARE developer options
settings to allow developers to both view and edit the current values of
all the factors under the job scheduler policy. The page uses a dropdown
so that the user can easily switch between the different policies. For
the factors with subfactors, the user simply clicks on the factor and
the subfactors wil pop up under it.

Bug: 191877052

Test: Manual (open Settings > System > Developer Options > TARE >
JobScheduler and verify all factors are there)

Change-Id: Icea6cda5e4b59d1736f85defcb9532839c3720f5
2021-08-03 02:26:19 +00:00
alinasuarez
aef6ac2889 Alarm Manager policy TARE page implementation
An alarm manager policy page is needed in the TARE developer option
settings to allow developers to both view and edit the current values of
all the factors under the alarm manager policy. The page uses a dropdown
so that the user can easily switch between the different policies. For
the factors with subfactors, the user simply clicks on the factor and
the subfactors will pop up under it.

Bug: 191876714
Bug: 191876567

Test: Manual (open Settings > System > Developer Options > TARE > Alarm
Manger and verify all factors are there)

Change-Id: Ie036e26df80947d23041bedfd5b1385e48069b6b
2021-08-02 17:39:36 +00:00
alinasuarez
1a075e874f TARE string clarification
Clarify the strings used for the TARE homepage. Update
comments so that the translators understand that TARE is not
translatable and that AlarmManager and JobScheduler are Android system
services.

Bug: 191876567

Test: Manual (open Settings > System > Developer Options > TARE and
verify tabs and menus are there)

Change-Id: I935cd0ab9e8e6e5591875a1e7f8ed9f58d8abd9c
2021-07-28 20:17:41 +00:00
alinasuarez
6ffa9dad04 Add TARE button and homepage to developer options.
A TARE button is needed in the developer options in settings to allow
users and developers to change the default settings it will come with.
When clicked, it opens an activity of the TARE homepage with a toggle
and the two policies (Alarm Manager and Job Scheduler) to choose between. It also contains a revert to default settings button.

Bug: 191876567

Test: Manual (open Settings > System > Developer Options > TARE and
verify tabs and menus are there)

Change-Id: Id14bc9c1dcbaaf2aeb74ba7efb0168ab424f5d0c
2021-07-22 20:52:06 +00:00