Link to the main TARE flag and default value instead of the Settings
default.
Bug: 158300259
Test: atest CtsAlarmManagerTestCases
Test: atest CtsBatterySavingTestCases
Test: atest CtsJobSchedulerTestCases
Test: atest SettingsBackupTest
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/alarm
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/tare
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/tare
Test: Interact with UI and check settings via adb
Change-Id: I6afd0bdf56f39758076b6182fc4893a37760428b
Create separate fields for minimum and initial consumption limits so
that they can be modified independently.
Bug: 255321890
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/tare
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/tare
Test: manually change in Developer Options UI
Change-Id: I82c146a18b54a18313de590038f2f807a2310aa0
The switch should be on if the default state is on. Also, make sure the
revert button is accessible if the default value is on.
Bug: 240726265
Test: Toggle the switch and then Revert to Defaults with the default value as on
Change-Id: I07d1713316281b0590fab7f1581e15d9f5e57969
1. Add configuration support for the ongoing rewards (that are normally
less than 1 ARC).
2. Fix key/configuration of instant rewards
3. Fix UI string issue
Bug: 158300259
Bug: 189850067
Bug: 191876714
Bug: 191877052
Test: Use UI to change factors. Check Settings via adb and TARE dumpsys
Change-Id: I571e188faa6915ea74826b725c9883a825ab152a
1. Use a ContentObserver so the UI is always up-to-date.
2. Don't write a value when it would effectively be putting the default
value and the current value is null. This allows us to have a "use
default" option so that DeviceConfig can take over if a user ever
resets to default settings.
Bug: 158300259
Bug: 189850067
Bug: 205624100
Test: manually toggle and look at logcat for expected values
Change-Id: I429977d37cd8afc2ce12b89cbac002503484ad7e
Make it possible to configure the instant and max values of all
supported actions. Ongoing rewards will be enabled later.
Bug: 158300259
Bug: 189850067
Bug: 191876714
Bug: 191877052
Test: Manual
Change-Id: Ia854f18820f3fe95b3b1448c5fa8411853859052
Make it possible to configure the base price and cost to produce of all
supported actions.
Bug: 158300259
Bug: 189850067
Bug: 191876714
Bug: 191877052
Test: Manual
Change-Id: I2dcd3382f7404655fb0d10538a426071c157ea18
1. Connect the UI and controller components so that users can make
changes and the changes will be written to settings and properly read
back.
2. Update string constants to reflect changes from TIP1.
3. Refactor components slightly to reduce duplicate code.
4. Hide unsupported factors for now. They'll be added back later.
Bug: 158300259
Test: Manually change factors and check settings constant via adb
Change-Id: I2b70e7013c4766ea50f1f013da582eca74015c6b
1. Create a method for duplicate code.
2. Address style/lint issues.
3. Properly parse settings constant string. The original iteration
wouldn't reset values to their default if the constant string didn't
have a value set.
Bug: 158300259
Test: manual
Change-Id: I994b872ba16f12c8e06ce85aedc526b84e5fa31b
The rest of the TARE classes use pure Android Fragments and will have an
issue trying to create an androidx Fragment, so switch from using an
androidx Fragment to an android Fragment.
Bug: 158300259
Test: manual
Change-Id: I4c27198a66bd51b3822421116b46ae3d80d589ff
Reset all TARE constants, not just the enabled status, when a user
clicks on "Reset to defaults."
Bug: 158300259
Test: manual
Change-Id: I5328c7790729e3358751e703271a6ffd386bb33f
Remove duplicate code for generating the settings constant strings, and
make sure not to write redundant data (setting a value to its default).
Bug: 158300259
Test: Android builds
Change-Id: Id79bae3685bfecb4858574ee38b67b2a554823fe
Updating references based on changes for TIP1. This change is just to
keep things building properly. Updates to the UI and functionality will
be done separately.
Bug: 158300259
Test: Android builds
Change-Id: I3a50c028fe69a6180ae842d3117b5cdfd712e0fd
(cherry picked from commit b05665fa83)
Initializes the JobScheduler constants string in Global Settings and
takes it through the parsing of creating a map with the key:value pairs
linked to the JobScheduler policy. Also changes the way the getter
methods work to take a factor policy so we can know what policy to
change.
Bug: 195056296
Bug: 195056102
Bug: 195055895
Test: Manual
Change-Id: Id82101b2a045dd14bb8eacfbe51c363b4bafb1ce
Implements methods that update the AlarmManager Global Settings String
when the user confirms a value in the Dialog. updateAlarmManagerValue
takes the key of the factor being edited and the edited value enterd by
the user in the dialog assigning it as the current value of the key.
This a new string is then rebuilt with the updated values and assigned
to be the new Settings Global String.
Bug: 195056102
Bug: 195055895
Test: Manual
Change-Id: I5776822c665bdfa052f23099d367ba8cf29743df
Takes the AlarmManager csv string and parsees it for key:value
pairs. These key value pairs are then used to fill in information that
the DialogFragment class needs to display information. An ArrayMap is
used to initialize and store a key and the values associated with it
through a data object class. This data can be retrived in updated by
providing only a key.
Bug: 195056296
Bug: 195056102
Bug: 195055428
Test: Manual
Change-Id: Ia11f41bdd1790f7f3483d33148c251c58243e890
This CL is the base framework for creating and adjusting TARE factor
values. TareFactorDialogFragment sets the basic outline for a factor
that uses a DialogBox to adjust the value. It takes the "title" or name
of the factor, the key that will be associated with the factor, and an
initial value for the factor; then sets up everything so that the factor
value can be easily changed and stored. These factors are also
registered into the settings observer class.
Bug: 195055619
Bug: 193238774
Test: Manual (Made a temporary class instance of the DialogFragment and
showed it in inactive apps onResume())
Change-Id: I3bb67717175e70eab3bbb11f4a42ee63a42f60bc
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
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
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
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
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
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
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