diff options
| author | 2023-08-07 02:04:36 +0000 | |
|---|---|---|
| committer | 2023-08-07 02:04:36 +0000 | |
| commit | 8db6f5842260e8d6ee42762a8f5350008f8c1d18 (patch) | |
| tree | 328821bd0c5b0d63cbddce95fc18595f84f85535 | |
| parent | 14e20db7b049ccf63d7a7624542fcab6766df276 (diff) | |
| parent | 03a3b6a4bfdf2ca991c09b8d991d1f5856a8af8e (diff) | |
Merge "Finish PIA if UnknownSourcesListener would like to start a PIA again" into main
| -rw-r--r-- | packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java index b66679af3fe3..2d6cc699fc11 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -16,9 +16,7 @@ */ package com.android.packageinstaller; -import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP; import static android.content.Intent.FLAG_ACTIVITY_NO_HISTORY; -import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP; import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; import android.Manifest; @@ -808,8 +806,12 @@ public class PackageInstallerActivity extends AlertActivity { } new Handler(Looper.getMainLooper()).postDelayed(() -> { if (!isDestroyed()) { - startActivity(getIntent().addFlags( - FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP)); + // The start flag (FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP) doesn't + // work for the multiple user case, i.e. the caller task user and started + // Activity user are not the same. To avoid having multiple PIAs in the task, + // finish the current PackageInstallerActivity + finish(); + startActivity(getIntent()); } }, 500); |