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

Commit c5e65501 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

[automerger] DO NOT MERGE Disable overlays while installer is resumed am: 172eddd2 am: 1ef521c1

Change-Id: Ie5e998bae2cbe79ad80898cb49b4d60ef2d45a1e
parents 715eac8f 1ef521c1
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
*/
package com.android.packageinstaller;

import android.app.Activity;
import android.app.ActivityManagerNative;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -53,6 +52,8 @@ import android.widget.TabHost;
import android.widget.TextView;
import com.android.packageinstaller.permission.utils.Utils;

import com.android.packageinstaller.permission.ui.OverlayTouchActivity;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -69,7 +70,8 @@ import java.io.OutputStream;
 * Based on the user response the package is then installed by launching InstallAppConfirm
 * sub activity. All state transitions are handled in this activity
 */
public class PackageInstallerActivity extends Activity implements OnCancelListener, OnClickListener {
public class PackageInstallerActivity extends OverlayTouchActivity implements OnCancelListener,
        OnClickListener {
    private static final String TAG = "PackageInstaller";

    private static final int REQUEST_ENABLE_UNKNOWN_SOURCES = 1;
@@ -218,6 +220,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);
        }
    }

    private void showDialogInner(int id) {
        // TODO better fix for this? Remove dialog so that it gets created again
        removeDialog(id);