From 6fdd93b33927675a6a062f0b8fd00ef3866ac2f7 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Wed, 18 May 2016 14:28:06 -0700 Subject: Finish package installer activity on a cancel result We made a change to the PackageInstaller to start settings for a result to allow partners to return OK to continue the install flow, otherwise requiring the user to start install again (the desired behavior on Nexus). This change finishes the package installer activity if settings does not return success to continue the install flow. bug:28838075 Change-Id: I4ff1b1a713d46a8584baf66f379ab070226c125f --- src/com/android/packageinstaller/PackageInstallerActivity.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java index a059931d..3b191458 100644 --- a/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -324,6 +324,8 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen // implement a "allow untrusted source once" feature. if (request == REQUEST_ENABLE_UNKNOWN_SOURCES && result == RESULT_OK) { initiateInstall(); + } else { + clearCachedApkIfNeededAndFinish(); } } @@ -474,6 +476,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen showDialogInner(DLG_ADMIN_RESTRICTS_UNKNOWN_SOURCES); } else if (!isUnknownSourcesEnabled()) { // Ask user to enable setting first + showDialogInner(DLG_UNKNOWN_SOURCES); } else { processPackageUri(packageUri); -- cgit v1.2.3