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

Commit a5111bfd authored by Ricky Wai's avatar Ricky Wai Committed by Android (Google) Code Review
Browse files

Merge "Do not allow to disable package "android"" into nyc-mr1-dev

parents 5710e919 1a7b160c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -11511,12 +11511,18 @@ public class PackageManagerService extends IPackageManager.Stub {
                if (pkgSetting == null) {
                    return false;
                }
                // Do not allow "android" is being disabled
                if ("android".equals(packageName)) {
                    Slog.w(TAG, "Cannot hide package: android");
                    return false;
                }
                // Only allow protected packages to hide themselves.
                if (hidden && !UserHandle.isSameApp(uid, pkgSetting.appId)
                        && mProtectedPackages.isPackageStateProtected(userId, packageName)) {
                    Slog.w(TAG, "Not hiding protected package: " + packageName);
                    return false;
                }
                if (pkgSetting.getHidden(userId) != hidden) {
                    pkgSetting.setHidden(hidden, userId);
                    mSettings.writePackageRestrictionsLPr(userId);