Add a method to go Home from immersive fullscreen app

This requires two swipes - first to bring the navbar back followed by
standard goHome() interaction.

Currently only supported in gesture nav, as with immersive landscape in
3 button navigation the swipe gesture must happen on the left/right
edge of the screen.

Bug: 300969961
Test: n/a

Change-Id: I9d6d327998d474063727acc786fe297cc2df6b62
This commit is contained in:
Mateusz Cicheński
2023-09-28 06:21:47 +00:00
parent a54772832b
commit 1f294a4281

View File

@@ -21,6 +21,7 @@ import static android.content.pm.PackageManager.DONT_KILL_APP;
import static android.content.pm.PackageManager.MATCH_ALL;
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
import static android.view.MotionEvent.AXIS_GESTURE_SWIPE_FINGER_COUNT;
import static com.android.launcher3.tapl.Folder.FOLDER_CONTENT_RES_ID;
import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
@@ -980,6 +981,25 @@ public final class LauncherInstrumentation {
return goHome();
}
/**
* Goes to home from immersive fullscreen app by first swiping up to bring navbar, and then
* performing {@code goHome()} action.
* Currently only supports gesture navigation mode.
*
* @return the Workspace object.
*/
public Workspace goHomeFromImmersiveFullscreenApp() {
assertTrue("expected gesture navigation mode",
getNavigationModel() == NavigationModel.ZERO_BUTTON);
final Point displaySize = getRealDisplaySize();
linearGesture(
displaySize.x / 2, displaySize.y - 1,
displaySize.x / 2, 0,
ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME,
false, GestureScope.EXPECT_PILFER);
return goHome();
}
/**
* Goes to home by swiping up in zero-button mode or pressing Home button.
* Calling it after another TAPL call is safe because all TAPL methods wait for the animations