summaryrefslogtreecommitdiff
path: root/core/java/android/view/KeyEvent.java
Commit message (Collapse)AuthorAgeFilesLines
* Camera button supportHazouPH2022-11-071-0/+1
| | | | | | | | | | | | | Add support for camera button Based on commit http://review.cyanogenmod.org/#/c/51487/ This patch adds: - Use camera button as wake key - Use focus button as peek and wake key - Use camera button to launch (secure) camera Change-Id: Ia515c04cca098bf0d20b077ebffc079ee4008f21
* Reimplement device hardware wake keys supportLuK13372022-11-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Author: LuK1337 <priv.luk@gmail.com> Date: Mon Jun 4 10:05:37 2018 +0200 PhoneWindowManager: Improve home button wake haptic feedback handling * This fixes an issue where haptic feedback is used when screen is off and home button wake is disabled. Change-Id: I7ac4c00598cedf7f174dc99629f55dc7b74b0d2a Author: Gabriele M <moto.falcon.git@gmail.com> Date: Mon Sep 26 00:43:08 2016 +0200 Fix volume keys wakeup status handling The same status flag is used for the three different volume keys, however nothing prevents users from pressing multiple keys at the same time. This allows to set the status flag with one volume key and clear it with the other volume key. Use one flag per key so that we never end up in an inconsistent state. This fixes the seldom power button issues that happen when the "volume wake" feature is enabled. Change-Id: I08f5f9ff696bef3dd840cff97d570e44ebe03e4e Author: Martin Brabham <optedoblivion@cyngn.com> Date: Wed Dec 3 11:48:28 2014 -0800 Android Policy: handle volume key event as wake key when preference is set Change-Id: If9a61cd65553bf00f0efda1a75b1ab75b9129090 Author: willl03 <wgangers@gmail.com> Date: Mon Dec 8 11:13:28 2014 -0500 Only go HOME if screen is fully awake Avoid going home when hardware home button is used to wake the device on an insecure keyguard Change-Id: I5d5d8c4fff76967c29e70251f7b165205005ba11 Author: Matt Garnes <matt@cyngn.com> Date: Tue Mar 31 14:39:38 2015 -0700 If a wake key is disabled by the user, do not wake from doze. Currently, any wake key will wake the device from a doze, even if that key has not been enabled as a wake key in Settings. If the device is 'dreaming' in the Doze state, check if the user has explicitly disabled the wake key (or never enabled the setting in the first place) before waking the device. Change-Id: I7397087c143161e8e1ddb84d0e23f6027fea0aac Author: Michael Bestas <mikeioannina@gmail.com> Date: Thu Dec 18 04:26:38 2014 +0200 Cleanup button wake settings (2/2) Change-Id: Ie37136cbd57c4c334321abbfa4543727e940bc43 Keep quiet when volume keys are used to wake up device - Userspace will make a 'beep' with it receives a key up, so consume that event as well. - Removed wake key check in music control code as it will already be disabled here. Change-Id: I93839acd39aec8a2ee40291f833a31f6b048c9f8 Wake Keys: enforce the wake keys overlay * Keys disabled as wake keys by the overlay were still being allowed to wake the device. This change enforces the hardwareWakeKeys settings. Change-Id: Ifde0491b2de64a7f61a101cf22f5589cb5e841e2 Allow disabling Search/Recents button wake (2/2) Change-Id: I6a2ac064efc4fe85413bf0b935c28aa7bde5d672 Author: Danny Baumann <dannybaumann@web.de> Date: Sun Nov 30 23:04:37 2014 -0600 fw/base: allow home button to wake device [1/2] Change-Id: I2b79561dcfa7e569b2e24bbabfffb11517d4d313 Change-Id: Ic294515c7200c1260ac514db23ef3778d374d727
* Tweak Javadoc for mute keycode constantsOliver Woodman2021-11-121-4/+6
| | | | | | | | Tweak documentation so that it doesn't imply that the platform implements default behavior for the microphone mute key. Bug: 204908779 Change-Id: I9aa53623854f5f62f873f7bb2c4a1f64c7025c56
* Add direct keys to launch applications.Kyeongkab.Nam2021-10-261-3/+35
| | | | | | | | | | | | | | | | | Many TV remotes have direct keys to launch the specific application such as Netflix. KEYCODE_APP_X are intended to be used for such a purpose and to be handled by GlobalKeyManager. Categorized like below. - KEYCODE_VIDEO_APP_X - KEYCODE_FEATURED_APP_X - KEYCODE_DEMO_APP_X Prevent KEYCODE_APP_X from being sent to the apps. Bug: 182532772 Test: atest KeyEventInterceptTest Change-Id: I13c469c92da97014be5c76c230806331f0602b54
* Store time in nanoseconds in KeyEventSiarhei Vishniakou2021-08-141-24/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEvent today stores time in milliseconds. That means that data is lost when it gets sent from native to Java layers. The subsequent return route, going from Java to native, cannot recover this data. This causes the KeyEvents to have truncated event times when they are inspected by InputDispatcher (for example, for injectInputEvent and verifyInputEvent apis). In the injectInputEvent, this is fine, because the public api to create a KeyEvent does not allow the caller to provide nanoseconds. For the verifyInputEvent, however, this is a problem. When the HMAC of the provided KeyEvent is computed, it no longer matches the HMAC of the original KeyEvent. That means that verification for KeyEvents is broken. To fix this, we pass nanosecond values to Java layer. The fields are already stored as 'long', so there's enough room for that. To maintain the existing api behaviour, though, we need to convert to/from milliseconds at the public api bondary. This specifically applies to KeyEvent constructors, some of the 'obtain' apis, and 'getDownTime'/'getEventTime' apis. Test: atest VerifyHardwareKeyEventTest Bug: 194264616 Change-Id: I0c82a2f065bc947a0e48a26ae3ea5f4ef77f464f
* Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEventSiarhei Vishniakou2021-06-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | This flag indicates that the event was modified or generated by an accessibility service. It allows apps to tell apart real hardware events, events that are injected (device id == -1), and events coming from accessibility (has flag is_accessibility_event). Events that have gone into accessibility, and got reinjected without being modified will not be distinguishable from real hardware events. In the next release, we will make FLAG_IS_ACCESSIBILITY_EVENT public api. Until then, applications will have to hard-code its value (0x800) to use it. The value is the same for both KeyEvents and MotionEvents for convenience. Bug: 175069843 Bug: 152399927 Test: atest VerifiedMotionEventTest VerifiedKeyEventTest Test: atest AccessibilityGestureDispatchTest Test: atest inputflinger_tests libinput_tests GamepadWithAccessibilityTest Change-Id: I38ac2ab8e19e32cad927742c623f14f43ea0c588
* Implement KEYCODE_TV_POWERNathalie Le Clair2021-01-081-2/+7
| | | | | | | | | | | | | | | | | For devices that are not Android TV devices and not connected to a TV via HDMI, KEYCODE_TV_POWER is ignored. For the following Android TV devices, KEYCODE_TV_POWER is an alias of KEYCODE_POWER: - Devices that don't support HDMI - HDMI TV panel devices - HDMI devices with POWER_CONTROL_MODE set to NONE - HDMI devices with CEC control disabled For all other HDMI devices, KEYCODE_TV_POWER is forwarded to the HDMI stack by calling toggleAndFollowTvPower(). For HDMI source devices, this results in 1. Toggling of the HDMI-connected TV power state over HDMI-CEC 2. The source device following the TV power state Bug: 157402294 Test: adb shell input keyevent KEYCODE_TV_POWER, manually verified TV power toggle behavior on ADT3 Change-Id: I59cd3f2a5c2b7a551176ab40ef9c559ad502a974
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-20/+20
| | | | | | | | | | | | | | | | | | | 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-20/+20
| | | | | | | | | 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-20/+20
| | | | | | | | | | 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
* Make KeyEvent#isMediaSessionKey() as publicHyundo Moon2020-09-101-2/+0
| | | | | | Bug: 168144655 Test: m update-api -j; Change-Id: I701368b5d6413e94ac3c25b4cd352a0b8315af53
* Merge "Add Option To Prevent Wake On Back Key Press" into rvc-dev am: ↵Automerger Merge Worker2020-02-251-1/+0
|\ | | | | | | | | | | ba58fd615f am: d4797a1dfb am: d2c04ff861 am: 9408c534fe Change-Id: I81d07b22c12305642d0ff69a9a09607f11a5b230
| * Add Option To Prevent Wake On Back Key PressPatrick Rohr2020-02-241-1/+0
| | | | | | | | | | | | | | | | | | KEYCODE_BACK was previously hardcoded as a wake key in KeyEvent.java. For TV remotes, we want to make this behavior configurable. Test: Tested on Android TV Device. Bug: 144979700 Change-Id: I496c9c283525d5e04325e4bb3d6ab19a571db0c7
* | Add ID to InputEvent.Garfield Tan2020-02-141-5/+40
|/ | | | | | | | | | | | | | | | | | | | | | The interaction between Java and native code for KeyEvent and MotionEvent is different, so I used different arrangement to pass sequence number across JNI that keeps the consistency with other metadata. Unfortunately this new ID doesn't have absolute uniqueness guarantee so it can't replace InputEvent#getSequenceNumber() which is used with a strict in-process uniqueness assumption. Therefore only convert systrace related use to ID. Also expose ID generator through a static function in InputEvent so that everyone can use it. InputReader and InputDispatcher will use different instances. Bug: 144889238 Test: Build and run. Test: atest FrameworksCoreTests:KeyEventTest Test: atest FrameworksCoreTests:MotionEventTest Change-Id: Icbdcaee1d98948c05484865a4e15e55161ecfa69
* Add hmac to InputEvent and scale to MotionEventSiarhei Vishniakou2020-01-271-2/+12
| | | | | | | | | | | | We need hmac for event verification and scale for supporting raw coordinates properly. Add these to InputEvent/MotionEvent/KeyEvent. Bug: 134977432 Bug: 140786233 Test: atest libinput_tests inputflinger_tests Change-Id: I688718dce98a38318a87e3a30d441b27bba93085
* 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
* Merge "PhoneWindowManager/KeyEvent: Camera key as WakeKey" am: dec76b8a40Felix2019-06-261-1/+2
|\ | | | | | | | | | | am: 1841f6af1d Change-Id: I6771fdd3408461fb8343006a05d15c260d0fb256
| * PhoneWindowManager/KeyEvent: Camera key as WakeKeyFelix2019-06-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | As discussed in https://r.android.com/973723 This makes any camera key event wake up the device. Handling of the camera key apart from waking up the device might follow in a later commit. Signed-off-by: Felix <google@ix5.org> Change-Id: I44dbc3f9ac465f664b6d740cb6a056b7f6e118fb
| * DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) intoXin Li2019-02-141-2/+2
| |\ | | | | | | | | | | | | | | | | | | stage-aosp-master Bug: 124234733 Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
| | * docs: Replacing {#link with {@linkAndrew Solovay2018-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several java files had the typo {#link (for cross-references to other Javadocs) instead of the proper {@link format. This was confusing the new doc publish tool (Mivi) since that's the format used for {# Django comments #}. Fixed a couple of links that had other errors (which prevented building once the {# -> {@ was done) and other typos. Replaced throughout the frameworks/base project; I'll need a separate CL for the AndroidX fixes. Staged to: go/dac-stage/reference/android/app/Instrumentation.html go/dac-stage/reference/android/bluetooth/BluetoothAdapter.html go/dac-stage/reference/android/bluetooth/BluetoothDevice.html go/dac-stage/reference/android/bluetooth/BluetoothServerSocket.html go/dac-stage/reference/android/inputmethodservice/InputMethodService.html go/dac-stage/reference/android/view/KeyCharacterMap.html go/dac-stage/reference/android/view/KeyEvent.html go/dac-stage/reference/android/media/AudioManager.html go/dac-stage/reference/android/net/wifi/WifiConfiguration.html (Other files were not in the public Javadocs.) Bug: 111925950 Test: make ds-docs Exempt-From-Owner-Approval: Docs-only change Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7 Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
| * | Move some members to the "Q blacklist".Mathew Inwood2018-10-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e (cherry picked from commit 8c854f86a477fbbee38092f449333e1425e5cd7e)
| * | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+27
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Ie4663ebd4640b2893e575e599582d2c9530da313 Merged-In: I4147b038ed7adf0311ee9918b44766f82a057eaf
* | Revert Media 1.0 API changes introduced for making 1.0 updatableHyundo Moon2019-03-111-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL reverts API changes which were introduced by below CLs: - "761c475: AML: Make config_mediaMetadataBitmapMaxSize as @SystemApi" - "888b791: Make AudioManager.FLAG_FROM_KEY as @SystemApi" - "3d1353a: AML: Unhide KeyEvent.isMediaSessionKey()" Bug: 128245348 Test: atest CtsMediaTestCases:android.media.cts.MediaSessionTest; atest CtsMediaTestCases:android.media.cts.MediaControllerTest; atest CtsMediaTestCases:android.media.cts.MediaBrowserTest; Change-Id: I263a958bf340336f699adb28424241fd00e46e28
* | All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | | | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* | Merge "Better docs for KEYCODE_PROFILE_SWITCH"Oleg Kibirev2019-01-181-1/+4
|\ \
| * | Better docs for KEYCODE_PROFILE_SWITCHOleg Kibirev2019-01-031-1/+4
| | | | | | | | | | | | | | | | | | Bug: 122276228 Test: not needed Change-Id: I57dcb1d2b8499e8c1864fcbf8df8bc7e684155e9
* | | AML: Unhide KeyEvent.isMediaSessionKey()Hyundo Moon2018-12-051-25/+22
| | | | | | | | | | | | | | | | | | Bug: 119789707 Test: make update-api Change-Id: I60f3271b205348ed64241851304fe7213a535c8e
* | | Rename KeyEvent.isMediaKey() to isMediaSessionKey()Hyundo Moon2018-11-301-3/+3
|/ / | | | | | | | | | | | | | | | | | | Since not all KEYCODE_MEDIA_* keycodes return true in isMediaKey(), the naming can give confusion. This CL renames the method to isMediaSessionKey() and revises its Javadoc. Bug: 119789707 Test: make -j Change-Id: I36786ccf5606977e6d971c13d77d950356561bda
* | Expose display ID related APIs for use by CTSTiger Huang2018-11-131-0/+25
| | | | | | | | | | | | | | | | For CtsWindowManagerDeviceTestCases:WindowFocusTests Bug: 111361570 Test: atest WindowFocusTests android.view.cts.KeyEventTest Change-Id: I273120f71f42d2eaa52786b4a350f3c099d11989
* | Merge "Add key code for thumbs up, thumbs down and profile switch keys"Oleg Kibirev2018-11-121-1/+7
|\ \
| * | Add key code for thumbs up, thumbs down and profile switch keysOleg Kibirev2018-11-081-1/+7
| | | | | | | | | | | | | | | | | | Bug: 119202163 Test: Trivial addition of new constants Change-Id: I5743b4b818a837c88efaca311908bb5e8ec206ca
* | | Documentation for KeyEvent.getRepeatCount()Siarhei Vishniakou2018-11-071-4/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing documentation suggests that ACTION_UP events will contain a valid repeat count that is equal to the repeat count of the latest ACTION_DOWN event. However, in practice, that is not the case. Rather than changing the behaviour to follow the existing documentation, change documentation to conform to the existing behaviour. The rationale here is that changing the behaviour might mean that some apps would start relying on getRepeatCount() being non-zero. But this would only work on the latest Android release. So if an app is tested only on the latest Android release, and not on the release before this behaviour was changed, the app would be broken on the older releases of Android. Test: CTS tests will be added for injection Bug: 113341746 Change-Id: Ia53e0e606c0b3c64135ef00950dc8a19f62933ca
* | cherry-pick from pi-dev docs: Replacing {#link with {@linkAndrew Solovay2018-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several java files had the typo {#link (for cross-references to other Javadocs) instead of the proper {@link format. This was confusing the new doc publish tool (Mivi) since that's the format used for {# Django comments #}. Fixed a couple of links that had other errors (which prevented building once the {# -> {@ was done) and other typos. Replaced throughout the frameworks/base project; I'll need a separate CL for the AndroidX fixes. (Other files were not in the public Javadocs.) Bug: 111925950 Test: make ds-docs Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7 Original Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7 Exempt-From-Owner-Approval: Docs-only change
* | Move some members to the "Q blacklist".Mathew Inwood2018-09-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Parcel mCharacters in KeyEventSiarhei Vishniakou2018-08-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the mCharacters field gets lost via IPC because it is not written to Parcel during serialization. Add this field to the parcel. The ACTION_MULTIPLE with KEYCODE_UNKNOWN signals usage of mCharacters. But the mCharacters field isn't really used by the system. So, deprecate this field. Also deprecate ACTION_MULTIPLE, which doesn't really get used. Bug: 111386868 Test: atest cts.KeyEventTest Change-Id: Ie01b796a10f8b2dcc2bcfa15f71b17a7e917faa7
* | Clarify usage of KeyEvent.keyCodeToStringSiarhei Vishniakou2018-07-171-0/+3
| | | | | | | | | | | | | | | | | | | | KeyEvent.keyCodeToString is not really intended to be used for user-facing tasks, and is not locale-specific. Clarify this in the documentation. Test: none Bug: 77954533 Change-Id: I57cd217c1778824f119e48b2b30d61a72aad6525
* | Move displayId into InputEventSiarhei Vishniakou2018-07-051-1/+40
| | | | | | | | | | | | | | | | | | | | | | Now both KeyEvent and MotionEvent will contain displayId. This will help with dispatching input events to specific displays. There are use cases where a particular input device is used for a specific display only, and it sends key events to the system. This will help with those usages. Test: atest view.MotionEventTest view.KeyEventTest Bug: 64258305 Change-Id: I75891037617ed60820d60736216a0d615ab5e3b0
* | Fix broken links in @see tags in framework docs.Aurimas Liutikas2018-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | doclava was accidentally suppressing all these broken links in @see tags. This CL fixes issues so we can start enfocing checks for broken @see links. Test: make docs Change-Id: If7830ece85f8d1f27c991eae282230814726e115 Exempt-From-Owner-Approval: Fixing @see javadoc link issues that are currently completely broken
* | Allow keycode lookup without KEYCODE_ prefixSiarhei Vishniakou2018-05-221-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, KeyEvent.keyCodeFromString(String name) requires the string to either start with "KEYCODE_", or be directly convertible to an int. However, the string representation of every keycode starts with "KEYCODE_", so this requirement is redundant. Relax this requirement to alllow both of the following usages: 1) keyCodeFromString("KEYCODE_BUTTON_A") 2) keyCodeFromString("BUTTON_A") Currently, only 1) is supported. The other usage, 3) keyCodeFromString("29") is unchanged. The input is no longer case-sensitive. Improved the example of usage in the documentation: the input "1001" suggests that the string must contain binary representation for usage 3), while in fact it is supposed to be a base 10 number. Test: atest cts.KeyEventTest#testKeyCodeFromString Bug: 36069459 Change-Id: I54d7f9d1270748854143cc9d1e8af48c9ec0cd0f
* | Add @TestApi to KeyEvent.actionToString(..)Siarhei Vishniakou2018-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | Currently, it is not possible to use KeyEvent.actionToString(..) in a CTS test because that API is @hide. However, it would be useful to print these actions when tests fail. Therefore, add the @TestApi annotation. Bug: 77803694 36069459 Test: m cts-input-lib CtsHardwareTestCases (under development) Change-Id: I2d23dbd101cef3f1c6c7a70c521a9dc219797615
* | Move display id into MotionEventSiarhei Vishniakou2018-03-061-2/+2
|/ | | | | | | | | Display id is now part of MotionEvent. Test: atest view.MotionEventTest view.KeyEventTest Bug: 64258305 Change-Id: Ifadd6b34f4dd5a91669baf146daa62944d1de974
* Add new refresh key constant.Yuichiro Hanada2018-01-241-1/+3
| | | | | | | | Bug: 64149858 Bug: 64662317 Test: Builds and manual tests with Chromebook. Change-Id: I865d657ee7d78b5e45f642e786d26a65a14f49e1
* Remove @hide for KEYCODE_ALL_APPSSujith Ramakrishnan2018-01-111-2/+1
| | | | | | | | | | | - KEYCODE_ALL_APPS which was introduced late in O is now a proper & valid keycode in P Bug: 64935695 Test: Manual: ALL_APPS: adb shell input keyevent 284 Test: also tested with --longpress for these keys Change-Id: If56c5b87f88e927c52468485b790581fa19ad48b
* Make ASSIST launch VIS and add a new keycode for TV (ALL_APPS)Sujith Ramakrishnan2017-09-071-1/+4
| | | | | | | | | | | | | | | | | | | | | - KEYCODE_ASSIST: Looks for default VIS in system partition and launches it. - Ensure foreground activity assist context extras are collected and sent to VIS. - KEYCODE_ALL_APPS: Sends Intent.ACTION_ALL_APPS. For TV, this targets default launcher package in system partition. Test: Manual: ASSIST: adb shell input keyevent 219 Test: Manual: ALL_APPS: adb shell input keyevent 284 Test: also tested with --longpress for these keys Test: Manual: Checked with dummy app populating overridden onProvideAssistData() Test: Keypresses after overriding ALL_APPS and ASSIST on Nexus Remote Bug: 37950079 Bug: 38496261 Change-Id: I96d9de67d4a442a8c6cb7feec28fc9aeb0dcbc18
* Document Android Wear usage of KEYCODE_WINDOW. am: 03d4a65865Julius D'souza2017-04-061-1/+2
|\ | | | | | | | | | | am: 137006ff5c Change-Id: I40ba20230d36bfe7b1f397b822f2122172de9da3
| * Document Android Wear usage of KEYCODE_WINDOW.Julius D'souza2017-04-031-1/+2
| | | | | | | | | | Bug: 36779123 Change-Id: I17ea8c13d91bd3d8125413cc0c4a7881d0f289e8
| * docs: Clarified definition of KeyEvent.Callback.onKeyMultiple()Kevin Hufnagle2016-09-261-2/+3
| |\ | | | | | | | | | | | | | | | am: b248b1f689 Change-Id: Ie7380c80fc81b65a89337c7c126abc1dfe58a76e
* | | Fix import statement in view|transition|animation packages.Aurimas Liutikas2016-10-121-1/+0
| | | | | | | | | | | | | | | | | | | | | This change also remove trailing whitespace. Test: code still compiles Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
* | | docs: Clarified definition of KeyEvent.Callback.onKeyMultiple() am: b248b1f689Kevin Hufnagle2016-09-261-2/+3
|\ \ \ | |/ / |/| / | |/ | | | | am: f3f234ff36 Change-Id: I2c86132a817e6629435baaaa5a525ea828b6848d