Clear preferred top focusable root task

When the last activity in the task is finishing and there is no next
activity can be resumed. We will use pre-recorded task which is no
longer visible to resume activity. This will not only fail to resume
activity, but also miss the chance to resume home.

We should not ask an invisible task to resume activity, so this CL is to
clear mPreferredTopFocusableRootTask when we can't find a next focusable
task.

Bug: 183373468
Test: Finish SUW and use back key to finish AllSetActivity
Test: atest ActivityRecordTests TaskTest RootTaskTests
Test: atest DisplayContentTests#testNotResumeHomeRootTaskOnRemovingDisplay
Change-Id: I38b69b9dd25ac1fbf88042fb943f1200c3e33474
2 files changed