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(user.id);
for (String key : mDefaultGuestRestrictions.keySet()) {
mUserManager.setUserRestriction(
key, mDefaultGuestRestrictions.getBoolean(key));
key, mDefaultGuestRestrictions.getBoolean(key), userHandle);
}
}
}
} else {
UserHandle userHandle = new UserHandle(mUserInfo.id);
UserHandle userHandle = UserHandle.of(mUserInfo.id);
mUserManager.setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, !enabled,
userHandle);
mUserManager.setUserRestriction(UserManager.DISALLOW_SMS, !enabled, userHandle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment