Commit 2b77ad28 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by The Android Automerger

Use the right userId when setting guest restrictions

Bug: 25977335
Change-Id: I5e58fc2d07d111d084dd33bc1fd5514b9bb6ff10
parent 2e214ce5
......@@ -145,14 +145,15 @@ public class UserDetailsSettings extends SettingsPreferenceFragment
List<UserInfo> users = mUserManager.getUsers(true);
for (UserInfo user: users) {
if (user.isGuest()) {
UserHandle userHandle = UserHandle.of(;
for (String key : mDefaultGuestRestrictions.keySet()) {
key, mDefaultGuestRestrictions.getBoolean(key));
key, mDefaultGuestRestrictions.getBoolean(key), userHandle);
} else {
UserHandle userHandle = new UserHandle(;
UserHandle userHandle = UserHandle.of(;
mUserManager.setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, !enabled,
mUserManager.setUserRestriction(UserManager.DISALLOW_SMS, !enabled, userHandle);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment