Loading libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/DelegateLetterboxTransitionObserver.kt +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.wm.shell.compatui.letterbox.lifecycle.LetterboxLifecycleEvent import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_APP_COMPAT import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.transition.Transitions import com.android.wm.shell.transition.Transitions.TRANSIT_MOVE_LETTERBOX_REACHABILITY /** * The [TransitionObserver] to handle Letterboxing events in Shell delegating to a Loading Loading @@ -58,6 +59,10 @@ class DelegateLetterboxTransitionObserver( startTransaction: SurfaceControl.Transaction, finishTransaction: SurfaceControl.Transaction ) { if (info.type == TRANSIT_MOVE_LETTERBOX_REACHABILITY) { // Reachability transitions are handled in LetterboxAnimationHandler return } info.changes.forEach { change -> if (letterboxLifecycleEventFactory.canHandle(change)) { letterboxLifecycleEventFactory.createLifecycleEvent(change)?.let { event -> Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/DelegateLetterboxTransitionObserverTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.wm.shell.compatui.letterbox.lifecycle.LetterboxLifecycleContr import com.android.wm.shell.compatui.letterbox.lifecycle.LetterboxLifecycleEvent import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.transition.Transitions import com.android.wm.shell.transition.Transitions.TRANSIT_MOVE_LETTERBOX_REACHABILITY import com.android.wm.shell.util.executeTransitionObserverTest import java.util.function.Consumer import org.junit.Test Loading Loading @@ -72,6 +73,24 @@ class DelegateLetterboxTransitionObserverTest : ShellTestCase() { } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController ignores Changes about Reachability`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { r.invokeShellInit() transitionInfo { type = TRANSIT_MOVE_LETTERBOX_REACHABILITY addChange { } } validateOnTransitionReady { r.checkLifecycleControllerInvoked(times = 0) } } } } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController not used with no changes`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { Loading @@ -86,6 +105,7 @@ class DelegateLetterboxTransitionObserverTest : ShellTestCase() { } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController used with a single change`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { Loading @@ -101,6 +121,7 @@ class DelegateLetterboxTransitionObserverTest : ShellTestCase() { } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController used for each change`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/DelegateLetterboxTransitionObserver.kt +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.wm.shell.compatui.letterbox.lifecycle.LetterboxLifecycleEvent import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_APP_COMPAT import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.transition.Transitions import com.android.wm.shell.transition.Transitions.TRANSIT_MOVE_LETTERBOX_REACHABILITY /** * The [TransitionObserver] to handle Letterboxing events in Shell delegating to a Loading Loading @@ -58,6 +59,10 @@ class DelegateLetterboxTransitionObserver( startTransaction: SurfaceControl.Transaction, finishTransaction: SurfaceControl.Transaction ) { if (info.type == TRANSIT_MOVE_LETTERBOX_REACHABILITY) { // Reachability transitions are handled in LetterboxAnimationHandler return } info.changes.forEach { change -> if (letterboxLifecycleEventFactory.canHandle(change)) { letterboxLifecycleEventFactory.createLifecycleEvent(change)?.let { event -> Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/DelegateLetterboxTransitionObserverTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.wm.shell.compatui.letterbox.lifecycle.LetterboxLifecycleContr import com.android.wm.shell.compatui.letterbox.lifecycle.LetterboxLifecycleEvent import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.transition.Transitions import com.android.wm.shell.transition.Transitions.TRANSIT_MOVE_LETTERBOX_REACHABILITY import com.android.wm.shell.util.executeTransitionObserverTest import java.util.function.Consumer import org.junit.Test Loading Loading @@ -72,6 +73,24 @@ class DelegateLetterboxTransitionObserverTest : ShellTestCase() { } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController ignores Changes about Reachability`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { r.invokeShellInit() transitionInfo { type = TRANSIT_MOVE_LETTERBOX_REACHABILITY addChange { } } validateOnTransitionReady { r.checkLifecycleControllerInvoked(times = 0) } } } } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController not used with no changes`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { Loading @@ -86,6 +105,7 @@ class DelegateLetterboxTransitionObserverTest : ShellTestCase() { } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController used with a single change`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { Loading @@ -101,6 +121,7 @@ class DelegateLetterboxTransitionObserverTest : ShellTestCase() { } @Test @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING) fun `LetterboxLifecycleController used for each change`() { runTestScenario { r -> executeTransitionObserverTest(observerFactory = r.observerFactory) { Loading