summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewConfiguration.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix ViewConfiguration's ArrayIndexOutOfBoundsException优秀2022-11-191-1/+1
| | | | | | | | | | | The get method of ViewConfiguration has a multi-thread safety problem Bug: 257881744 Test: MTBF Change-Id: I69114d86e5dcca3854229d28a86ff0795f6c946b Signed-off-by: minaripenguin37 <alexfinhart@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* base: set scrolling friction to 0.006fJake Weinstein2022-09-221-1/+1
| | | | | | | | [jhonboy121]: set it in ViewConfiguration.SCROLL_FRICTION Co-authored-by: jhonboy121 <alfredmathew05@gmail.com> Signed-off-by: jhonboy121 <alfredmathew05@gmail.com> Change-Id: I579f2ded5e8478dab62c8b9bf54cf5826aa5829b
* Remove preferKeepClearAreaForFocusDelay, turn it into a flagRobert Horvath2022-05-191-8/+8
| | | | | | | | | | | | | TV PiP repositioning in response to keep clear area changes will be debounced in SystemUI, so the client side delay in setting a keep clear area with focus becomes obsolete. Instead the config is turned into a flag for whether focused views should automatically be marked as keep clear areas. Bug: 231309309 Test: atest KeepClearRectsTests Change-Id: I0ac61e671bb75e22a95b400c9bd8d84004379e43 Merged-In: I0ac61e671bb75e22a95b400c9bd8d84004379e43
* Expose getPreferKeepClearForFocusDelay as TestApiRobert Horvath2022-03-041-0/+1
| | | | | | | | | This allows tests to check the behavior of automatically reporting the focused View as a keep clear area. Test: atest KeepClearRectsTests Bug: 218494300 Change-Id: I602406572a540c4b5f77164efab28376faec2701
* Mark focused Views as keep clear areasRobert Horvath2022-03-021-0/+13
| | | | | | | | | Mark/unmark Views as keep clear areas as they gain/lose focus with a small delay. Test: atest KeepClearRectsTests Bug: 218494300 Change-Id: I33c89b5d2ed6707f95eca8ec4b5604c9193aec05
* Nullability annotations for view and widgetAlan Viverette2022-02-031-2/+3
| | | | | | | | | | I inferred nullability annotations in Jetpack based on the guaranteed behavior of the platform, so now I'm propagating those inferences back to the platform as annotations. Test: nullability presubmit checks Fixes: 206801689 Change-Id: I78a1997faeecdafc51d303b0fc766369938b9101
* Merge "Remove WindowManager usage in ViewConfiguration" into sc-v2-dev am: ↵Charles Chen2021-08-261-3/+2
|\ | | | | | | | | | | | | | | d51d2f5efb am: 8d72a79a48 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15659012 Change-Id: I23b66264334fdd88c0eafccd2a43fc92a0c28960
| * Remove WindowManager usage in ViewConfigurationCharles Chen2021-08-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [1] made context created via #createConfigurationContext access ViewConfiguration without StrictModeViolation. However, we may obtain WindowManager in ViewConfiguration and still breaks the violation. This CL gets rid of WindowManager usage to prevent the violation. Test: atest StrictModeTest Bug: 197282789 Bug: 191683535 Change-Id: Ifed3f318601ad2214db137ed3d75efdf2157799e
* | Make sure adb shell input keyevent --longpress KEYCODE_DPAD_CENTER triggers ↵Philip Junker2021-08-091-0/+2
|/ | | | | | | | | | | | | | View#performLongClick(...) KeyEvent#ACTION_UP removes the CheckForLongPress callback that triggers View#performLongClick(...) after the longpress timeout. By adding a delay in case of a long press, the View#CheckForLongPress callback runs as expected and the long press is triggered. Bug: 194799728 Test: manual; build ohm_gtv-userdebug and flash it; navigate to movie / app on main view of LauncherX; adb shell input keyevent --longpress KEYCODE_DPAD_CENTER; verify that longpress menu opens; adb shell input keyevent KEYCODE_DPAD_CENTER; verify that entity page opens Change-Id: Iae08a6c3b2c52888eae63c91a609f4aff06d2297
* Allow config context to inflate viewsCharles Chen2021-04-071-16/+2
| | | | | | | | | | | | | Besides UI contexts, the context created via Context#createConfigurationContext with a proper configuration should be allowed to inflate views or obtain ViewConfiguration. An example is that a wear device inflate views into bitmap and pass the bitmap to the Wear OS Companion app on the phone. Bug: 177847640 Test: atest StrictModeTest Change-Id: Iab232a80a973f54bf0484262d45af3e4c2f0e5dc
* Make SelectionActionModeHelper hardcoded constants configurable.Joanne Chung2021-03-021-0/+39
| | | | | | | | | | | | | | | | | | Read the selection timeout value from ViewConfiguration, ViewConfiguration is statically configurable by the OEM. OEMs can set the value which works on their device before shipping it. After privacy sync, we can make the selection context size configurable by DeviceConfig but we need to provide a reasonable upper bound. The value is 240 after experiment. Bug: 169042855 Test: atest CtsTextClassifierTestCases Test: atest CtsWidgetTestCases:TextViewTest Test: atest android.widget.TextViewActivityTest Test: manual. Changes values by command and checks the values. Change-Id: I59346fdc3b482bca586c13ba6c653d1e9b593922
* Make ViewConfiguration#getMultiPressTimeout publicKyunglyul Hyun2020-11-021-1/+0
| | | | | | | | | | | | | | As part of media mainline project, we're resolving hidden API usages. ViewConfigration#getMultiPressTimeout is a hidden API used by MediaSessionService, which is going to move to mainline module. Seeing a public API, ViewConfiguration#getLongPressTimeout, making getMultiPressTimeout public seems to be trivial. Bug: 171163798 Test: build successful Change-Id: I4fb7b884b7496bfc0e4f33a93eb2a69a889a91c5
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+1
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-1/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+1
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Set the default screenshot delay to 0msMiranda Kephart2020-09-031-1/+1
| | | | | | | | | | | Bug: 165267251 Test: manual -- ensured that the time needed to hold is 0ms if the screenshot_keychord_delay debug value is not set, and that the delay can still be changed using adb shell device_config put systemui screenshot_keychord_delay <ms> Change-Id: Iab989ecf14ef379658130adbced241e084554e63
* Annotating context in framework baseCharles Chen2020-08-031-2/+4
| | | | | | Bug: 151414704 Test: build & run Change-Id: I42c8ab699433c51158a1af201da0521413d74dcd
* Revert "Revert "Enable IMS and its config context to obtain UI component""Charles Chen2020-06-291-2/+3
| | | | | | | Test: atest StrictModeTest Bug: 157027563 Bug: 159795597 Change-Id: I2a1b3fefa0bd82eeaa507c08fc4a79fc9f4391c5
* Revert "Enable IMS and its config context to obtain UI component"Alistair Delva2020-06-241-3/+2
| | | | | | | | | | | | | | | | | | | | | Revert "Verify IMS to get display and WM" Revert submission 11823238-ims_ui_context Reason for revert: Broke the following tests: android.os.cts.StrictModeTest#testIncorrectContextUse_GetDisplay android.os.cts.StrictModeTest#testIncorrectContextUse_GetSystemService android.os.cts.StrictModeTest#testIncorrectContextUse_GetViewConfiguration But was submitted with a bypass. Reverted Changes: I688b46a92:Verify IMS to get display and WM I172ceb2e1:Enable IMS and its config context to obtain UI com... Bug: 157027563 Bug: 159795597 Change-Id: Id309faac0ac8f60ee0d92c26767a89f450ddc455
* Enable IMS and its config context to obtain UI componentCharles Chen2020-06-231-2/+3
| | | | | | | Test: atest StrictModeTest Bug: 157027563 Change-Id: I172ceb2e17722a7cba917a6e3a808d7559cad3e0
* Make sure AmbiguousGestureMultiplier could start from 1arthurhung2020-05-081-1/+1
| | | | | | | | | | | If a motion event classified CLASSIFICATION_AMBIGUOUS_GESTURE, it would multiplied the AmbiguousGestureMultiplier from configuration for the touch slop, we have to make sure this value should be start from 1 or the touch slop could be zero and click action may fail. Bug: 155160957 Test: manual Change-Id: I61e1262b4f3de61214297b678956cc14fa2f24ef
* Report incorrect context usage in ViewConfigurationChris Li2020-03-261-7/+31
| | | | | | | | Before, the documentation said that the passed context is an application context, which is incorrect to get the density, window metrics, and window manager. We should use visual context to get these instead. Bug: 151474461 Test: StrictModeTest#testIncorrectContextUse_GetViewConfiguration Change-Id: Iea28d727cafbb3ec8536742c6a0e594f73fe5a51
* Report bounds instead of size in WindowMetricsAndrii Kulian2020-03-241-3/+3
| | | | | | | | | | | | Use case: Jetpack WM will use them to get the location of windows on screen and compute the display feature positions in window coordinate space. Bug: 150908045 Test: atest FrameworksCoreTests:WindowMetricsTest Test: atest CtsWindowManagerDeviceTestCases:WindowMetricsTests Change-Id: Ia08950cd5df35971408e8b17bb27d97d29d0ab9b Exempt-From-Owner-Approval: API change
* resolve merge conflicts of 7e0769b219257a5053ad79160574892c5aca9ca2 to rvc-devSiarhei Vishniakou2020-03-211-2/+2
|\ | | | | | | | | Bug: 148311342 Change-Id: I99d6296b8947ba85573a11fc5d07583326dd15da
| * Disable deep press when long press is longSiarhei Vishniakou2020-03-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If long press timeout is not 'short', we disable deep press. Also InputManagerService.java will now be responsible for keeping track of the feature state. In ViewConfiguration, we update the default value to 400 to match the value in the settings (b/30159825) Bug: 148311342 Bug: 30159825 Test: see the description in the frameworks/native change Change-Id: I88b933e9e863d40e383afdc990e09b848e23192e Merged-In: I88b933e9e863d40e383afdc990e09b848e23192e
* | Merge changes from topic "add_bundle_to_window_context"Andrii Kulian2020-01-311-5/+4
|\ \ | | | | | | | | | | | | | | | * changes: Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b Add bundle options to Context#createWindowContext API
| * | Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() ↵Andrii Kulian2020-01-311-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in f/b Replace the existing usages of now-deprecated API WindowManager.getDefaultDisplay() with WindowMetrics or Context.getDisplay() in frameworks/base. Bug: 128338354 Test: Build, auto test Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
* | | Move ViewConfiguration#AMBIGUOUS_GESTURE_MULTIPLIER to config.xml.Philip Quinn2020-01-241-7/+30
|/ / | | | | | | | | | | Bug: 132648945 Test: run cts -m android.view.cts Change-Id: Iea918b4cfbff617e495d3d3180a08a9b62bd0b68
* | Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | | | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
* | Revert "Be less slow"John Reck2019-11-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | This reverts commit f2d03d2279a4be18c8d0becc1c13976edbd62acb. Reason for revert: unexpected app-compat impact Change-Id: I59dac6564b9e6c43f5bee82a7a8cd7e6f52f4f1d Fixes: 144190081 Bug: 123756136 Test: none
* | Be less slowJohn Reck2019-10-301-6/+2
|/ | | | | | Bug: 123756136 Test: cts viewconfig test Change-Id: I91beda13cddb2bd14406c2ccefa4511add039a95
* Add a longpress timeout config for screenshot chordEdward Savage-Jones2019-04-091-0/+23
| | | | | | | | | | | | | | | The global actions longpress timeout is currently used for the screenshot chord. This means that increasing the globalactions longpress timeout would also increase the time for triggering a screenshot. This adds a configuration item specifically for the screenshot chord. Bug: 119989329 Test: manual - increase the globalactions timeout and check that the screenshot chord is not affected. Change-Id: I6bd8416f7546aa1d2da43f37f3e76edac3ed543b
* getScaledMinScalingSpan -> getScaledMinimum...shepshapard2019-02-261-1/+1
| | | | | | | Fixes: 126376129 Test: android.view.cts.ViewConfigurationTest Change-Id: Ie5ac265bb8a390d9b82a61cac32ac1dc02556eb7
* Linkify CLASSIFICATION_AMBIGUOUS_GESTURESiarhei Vishniakou2019-02-231-2/+2
| | | | | | | | | Add a doc link to MotionEvent#CLASSIFICATION_AMBIGUOUS_GESTURE, to make it easier for readers to cross-reference documentation. Bug: 125800452 Test: m doc-comment-check-docs Change-Id: Ic7a5a14d30c0cc3aa57f8bcd6af34e2e684f0437
* Prevent reflection - ScaleGestureDetector#mMinSpanshepshapard2019-02-081-0/+30
| | | | | | | | | | | | Also makes "minScalingSpan" accessible to developers via ViewConfiguration in case developers were accessing mMinSpan in order to simply read the value of the field, since that was previously the only way to read the value. Fixes: 123768938 Test: android.view.cts.ViewConfigurationTest Change-Id: Ib179aa153f00a55b6913c7497a1e43bd101f41d3
* Don't allow reflection on ViewConfiguration#sHasPermanentMenuKey.Sumir Kataria2019-02-041-1/+2
| | | | | | | | | | | This seems to be used to force action bar to show an overflow menu. Perhaps this functionality needs to exist in Toolbar, but after discussion with the team, we have decided it does not need to be supported in this fashion any longer. Bug: 123768915 Test: No API or behavior changes Change-Id: I8e311133faec599f4dee635e261507521318260e
* Move multiplier to ViewConfigurationSiarhei Vishniakou2019-01-311-0/+22
| | | | | | | | | We have defined the same constant twice. Let's move it to ViewConfiguration to avoid redundancy. Test: build only Bug: 123368517 Change-Id: I2ac765a85ccd71584429edc693d3ef33b2515c9d
* Support hasNavigationBar per display(1/2)Charles Chen2018-11-281-1/+1
| | | | | | | | | | | | | | | | | This change is to support Auto case. Auto may need to support displays without navigation bar by default, because the display may be far away from driver. Note: currently, hasNavigationBar is global since it's from config. In future patches, it will also check hasSystemDecorations() on secondary display. TODO: We may find a way to make OEMs set hasNavigationBar() for each display. Fixes: 119584629 Test: atest WmTests Test: atest InputMethodManagerServiceTests Test: atest SystemUiTests Change-Id: I427f8ad1f3da644a2bf79ee5b777830378515348
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | For packages: android.view.textservice android.view.textclassifier.logging android.view.textclassifier android.view.inputmethod android.view.autofill android.view.accessibility android.view This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4147b038ed7adf0311ee9918b44766f82a057eaf
* Add @TestApi annotation to a few @hide APIs that were used in CTS.Aurimas Liutikas2018-08-131-0/+1
| | | | | | | | | CtsViewTestCases tests were using @hide APIs. This change makes some of these APIs @TestApi, so CtsViewTestCases can just link againts test_current. Test: make -j Bug: 37778825 Change-Id: I685ab5f0d1d5fcb5557ce4d93fe4f55cc695ed3d
* Add ViewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresentVladislav Kaznacheev2018-02-261-0/+15
| | | | | | | | | This method returns config_showMenuShortcutsWhenKeyboardPresent value. It is necessary for the correct support library implementation of menus. Bug: 31045453 Test: build and flash Android Change-Id: Ibdd354b2d00f0c5f5ed91aa4840e942d772516ef
* Filter out position jitter in hover tooltip handlingVladislav Kaznacheev2017-12-121-0/+12
| | | | | | | | | Allow for some jitter when detecting stationary hover in the tooltip handling code. This makes it possible to invoke a tooltip with stylus. Bug: 70173905 Test: android.view.cts.TooltipTest Change-Id: I016e378df5b48fdc45bcc3a4dbe46e3644ecb74a
* Reduce a11y shortcut timeout from 1.5sec to 1secEugene Susla2017-10-311-1/+1
| | | | | | | Fixes: 63914635 Test: ensure shortcut delay is still 3sec before dialog confirmation and 1sec afterwards Change-Id: I1b9d8eeb93358d036f2f6d048f85a379d996d758
* Reduce a11y shortcut timeout after dialog confirmationEugene Susla2017-10-191-2/+16
| | | | | | | Bug: 63914635 Test: ensure shortcut delay is still 3sec before dialog confirmation and 1.5sec afterwards Change-Id: Ifbc25dd2a3915809b570719ad79fbc83016989a6
* Revert "Revert "Make scrollbarSize in Material Design theme configurable""Tarun Lohani2017-06-161-2/+3
| | | | | | This reverts commit f619ead8d3cf479c965f10ad94960cacbcd7fc3d. Change-Id: I9c80a0439d32f5d458d50c0f7be69a8c8ae1311f
* Revert "Make scrollbarSize in Material Design theme configurable"Vladislav Kaznacheev2017-04-121-3/+2
| | | | | | | | This reverts commit 98329f4da372e2ab00565b88df785620856cfb65. Bug: 35432058 Test: android.view.cts.ViewTest passes Change-Id: I4c76450a47b581a8237108180806845f5f66ac39
* Split scroll factor into a 2d float.Aaron Whyte2017-03-291-8/+37
| | | | | | | | Test: Existing unit tests, manual sanity check. BUG=35764483 Change-Id: If6ac121452698747e1f8bc9d4ec0111bb881d4d4 (cherry picked from commit e9956c5c65ecd3aaf7390c10d135749e5adfb344)
* Make scrollbarSize in Material Design theme configurableVladislav Kaznacheev2017-02-171-2/+3
| | | | | | | | | | 1. Introduce config_scrollbarSize, default value=4dp 2. Use it to define android:scrollbarSize in themes. 3. Remove the explicit size from the MD scrollbar thumb shape. Bug: 35432058 Test: android.cts.view.ViewTest#testScrollbarSize Change-Id: Ia97b8f34ae1b9296ca2afcf62ff5bde55f70a63e
* Introduce a minimum scrollbar touch target sizeVladislav Kaznacheev2017-02-101-0/+17
| | | | | | | | | | | | Currently a default scrollbar is fairly hard to grab with a mouse as it is sometimes as narrow as 8dp. Introduce a larger touch target configured by config_minScrollbarTouchTarget Bug: 35114313 Test: manual Change-Id: Ib15b24e5a82ea912ec5837d965319b758b4d9b6b
* New accessibility shortcut.Phil Weaver2017-01-181-0/+19
| | | | | | | | | | | | | | Removing accessibility gesture from power dialog. Adding new accessibility shortcut activated by holding both volume buttons down. This shortcut is configurable by OEMs and users to work with any installed accessibility service. Bug: 30160335 Test: Added automated testing for the EnableAccessibilityController. Manually toggled various services on and off. Change-Id: I546bd29a2ab1ba64a0cbfd11e2004cdf85ee6cfd