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

Commit 939edb0d authored by Ricky Wai's avatar Ricky Wai Committed by android-build-merger
Browse files

Merge \\"Do not allow to disable package \\"android\\"\\" into nyc-mr1-dev am: a5111bfd

am: e9e9f300

Change-Id: I6159402639a440849357bd4ccd53bc4cb8fbab7a
parents fef4777c e9e9f300
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);