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

Commit 454f5b75 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

[automerger] DO NOT MERGE Disable overlays while installer is resumed am: 5e72bf05 am: 4add6df2

Change-Id: I2186b17615499b34ac2d8e3dea417bee5771e765
parents a470ac62 4add6df2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MANAGE_USERS" />
    <uses-permission android:name="android.permission.GRANT_REVOKE_PERMISSIONS" />
    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />
    <application android:label="@string/app_name"
            android:allowBackup="false"
            android:theme="@android:style/Theme.DeviceDefault.DialogWhenLarge.NoActionBar"
+22 −1
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;
@@ -410,7 +412,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);
        // get intent information
        final Intent intent = getIntent();
        mPackageURI = intent.getData();
@@ -501,6 +503,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();