ActivityManagerProcessStateTest: Use intent to finish Activity

The behavior of the back button on the root task was changed so that it
no longer finishes the task, but instead moves it to the back
(b/146418616).

These tests used back button presses to exit Activities. Given the
behavior change, we now use a new intent with a dedicated action to
finish activities.

Bug: 162197169
Test: atest
ActivityManagerProcessStateTest#testCantSaveStateLaunchAndBackground
Test: atest
ActivityManagerProcessStateTest#testCantSaveStateLaunchAndShow

Change-Id: Iaf2894ab1880626d7d6b48b6ba34b6a008b71c47
3 files changed