Home
last modified time | relevance | path

Searched refs:keyEvent (Results 1 – 25 of 78) sorted by relevance

1234

/frameworks/base/core/tests/coretests/src/android/view/
DKeyEventTest.java65 KeyEvent keyEvent = KeyEvent.obtain(DOWN_TIME, EVENT_TIME, ACTION, KEYCODE, REPEAT, in testObtain() local
68 assertHasDefaultFields(keyEvent, INVALID_DISPLAY); in testObtain()
73 KeyEvent keyEvent = KeyEvent.obtain(DOWN_TIME, EVENT_TIME, ACTION, KEYCODE, REPEAT, in testObtainFromKeyEvent() local
75 KeyEvent keyEvent2 = KeyEvent.obtain(keyEvent); in testObtainFromKeyEvent()
77 compareKeys(keyEvent, keyEvent2); in testObtainFromKeyEvent()
83 KeyEvent keyEvent = KeyEvent.obtain(DOWN_TIME, EVENT_TIME, ACTION, KEYCODE, REPEAT, in testObtainWithDisplayId() local
86 assertHasDefaultFields(keyEvent, displayId); in testObtainWithDisplayId()
99 KeyEvent keyEvent = KeyEvent.obtain(DOWN_TIME, EVENT_TIME, ACTION, KEYCODE, REPEAT, in testObtainGeneratesUniqueId() local
101 assertWithMessage("event IDs (event generated on round %s: %s)", i, keyEvent) in testObtainGeneratesUniqueId()
102 .that(set).doesNotContain(keyEvent.getId()); in testObtainGeneratesUniqueId()
[all …]
DVerifiedKeyEventTest.kt60 val keyEvent = createVerifiedKeyEvent() in testParcelUnparcel() constant
62 keyEvent.writeToParcel(parcel, 0 /*flags*/) in testParcelUnparcel()
68 compareVerifiedKeyEvents(keyEvent, unparceledKeyEvent) in testParcelUnparcel()
76 val keyEvent = createVerifiedKeyEvent() in testParcelInputEvent() constant
77 val inputEvent: VerifiedInputEvent = keyEvent in testParcelInputEvent()
86 compareVerifiedKeyEvents(keyEvent, unparceledEvent as VerifiedKeyEvent) in testParcelInputEvent()
94 val keyEvent = createVerifiedKeyEvent() in testParcelKeyEvent() constant
96 keyEvent.writeToParcel(parcel, 0 /*flags*/) in testParcelKeyEvent()
103 compareVerifiedKeyEvents(keyEvent, unparceledEvent as VerifiedKeyEvent) in testParcelKeyEvent()
111 val keyEvent = createVerifiedKeyEvent() in testParcelInputToKeyEvent() constant
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/keyevent/domain/interactor/
DSysUIKeyEventHandlerTest.kt84 val keyEvent = in dispatchKeyEvent_isNotHandledByKeyguardKeyEventInteractor() constant
89 whenever(keyguardKeyEventInteractor.dispatchKeyEvent(eq(keyEvent))).thenReturn(false) in dispatchKeyEvent_isNotHandledByKeyguardKeyEventInteractor()
90 assertThat(underTest.dispatchKeyEvent(keyEvent)).isFalse() in dispatchKeyEvent_isNotHandledByKeyguardKeyEventInteractor()
95 val keyEvent = in dispatchKeyEvent_handledByKeyguardKeyEventInteractor() constant
100 whenever(keyguardKeyEventInteractor.dispatchKeyEvent(eq(keyEvent))).thenReturn(true) in dispatchKeyEvent_handledByKeyguardKeyEventInteractor()
101 assertThat(underTest.dispatchKeyEvent(keyEvent)).isTrue() in dispatchKeyEvent_handledByKeyguardKeyEventInteractor()
106 val keyEvent = in interceptMediaKey_isNotHandledByKeyguardKeyEventInteractor() constant
111 whenever(keyguardKeyEventInteractor.interceptMediaKey(eq(keyEvent))).thenReturn(false) in interceptMediaKey_isNotHandledByKeyguardKeyEventInteractor()
112 assertThat(underTest.interceptMediaKey(keyEvent)).isFalse() in interceptMediaKey_isNotHandledByKeyguardKeyEventInteractor()
117 val keyEvent = in interceptMediaKey_handledByKeyguardKeyEventInteractor() constant
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/
DGestureLauncherServiceTest.java254 KeyEvent keyEvent = new KeyEvent(IGNORED_DOWN_TIME, eventTime, IGNORED_ACTION, IGNORED_CODE, in testInterceptPowerKeyDown_firstPowerDownCameraPowerGestureOnInteractive() local
258 boolean intercepted = mGestureLauncherService.interceptPowerKeyDown(keyEvent, interactive, in testInterceptPowerKeyDown_firstPowerDownCameraPowerGestureOnInteractive()
273 KeyEvent keyEvent = new KeyEvent(IGNORED_DOWN_TIME, eventTime, IGNORED_ACTION, IGNORED_CODE, in testInterceptPowerKeyDown_firstPowerDown_emergencyGestureNotLaunched() local
277 boolean intercepted = mGestureLauncherService.interceptPowerKeyDown(keyEvent, interactive, in testInterceptPowerKeyDown_firstPowerDown_emergencyGestureNotLaunched()
292 KeyEvent keyEvent = new KeyEvent(IGNORED_DOWN_TIME, eventTime, IGNORED_ACTION, IGNORED_CODE, in testInterceptPowerKeyDown_intervalInBoundsCameraPowerGestureOffInteractive() local
296 boolean intercepted = mGestureLauncherService.interceptPowerKeyDown(keyEvent, interactive, in testInterceptPowerKeyDown_intervalInBoundsCameraPowerGestureOffInteractive()
303 keyEvent = new KeyEvent(IGNORED_DOWN_TIME, eventTime, IGNORED_ACTION, IGNORED_CODE, in testInterceptPowerKeyDown_intervalInBoundsCameraPowerGestureOffInteractive()
306 intercepted = mGestureLauncherService.interceptPowerKeyDown(keyEvent, interactive, in testInterceptPowerKeyDown_intervalInBoundsCameraPowerGestureOffInteractive()
337 KeyEvent keyEvent = new KeyEvent(IGNORED_DOWN_TIME, eventTime, IGNORED_ACTION, IGNORED_CODE, in testInterceptPowerKeyDown_intervalMidBoundsCameraPowerGestureOffInteractive() local
341 boolean intercepted = mGestureLauncherService.interceptPowerKeyDown(keyEvent, interactive, in testInterceptPowerKeyDown_intervalMidBoundsCameraPowerGestureOffInteractive()
[all …]
/frameworks/base/services/core/java/com/android/server/media/
DMediaSessionService.java1126 private void dispatchVolumeKeyLongPressLocked(KeyEvent keyEvent) { in dispatchVolumeKeyLongPressLocked() argument
1131 mCurrentFullUserRecord.mOnVolumeKeyLongPressListener.onVolumeKeyLongPress(keyEvent); in dispatchVolumeKeyLongPressLocked()
1133 Log.w(TAG, "Failed to send " + keyEvent + " to volume key long-press listener"); in dispatchVolumeKeyLongPressLocked()
1729 KeyEvent keyEvent, boolean needWakeLock) { in dispatchMediaKeyEvent() argument
1730 if (keyEvent == null || !KeyEvent.isMediaSessionKey(keyEvent.getKeyCode())) { in dispatchMediaKeyEvent()
1742 + keyEvent); in dispatchMediaKeyEvent()
1764 Log.d(TAG, "Send " + keyEvent + " to the media key listener"); in dispatchMediaKeyEvent()
1767 mCurrentFullUserRecord.mOnMediaKeyListener.onMediaKey(keyEvent, in dispatchMediaKeyEvent()
1769 asSystemService, keyEvent, needWakeLock)); in dispatchMediaKeyEvent()
1772 Log.w(TAG, "Failed to send " + keyEvent in dispatchMediaKeyEvent()
[all …]
DMediaKeyDispatcher.java94 MediaSession.Token getMediaSession(@NonNull KeyEvent keyEvent, int uid, in getMediaSession() argument
112 PendingIntent getMediaButtonReceiver(@NonNull KeyEvent keyEvent, int uid, in getMediaButtonReceiver() argument
183 void onSingleTap(KeyEvent keyEvent) { in onSingleTap() argument
200 void onDoubleTap(KeyEvent keyEvent) { in onDoubleTap() argument
217 void onTripleTap(KeyEvent keyEvent) { in onTripleTap() argument
240 void onLongPress(KeyEvent keyEvent) { in onLongPress() argument
DMediaButtonReceiverHolder.java191 public boolean send(Context context, KeyEvent keyEvent, String callingPackageName, in send() argument
196 mediaButtonIntent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent); in send()
207 Log.d(TAG, "Sending " + keyEvent + " to the last known PendingIntent " in send()
220 Log.d(TAG, "Sending " + keyEvent + " to the restored intent " in send()
/frameworks/opt/setupwizard/library/test/instrumentation/src/com/android/setupwizardlib/test/util/
DMockWindow.java97 public void openPanel(int i, KeyEvent keyEvent) { in openPanel() argument
107 public void togglePanel(int i, KeyEvent keyEvent) { in togglePanel() argument
117 public boolean performPanelShortcut(int i, int i1, KeyEvent keyEvent, int i2) { in performPanelShortcut() argument
177 public boolean superDispatchKeyEvent(KeyEvent keyEvent) { in superDispatchKeyEvent() argument
182 public boolean superDispatchKeyShortcutEvent(KeyEvent keyEvent) { in superDispatchKeyShortcutEvent() argument
237 public boolean isShortcutKey(int i, KeyEvent keyEvent) { in isShortcutKey() argument
/frameworks/base/services/core/java/com/android/server/input/debug/
DFocusEventDebugView.java232 KeyEvent keyEvent = KeyEvent.obtain(event); in reportKeyEvent() local
233 post(() -> handleKeyEvent(keyEvent)); in reportKeyEvent()
247 private void handleKeyEvent(KeyEvent keyEvent) { in handleKeyEvent() argument
252 final var identifier = new Pair<>(keyEvent.getDeviceId(), keyEvent.getScanCode()); in handleKeyEvent()
253 final var container = KeyEvent.isModifierKey(keyEvent.getKeyCode()) in handleKeyEvent()
257 switch (keyEvent.getAction()) { in handleKeyEvent()
260 if (keyEvent.getRepeatCount() == 0) { in handleKeyEvent()
262 + KeyEvent.keyCodeToString(keyEvent.getKeyCode()) in handleKeyEvent()
270 pressedKeyView = new PressedKeyView(mContext, getLabel(keyEvent)); in handleKeyEvent()
277 Slog.w(TAG, "Got key up for " + KeyEvent.keyCodeToString(keyEvent.getKeyCode()) in handleKeyEvent()
[all …]
/frameworks/base/media/java/android/media/session/
DMediaSessionManager.java594 public void dispatchMediaKeyEvent(@NonNull KeyEvent keyEvent, boolean needWakeLock) { in dispatchMediaKeyEvent() argument
595 dispatchMediaKeyEventInternal(keyEvent, /*asSystemService=*/false, needWakeLock); in dispatchMediaKeyEvent()
609 public void dispatchMediaKeyEventAsSystemService(@NonNull KeyEvent keyEvent) { in dispatchMediaKeyEventAsSystemService() argument
610 dispatchMediaKeyEventInternal(keyEvent, /*asSystemService=*/true, /*needWakeLock=*/true); in dispatchMediaKeyEventAsSystemService()
613 private void dispatchMediaKeyEventInternal(KeyEvent keyEvent, boolean asSystemService, in dispatchMediaKeyEventInternal() argument
615 Objects.requireNonNull(keyEvent, "keyEvent shouldn't be null"); in dispatchMediaKeyEventInternal()
617 mService.dispatchMediaKeyEvent(mContext.getPackageName(), asSystemService, keyEvent, in dispatchMediaKeyEventInternal() local
636 public boolean dispatchMediaKeyEventToSessionAsSystemService(@NonNull KeyEvent keyEvent, in dispatchMediaKeyEventToSessionAsSystemService() argument
639 Objects.requireNonNull(keyEvent, "keyEvent shouldn't be null"); in dispatchMediaKeyEventToSessionAsSystemService()
640 if (!KeyEvent.isMediaSessionKey(keyEvent.getKeyCode())) { in dispatchMediaKeyEventToSessionAsSystemService()
[all …]
DISessionManager.aidl44 void dispatchMediaKeyEvent(String packageName, boolean asSystemService, in KeyEvent keyEvent, in dispatchMediaKeyEvent() argument
47 in KeyEvent keyEvent, in MediaSession.Token sessionToken); in dispatchMediaKeyEventToSessionAsSystemService() argument
49 in KeyEvent keyEvent, int stream, boolean musicOnly); in dispatchVolumeKeyEvent() argument
51 in KeyEvent keyEvent, in MediaSession.Token sessionToken); in dispatchVolumeKeyEventToSessionAsSystemService() argument
DMediaSessionLegacyHelper.java172 public void sendMediaButtonEvent(KeyEvent keyEvent, boolean needWakeLock) { in sendMediaButtonEvent() argument
173 if (keyEvent == null) { in sendMediaButtonEvent()
177 mCommunicationManager.dispatchMediaKeyEvent(keyEvent, needWakeLock); in sendMediaButtonEvent()
179 Log.d(TAG, "dispatched media key " + keyEvent); in sendMediaButtonEvent()
183 public void sendVolumeKeyEvent(KeyEvent keyEvent, int stream, boolean musicOnly) { in sendVolumeKeyEvent() argument
184 if (keyEvent == null) { in sendVolumeKeyEvent()
188 mSessionManager.dispatchVolumeKeyEvent(keyEvent, stream, musicOnly); in sendVolumeKeyEvent()
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/
DLeftRightArrowPressedListener.kt40 override fun onKey(view: View, keyCode: Int, keyEvent: KeyEvent): Boolean { in onKey()
45 if (keyEvent.action == KeyEvent.ACTION_UP && keyCode == lastKeyCode) { in onKey()
48 } else if (keyEvent.repeatCount == 0) { in onKey()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/
DKeyguardKeyEventInteractorTest.kt219 val keyEvent = KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_VOLUME_UP) in interceptMediaKey_keyguard_SBKVMdoesNotHandle_doesNotHandleMediaKey() constant
221 whenever(statusBarKeyguardViewManager.interceptMediaKey(eq(keyEvent))).thenReturn(false) in interceptMediaKey_keyguard_SBKVMdoesNotHandle_doesNotHandleMediaKey()
223 assertThat(underTest.interceptMediaKey(keyEvent)).isFalse() in interceptMediaKey_keyguard_SBKVMdoesNotHandle_doesNotHandleMediaKey()
224 verify(statusBarKeyguardViewManager).interceptMediaKey(eq(keyEvent)) in interceptMediaKey_keyguard_SBKVMdoesNotHandle_doesNotHandleMediaKey()
229 val keyEvent = KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_VOLUME_UP) in interceptMediaKey_keyguard_handleMediaKey() constant
231 whenever(statusBarKeyguardViewManager.interceptMediaKey(eq(keyEvent))).thenReturn(true) in interceptMediaKey_keyguard_handleMediaKey()
233 assertThat(underTest.interceptMediaKey(keyEvent)).isTrue() in interceptMediaKey_keyguard_handleMediaKey()
234 verify(statusBarKeyguardViewManager).interceptMediaKey(eq(keyEvent)) in interceptMediaKey_keyguard_handleMediaKey()
/frameworks/native/services/inputflinger/dispatcher/include/
DInputDispatcherPolicyInterface.h98 virtual void interceptKeyBeforeQueueing(const KeyEvent& keyEvent, uint32_t& policyFlags) = 0;
113 const KeyEvent& keyEvent,
119 const KeyEvent& keyEvent,
/frameworks/base/services/tests/wmtests/src/com/android/server/policy/
DShortcutKeyTestBase.java224 private void interceptKey(KeyEvent keyEvent) { in interceptKey() argument
225 int actions = mPhoneWindowManager.interceptKeyBeforeQueueing(keyEvent); in interceptKey()
227 if (0 == mPhoneWindowManager.interceptKeyBeforeDispatching(keyEvent)) { in interceptKey()
228 if (!mDispatchedKeyHandler.onKeyDispatched(keyEvent)) { in interceptKey()
229 mPhoneWindowManager.dispatchUnhandledKey(keyEvent); in interceptKey()
/frameworks/base/apct-tests/perftests/core/src/android/widget/
DEditTextLongTextPerfTest.java106 final KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER); in testEditText() local
113 editText.onKeyDown(keyEvent.getKeyCode(), keyEvent); in testEditText() local
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/shade/
DNotificationShadeWindowViewControllerTest.kt628 val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B) in forwardsDispatchKeyEvent() constant
629 interactionEventHandler.dispatchKeyEvent(keyEvent) in forwardsDispatchKeyEvent()
630 verify(sysUIKeyEventHandler).dispatchKeyEvent(keyEvent) in forwardsDispatchKeyEvent()
635 val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B) in forwardsDispatchKeyEventPreIme() constant
636 interactionEventHandler.dispatchKeyEventPreIme(keyEvent) in forwardsDispatchKeyEventPreIme()
637 verify(sysUIKeyEventHandler).dispatchKeyEventPreIme(keyEvent) in forwardsDispatchKeyEventPreIme()
642 val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_VOLUME_UP) in forwardsInterceptMediaKey() constant
643 interactionEventHandler.interceptMediaKey(keyEvent) in forwardsInterceptMediaKey()
644 verify(sysUIKeyEventHandler).interceptMediaKey(keyEvent) in forwardsInterceptMediaKey()
649 val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A) in forwardsCollectKeyEvent() constant
[all …]
/frameworks/native/libs/input/tests/
DInputPublisherAndConsumer_test.cpp300 KeyEvent* keyEvent = static_cast<KeyEvent*>(event); in publishAndConsumeKeyEvent() local
302 EXPECT_EQ(eventId, keyEvent->getId()); in publishAndConsumeKeyEvent()
303 EXPECT_EQ(deviceId, keyEvent->getDeviceId()); in publishAndConsumeKeyEvent()
304 EXPECT_EQ(source, keyEvent->getSource()); in publishAndConsumeKeyEvent()
305 EXPECT_EQ(displayId, keyEvent->getDisplayId()); in publishAndConsumeKeyEvent()
306 EXPECT_EQ(hmac, keyEvent->getHmac()); in publishAndConsumeKeyEvent()
307 EXPECT_EQ(action, keyEvent->getAction()); in publishAndConsumeKeyEvent()
308 EXPECT_EQ(flags, keyEvent->getFlags()); in publishAndConsumeKeyEvent()
309 EXPECT_EQ(keyCode, keyEvent->getKeyCode()); in publishAndConsumeKeyEvent()
310 EXPECT_EQ(scanCode, keyEvent->getScanCode()); in publishAndConsumeKeyEvent()
[all …]
DInputPublisherAndConsumerNoResampling_test.cpp471 std::unique_ptr<KeyEvent> keyEvent = std::move(*optKeyEvent); in publishAndConsumeKeyEvent() local
478 EXPECT_EQ(eventId, keyEvent->getId()); in publishAndConsumeKeyEvent()
479 EXPECT_EQ(deviceId, keyEvent->getDeviceId()); in publishAndConsumeKeyEvent()
480 EXPECT_EQ(source, keyEvent->getSource()); in publishAndConsumeKeyEvent()
481 EXPECT_EQ(displayId, keyEvent->getDisplayId()); in publishAndConsumeKeyEvent()
482 EXPECT_EQ(hmac, keyEvent->getHmac()); in publishAndConsumeKeyEvent()
483 EXPECT_EQ(action, keyEvent->getAction()); in publishAndConsumeKeyEvent()
484 EXPECT_EQ(flags, keyEvent->getFlags()); in publishAndConsumeKeyEvent()
485 EXPECT_EQ(keyCode, keyEvent->getKeyCode()); in publishAndConsumeKeyEvent()
486 EXPECT_EQ(scanCode, keyEvent->getScanCode()); in publishAndConsumeKeyEvent()
[all …]
/frameworks/base/core/java/com/android/internal/policy/
DPhoneFallbackEventHandler.java316 private void handleVolumeKeyEvent(KeyEvent keyEvent) { in handleVolumeKeyEvent() argument
317 getMediaSessionManager().dispatchVolumeKeyEventAsSystemService(keyEvent, in handleVolumeKeyEvent()
321 private void handleMediaKeyEvent(KeyEvent keyEvent) { in handleMediaKeyEvent() argument
322 getMediaSessionManager().dispatchMediaKeyEventAsSystemService(keyEvent); in handleMediaKeyEvent()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/qs/
DLeftRightArrowPressedListenerTest.kt97 val keyEvent = in sendKeyWithRepeat() constant
105 onKey(view, keyCode, keyEvent) in sendKeyWithRepeat()
/frameworks/base/core/java/android/view/
DInputEventConsistencyVerifier.java177 final KeyEvent keyEvent = (KeyEvent)event; in onInputEvent() local
178 onKeyEvent(keyEvent, nestingLevel); in onInputEvent()
597 final KeyEvent keyEvent = (KeyEvent)event; in onUnhandledEvent() local
598 final int deviceId = keyEvent.getDeviceId(); in onUnhandledEvent()
599 final int source = keyEvent.getSource(); in onUnhandledEvent()
600 final int keyCode = keyEvent.getKeyCode(); in onUnhandledEvent()
/frameworks/native/services/inputflinger/tests/
DFakeWindows.cpp99 const KeyEvent& keyEvent = static_cast<const KeyEvent&>(*event); in consumeEvent() local
100 ASSERT_THAT(keyEvent, WithKeyAction(expectedAction)); in consumeEvent()
102 EXPECT_EQ(expectedFlags.value(), keyEvent.getFlags()); in consumeEvent()
207 KeyEvent& keyEvent = static_cast<KeyEvent&>(*event); in assertNoEvents() local
208 ADD_FAILURE() << "Received key event " << keyEvent; in assertNoEvents()
DFakeWindows.h244 std::unique_ptr<KeyEvent> keyEvent = consumeKey(); in consumeKeyEvent() local
245 EXPECT_NE(nullptr, keyEvent); in consumeKeyEvent()
246 if (!keyEvent) { in consumeKeyEvent()
249 EXPECT_THAT(*keyEvent, matcher); in consumeKeyEvent()
250 return keyEvent; in consumeKeyEvent()

1234