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

Commit 4a63b26d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix an app data removal issue during OTA update" into sc-dev

parents 72e35e6a ef96992b
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -6469,20 +6469,6 @@ public class PackageManagerService extends IPackageManager.Stub
            mPermissionManager.readLegacyPermissionsTEMP(mSettings.mPermissions);
            // Clean up orphaned packages for which the code path doesn't exist
            // and they are an update to a system app - caused by bug/32321269
            final WatchedArrayMap<String, PackageSetting> packageSettings =
                mSettings.getPackagesLocked();
            final int packageSettingCount = packageSettings.size();
            for (int i = packageSettingCount - 1; i >= 0; i--) {
                PackageSetting ps = packageSettings.valueAt(i);
                if (!isExternal(ps) && (ps.getPath() == null || !ps.getPath().exists())
                        && mSettings.getDisabledSystemPkgLPr(ps.name) != null) {
                    packageSettings.removeAt(i);
                    mSettings.enableSystemPackageLPw(ps.name);
                }
            }
            if (!mOnlyCore && mFirstBoot) {
                requestCopyPreoptedFiles(mInjector);
            }
@@ -6531,6 +6517,9 @@ public class PackageManagerService extends IPackageManager.Stub
            mIsPreNMR1Upgrade = mIsUpgrade && ver.sdkVersion < Build.VERSION_CODES.N_MR1;
            mIsPreQUpgrade = mIsUpgrade && ver.sdkVersion < Build.VERSION_CODES.Q;
            final WatchedArrayMap<String, PackageSetting> packageSettings =
                mSettings.getPackagesLocked();
            // Save the names of pre-existing packages prior to scanning, so we can determine
            // which system packages are completely new due to an upgrade.
            if (isDeviceUpgrading()) {