From 39d4d586ba604b9cd513e863f0b61958271e58dd Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Mon, 25 Jul 2022 20:02:14 +0000 Subject: [PATCH] Remove untargeted injection fallback for targeted injection This fallback was added because some tests performed targeted injection into activities started by the shell. Since the known effected tests were fixed in ag/17691131, we can try removing the fallback to see if anything else breaks. Bug: 228161340 Test: atest WindowFocusTests Test: atest WindowInsetsControllerTests Change-Id: I22d05ddd18d961e3c5d6568b53231d7888ea09fd --- .../com/android/server/input/InputManagerService.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java index 44aefccaeaf6d..fe9e68d285cdb 100644 --- a/services/core/java/com/android/server/input/InputManagerService.java +++ b/services/core/java/com/android/server/input/InputManagerService.java @@ -897,17 +897,6 @@ public class InputManagerService extends IInputManager.Stub throw new IllegalStateException("Injection should not result in TARGET_MISMATCH" + " when it is not targeted into to a specific uid."); } - // TODO(b/228161340): Remove the fallback of targeting injection into all windows - // when the caller has the injection permission. - // Explicitly maintain the same behavior as previous versions of Android, where - // injection is allowed into all windows if the caller has the INJECT_EVENTS - // permission, even if it is targeting a certain uid. - if (checkCallingPermission(android.Manifest.permission.INJECT_EVENTS, - "injectInputEvent-target-mismatch-fallback")) { - Slog.w(TAG, "Targeted input event was not directed at a window owned by uid " - + targetUid + ". Falling back to injecting into all windows."); - return injectInputEventToTarget(event, mode, Process.INVALID_UID); - } throw new IllegalArgumentException( "Targeted input event injection from pid " + pid + " was not directed at a window owned by uid "