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

Commit d83753d6 authored by Yanting Yang's avatar Yanting Yang Committed by Android Build Coastguard Worker
Browse files

Add DISALLOW_APPS_CONTROL check into uninstall app for all users

Settings App info page supports a "Uninstall for all users" function
when multiple users are enabled. It bypasses the restriction of
DISALLOW_APPS_CONTROL which breaks the user isolation guideline.

To fix this vulnerability, we should check the DISALLOW_APPS_CONTROL
restriction to provide the "Uninstall for all users" function.

Bug: 258653813
Test: manual & robotests
Change-Id: I5d3bbcbaac439c4f7a1e6a9ade7775ff4f2f2ec6
Merged-In: I5d3bbcbaac439c4f7a1e6a9ade7775ff4f2f2ec6
(cherry picked from commit 9191ec13)
Merged-In: I5d3bbcbaac439c4f7a1e6a9ade7775ff4f2f2ec6
parent 3ba0bed4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -385,7 +385,13 @@ public class AppInfoDashboardFragment extends DashboardFragment
            return;
        }
        super.onPrepareOptionsMenu(menu);
        menu.findItem(UNINSTALL_ALL_USERS_MENU).setVisible(shouldShowUninstallForAll(mAppEntry));
        final MenuItem uninstallAllUsersItem = menu.findItem(UNINSTALL_ALL_USERS_MENU);
        uninstallAllUsersItem.setVisible(
                shouldShowUninstallForAll(mAppEntry) && !mAppsControlDisallowedBySystem);
        if (uninstallAllUsersItem.isVisible()) {
            RestrictedLockUtilsInternal.setMenuItemAsDisabledByAdmin(getActivity(),
                    uninstallAllUsersItem, mAppsControlDisallowedAdmin);
        }
        mUpdatedSysApp = (mAppEntry.info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
        final MenuItem uninstallUpdatesItem = menu.findItem(UNINSTALL_UPDATES);
        final boolean uninstallUpdateDisabled = getContext().getResources().getBoolean(