Make CarLauncher multi-display CTS compatible.

CarLauncher has the logic to restart Maps in TaskView if it's crashed.
But this behavior hinders multi-display CTS because CTS's setup removes
all tasks but Home (CarLauncher), and it removes Maps too, so our logic
tries to restart Maps, and it creates unexpected superfluous Activity
state changes and the tests will be failed.

We changed the logic to restart Maps only when CarLauncher is focused.
The logic is safe for CTS, since most CTS doesn't give the focus to
Home explicitly.

This CL also sets setTaskAlwaysOnTop() on the Activity in TaskView and
cleans up some unused variables.

Test: atest MultiDisplayActivityLaunchTests
Test: atest MultiDisplayClientTests
Bug: 192122834
Bug: 192123204
Change-Id: Ie920e0ce78a3308e8cdc7aeeb5f2c4f600ecaa97
Merged-In: Ie920e0ce78a3308e8cdc7aeeb5f2c4f600ecaa97
1 file changed
tree: 4d7de047995939d5a5c11340f974a9262726993c
  1. res/
  2. src/
  3. tests/
  4. tools/
  5. Android.bp
  6. AndroidManifest.xml
  7. OWNERS
  8. PREUPLOAD.cfg