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

Commit f4b8c971 authored by Winson's avatar Winson
Browse files

Dismiss PackageInstallerActivity when SimpleErrorDialog cancelled

Otherwise the translucent Activity sticks around until another back
press.

Bug: 187221431

Test: manual, adb shell am start \
    -a android.intent.action.INSTALL_PACKAGE \
    -d "file:///the-apk-that-wasnt.apk" \
    -n com.google.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity

Change-Id: I80ecf62247c62d76a832676ed52c68f9aefcb54e
parent bc8bb626
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTE
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.StringRes;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AppGlobals;
import android.app.AppOpsManager;
@@ -632,6 +633,12 @@ public class PackageInstallerActivity extends AlertActivity {
                    .setPositiveButton(R.string.ok, (dialog, which) -> getActivity().finish())
                    .create();
        }

        @Override
        public void onCancel(DialogInterface dialog) {
            getActivity().setResult(Activity.RESULT_CANCELED);
            getActivity().finish();
        }
    }

    /**