Fix app launch time regression

An idle now message was scheduled when an activity paused
completed and added to stopping list. The message was then
executed before resuming current top activity (waiting for
top activity process to be attached). We sent a power hint
to notify the launch has ended due to there was no activities
in resumed state, which degraded the launch performance.

Get the resumed activity from focused stack. If the focused
stack is not null or not empty, there should have some
activities resuming or resumed. Check if these activities are
idled.

Bug: 118885508
Test: atest cold-dropcache-test

Change-Id: I88a2b16504fe030dd57e910f29ca15adac30d2ce
1 file changed