Guard slices from being requested by guest user
According to patch of A-231987122, AOSP restricts app to modify relevant mobile settings when user is a guest. This change intends to prevent the slices related to mobile settings from being requested by guest user. Bug: 278616139 Bug: 277333776 Bug: 262244832 Bug: 278616520 Bug: 278615120 Test: robotests Change-Id: I4dc4bbfdb5cf76e188e6f62ebfd74ef6fa2fe33b
This commit is contained in:
@@ -55,6 +55,7 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
private int[] profileIdsForUser = new int[0];
|
||||
private boolean mUserSwitchEnabled;
|
||||
private Bundle mDefaultGuestUserRestriction = new Bundle();
|
||||
private boolean mIsGuestUser = false;
|
||||
|
||||
private @UserManager.UserSwitchabilityResult int mSwitchabilityStatus =
|
||||
UserManager.SWITCHABILITY_STATUS_OK;
|
||||
@@ -270,4 +271,13 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
|
||||
mUserProfileInfos.get(i).flags |= UserInfo.FLAG_ADMIN;
|
||||
}
|
||||
}
|
||||
|
||||
@Implementation
|
||||
protected boolean isGuestUser() {
|
||||
return mIsGuestUser;
|
||||
}
|
||||
|
||||
public void setGuestUser(boolean isGuestUser) {
|
||||
mIsGuestUser = isGuestUser;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user