am b1de932e: am 99ad06c2
: Merge "Change the location mode before applying restrictions" into lmp-dev
* commit 'b1de932ec6c5b3d59b8181701b34b5346beda437': Change the location mode before applying restrictions
This commit is contained in:
@@ -418,9 +418,11 @@ public class UserSettings extends SettingsPreferenceFragment
|
||||
int userId = newUserInfo.id;
|
||||
UserHandle user = new UserHandle(userId);
|
||||
mUserManager.setUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, true, user);
|
||||
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user);
|
||||
// Change the setting before applying the DISALLOW_SHARE_LOCATION restriction, otherwise
|
||||
// the putIntForUser() will fail.
|
||||
Secure.putIntForUser(getContentResolver(),
|
||||
Secure.LOCATION_MODE, Secure.LOCATION_MODE_OFF, userId);
|
||||
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user);
|
||||
Bitmap bitmap = createBitmapFromDrawable(
|
||||
USER_DRAWABLES[userId % UserSettings.USER_DRAWABLES.length]);
|
||||
mUserManager.setUserIcon(userId, bitmap);
|
||||
|
Reference in New Issue
Block a user