Get profile parent's context in case of work profile
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 commit is contained in:
@@ -181,7 +181,7 @@ public final class DataProcessor {
|
||||
@Nullable
|
||||
public static Map<Long, UsageEvents> getAppUsageEvents(Context context) {
|
||||
final long start = System.currentTimeMillis();
|
||||
context = DatabaseUtils.getOwnerContext(context);
|
||||
context = DatabaseUtils.getParentContext(context);
|
||||
if (context == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public final class DataProcessor {
|
||||
public static UsageEvents getAppUsageEventsForUser(
|
||||
Context context, final int userID, final long startTimestampOfLevelData) {
|
||||
final long start = System.currentTimeMillis();
|
||||
context = DatabaseUtils.getOwnerContext(context);
|
||||
context = DatabaseUtils.getParentContext(context);
|
||||
if (context == null) {
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user