Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5efa8315 authored by Adam Bookatz's avatar Adam Bookatz Committed by Android Build Coastguard Worker
Browse files

Don't let profiles open the UserSettings overflow [DO NOT MERGE]

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'

(cherry picked from commit 69c7f5da)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ee39c30c69a2820deebb8e1c32b95a3167cbfe50)
Merged-In: I5e4c095cda3e19fa5c63c2c550a526f5da8ec5c1
Change-Id: I5e4c095cda3e19fa5c63c2c550a526f5da8ec5c1
parent 19c68149
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -380,8 +380,8 @@ public class UserSettings extends SettingsPreferenceFragment
        int pos = 0;
        // TODO(b/191509236): The menu item does not need to be accessible for guest users,
        //  regardless of mGuestUserAutoCreated
        if (!mUserCaps.mIsAdmin && canSwitchUserNow() && !(isCurrentUserGuest()
                && mGuestUserAutoCreated)) {
        if (!mUserCaps.mIsAdmin && canSwitchUserNow() && !mUserManager.isProfile()
                && !(isCurrentUserGuest() && mGuestUserAutoCreated)) {
            String nickname = mUserManager.getUserName();
            MenuItem removeThisUser = menu.add(0, MENU_REMOVE_USER, pos++,
                    getResources().getString(R.string.user_remove_user_menu, nickname));