Loading data/etc/services.core.protolog.json +6 −0 Original line number Diff line number Diff line Loading @@ -4171,6 +4171,12 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "1945495497": { "message": "Focused window didn't have a valid surface drawn.", "level": "DEBUG", "group": "WM_DEBUG_BACK_PREVIEW", "at": "com\/android\/server\/wm\/BackNavigationController.java" }, "1947239194": { "message": "Deferring rotation, still finishing previous rotation", "level": "VERBOSE", Loading services/core/java/com/android/server/wm/BackNavigationController.java +6 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,12 @@ class BackNavigationController { + "recents. Overriding back callback to recents controller callback."); return null; } if (!window.isDrawn()) { ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "Focused window didn't have a valid surface drawn."); return null; } } if (window == null) { Loading services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java +18 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ public class BackNavigationControllerTests extends WindowTestsBase { WindowState window = createWindow(null, WindowManager.LayoutParams.TYPE_WALLPAPER, "Wallpaper"); addToWindowMap(window, true); makeWindowVisibleAndDrawn(window); IOnBackInvokedCallback callback = createOnBackInvokedCallback(); window.setOnBackInvokedCallbackInfo( Loading Loading @@ -236,6 +237,20 @@ public class BackNavigationControllerTests extends WindowTestsBase { 1, appLatch.getCount()); } @Test public void backInfoWindowWithoutDrawn() { WindowState window = createWindow(null, WindowManager.LayoutParams.TYPE_APPLICATION, "TestWindow"); addToWindowMap(window, true); IOnBackInvokedCallback callback = createOnBackInvokedCallback(); window.setOnBackInvokedCallbackInfo( new OnBackInvokedCallbackInfo(callback, OnBackInvokedDispatcher.PRIORITY_DEFAULT)); BackNavigationInfo backNavigationInfo = startBackNavigation(); assertThat(backNavigationInfo).isNull(); } private IOnBackInvokedCallback withSystemCallback(Task task) { IOnBackInvokedCallback callback = createOnBackInvokedCallback(); task.getTopMostActivity().getTopChild().setOnBackInvokedCallbackInfo( Loading Loading @@ -309,6 +324,7 @@ public class BackNavigationControllerTests extends WindowTestsBase { Mockito.doNothing().when(task).reparentSurfaceControl(any(), any()); mAtm.setFocusedTask(task.mTaskId, record); addToWindowMap(window, true); makeWindowVisibleAndDrawn(window); return task; } Loading @@ -333,6 +349,8 @@ public class BackNavigationControllerTests extends WindowTestsBase { addToWindowMap(window1, true); addToWindowMap(window2, true); makeWindowVisibleAndDrawn(window2); CrossActivityTestCase testCase = new CrossActivityTestCase(); testCase.task = task; testCase.recordBack = record1; Loading Loading
data/etc/services.core.protolog.json +6 −0 Original line number Diff line number Diff line Loading @@ -4171,6 +4171,12 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "1945495497": { "message": "Focused window didn't have a valid surface drawn.", "level": "DEBUG", "group": "WM_DEBUG_BACK_PREVIEW", "at": "com\/android\/server\/wm\/BackNavigationController.java" }, "1947239194": { "message": "Deferring rotation, still finishing previous rotation", "level": "VERBOSE", Loading
services/core/java/com/android/server/wm/BackNavigationController.java +6 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,12 @@ class BackNavigationController { + "recents. Overriding back callback to recents controller callback."); return null; } if (!window.isDrawn()) { ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "Focused window didn't have a valid surface drawn."); return null; } } if (window == null) { Loading
services/tests/wmtests/src/com/android/server/wm/BackNavigationControllerTests.java +18 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ public class BackNavigationControllerTests extends WindowTestsBase { WindowState window = createWindow(null, WindowManager.LayoutParams.TYPE_WALLPAPER, "Wallpaper"); addToWindowMap(window, true); makeWindowVisibleAndDrawn(window); IOnBackInvokedCallback callback = createOnBackInvokedCallback(); window.setOnBackInvokedCallbackInfo( Loading Loading @@ -236,6 +237,20 @@ public class BackNavigationControllerTests extends WindowTestsBase { 1, appLatch.getCount()); } @Test public void backInfoWindowWithoutDrawn() { WindowState window = createWindow(null, WindowManager.LayoutParams.TYPE_APPLICATION, "TestWindow"); addToWindowMap(window, true); IOnBackInvokedCallback callback = createOnBackInvokedCallback(); window.setOnBackInvokedCallbackInfo( new OnBackInvokedCallbackInfo(callback, OnBackInvokedDispatcher.PRIORITY_DEFAULT)); BackNavigationInfo backNavigationInfo = startBackNavigation(); assertThat(backNavigationInfo).isNull(); } private IOnBackInvokedCallback withSystemCallback(Task task) { IOnBackInvokedCallback callback = createOnBackInvokedCallback(); task.getTopMostActivity().getTopChild().setOnBackInvokedCallbackInfo( Loading Loading @@ -309,6 +324,7 @@ public class BackNavigationControllerTests extends WindowTestsBase { Mockito.doNothing().when(task).reparentSurfaceControl(any(), any()); mAtm.setFocusedTask(task.mTaskId, record); addToWindowMap(window, true); makeWindowVisibleAndDrawn(window); return task; } Loading @@ -333,6 +349,8 @@ public class BackNavigationControllerTests extends WindowTestsBase { addToWindowMap(window1, true); addToWindowMap(window2, true); makeWindowVisibleAndDrawn(window2); CrossActivityTestCase testCase = new CrossActivityTestCase(); testCase.task = task; testCase.recordBack = record1; Loading