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

Commit 0eaf43c7 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge "Fix crash when showing the media projection dialog on work profile" into tm-dev

parents 4ff1762d 79faca22
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class MediaProjectionPermissionActivity extends Activity
    private int mUid;
    private IMediaProjectionManager mService;

    private SystemUIDialog mDialog;
    private AlertDialog mDialog;

    @Override
    public void onCreate(Bundle icicle) {
@@ -141,13 +141,18 @@ public class MediaProjectionPermissionActivity extends Activity
            dialogTitle = getString(R.string.media_projection_dialog_title, appName);
        }

        mDialog = new SystemUIDialog(this);
        mDialog.setTitle(dialogTitle);
        mDialog.setIcon(R.drawable.ic_media_projection_permission);
        mDialog.setMessage(dialogText);
        mDialog.setPositiveButton(R.string.media_projection_action_text, this);
        mDialog.setNeutralButton(android.R.string.cancel, this);
        mDialog.setOnCancelListener(this);
        mDialog = new AlertDialog.Builder(this, R.style.Theme_SystemUI_Dialog)
                .setTitle(dialogTitle)
                .setIcon(R.drawable.ic_media_projection_permission)
                .setMessage(dialogText)
                .setPositiveButton(R.string.media_projection_action_text, this)
                .setNeutralButton(android.R.string.cancel, this)
                .setOnCancelListener(this)
                .create();

        SystemUIDialog.registerDismissListener(mDialog);
        SystemUIDialog.applyFlags(mDialog);
        SystemUIDialog.setDialogSize(mDialog);

        mDialog.create();
        mDialog.getButton(DialogInterface.BUTTON_POSITIVE).setFilterTouchesWhenObscured(true);