Skip to content
Snippets Groups Projects
Commit 641f6fab authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Skip predict back animation for translucent activity." into main

parents 52d4cfa2 49604792
No related branches found
No related tags found
No related merge requests found
......@@ -276,6 +276,10 @@ class BackNavigationController {
// activity, we won't close the activity.
backType = BackNavigationInfo.TYPE_DIALOG_CLOSE;
removedWindowContainer = window;
} else if (!currentActivity.occludesParent() || currentActivity.showWallpaper()) {
// skip if current activity is translucent
backType = BackNavigationInfo.TYPE_CALLBACK;
removedWindowContainer = window;
} else if (prevActivity != null) {
if (!isOccluded || prevActivity.canShowWhenLocked()) {
// We have another Activity in the same currentTask to go to
......
......@@ -130,12 +130,22 @@ public class BackNavigationControllerTests extends WindowTestsBase {
// verify if back animation would start.
assertTrue("Animation scheduled", backNavigationInfo.isPrepareRemoteAnimation());
// reset drawing status
// reset drawing status to test translucent activity
backNavigationInfo.onBackNavigationFinished(false);
mBackNavigationController.clearBackAnimations();
topTask.forAllWindows(w -> {
makeWindowVisibleAndDrawn(w);
}, true);
final ActivityRecord topActivity = topTask.getTopMostActivity();
makeWindowVisibleAndDrawn(topActivity.findMainWindow());
// simulate translucent
topActivity.setOccludesParent(false);
backNavigationInfo = startBackNavigation();
assertThat(typeToString(backNavigationInfo.getType()))
.isEqualTo(typeToString(BackNavigationInfo.TYPE_CALLBACK));
// reset drawing status to test keyguard occludes
topActivity.setOccludesParent(true);
backNavigationInfo.onBackNavigationFinished(false);
mBackNavigationController.clearBackAnimations();
makeWindowVisibleAndDrawn(topActivity.findMainWindow());
setupKeyguardOccluded();
backNavigationInfo = startBackNavigation();
assertThat(typeToString(backNavigationInfo.getType()))
......@@ -201,9 +211,7 @@ public class BackNavigationControllerTests extends WindowTestsBase {
// reset drawing status
backNavigationInfo.onBackNavigationFinished(false);
mBackNavigationController.clearBackAnimations();
testCase.recordFront.forAllWindows(w -> {
makeWindowVisibleAndDrawn(w);
}, true);
makeWindowVisibleAndDrawn(testCase.recordFront.findMainWindow());
setupKeyguardOccluded();
backNavigationInfo = startBackNavigation();
assertThat(typeToString(backNavigationInfo.getType()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment