summaryrefslogtreecommitdiffstats
path: root/src/com/android/packageinstaller/PackageInstallerActivity.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2016-05-10 10:55:26 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2016-05-10 13:02:57 -0700
commitf63739bb3f5de9927171b84630ec5872ba85fa6c (patch)
tree80a2d14064b7d1b7c7a1d500dcdf3872106f71dd /src/com/android/packageinstaller/PackageInstallerActivity.java
parent1dba1776c3fd432fd9adb5e3e251b6562aca7f3c (diff)
downloadandroid_packages_apps_PackageInstaller-f63739bb3f5de9927171b84630ec5872ba85fa6c.tar.gz
android_packages_apps_PackageInstaller-f63739bb3f5de9927171b84630ec5872ba85fa6c.tar.bz2
android_packages_apps_PackageInstaller-f63739bb3f5de9927171b84630ec5872ba85fa6c.zip
Fix app install flow
A regression was introduced when we added support for installing apps from content URIs. Since we stage the APK in the cache folder we changed the flow to wipe the cached version when the PackageInstallerActivity finishes or gets an installation result, so we started the InstallAppProgress activity for result but the latter may be called with the forward result flag which is incompatible with start activity for result. This change delegates clearing the staging file in the cache folder to the InstallAppProgress activity. bug:28551937 Change-Id: I0d9978aff60b7fab6b64fe7bf889ef30f9b2fd7c
Diffstat (limited to 'src/com/android/packageinstaller/PackageInstallerActivity.java')
-rw-r--r--src/com/android/packageinstaller/PackageInstallerActivity.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java
index ab4c6045..cbb9f646 100644
--- a/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -72,7 +72,6 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
private static final String TAG = "PackageInstaller";
private static final int REQUEST_ENABLE_UNKNOWN_SOURCES = 1;
- private static final int REQUEST_INSTALL_PACKAGE = 2;
private static final String SCHEME_FILE = "file";
private static final String SCHEME_CONTENT = "content";
@@ -324,7 +323,6 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
if (request == REQUEST_ENABLE_UNKNOWN_SOURCES && result == RESULT_OK) {
initiateInstall();
}
- clearCachedApkIfNeededAndFinish();
}
private boolean isInstallRequestFromUnknownSource(Intent intent) {
@@ -684,7 +682,8 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
newIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
}
if(localLOGV) Log.i(TAG, "downloaded app uri="+mPackageURI);
- startActivityForResult(newIntent, REQUEST_INSTALL_PACKAGE);
+ startActivity(newIntent);
+ finish();
}
private void clearCachedApkIfNeededAndFinish() {