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

Skip to content
Commit dc8c2c65 authored by Bernardo Rufino's avatar Bernardo Rufino
Browse files

Consider UID instead of PID in canBeObscuredBy()

This method is used to inform the decision to include flags
FLAG_WINDOW_IS_OBSCURED, FLAG_WINDOW_IS_PARTIALLY_OBSCURED or not. These
flags were created to enhance the opt-in security of apps (ag/64561,
ag/903312), ie. an app can decide to filter out events that contain
these flags if desired. Filtering out events obscured by the same UID
but by a different process does not have any effect on security since in
this case apps with the same UID can already inject motion events into
each other (
http://cs/android/frameworks/native/services/inputflinger/dispatcher/InputDispatcher.cpp?l=2069&rcl=c8118551a204469df34ad6d5445e15ffb46ef96b),
but more generally those apps share the same identity, so, in practice,
for the system they act like the same (eg. they share all permissions,
they usually can act as another package from the same UID, can access
the private data of the other app, etc). Finally, if 2 apps share the
same process, they necessarily share the same UID (
https://developer.android.com/guide/topics/manifest/application-element.html#proc),
so this wouldn't create app-compat problems with the check before, it
would probably help since it wouldn't generate some obscured events
unnecessarily.

This is also in preparation for ag/12408004.

Test: With child CL, atest WindowCrossTouchTest
Test: TH pass
Bug: 158002302
Change-Id: I5cf9fd6a9b33620b8c40d18a394aa4fc57694d28
parent 0ede4cdd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment