Use taskRootPackageName instead of packageName to load uid when usage

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
This commit is contained in:
Kuan Wang
2022-12-19 14:54:50 +08:00
parent a1a7cba6a6
commit 2c7f06e9b3
3 changed files with 122 additions and 13 deletions

View File

@@ -256,7 +256,8 @@ public final class DataProcessor {
break;
}
final AppUsageEvent appUsageEvent =
ConvertUtils.convertToAppUsageEvent(context, event, userId);
ConvertUtils.convertToAppUsageEvent(
context, sUsageStatsManager, event, userId);
if (appUsageEvent != null) {
numEventsFetched++;
appUsageEventList.add(appUsageEvent);