Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21f06911 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

Fix NumberFormatException in LauncherTests

If the key event flags contain 0x80000000 then it causes number
format exception during parsing to Integer

Bug: 358569822
Test: atest NexusLauncherTests
Flag: EXEMPT TEST_ONLY
Change-Id: I6371ab7b9d5d5e356d7199830543177daeda3eea
parent 5b569e76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2423,7 +2423,7 @@ public final class LauncherInstrumentation {
        eventChecker.setLogExclusionRule(event -> {
            Matcher matcher = Pattern.compile("KeyEvent.*flags=0x([0-9a-fA-F]+)").matcher(event);
            if (matcher.find()) {
                int keyEventFlags = Integer.parseInt(matcher.group(1), 16);
                long keyEventFlags = Long.parseLong(matcher.group(1), 16);
                // ignore KeyEvents with FLAG_CANCELED
                return (keyEventFlags & KeyEvent.FLAG_CANCELED) != 0;
            }