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

Commit f506c367 authored by Evan Severson's avatar Evan Severson
Browse files

Invoke uid state change callback for all nonexistent apps

Uids transitioning from UID_STATE_CACHED to UID_STATE_NONEXISTENT don't
currently invoke the callback since NONEXISTENT is equivalent to CACHED
externally to AppOpsService. This lead to an issue where an app getting
killed from the CACHED state doesn't invoke the cleanup routine for
running ops.

In this change we treat NONEXISTENT as a separate state inside of
AppOpsUidStateTracker so that we can track killed uids the same way as
other transistions and then external to the tracker translate back to
CACHED and invoke that callback if transistioning from something other
than CACHED. Then finally the NONEXISTENT callback will always be
invoked so that AppOpsService can run its cleanup routine.

Mocking tests are updated to be more rigorous to expect exact amounts
of invocations.

Test: atest CtsMediaAudioPermissionTestCases CtsAppOpsTestCases \
          AppOpsUidStateTrackerTest
Flag: android.permission.flags.finish_running_ops_for_killed_packages
Bug: 399667889
Change-Id: I515173921cd4df88c35e2a4847122b5ab56cb937
parent 34f9f07e
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