Loading core/api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -2923,7 +2923,7 @@ package android.view { method public static int getHoverTooltipHideTimeout(); method public static int getHoverTooltipShowTimeout(); method public static int getLongPressTooltipHideTimeout(); method public int getPreferKeepClearForFocusDelay(); method public boolean isPreferKeepClearForFocusEnabled(); } public class ViewDebug { Loading core/java/android/view/View.java +6 −31 Original line number Diff line number Diff line Loading @@ -4781,9 +4781,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @UnsupportedAppUsage ListenerInfo mListenerInfo; private boolean mPreferKeepClearForFocus; private Runnable mMarkPreferKeepClearForFocus; private static class TooltipInfo { /** * Text to be displayed in a tooltip popup. Loading Loading @@ -11962,8 +11959,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @NonNull List<Rect> collectPreferKeepClearRects() { ListenerInfo info = mListenerInfo; boolean keepBoundsClear = (info != null && info.mPreferKeepClear) || mPreferKeepClearForFocus; boolean keepClearForFocus = isFocused() && ViewConfiguration.get(mContext).isPreferKeepClearForFocusEnabled(); boolean keepBoundsClear = (info != null && info.mPreferKeepClear) || keepClearForFocus; boolean hasCustomKeepClearRects = info != null && info.mKeepClearRects != null; if (!keepBoundsClear && !hasCustomKeepClearRects) { Loading @@ -11985,33 +11983,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private void updatePreferKeepClearForFocus() { if (mMarkPreferKeepClearForFocus != null) { removeCallbacks(mMarkPreferKeepClearForFocus); mMarkPreferKeepClearForFocus = null; } final ViewConfiguration configuration = ViewConfiguration.get(mContext); final int delay = configuration.getPreferKeepClearForFocusDelay(); if (delay >= 0) { mMarkPreferKeepClearForFocus = () -> { mPreferKeepClearForFocus = isFocused(); mMarkPreferKeepClearForFocus = null; if (ViewConfiguration.get(mContext).isPreferKeepClearForFocusEnabled()) { updatePositionUpdateListener(); post(this::updateKeepClearRects); }; postDelayed(mMarkPreferKeepClearForFocus, delay); } } private void cancelMarkPreferKeepClearForFocus() { if (mMarkPreferKeepClearForFocus != null) { removeCallbacks(mMarkPreferKeepClearForFocus); mMarkPreferKeepClearForFocus = null; } mPreferKeepClearForFocus = false; } /** * Retrieve the list of unrestricted areas within this view's post-layout coordinate space * which the system will try to not cover with other floating elements, like the pip window. Loading Loading @@ -13754,7 +13731,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } invalidate(); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); updatePreferKeepClearForFocus(); return true; } return false; Loading Loading @@ -21154,7 +21130,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, removePerformClickCallback(); clearAccessibilityThrottles(); stopNestedScroll(); cancelMarkPreferKeepClearForFocus(); // Anything that started animating right before detach should already // be in its final state when re-attached. core/java/android/view/ViewConfiguration.java +8 −8 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ public class ViewConfiguration { private final long mScreenshotChordKeyTimeout; private final int mSmartSelectionInitializedTimeout; private final int mSmartSelectionInitializingTimeout; private final int mPreferKeepClearForFocusDelay; private final boolean mPreferKeepClearForFocusEnabled; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768915) private boolean sHasPermanentMenuKey; Loading Loading @@ -393,7 +393,7 @@ public class ViewConfiguration { mMinScalingSpan = 0; mSmartSelectionInitializedTimeout = SMART_SELECTION_INITIALIZED_TIMEOUT_IN_MILLISECOND; mSmartSelectionInitializingTimeout = SMART_SELECTION_INITIALIZING_TIMEOUT_IN_MILLISECOND; mPreferKeepClearForFocusDelay = -1; mPreferKeepClearForFocusEnabled = false; } /** Loading Loading @@ -508,8 +508,8 @@ public class ViewConfiguration { com.android.internal.R.integer.config_smartSelectionInitializedTimeoutMillis); mSmartSelectionInitializingTimeout = res.getInteger( com.android.internal.R.integer.config_smartSelectionInitializingTimeoutMillis); mPreferKeepClearForFocusDelay = res.getInteger( com.android.internal.R.integer.config_preferKeepClearForFocusDelayMillis); mPreferKeepClearForFocusEnabled = res.getBoolean( com.android.internal.R.bool.config_preferKeepClearForFocus); } /** Loading Loading @@ -1100,13 +1100,13 @@ public class ViewConfiguration { } /** * @return The delay in milliseconds before focused Views set themselves as preferred to keep * clear, or -1 if Views should not set themselves as preferred to keep clear. * @return {@code true} if Views should set themselves as preferred to keep clear when focused, * {@code false} otherwise. * @hide */ @TestApi public int getPreferKeepClearForFocusDelay() { return mPreferKeepClearForFocusDelay; public boolean isPreferKeepClearForFocusEnabled() { return mPreferKeepClearForFocusEnabled; } /** Loading core/res/res/values/config.xml +2 −3 Original line number Diff line number Diff line Loading @@ -5163,9 +5163,8 @@ when TextClassifier has not been initialized. --> <integer name="config_smartSelectionInitializingTimeoutMillis">500</integer> <!-- The delay in milliseconds before focused Views set themselves as preferred to keep clear. Set to -1 if Views should not set themselves as preferred to keep clear. --> <integer name="config_preferKeepClearForFocusDelayMillis">-1</integer> <!-- If true, Views will declare they prefer to be kept clear from overlays when focused. --> <bool name="config_preferKeepClearForFocus">false</bool> <!-- Indicates that default fitness tracker app needs to request sensor and location permissions. --> <bool name="config_trackerAppNeedsPermissions">false</bool> Loading core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -479,7 +479,7 @@ <java-symbol type="bool" name="config_useAssistantVolume" /> <java-symbol type="integer" name="config_smartSelectionInitializedTimeoutMillis" /> <java-symbol type="integer" name="config_smartSelectionInitializingTimeoutMillis" /> <java-symbol type="integer" name="config_preferKeepClearForFocusDelayMillis" /> <java-symbol type="bool" name="config_preferKeepClearForFocus" /> <java-symbol type="bool" name="config_hibernationDeletesOatArtifactsEnabled"/> <java-symbol type="integer" name="config_defaultAnalogClockSecondsHandFps"/> Loading Loading
core/api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -2923,7 +2923,7 @@ package android.view { method public static int getHoverTooltipHideTimeout(); method public static int getHoverTooltipShowTimeout(); method public static int getLongPressTooltipHideTimeout(); method public int getPreferKeepClearForFocusDelay(); method public boolean isPreferKeepClearForFocusEnabled(); } public class ViewDebug { Loading
core/java/android/view/View.java +6 −31 Original line number Diff line number Diff line Loading @@ -4781,9 +4781,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @UnsupportedAppUsage ListenerInfo mListenerInfo; private boolean mPreferKeepClearForFocus; private Runnable mMarkPreferKeepClearForFocus; private static class TooltipInfo { /** * Text to be displayed in a tooltip popup. Loading Loading @@ -11962,8 +11959,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @NonNull List<Rect> collectPreferKeepClearRects() { ListenerInfo info = mListenerInfo; boolean keepBoundsClear = (info != null && info.mPreferKeepClear) || mPreferKeepClearForFocus; boolean keepClearForFocus = isFocused() && ViewConfiguration.get(mContext).isPreferKeepClearForFocusEnabled(); boolean keepBoundsClear = (info != null && info.mPreferKeepClear) || keepClearForFocus; boolean hasCustomKeepClearRects = info != null && info.mKeepClearRects != null; if (!keepBoundsClear && !hasCustomKeepClearRects) { Loading @@ -11985,33 +11983,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private void updatePreferKeepClearForFocus() { if (mMarkPreferKeepClearForFocus != null) { removeCallbacks(mMarkPreferKeepClearForFocus); mMarkPreferKeepClearForFocus = null; } final ViewConfiguration configuration = ViewConfiguration.get(mContext); final int delay = configuration.getPreferKeepClearForFocusDelay(); if (delay >= 0) { mMarkPreferKeepClearForFocus = () -> { mPreferKeepClearForFocus = isFocused(); mMarkPreferKeepClearForFocus = null; if (ViewConfiguration.get(mContext).isPreferKeepClearForFocusEnabled()) { updatePositionUpdateListener(); post(this::updateKeepClearRects); }; postDelayed(mMarkPreferKeepClearForFocus, delay); } } private void cancelMarkPreferKeepClearForFocus() { if (mMarkPreferKeepClearForFocus != null) { removeCallbacks(mMarkPreferKeepClearForFocus); mMarkPreferKeepClearForFocus = null; } mPreferKeepClearForFocus = false; } /** * Retrieve the list of unrestricted areas within this view's post-layout coordinate space * which the system will try to not cover with other floating elements, like the pip window. Loading Loading @@ -13754,7 +13731,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } invalidate(); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); updatePreferKeepClearForFocus(); return true; } return false; Loading Loading @@ -21154,7 +21130,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, removePerformClickCallback(); clearAccessibilityThrottles(); stopNestedScroll(); cancelMarkPreferKeepClearForFocus(); // Anything that started animating right before detach should already // be in its final state when re-attached.
core/java/android/view/ViewConfiguration.java +8 −8 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ public class ViewConfiguration { private final long mScreenshotChordKeyTimeout; private final int mSmartSelectionInitializedTimeout; private final int mSmartSelectionInitializingTimeout; private final int mPreferKeepClearForFocusDelay; private final boolean mPreferKeepClearForFocusEnabled; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768915) private boolean sHasPermanentMenuKey; Loading Loading @@ -393,7 +393,7 @@ public class ViewConfiguration { mMinScalingSpan = 0; mSmartSelectionInitializedTimeout = SMART_SELECTION_INITIALIZED_TIMEOUT_IN_MILLISECOND; mSmartSelectionInitializingTimeout = SMART_SELECTION_INITIALIZING_TIMEOUT_IN_MILLISECOND; mPreferKeepClearForFocusDelay = -1; mPreferKeepClearForFocusEnabled = false; } /** Loading Loading @@ -508,8 +508,8 @@ public class ViewConfiguration { com.android.internal.R.integer.config_smartSelectionInitializedTimeoutMillis); mSmartSelectionInitializingTimeout = res.getInteger( com.android.internal.R.integer.config_smartSelectionInitializingTimeoutMillis); mPreferKeepClearForFocusDelay = res.getInteger( com.android.internal.R.integer.config_preferKeepClearForFocusDelayMillis); mPreferKeepClearForFocusEnabled = res.getBoolean( com.android.internal.R.bool.config_preferKeepClearForFocus); } /** Loading Loading @@ -1100,13 +1100,13 @@ public class ViewConfiguration { } /** * @return The delay in milliseconds before focused Views set themselves as preferred to keep * clear, or -1 if Views should not set themselves as preferred to keep clear. * @return {@code true} if Views should set themselves as preferred to keep clear when focused, * {@code false} otherwise. * @hide */ @TestApi public int getPreferKeepClearForFocusDelay() { return mPreferKeepClearForFocusDelay; public boolean isPreferKeepClearForFocusEnabled() { return mPreferKeepClearForFocusEnabled; } /** Loading
core/res/res/values/config.xml +2 −3 Original line number Diff line number Diff line Loading @@ -5163,9 +5163,8 @@ when TextClassifier has not been initialized. --> <integer name="config_smartSelectionInitializingTimeoutMillis">500</integer> <!-- The delay in milliseconds before focused Views set themselves as preferred to keep clear. Set to -1 if Views should not set themselves as preferred to keep clear. --> <integer name="config_preferKeepClearForFocusDelayMillis">-1</integer> <!-- If true, Views will declare they prefer to be kept clear from overlays when focused. --> <bool name="config_preferKeepClearForFocus">false</bool> <!-- Indicates that default fitness tracker app needs to request sensor and location permissions. --> <bool name="config_trackerAppNeedsPermissions">false</bool> Loading
core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -479,7 +479,7 @@ <java-symbol type="bool" name="config_useAssistantVolume" /> <java-symbol type="integer" name="config_smartSelectionInitializedTimeoutMillis" /> <java-symbol type="integer" name="config_smartSelectionInitializingTimeoutMillis" /> <java-symbol type="integer" name="config_preferKeepClearForFocusDelayMillis" /> <java-symbol type="bool" name="config_preferKeepClearForFocus" /> <java-symbol type="bool" name="config_hibernationDeletesOatArtifactsEnabled"/> <java-symbol type="integer" name="config_defaultAnalogClockSecondsHandFps"/> Loading