OSDN Git Service

[Multi-user] add PackageInstaller.installExistingPackage with IntentSender which...
authorChandan Nath <nathch@google.com>
Mon, 28 Jan 2019 15:23:38 +0000 (15:23 +0000)
committerChandan Nath <nathch@google.com>
Fri, 22 Feb 2019 19:14:53 +0000 (19:14 +0000)
commite8e463bd84c73cd298b0a7c1870b923f81c52da0
tree006fc738034dc31df97ae78aafdec2bcd187e2ca
parenta54cb88d01d7131127bdf297be261c36e58978ad
[Multi-user] add PackageInstaller.installExistingPackage with IntentSender which is fired only
after the asynchronous restore is complete

This is a better alternative to the existing synchronous PackageManager.installExistingPackage
method where the restore operation happens asynchronously but the method itself will return
success before the restore finishes.

Bug: 122881085

Test: 1) cts-tradefed run cts -m CtsBackupHostTestCases
-t android.cts.backup.ProfileKeyValueBackupRestoreHostSideTest
2) atest RunBackupFrameworksServicesRoboTests
3) Install Hangouts on work profile. Then install on primary profile, backup and uninstall.
Now install again and immediately hit Open. Before this change, the app will crash after a few
seconds (when the background restore operation finishes). With this change and a corresponding
Play Store change to use this new method, Open shows up only after restore has finished so the
app doesn't crash.

Change-Id: I5d2e1f3bb5509894bedd6bbcfac32ed6cf946a80
api/current.txt
api/system-current.txt
core/java/android/content/pm/IPackageInstaller.aidl
core/java/android/content/pm/PackageInstaller.java
core/java/android/content/pm/PackageManager.java
services/core/java/com/android/server/pm/PackageInstallerService.java
services/core/java/com/android/server/pm/PackageManagerService.java
services/core/java/com/android/server/pm/PackageManagerShellCommand.java