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
Loading
Please register or sign in to comment