Files
frameworks_base/core/java/android/hardware
Prabir Pradhan 0f9ea02be0 Reland: Change input injection security model
This reverts commit 6b3c6cae3f.

Changes from revert:
- Explicitly maintain the same behavior as previous versions of Android,
  where injection is allowed into all window if the caller has the
  INJECT_EVENTS permission, even if it is targeting a certain uid. This
  fallback will be removed separately in b/228161340.
- Clear the calling identity before checking if the injection source has
  a permisssion to avoid hitting blanket-checks in PackageManager that
  denys permissions in some cases, such as if the permission check call
  is coming from an instant app (b/228319794).
- Leave the existing IInputManager#injectInputEvent method signature
  unchanged, and add a new input method injectInputEventToTarget to
  perform targeted injection. This makes it so that tools or apps
  relying on the @UnsupportedAppUsage injection method will not be
  broken by a change in the method's signature (b/228583652).

Bug: 207667844
Bug: 194952792
Test: Run tests affected by b/228319794 and its duplicates using
cts-tradefed, so that they are also run as instant apps.
Test: Test scrcpy tool works locally

Change-Id: I503e4f087501e3aecf2c18b4b1d27e51ecda59ac
Merged-In: I503e4f087501e3aecf2c18b4b1d27e51ecda59ac
2022-05-10 18:40:32 +00:00
..
2022-03-31 07:59:51 +00:00
…
2022-02-04 08:20:11 -08:00
2022-01-06 18:35:31 +00:00
2022-04-01 18:13:32 +00:00