Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -55057,10 +55057,12 @@ package android.view { method public static int getKeyRepeatDelay(); method public static int getKeyRepeatTimeout(); method public static int getLongPressTimeout(); method @FlaggedApi("android.companion.virtualdevice.flags.viewconfiguration_apis") public int getLongPressTimeoutMillis(); method @Deprecated public static int getMaximumDrawingCacheSize(); method @Deprecated public static int getMaximumFlingVelocity(); method @Deprecated public static int getMinimumFlingVelocity(); method public static int getMultiPressTimeout(); method @FlaggedApi("android.companion.virtualdevice.flags.viewconfiguration_apis") public int getMultiPressTimeoutMillis(); method public static int getPressedStateDuration(); method @FloatRange(from=1.0) public float getScaledAmbiguousGestureMultiplier(); method public int getScaledDoubleTapSlop(); core/java/android/app/ActivityThread.java +7 −3 Original line number Diff line number Diff line Loading @@ -9076,10 +9076,14 @@ public final class ActivityThread extends ClientTransactionHandler } } public int getIntCoreSetting(String key, int defaultValue) { int getIntCoreSetting(String key, int defaultValue) { return getIntCoreSetting(key, defaultValue, mLastReportedDeviceId); } int getIntCoreSetting(String key, int defaultValue, int deviceId) { synchronized (mCoreSettingsLock) { if (mCoreSettings != null) { Bundle bundle = getCoreSettingsForDeviceLocked(mLastReportedDeviceId); Bundle bundle = getCoreSettingsForDeviceLocked(deviceId); if (bundle != null) { return bundle.getInt(key, defaultValue); } Loading @@ -9091,7 +9095,7 @@ public final class ActivityThread extends ClientTransactionHandler /** * Get the string value of the given key from core settings. */ public String getStringCoreSetting(String key, String defaultValue) { String getStringCoreSetting(String key, String defaultValue) { synchronized (mCoreSettingsLock) { if (mCoreSettings != null) { Bundle bundle = getCoreSettingsForDeviceLocked(mLastReportedDeviceId); Loading core/java/android/app/AppGlobals.java +18 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,24 @@ public class AppGlobals { } } /** * Gets the value of an integer core setting. * * @param key The setting key. * @param defaultValue The setting default value. * @param deviceId The device id associated with the {@link android.content.Context} of the * caller. * @return The core settings. */ public static int getIntCoreSetting(String key, int defaultValue, int deviceId) { ActivityThread currentActivityThread = ActivityThread.currentActivityThread(); if (currentActivityThread != null) { return currentActivityThread.getIntCoreSetting(key, defaultValue, deviceId); } else { return defaultValue; } } /** * Gets the value of a float core setting. * Loading core/java/android/view/ViewConfiguration.java +28 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,8 @@ public class ViewConfiguration { private final int mTapTimeoutMillis; private final int mDoubleTapTimeoutMillis; private final int mDoubleTapMinTimeMillis; private final int mLongPressTimeoutMillis; private final int mMultiPressTimeoutMillis; private final float mScrollFriction; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768915) Loading Loading @@ -448,6 +450,8 @@ public class ViewConfiguration { mTapTimeoutMillis = sResourceCache.getTapTimeout(); mDoubleTapTimeoutMillis = sResourceCache.getDoubleTapTimeout(); mDoubleTapMinTimeMillis = sResourceCache.getDoubleTapMinTime(); mLongPressTimeoutMillis = getLongPressTimeout(); mMultiPressTimeoutMillis = getMultiPressTimeout(); mScrollFriction = sResourceCache.getScrollFriction(); } Loading Loading @@ -592,6 +596,12 @@ public class ViewConfiguration { mDoubleTapTimeoutMillis = res.getInteger(R.integer.config_doubleTapTimeoutMillis); mDoubleTapMinTimeMillis = res.getInteger(R.integer.config_doubleTapMinTimeMillis); mScrollFriction = res.getFloat(R.dimen.config_scrollFriction); int deviceId = context.getDeviceId(); mLongPressTimeoutMillis = AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT, DEFAULT_LONG_PRESS_TIMEOUT, deviceId); mMultiPressTimeoutMillis = AppGlobals.getIntCoreSetting(Settings.Secure.MULTI_PRESS_TIMEOUT, DEFAULT_MULTI_PRESS_TIMEOUT, deviceId); } /** Loading Loading @@ -717,6 +727,15 @@ public class ViewConfiguration { DEFAULT_LONG_PRESS_TIMEOUT); } /** * @return the duration in milliseconds before a press turns into * a long press. */ @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_VIEWCONFIGURATION_APIS) public int getLongPressTimeoutMillis() { return mLongPressTimeoutMillis; } /** * @return the duration in milliseconds between the first tap's up event and the second tap's * down event for an interaction to be considered part of the same multi-press. Loading @@ -726,6 +745,15 @@ public class ViewConfiguration { DEFAULT_MULTI_PRESS_TIMEOUT); } /** * @return the duration in milliseconds between the first tap's up event and the second tap's * down event for an interaction to be considered part of the same multi-press. */ @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_VIEWCONFIGURATION_APIS) public int getMultiPressTimeoutMillis() { return mMultiPressTimeoutMillis; } /** * @return the time before the first key repeat in milliseconds. */ Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -55057,10 +55057,12 @@ package android.view { method public static int getKeyRepeatDelay(); method public static int getKeyRepeatTimeout(); method public static int getLongPressTimeout(); method @FlaggedApi("android.companion.virtualdevice.flags.viewconfiguration_apis") public int getLongPressTimeoutMillis(); method @Deprecated public static int getMaximumDrawingCacheSize(); method @Deprecated public static int getMaximumFlingVelocity(); method @Deprecated public static int getMinimumFlingVelocity(); method public static int getMultiPressTimeout(); method @FlaggedApi("android.companion.virtualdevice.flags.viewconfiguration_apis") public int getMultiPressTimeoutMillis(); method public static int getPressedStateDuration(); method @FloatRange(from=1.0) public float getScaledAmbiguousGestureMultiplier(); method public int getScaledDoubleTapSlop();
core/java/android/app/ActivityThread.java +7 −3 Original line number Diff line number Diff line Loading @@ -9076,10 +9076,14 @@ public final class ActivityThread extends ClientTransactionHandler } } public int getIntCoreSetting(String key, int defaultValue) { int getIntCoreSetting(String key, int defaultValue) { return getIntCoreSetting(key, defaultValue, mLastReportedDeviceId); } int getIntCoreSetting(String key, int defaultValue, int deviceId) { synchronized (mCoreSettingsLock) { if (mCoreSettings != null) { Bundle bundle = getCoreSettingsForDeviceLocked(mLastReportedDeviceId); Bundle bundle = getCoreSettingsForDeviceLocked(deviceId); if (bundle != null) { return bundle.getInt(key, defaultValue); } Loading @@ -9091,7 +9095,7 @@ public final class ActivityThread extends ClientTransactionHandler /** * Get the string value of the given key from core settings. */ public String getStringCoreSetting(String key, String defaultValue) { String getStringCoreSetting(String key, String defaultValue) { synchronized (mCoreSettingsLock) { if (mCoreSettings != null) { Bundle bundle = getCoreSettingsForDeviceLocked(mLastReportedDeviceId); Loading
core/java/android/app/AppGlobals.java +18 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,24 @@ public class AppGlobals { } } /** * Gets the value of an integer core setting. * * @param key The setting key. * @param defaultValue The setting default value. * @param deviceId The device id associated with the {@link android.content.Context} of the * caller. * @return The core settings. */ public static int getIntCoreSetting(String key, int defaultValue, int deviceId) { ActivityThread currentActivityThread = ActivityThread.currentActivityThread(); if (currentActivityThread != null) { return currentActivityThread.getIntCoreSetting(key, defaultValue, deviceId); } else { return defaultValue; } } /** * Gets the value of a float core setting. * Loading
core/java/android/view/ViewConfiguration.java +28 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,8 @@ public class ViewConfiguration { private final int mTapTimeoutMillis; private final int mDoubleTapTimeoutMillis; private final int mDoubleTapMinTimeMillis; private final int mLongPressTimeoutMillis; private final int mMultiPressTimeoutMillis; private final float mScrollFriction; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768915) Loading Loading @@ -448,6 +450,8 @@ public class ViewConfiguration { mTapTimeoutMillis = sResourceCache.getTapTimeout(); mDoubleTapTimeoutMillis = sResourceCache.getDoubleTapTimeout(); mDoubleTapMinTimeMillis = sResourceCache.getDoubleTapMinTime(); mLongPressTimeoutMillis = getLongPressTimeout(); mMultiPressTimeoutMillis = getMultiPressTimeout(); mScrollFriction = sResourceCache.getScrollFriction(); } Loading Loading @@ -592,6 +596,12 @@ public class ViewConfiguration { mDoubleTapTimeoutMillis = res.getInteger(R.integer.config_doubleTapTimeoutMillis); mDoubleTapMinTimeMillis = res.getInteger(R.integer.config_doubleTapMinTimeMillis); mScrollFriction = res.getFloat(R.dimen.config_scrollFriction); int deviceId = context.getDeviceId(); mLongPressTimeoutMillis = AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT, DEFAULT_LONG_PRESS_TIMEOUT, deviceId); mMultiPressTimeoutMillis = AppGlobals.getIntCoreSetting(Settings.Secure.MULTI_PRESS_TIMEOUT, DEFAULT_MULTI_PRESS_TIMEOUT, deviceId); } /** Loading Loading @@ -717,6 +727,15 @@ public class ViewConfiguration { DEFAULT_LONG_PRESS_TIMEOUT); } /** * @return the duration in milliseconds before a press turns into * a long press. */ @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_VIEWCONFIGURATION_APIS) public int getLongPressTimeoutMillis() { return mLongPressTimeoutMillis; } /** * @return the duration in milliseconds between the first tap's up event and the second tap's * down event for an interaction to be considered part of the same multi-press. Loading @@ -726,6 +745,15 @@ public class ViewConfiguration { DEFAULT_MULTI_PRESS_TIMEOUT); } /** * @return the duration in milliseconds between the first tap's up event and the second tap's * down event for an interaction to be considered part of the same multi-press. */ @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_VIEWCONFIGURATION_APIS) public int getMultiPressTimeoutMillis() { return mMultiPressTimeoutMillis; } /** * @return the time before the first key repeat in milliseconds. */ Loading