Merge "Fix the trampoline activity shows at the top due to app transition."
This commit is contained in:
committed by
Android (Google) Code Review
commit
f2e177b923
@@ -154,7 +154,7 @@ public class AppTransitionController {
|
||||
ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "**** GOOD TO GO");
|
||||
// TODO(new-app-transition): Remove code using appTransition.getAppTransition()
|
||||
final AppTransition appTransition = mDisplayContent.mAppTransition;
|
||||
mDisplayContent.mSkipAppTransitionAnimation = false;
|
||||
|
||||
mDisplayContent.mNoAnimationNotifyOnTransitionFinished.clear();
|
||||
|
||||
appTransition.removeAppTransitionTimeoutCallbacks();
|
||||
@@ -188,7 +188,9 @@ public class AppTransitionController {
|
||||
final @TransitionOldType int transit = getTransitCompatType(
|
||||
mDisplayContent.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
mWallpaperControllerLocked.getWallpaperTarget(), getOldWallpaper());
|
||||
mWallpaperControllerLocked.getWallpaperTarget(), getOldWallpaper(),
|
||||
mDisplayContent.mSkipAppTransitionAnimation);
|
||||
mDisplayContent.mSkipAppTransitionAnimation = false;
|
||||
|
||||
ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
|
||||
"handleAppTransitionReady: displayId=%d appTransition={%s}"
|
||||
@@ -274,7 +276,8 @@ public class AppTransitionController {
|
||||
*/
|
||||
static @TransitionOldType int getTransitCompatType(AppTransition appTransition,
|
||||
ArraySet<ActivityRecord> openingApps, ArraySet<ActivityRecord> closingApps,
|
||||
@Nullable WindowState wallpaperTarget, @Nullable WindowState oldWallpaper) {
|
||||
@Nullable WindowState wallpaperTarget, @Nullable WindowState oldWallpaper,
|
||||
boolean skipAppTransitionAnimation) {
|
||||
|
||||
// Determine if closing and opening app token sets are wallpaper targets, in which case
|
||||
// special animations are needed.
|
||||
@@ -298,6 +301,10 @@ public class AppTransitionController {
|
||||
return TRANSIT_OLD_KEYGUARD_UNOCCLUDE;
|
||||
}
|
||||
|
||||
// This is not keyguard transition and one of the app has request to skip app transition.
|
||||
if (skipAppTransitionAnimation) {
|
||||
return WindowManager.TRANSIT_OLD_UNSET;
|
||||
}
|
||||
final @TransitionFlags int flags = appTransition.getTransitFlags();
|
||||
final @TransitionType int firstTransit = appTransition.getFirstAppTransition();
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class AppTransitionControllerTest extends WindowTestsBase {
|
||||
assertEquals(WindowManager.TRANSIT_OLD_TRANSLUCENT_ACTIVITY_OPEN,
|
||||
AppTransitionController.getTransitCompatType(mDisplayContent.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null, null));
|
||||
null, null, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -99,7 +99,7 @@ public class AppTransitionControllerTest extends WindowTestsBase {
|
||||
assertEquals(WindowManager.TRANSIT_OLD_TRANSLUCENT_ACTIVITY_CLOSE,
|
||||
AppTransitionController.getTransitCompatType(mDisplayContent.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null, null));
|
||||
null, null, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -117,7 +117,7 @@ public class AppTransitionControllerTest extends WindowTestsBase {
|
||||
assertEquals(TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE,
|
||||
AppTransitionController.getTransitCompatType(mDisplayContent.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null, null));
|
||||
null, null, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -23,6 +23,7 @@ import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
|
||||
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
|
||||
import static android.view.WindowManager.TRANSIT_OLD_CRASHING_ACTIVITY_CLOSE;
|
||||
import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY;
|
||||
import static android.view.WindowManager.TRANSIT_OLD_UNSET;
|
||||
import static android.view.WindowManager.TRANSIT_OPEN;
|
||||
|
||||
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
|
||||
@@ -81,7 +82,8 @@ public class AppTransitionTests extends WindowTestsBase {
|
||||
assertEquals(TRANSIT_OLD_KEYGUARD_GOING_AWAY,
|
||||
AppTransitionController.getTransitCompatType(mDc.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */));
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */,
|
||||
false /*skipAppTransitionAnimation*/));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -95,7 +97,8 @@ public class AppTransitionTests extends WindowTestsBase {
|
||||
assertEquals(TRANSIT_OLD_KEYGUARD_GOING_AWAY,
|
||||
AppTransitionController.getTransitCompatType(mDc.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */));
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */,
|
||||
false /*skipAppTransitionAnimation*/));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -109,7 +112,8 @@ public class AppTransitionTests extends WindowTestsBase {
|
||||
assertEquals(TRANSIT_OLD_CRASHING_ACTIVITY_CLOSE,
|
||||
AppTransitionController.getTransitCompatType(mDc.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */));
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */,
|
||||
false /*skipAppTransitionAnimation*/));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -123,7 +127,23 @@ public class AppTransitionTests extends WindowTestsBase {
|
||||
assertEquals(TRANSIT_OLD_KEYGUARD_GOING_AWAY,
|
||||
AppTransitionController.getTransitCompatType(mDc.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */));
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */,
|
||||
false /*skipAppTransitionAnimation*/));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSkipTransitionAnimation() {
|
||||
final DisplayContent dc = createNewDisplay(Display.STATE_ON);
|
||||
final ActivityRecord activity = createActivityRecord(dc);
|
||||
|
||||
mDc.prepareAppTransition(TRANSIT_OPEN);
|
||||
mDc.prepareAppTransition(TRANSIT_CLOSE);
|
||||
mDc.mClosingApps.add(activity);
|
||||
assertEquals(TRANSIT_OLD_UNSET,
|
||||
AppTransitionController.getTransitCompatType(mDc.mAppTransition,
|
||||
mDisplayContent.mOpeningApps, mDisplayContent.mClosingApps,
|
||||
null /* wallpaperTarget */, null /* oldWallpaper */,
|
||||
true /*skipAppTransitionAnimation*/));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user