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

Skip to content
Commit d70cdb93 authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Report top resumed activity state change

Some system resources can only be accessed exclusively by a single
client at a time. Previously there was only one resumed activity in
the system at any point, so apps were usually trying to obtain such
access in onResume. With multi-resume this is no longer a good place
to do so, because:
- onResume may be called for activity that is not on top;
- top resumed status may be switched between different resumed
  activities in multi-window mode by tapping on them.

This adds a separate callback to inform apps about top resumed state
gain and loss events. The following rules apply:
- both callbacks can only be delivered between onResume and onPause;
- top resumed state loss always follows top resumed state gain;
- the callbacks are optional, activity can go from onResume to
  onPause without obtaining top position.

Bug: 117135575
Test: atest CtsActivityManagerDeviceTestCases:ActivityLifecyclePositionTests
Change-Id: I45797afe47b166b22cfb75b64132b22d3fb4ecc7
parent 996df0db
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