Skip to content
Snippets Groups Projects
Commit feb91634 authored by Daniel Norman's avatar Daniel Norman Committed by Android (Google) Code Review
Browse files

Merge "Add an explicit delay before taking a screenshot in A11yMenu." into main

parents 21b5b8a3 8e6973df
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,7 @@ public class AccessibilityMenuService extends AccessibilityService
private static final String TAG = "A11yMenuService";
private static final long BUFFER_MILLISECONDS_TO_PREVENT_UPDATE_FAILURE = 100L;
private static final long TAKE_SCREENSHOT_DELAY_MS = 100L;
private static final int BRIGHTNESS_UP_INCREMENT_GAMMA =
(int) Math.ceil(BrightnessUtils.GAMMA_SPACE_MAX * 0.11f);
......@@ -301,7 +302,14 @@ public class AccessibilityMenuService extends AccessibilityService
} else if (viewTag == ShortcutId.ID_NOTIFICATION_VALUE.ordinal()) {
performGlobalActionInternal(GLOBAL_ACTION_NOTIFICATIONS);
} else if (viewTag == ShortcutId.ID_SCREENSHOT_VALUE.ordinal()) {
performGlobalActionInternal(GLOBAL_ACTION_TAKE_SCREENSHOT);
if (Flags.a11yMenuHideBeforeTakingAction()) {
// Delay before taking a screenshot to give time for the UI to close.
mHandler.postDelayed(
() -> performGlobalActionInternal(GLOBAL_ACTION_TAKE_SCREENSHOT),
TAKE_SCREENSHOT_DELAY_MS);
} else {
performGlobalActionInternal(GLOBAL_ACTION_TAKE_SCREENSHOT);
}
}
if (!Flags.a11yMenuHideBeforeTakingAction()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment