Commit Graph

9 Commits

Author SHA1 Message Date
Kweku Adams
d7189cc7ce Make final factors configurable.
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
2022-04-27 17:57:01 +00:00
Kweku Adams
10ef599170 Make reward constants configurable.
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
2022-03-22 17:37:07 +00:00
Kweku Adams
2d12b846d4 Update TARE UI.
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
2022-02-23 21:20:25 +00:00
Kweku Adams
bc3304b6a2 Clean up code.
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
2022-02-23 16:30:08 +00:00
Kweku Adams
82b0e1ccdb Simplifying settings string generation.
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
2022-02-22 18:52:35 +00:00
Kweku Adams
2a51b8bfe0 Update constant names.
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)
2022-02-18 21:55:13 +00:00
Joshua
76ca8923ab Add JobScheduler support in factor controller
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
2021-08-13 23:44:59 +00:00
Joshua
347f58ad6e Update AlarmManager Global Settings String
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
2021-08-13 19:16:20 +00:00
Joshua
7b2293ef9a Parse AM Constants to get keys:value for Dialog
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
2021-08-13 00:12:24 +00:00