Merge "Don't allow creating a guest from a secondary user..." into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
69b674656a
@@ -920,8 +920,11 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No guest user. Create one.
|
// No guest user. Create one, if there's no restriction.
|
||||||
if (mUserManager.hasUserRestriction(UserManager.DISALLOW_ADD_USER)) {
|
// If it is not the primary user, then adding users from lockscreen must be enabled
|
||||||
|
if (mUserManager.hasUserRestriction(UserManager.DISALLOW_ADD_USER)
|
||||||
|
|| (!mIsOwner && Settings.Global.getInt(getContentResolver(),
|
||||||
|
Settings.Global.ADD_USERS_WHEN_LOCKED, 0) != 1)) {
|
||||||
Log.i(TAG, "Blocking guest creation because it is restricted");
|
Log.i(TAG, "Blocking guest creation because it is restricted");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user