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

Commit d47637c0 authored by Pavel Grafov's avatar Pavel Grafov Committed by Evelyn Torres
Browse files

Don't allow hiding SysUi

Hiding SystemUI makes the phone impossible to use even when done inside
managed profile.

Bug: 328182084
Test: manual with custom DPC
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:befa3c99b9571d8f28f4974e0c4adfe538eeba66)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8652f538431ceecd661d1b59a90451c9d4496664)
Merged-In: I847cb6d69db4924b2b3ddb741ac61a8f065e7c78
Change-Id: I847cb6d69db4924b2b3ddb741ac61a8f065e7c78
parent 3c508117
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -16179,9 +16179,11 @@ public class PackageManagerService extends IPackageManager.Stub
                if (shouldFilterApplicationLocked(pkgSetting, callingUid, userId)) {
                    return false;
                }
                // Do not allow "android" is being disabled
                if ("android".equals(packageName)) {
                    Slog.w(TAG, "Cannot hide package: android");
            // Don't allow hiding "android" or SysUI as it makes device unusable.
            if ("android".equals(packageName)
                    || LocalServices.getService(PackageManagerInternal.class)
                            .getSystemUiServiceComponent().getPackageName().equals(packageName)) {
                Slog.w(TAG, "Cannot hide package: " + packageName);
                    return false;
                }
                // Cannot hide static shared libs as they are considered