Loading core/res/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -6434,4 +6434,6 @@ ul.</string> <string name="satellite_notification_open_message">Open Messages</string> <!-- Invoke Satellite setting activity of Settings --> <string name="satellite_notification_how_it_works">How it works</string> <!-- Initial/System provided label shown for an app which gets unarchived. [CHAR LIMIT=64]. --> <string name="unarchival_session_app_label">Pending...</string> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5373,4 +5373,6 @@ <java-symbol type="string" name="config_defaultContextualSearchKey" /> <java-symbol type="string" name="config_defaultContextualSearchEnabled" /> <java-symbol type="string" name="config_defaultContextualSearchLegacyEnabled" /> <java-symbol type="string" name="unarchival_session_app_label" /> </resources> services/core/java/com/android/server/pm/PackageArchiver.java +12 −3 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import static android.content.pm.PackageInstaller.UNARCHIVAL_STATUS_UNSET; import static android.content.pm.PackageManager.DELETE_ALL_USERS; import static android.content.pm.PackageManager.DELETE_ARCHIVE; import static android.content.pm.PackageManager.DELETE_KEEP_DATA; import static android.content.pm.PackageManager.INSTALL_UNARCHIVE; import static android.content.pm.PackageManager.INSTALL_UNARCHIVE_DRAFT; import static android.graphics.drawable.AdaptiveIconDrawable.getExtraInsetFraction; import static android.os.PowerExemptionManager.REASON_PACKAGE_UNARCHIVE; Loading Loading @@ -754,8 +755,9 @@ public class PackageArchiver { int draftSessionId; try { draftSessionId = Binder.withCleanCallingIdentity(() -> createDraftSession(packageName, installerPackage, statusReceiver, userId)); draftSessionId = Binder.withCleanCallingIdentity( () -> createDraftSession(packageName, installerPackage, callerPackageName, statusReceiver, userId)); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw ExceptionUtils.wrap((IOException) e.getCause()); Loading Loading @@ -795,11 +797,18 @@ public class PackageArchiver { } private int createDraftSession(String packageName, String installerPackage, String callerPackageName, IntentSender statusReceiver, int userId) throws IOException { PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams( PackageInstaller.SessionParams.MODE_FULL_INSTALL); sessionParams.setAppPackageName(packageName); sessionParams.installFlags = INSTALL_UNARCHIVE_DRAFT; sessionParams.setAppLabel( mContext.getString(com.android.internal.R.string.unarchival_session_app_label)); sessionParams.setAppIcon( getArchivedAppIcon(packageName, UserHandle.of(userId), callerPackageName)); // To make sure SessionInfo::isUnarchival returns true for draft sessions, // INSTALL_UNARCHIVE is also set. sessionParams.installFlags = (INSTALL_UNARCHIVE_DRAFT | INSTALL_UNARCHIVE); int installerUid = mPm.snapshotComputer().getPackageUid(installerPackage, 0, userId); // Handles case of repeated unarchival calls for the same package. Loading Loading
core/res/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -6434,4 +6434,6 @@ ul.</string> <string name="satellite_notification_open_message">Open Messages</string> <!-- Invoke Satellite setting activity of Settings --> <string name="satellite_notification_how_it_works">How it works</string> <!-- Initial/System provided label shown for an app which gets unarchived. [CHAR LIMIT=64]. --> <string name="unarchival_session_app_label">Pending...</string> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5373,4 +5373,6 @@ <java-symbol type="string" name="config_defaultContextualSearchKey" /> <java-symbol type="string" name="config_defaultContextualSearchEnabled" /> <java-symbol type="string" name="config_defaultContextualSearchLegacyEnabled" /> <java-symbol type="string" name="unarchival_session_app_label" /> </resources>
services/core/java/com/android/server/pm/PackageArchiver.java +12 −3 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import static android.content.pm.PackageInstaller.UNARCHIVAL_STATUS_UNSET; import static android.content.pm.PackageManager.DELETE_ALL_USERS; import static android.content.pm.PackageManager.DELETE_ARCHIVE; import static android.content.pm.PackageManager.DELETE_KEEP_DATA; import static android.content.pm.PackageManager.INSTALL_UNARCHIVE; import static android.content.pm.PackageManager.INSTALL_UNARCHIVE_DRAFT; import static android.graphics.drawable.AdaptiveIconDrawable.getExtraInsetFraction; import static android.os.PowerExemptionManager.REASON_PACKAGE_UNARCHIVE; Loading Loading @@ -754,8 +755,9 @@ public class PackageArchiver { int draftSessionId; try { draftSessionId = Binder.withCleanCallingIdentity(() -> createDraftSession(packageName, installerPackage, statusReceiver, userId)); draftSessionId = Binder.withCleanCallingIdentity( () -> createDraftSession(packageName, installerPackage, callerPackageName, statusReceiver, userId)); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw ExceptionUtils.wrap((IOException) e.getCause()); Loading Loading @@ -795,11 +797,18 @@ public class PackageArchiver { } private int createDraftSession(String packageName, String installerPackage, String callerPackageName, IntentSender statusReceiver, int userId) throws IOException { PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams( PackageInstaller.SessionParams.MODE_FULL_INSTALL); sessionParams.setAppPackageName(packageName); sessionParams.installFlags = INSTALL_UNARCHIVE_DRAFT; sessionParams.setAppLabel( mContext.getString(com.android.internal.R.string.unarchival_session_app_label)); sessionParams.setAppIcon( getArchivedAppIcon(packageName, UserHandle.of(userId), callerPackageName)); // To make sure SessionInfo::isUnarchival returns true for draft sessions, // INSTALL_UNARCHIVE is also set. sessionParams.installFlags = (INSTALL_UNARCHIVE_DRAFT | INSTALL_UNARCHIVE); int installerUid = mPm.snapshotComputer().getPackageUid(installerPackage, 0, userId); // Handles case of repeated unarchival calls for the same package. Loading