Loading core/java/android/view/ViewConfiguration.java +16 −2 Original line number Diff line number Diff line Loading @@ -84,11 +84,16 @@ public class ViewConfiguration { /** * Defines the duration in milliseconds a user needs to hold down the * appropriate button to bring up the accessibility shortcut (first time) or enable it * (once shortcut is configured). * appropriate button to bring up the accessibility shortcut for the first time */ private static final int A11Y_SHORTCUT_KEY_TIMEOUT = 3000; /** * Defines the duration in milliseconds a user needs to hold down the * appropriate button to enable the accessibility shortcut once it's configured. */ private static final int A11Y_SHORTCUT_KEY_TIMEOUT_AFTER_CONFIRMATION = 1500; /** * Defines the duration in milliseconds we will wait to see if a touch event * is a tap or a scroll. If the user does not move within this interval, it is Loading Loading @@ -850,6 +855,15 @@ public class ViewConfiguration { return A11Y_SHORTCUT_KEY_TIMEOUT; } /** * @return The amount of time a user needs to press the relevant keys to activate the * accessibility shortcut after it's confirmed that accessibility shortcut is used. * @hide */ public long getAccessibilityShortcutKeyTimeoutAfterConfirmation() { return A11Y_SHORTCUT_KEY_TIMEOUT_AFTER_CONFIRMATION; } /** * The amount of friction applied to scrolls and flings. * Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +14 −3 Original line number Diff line number Diff line Loading @@ -1654,11 +1654,23 @@ public class PhoneWindowManager implements WindowManagerPolicy { mScreenshotChordVolumeDownKeyConsumed = true; mA11yShortcutChordVolumeUpKeyConsumed = true; mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_ACCESSIBILITY_SHORTCUT), ViewConfiguration.get(mContext).getAccessibilityShortcutKeyTimeout()); getAccessibilityShortcutTimeout()); } } } private long getAccessibilityShortcutTimeout() { ViewConfiguration config = ViewConfiguration.get(mContext); try { return Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, mCurrentUserId) == 0 ? config.getAccessibilityShortcutKeyTimeout() : config.getAccessibilityShortcutKeyTimeoutAfterConfirmation(); } catch (Settings.SettingNotFoundException e) { throw new RuntimeException(e); } } private long getScreenshotChordLongPressDelay() { if (mKeyguardDelegate.isShowing()) { // Double the time it takes to take a screenshot from the keyguard Loading Loading @@ -3866,8 +3878,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mAccessibilityTvScheduled = true; Message msg = Message.obtain(mHandler, MSG_ACCESSIBILITY_TV); msg.setAsynchronous(true); mHandler.sendMessageDelayed(msg, ViewConfiguration.get(mContext).getAccessibilityShortcutKeyTimeout()); mHandler.sendMessageDelayed(msg, getAccessibilityShortcutTimeout()); } } else if (mAccessibilityTvScheduled) { mHandler.removeMessages(MSG_ACCESSIBILITY_TV); Loading Loading
core/java/android/view/ViewConfiguration.java +16 −2 Original line number Diff line number Diff line Loading @@ -84,11 +84,16 @@ public class ViewConfiguration { /** * Defines the duration in milliseconds a user needs to hold down the * appropriate button to bring up the accessibility shortcut (first time) or enable it * (once shortcut is configured). * appropriate button to bring up the accessibility shortcut for the first time */ private static final int A11Y_SHORTCUT_KEY_TIMEOUT = 3000; /** * Defines the duration in milliseconds a user needs to hold down the * appropriate button to enable the accessibility shortcut once it's configured. */ private static final int A11Y_SHORTCUT_KEY_TIMEOUT_AFTER_CONFIRMATION = 1500; /** * Defines the duration in milliseconds we will wait to see if a touch event * is a tap or a scroll. If the user does not move within this interval, it is Loading Loading @@ -850,6 +855,15 @@ public class ViewConfiguration { return A11Y_SHORTCUT_KEY_TIMEOUT; } /** * @return The amount of time a user needs to press the relevant keys to activate the * accessibility shortcut after it's confirmed that accessibility shortcut is used. * @hide */ public long getAccessibilityShortcutKeyTimeoutAfterConfirmation() { return A11Y_SHORTCUT_KEY_TIMEOUT_AFTER_CONFIRMATION; } /** * The amount of friction applied to scrolls and flings. * Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +14 −3 Original line number Diff line number Diff line Loading @@ -1654,11 +1654,23 @@ public class PhoneWindowManager implements WindowManagerPolicy { mScreenshotChordVolumeDownKeyConsumed = true; mA11yShortcutChordVolumeUpKeyConsumed = true; mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_ACCESSIBILITY_SHORTCUT), ViewConfiguration.get(mContext).getAccessibilityShortcutKeyTimeout()); getAccessibilityShortcutTimeout()); } } } private long getAccessibilityShortcutTimeout() { ViewConfiguration config = ViewConfiguration.get(mContext); try { return Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, mCurrentUserId) == 0 ? config.getAccessibilityShortcutKeyTimeout() : config.getAccessibilityShortcutKeyTimeoutAfterConfirmation(); } catch (Settings.SettingNotFoundException e) { throw new RuntimeException(e); } } private long getScreenshotChordLongPressDelay() { if (mKeyguardDelegate.isShowing()) { // Double the time it takes to take a screenshot from the keyguard Loading Loading @@ -3866,8 +3878,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mAccessibilityTvScheduled = true; Message msg = Message.obtain(mHandler, MSG_ACCESSIBILITY_TV); msg.setAsynchronous(true); mHandler.sendMessageDelayed(msg, ViewConfiguration.get(mContext).getAccessibilityShortcutKeyTimeout()); mHandler.sendMessageDelayed(msg, getAccessibilityShortcutTimeout()); } } else if (mAccessibilityTvScheduled) { mHandler.removeMessages(MSG_ACCESSIBILITY_TV); Loading