Don't let profiles open the UserSettings overflow
Really, profiles aren't expected to open Settings at all. But if they do somehow, the overflow shouldn't appear. Bug: 352542820 Flag: EXEMPT bugfix Test: Try to access the overflow of the work profile by launching its Settings in adb shell am start --user 10 'com.android.settings/.Settings\$UserSettingsActivity' Change-Id: I5e4c095cda3e19fa5c63c2c550a526f5da8ec5c1
This commit is contained in:
@@ -465,7 +465,7 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
if (!isCurrentUserAdmin() && (canSwitchUserNow() || Flags.newMultiuserSettingsUx())
|
if (!isCurrentUserAdmin() && (canSwitchUserNow() || Flags.newMultiuserSettingsUx())
|
||||||
&& !isCurrentUserGuest()) {
|
&& !isCurrentUserGuest() && !mUserManager.isProfile()) {
|
||||||
String nickname = mUserManager.getUserName();
|
String nickname = mUserManager.getUserName();
|
||||||
MenuItem removeThisUser = menu.add(0, MENU_REMOVE_USER, pos++,
|
MenuItem removeThisUser = menu.add(0, MENU_REMOVE_USER, pos++,
|
||||||
getResources().getString(R.string.user_remove_user_menu, nickname));
|
getResources().getString(R.string.user_remove_user_menu, nickname));
|
||||||
|
Reference in New Issue
Block a user