Fix press HOME logging tests.
The logic to log the system event triggered by the key press is executed after the tests check if the system event was logged. This happens when: 1. PhoneWindowManager posts handleShortPressOnHome, message queue: [handleShortPressOnHome] 2. TestPhoneWindowManager posts runWithScissors, message queue: [handleShortPressOnHome, runWithScissors] 3. Handler runs handleShortPressOnHome, which posts logKeyboardSystemsEvent, message queue: [runWithScissors, logKeyboardSystemsEvent] 4. Handler runs runWithScissors, fails the assertion that keyboardSystemEvent was logged, message queue: [logKeyboardSystemsEvent] 5. Handler runs logKeyboardSystemsEvent, message queue: [] A copy of the KeyEvent is needed, because the KeyEvent gets recycle later on. Test: atest ShortcutLoggingTests Change-Id: I0878bb616296ebbed4bf2a7e9479a970c3eb6bce Bug: b/300023716
Loading
Please register or sign in to comment