summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Patrick Baumann <patb@google.com> 2020-07-01 14:53:10 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-07-01 14:53:10 +0000
commit93b7187b08d8c4bd75fe686a59cb808c42f82db3 (patch)
treea689c40935f165e78407df8a2605876231f61ccc
parent64ab1a4fb22493dc645ea999aa5e3ec5baf94175 (diff)
parent8b811f2d2ac814374c23ba39a945f4d605ae2503 (diff)
Merge "Add installerSource to packageSetting earlier" into rvc-dev
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 670b88e4a0c9..e734ed443189 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -11083,6 +11083,21 @@ public class PackageManagerService extends IPackageManager.Stub
pkgSetting.forceQueryableOverride = true;
}
+ // If this is part of a standard install, set the initiating package name, else rely on
+ // previous device state.
+ if (reconciledPkg.installArgs != null) {
+ InstallSource installSource = reconciledPkg.installArgs.installSource;
+ if (installSource.initiatingPackageName != null) {
+ final PackageSetting ips = mSettings.mPackages.get(
+ installSource.initiatingPackageName);
+ if (ips != null) {
+ installSource = installSource.setInitiatingPackageSignatures(
+ ips.signatures);
+ }
+ }
+ pkgSetting.setInstallSource(installSource);
+ }
+
// TODO(toddke): Consider a method specifically for modifying the Package object
// post scan; or, moving this stuff out of the Package object since it has nothing
// to do with the package on disk.
@@ -16089,16 +16104,7 @@ public class PackageManagerService extends IPackageManager.Stub
ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT, userId, installerPackageName);
}
- if (installSource.initiatingPackageName != null) {
- final PackageSetting ips = mSettings.mPackages.get(
- installSource.initiatingPackageName);
- if (ips != null) {
- installSource = installSource.setInitiatingPackageSignatures(
- ips.signatures);
- }
- }
- ps.setInstallSource(installSource);
- mSettings.addInstallerPackageNames(installSource);
+ mSettings.addInstallerPackageNames(ps.installSource);
// When replacing an existing package, preserve the original install reason for all
// users that had the package installed before. Similarly for uninstall reasons.