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

Skip to content
Commit d8321163 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Avoid applying unexpected sync state when checking sync finish

For example:
A task launch transition is completed so its window finishes sync
to SYNC_STATE_NONE. And then a new activity X is launching in the
same task (given sync-group{X}). If a code path accidentally invokes
isSyncFinished to check a window that isn't in the sync-group, e.g.
the window of previous activity, then prepareSync will still be called
and change the sync state to SYNC_STATE_WAITING_FOR_DRAW.

And later when removing the window without sync-group, an exception
will be thrown by not SYNC_STATE_NONE.

So when checking isSyncFinished, if there is no sync-group from
ancestor, then behave as a getter function.

Also tweak getSyncGroup a bit to reduce method invocation.

Fix: 318642514
Test: atest SyncEngineTests#testWaitingSyncCallback
Change-Id: Idd1bc09eb9bdec1a8b0ba44fa34f417f2fa92102
parent 429020dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment