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

Commit 3f5c440d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Disable overlays while installer is resumed" into lmp-dev

parents 783035bb 308302f6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
    <uses-permission android:name="android.permission.GRANT_REVOKE_PERMISSIONS" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
    <uses-permission android:name="android.permission.READ_INSTALL_SESSIONS" />
    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />

    <application android:label="@string/app_name"
            android:allowBackup="false"
+22 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
*/
package com.android.packageinstaller;

import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.app.Activity;
import android.app.ActivityManagerNative;
import android.app.AlertDialog;
@@ -425,6 +427,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);

        mPm = getPackageManager();
        mInstaller = mPm.getPackageInstaller();
@@ -533,6 +536,25 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
        initiateInstall();
    }

    @Override
    protected void onResume() {
        super.onResume();

        if (mOk != null) {
            mOk.setEnabled(mOkCanInstall);
        }
    }

    @Override
    protected void onPause() {
        super.onPause();

        if (mOk != null) {
            // Don't allow the install button to be clicked as there might be overlays
            mOk.setEnabled(false);
        }
    }

    /** Get the ApplicationInfo for the calling package, if available */
    private ApplicationInfo getSourceInfo() {
        String callingPackage = getCallingPackage();