The function insertHourlyUsageDiffDataPerSlot() only supports the slot
has two-hour data now. This assumption is not neccessary. Refactor this
so in my next cl ag/22379150, the last-full-charge slot and now slot
could have only one-hour data.
Bug: 271214926
Test: manual
Change-Id: I57f7898ce1c92b8849baf9a44314455adf0098f4
Use the raw start timestamp instead of the first timestamp in the level
map to query app usage time.
Bug: 273175976
Fix: 273175976
Test: manual
Change-Id: Idb43b2bd5378e2f34ec722354408754f4a439c6d
In the headless system user mode a non-system user can also have
a work profile.
Refactor DatabaseUtils to get the profile parent's context when
the user is a work profile.
Bug: 270039752
Test: make RunSettingsRoboTests
Change-Id: I1fb78c9d91d59d50880a1ea0dd5f83a3d11dd08f
This only happens on the first time the Settings package is installed.
Discussed with Chaohui, the old showSystemApp() logic in Settings->Apps has some issues. This cl updates the logic to the new logic Chaohui provided.
Bug: 265632782
Fix: 265632782
Test: manual
Change-Id: I65ca150cc685409f69b8950b131feb198662f055
events outside the expected period to make sure the app usage calculation near the boundaries are correct.
Test: make RunSettingsRoboTests + manual
Bug: 264858898
Change-Id: I9f6aa5a09a537f48a26a08b7dff8ae81e8a16e2a
* changes:
Refactor processBatteryDiffData() from DataProcessor to BatteryDiffData class.
Refactor PowerUsageFeatureProvider: Cache the config set to avoid generating the set again.
So that only hourly battery diff data needs purgeFakeAndHiddenPackages()
and combineBatteryDiffEntry(). This is also easy to set hourly threshold
in the next cl.
Bug: 264840285
Test: manual
Change-Id: Ie0bc6d53f96285285019dd83c1f39305eca79c71
resource is USAGE_SOURCE_TASK_ROOT_ACTIVITY and taskRootPackageName is
not empty.
This logic is consistent with digital wellbeing: assign the screen-on
time onto task root activity when usage resource is
USAGE_SOURCE_TASK_ROOT_ACTIVITY.
Bug: 260964679
Test: make RunSettingsRoboTests + manual
Change-Id: I4c7ed342d8c00951879f5826bf79575f330ce86e
DataProcessManager and start the async task in DataProcessManager when
there is no battery level data.
Test: make RunSettingsRoboTests + manually
Bug: 260964903
Change-Id: Ie36ab6d121a5596a3abc16e7f570dd0d9b32e11c
Don't show the aggregated other user entry in the app usage list to keep
consistent with screen-on time data.
Bug: 260964903
Test: make RunSettingsRoboTests
Change-Id: Id611e7222602f5ad2ea0fe27fb3f9f62fed31ff9
(1) Use Set<CharSequence> for all the allowlists.
(2) The contains() method of Set<CharSequence> also works for String. No
need an extra contains() util function.
Bug: 262802531
Fix: 262802531
Test: presubmit
Change-Id: Ib2aaf9a3b8db4618a8c46f138e8d35f15b77c104
into background_usage_time_in_ms in the BatteryUsageStats (b/257392992).
Test: make RunSettingsRoboTests + manual
Bug: 258124768
Bug: 253553141
Change-Id: I0967eec0cbe6d0cb7a0535d744a1046dec1d267b
foreground_usage_consume_power, foreground_service_usage_consume_power,
background_usage_consume_power and cached_usage_consume_power into
database and pass them to UI.
Test: make RunSettingsRoboTests + manual
Bug: 256123455
Bug: 258124768
Change-Id: Ic46032f67eff5898f9d4182c517bbebe478eca01
in DataProcessor to make it reusable by BatteryUsageLoaderService.
Bug: 246233366
Test: make RunSettingsRoboTests + manually
Change-Id: I5c721120cc4005044def63937506cc64339a3e6b