Merge "Use Device Policy dialog in switchbar"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b67abe180c
@@ -26,6 +26,7 @@ import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Implementation;
|
||||
import org.robolectric.annotation.Implements;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.annotation.Resetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -38,6 +39,8 @@ import java.util.Set;
|
||||
@Implements(value = UserManager.class)
|
||||
public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager {
|
||||
|
||||
private static boolean sIsSupportsMultipleUsers;
|
||||
|
||||
private final List<String> mRestrictions = new ArrayList<>();
|
||||
private final Map<String, List<EnforcingUser>> mRestrictionSources = new HashMap<>();
|
||||
private final List<UserInfo> mUserProfileInfos = new ArrayList<>();
|
||||
@@ -50,6 +53,11 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
mUserProfileInfos.add(userInfo);
|
||||
}
|
||||
|
||||
@Resetter
|
||||
public static void reset() {
|
||||
sIsSupportsMultipleUsers = false;
|
||||
}
|
||||
|
||||
@Implementation
|
||||
protected List<UserInfo> getProfiles(@UserIdInt int userHandle) {
|
||||
return mUserProfileInfos;
|
||||
@@ -124,4 +132,13 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
public void setUserSwitcherEnabled(boolean userSwitchEnabled) {
|
||||
mUserSwitchEnabled = userSwitchEnabled;
|
||||
}
|
||||
|
||||
@Implementation
|
||||
protected static boolean supportsMultipleUsers() {
|
||||
return sIsSupportsMultipleUsers;
|
||||
}
|
||||
|
||||
public void setSupportsMultipleUsers(boolean supports) {
|
||||
sIsSupportsMultipleUsers = supports;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user