Fix Launcher crash while handling top resumed state

The process of current top resumed activity was killed. Before getting
the callbacks from binder death recipient, the process was being restarted
while bringing up other non-UI components - such as sending broadcast.
Since the top resumed activity was not being updated, ATM had to schedule
to the client for dropping the top resumed state after process bound.
So, exceptions thrown because it was illegal to drop the top resumed state
for a fresh client.

Check if necessary to update top resumed activity whenever the stack resumed
activity changes.

Bug: 128837461
Test: run emulator for 10 times
Test: atest ActivityLifecycleTopResumedStateTests
Test: atest ActivityLifecycleKeyguardTests
Test: atest ActivityLifecycleTests

Change-Id: Iefde9bbe5ae50f3a241235faa505a2e58ed681ee
3 files changed