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

Commit 4b16c088 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Automerger Merge Worker
Browse files

Merge "Fix crash when showing the media projection dialog on work profile"...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17136603

Change-Id: I8b86f396abebe15c6f710494e2bf46ec7f0e7c2f
parents 4fe16231 0eaf43c7
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);