summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/pm/PackageArchiver.java4
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverTest.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/PackageArchiver.java b/services/core/java/com/android/server/pm/PackageArchiver.java
index fb0e50eb49b2..9bdf61341366 100644
--- a/services/core/java/com/android/server/pm/PackageArchiver.java
+++ b/services/core/java/com/android/server/pm/PackageArchiver.java
@@ -463,8 +463,10 @@ public class PackageArchiver {
final CompletableFuture<Void> archiveStateStored = new CompletableFuture<>();
mPm.mHandler.post(() -> {
try {
+ final String installerTitle = getResponsibleInstallerTitle(
+ mContext, installerInfo, responsibleInstallerPackage, userId);
var archiveState = createArchiveStateInternal(packageName, userId, mainActivities,
- installerInfo.loadLabel(mContext.getPackageManager()).toString());
+ installerTitle);
storeArchiveState(packageName, archiveState, userId);
archiveStateStored.complete(null);
} catch (IOException | PackageManager.NameNotFoundException e) {
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverTest.java b/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverTest.java
index 4535ecee8097..8d0b2797d200 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/PackageArchiverTest.java
@@ -191,6 +191,8 @@ public class PackageArchiverTest {
when(mContext.checkCallingOrSelfPermission(
eq(Manifest.permission.REQUEST_DELETE_PACKAGES))).thenReturn(
PackageManager.PERMISSION_DENIED);
+ when(mContext.createPackageContextAsUser(
+ eq(INSTALLER_PACKAGE), anyInt(), eq(UserHandle.CURRENT))).thenReturn(mContext);
when(mAppOpsManager.checkOp(
eq(AppOpsManager.OP_AUTO_REVOKE_PERMISSIONS_IF_UNUSED),