Loading core/java/android/os/UserManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -660,6 +660,7 @@ public class UserManager { try { Bundle guestRestrictions = mService.getDefaultGuestRestrictions(); guestRestrictions.putBoolean(DISALLOW_SMS, true); guestRestrictions.putBoolean(DISALLOW_INSTALL_UNKNOWN_SOURCES, true); mService.setUserRestrictions(guestRestrictions, guest.id); } catch (RemoteException re) { Log.w(TAG, "Could not update guest restrictions"); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -3661,11 +3661,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USERS, null); if (mUserManager.getUserInfo(userHandle) == null) { UserInfo info = mUserManager.getUserInfo(userHandle); if (info == null) { // User doesn't exist. throw new IllegalArgumentException( "Attempted to set profile owner for invalid userId: " + userHandle); } if (info.isGuest()) { throw new IllegalStateException("Cannot set a profile owner on a guest"); } if (who == null || !DeviceOwner.isInstalledForUser(who.getPackageName(), userHandle)) { Loading Loading
core/java/android/os/UserManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -660,6 +660,7 @@ public class UserManager { try { Bundle guestRestrictions = mService.getDefaultGuestRestrictions(); guestRestrictions.putBoolean(DISALLOW_SMS, true); guestRestrictions.putBoolean(DISALLOW_INSTALL_UNKNOWN_SOURCES, true); mService.setUserRestrictions(guestRestrictions, guest.id); } catch (RemoteException re) { Log.w(TAG, "Could not update guest restrictions"); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -3661,11 +3661,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USERS, null); if (mUserManager.getUserInfo(userHandle) == null) { UserInfo info = mUserManager.getUserInfo(userHandle); if (info == null) { // User doesn't exist. throw new IllegalArgumentException( "Attempted to set profile owner for invalid userId: " + userHandle); } if (info.isGuest()) { throw new IllegalStateException("Cannot set a profile owner on a guest"); } if (who == null || !DeviceOwner.isInstalledForUser(who.getPackageName(), userHandle)) { Loading