Always finish activity when moving to a destroyed state.
There is a possibility that an activity will not be marked as
finishing when its state is moved to the destroying/destroyed state.
This opens up the possibility of future lifecycle actions that are
gated by the finishing flag. As a result, errant signals can be
sent to the client for a destroyed activity.
This changelist addresses the issue by limiting interaction with
ActivityRecord's state to accessors. When the state is changed to
destroyed or destroying, the activity is subsequently marked as
finished.
Bug: 71506345
Test: atest FrameworksServicesTests:com.android.server.am.ActivityRecordTests#testFinishingAfterDestroying
Test: atest FrameworksServicesTests:com.android.server.am.ActivityRecordTests#testFinishingAfterDestroyed
Change-Id: Iae8766201477103c9d632a16ecb9f6e95f796a45
7 files changed