Merge "Fix NPE if keyboard settings is launched by work apps"
This commit is contained in:
@@ -44,6 +44,8 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
|
||||
private static boolean sIsSupportsMultipleUsers;
|
||||
|
||||
private static final int PRIMARY_USER_ID = 0;
|
||||
|
||||
private final List<String> mBaseRestrictions = new ArrayList<>();
|
||||
private final List<String> mGuestRestrictions = new ArrayList<>();
|
||||
private final Map<String, List<EnforcingUser>> mRestrictionSources = new HashMap<>();
|
||||
@@ -218,4 +220,10 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
mEnabledTypes.remove(type);
|
||||
}
|
||||
}
|
||||
|
||||
@Implementation
|
||||
protected UserInfo getPrimaryUser() {
|
||||
return new UserInfo(PRIMARY_USER_ID, null, null,
|
||||
UserInfo.FLAG_INITIALIZED | UserInfo.FLAG_ADMIN | UserInfo.FLAG_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user