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

Commit f2f7b8f5 authored by Evan Rosky's avatar Evan Rosky
Browse files

Add global tracking of the active action

This enables usage of chain tracking without requiring
all intermediate calls to plumb it. Eventually, this will
need to be replaced, but during the migration, this allows
incremental work.

The general expectation is that when an action is started,
it will be pushed onto a stack. Then when the work for that
action is done, we pop the action off the stack (manuall)
with a call to either end or endPartial.

The difference between end and endPartial is that end is
known to always close the whole action while endPartial
is used when the sub-action it's closing may be nested.

A single action is expected to be a synchronous/atomic block
of work -- as such, we can add a primitive form safeguarding
against mismatched start/end by ensuring that there are no
open actions on other threads (since that would imply that
action wasn't ended properly).

There is, however, an edge-case which is the trick we
currently use for asyncStart. In this case, we explicitly
exit the global lock and re-enter later. So this CL also
adds some extra infra to track mismatches across those.

Besides adding some logic, the rest of this CL is mechanical
under the following rules:
- For each chain start*, add a corresponding end
- If we leave global lock before end, add a push/popAsyncStart

Bug: 325114242
Test: existing tests (mechanical refactor)
Flag: com.android.window.flags.transit_tracker_plumbing
Change-Id: I1d146adc502d55e9586472ee02df1d973e076416
parent e7ba61fd
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