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

Commit c2358461 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-mr1-dev

parents 1dd89e77 a7fe26f6
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;
@@ -441,6 +443,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();
@@ -566,6 +569,25 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
        }
    }

    @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();