Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8db6f584 authored by Joanne Chung's avatar Joanne Chung Committed by Android (Google) Code Review
Browse files

Merge "Finish PIA if UnknownSourcesListener would like to start a PIA again" into main

parents 14e20db7 03a3b6a4
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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);