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

Commit ddc65536 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[PM] Support update-ownership for Archived app" into android15-tests-dev

parents e996ae8f 72b969e7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -330,7 +330,8 @@ public class PackageInstallerActivity extends Activity {
            // data we still want to count it as "installed".
            mAppInfo = mPm.getApplicationInfo(pkgName,
                    PackageManager.MATCH_UNINSTALLED_PACKAGES);
            if ((mAppInfo.flags&ApplicationInfo.FLAG_INSTALLED) == 0) {
            // If the package is archived, treat it as update case.
            if (!mAppInfo.isArchived && (mAppInfo.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {
                mAppInfo = null;
            }
        } catch (NameNotFoundException e) {
+4 −1
Original line number Diff line number Diff line
@@ -1060,7 +1060,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        final boolean isInstallDpcPackagesPermissionGranted = (snapshot.checkUidPermission(
                android.Manifest.permission.INSTALL_DPC_PACKAGES, mInstallerUid)
                == PackageManager.PERMISSION_GRANTED);
        final int targetPackageUid = snapshot.getPackageUid(packageName, 0, userId);
        // Also query the package uid for archived packages, so that the user confirmation
        // dialog can be displayed for updating archived apps.
        final int targetPackageUid = snapshot.getPackageUid(packageName,
                PackageManager.MATCH_ARCHIVED_PACKAGES, userId);
        final boolean isUpdate = targetPackageUid != -1 || isApexSession();
        final InstallSourceInfo existingInstallSourceInfo = isUpdate
                ? snapshot.getInstallSourceInfo(packageName, userId)