Commit 37dea4b3 authored by Pavel Yatsuk's avatar Pavel Yatsuk Committed by Commit Bot

Update message in permission dialog overlay warning

The current overlay warning message does not directly address the
typical case: when dialer or chat bubble is displayed on the screen.

One change in behavior is that "Cancel" button of overlay warning dialog
dismisses both overlay warning and permission dialog.

BUG=1127455
R=twellington@chromium.org

Change-Id: I9d5c13a6c7d4e52a3fa73b3193d1ef463272ab64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2406148Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Commit-Queue: Pavel Yatsuk <pavely@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807089}
parent c6900f8d
......@@ -300,9 +300,6 @@
<message name="IDS_MENU_ITEM_MOVE_TO_TOP" desc="Option in item menu. User can click the 'Move to top' option to move the item up to the top of its list. [CHAR-LIMIT=24]">
Move to top
</message>
<message name="IDS_OPEN_SETTINGS" desc="Generic label for a button to show settings screen. [CHAR-LIMIT=20]">
Open settings
</message>
<message name="IDS_ACCESSIBILITY_TOOLBAR_BTN_MENU" desc="Content description for the settings menu button.">
More options
......
......@@ -6,9 +6,6 @@ package org.chromium.components.permissions;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.provider.Settings;
import androidx.annotation.IntDef;
import androidx.annotation.VisibleForTesting;
......@@ -176,22 +173,18 @@ public class PermissionDialogController
/**
* Displays the dialog explaining that Chrome has detected an overlay. Offers the user to close
* overlay window or revoke "Draw on top" permission in Android settings.
* the overlay window and try again.
*/
private void showFilteredTouchEventDialog(Context context) {
// Settings.ACTION_MANAGE_OVERLAY_PERMISSION is only supported on M+ therefore we shouldn't
// display this dialog on L. The function won't be called on L anyway because touch
// filtering was introduced in M.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return;
// Don't show another dialog if one is already displayed.
if (mOverlayDetectedDialogModel != null) return;
ModalDialogProperties.Controller overlayDetectedDialogController =
new SimpleModalDialogController(mModalDialogManager, (Integer dismissalCause) -> {
if (dismissalCause == DialogDismissalCause.POSITIVE_BUTTON_CLICKED) {
context.startActivity(
new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION));
if (dismissalCause == DialogDismissalCause.POSITIVE_BUTTON_CLICKED
&& mDialogModel != null) {
mModalDialogManager.dismissDialog(
mDialogModel, DialogDismissalCause.NAVIGATE_BACK_OR_TOUCH_OUTSIDE);
}
mOverlayDetectedDialogModel = null;
});
......@@ -204,7 +197,7 @@ public class PermissionDialogController
.with(ModalDialogProperties.MESSAGE, context.getResources(),
R.string.overlay_detected_dialog_message)
.with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, context.getResources(),
R.string.open_settings)
R.string.cancel)
.with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, context.getResources(),
R.string.try_again)
.with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, true)
......
......@@ -198,10 +198,10 @@
<!-- Overlay detected dialog -->
<message name="IDS_OVERLAY_DETECTED_DIALOG_TITLE" desc="Title of the dialog that informs the user about detected overlay window that prevents interaction with permissions.">
Another app is displaying over <ph name="APP_NAME">%1$s<ex>Chrome</ex></ph>
This site can’t ask for your permission
</message>
<message name="IDS_OVERLAY_DETECTED_DIALOG_MESSAGE" desc="Dialog message that informs the user about detected overlay window that prevents interaction with permissions.">
To change the permission for this site, close the other app and try again.\n\nIf you can’t close the app, turn off the app’s permission to “Display over other apps” in Android settings.
Close any bubbles or overlays from other apps. Then, try again.
</message>
</messages>
</release>
......
59eeb17905a49e3917ea3de287f529e8de3df872
\ No newline at end of file
9d91339a62c7718bb8da43b6702173172723980d
\ No newline at end of file
59eeb17905a49e3917ea3de287f529e8de3df872
\ No newline at end of file
9d91339a62c7718bb8da43b6702173172723980d
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment