[PB] Migrate visibility change to transition.
There are two possible visibility change during predictive back animation. 1. No snapshot for previous activity. Currently core use setLauncherBehind to make previous activity become visible. To migrate the visibility change in transition, create a TRANSIT_PREPARE_BACK_NAVIGATION transition in core, and handle that transition in BackTransitionHandler once it received handleRequest. 2. Close transition after gesture release. For close home/task/activity case, core should expect a close transition happen. The BackTransitionHandler can distingush that close transiton by FLAG_BACK_GESTURE_ANIMATED. If another transition happen while first transition is playing, just finish first transition and cancel the predictive back animation, so the next transition can play by corresponding handler. In both 1 & 2 case, apply start transaction to remove windowless surface, and reparent to the exist animation leash if needed. For no transition cases(i.e. close window) the finish signal still passing by animation finish callback. Bug: 347168362 Flag: com.android.window.flags.migrate_predictive_back_transition Test: atest BackNavigationControllerTests BackAnimationControllerTest Test: verify back-to-home/cross-activity/cross-task transition can be closed smoothly after back gesture trigger. Change-Id: Ic70e16c57b4aca0d4d4275f788985027324b4e4c
Loading
Please register or sign in to comment