Loading libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java +3 −1 Original line number Diff line number Diff line Loading @@ -482,8 +482,10 @@ public class OneHandedController implements RemoteCallable<OneHandedController> @VisibleForTesting void notifyExpandNotification() { if (mEventCallback != null) { mMainExecutor.execute(() -> mEventCallback.notifyExpandNotification()); } } @VisibleForTesting void notifyUserConfigChanged(boolean success) { Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedControllerTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -435,4 +435,17 @@ public class OneHandedControllerTest extends OneHandedTestCase { verify(mSpiedOneHandedController).notifyShortcutState(anyInt()); } @Test public void testNotifyExpandNotification_withNullCheckProtection() { when(mSpiedOneHandedController.isOneHandedEnabled()).thenReturn(false); when(mSpiedTransitionState.getState()).thenReturn(STATE_NONE); when(mSpiedTransitionState.isTransitioning()).thenReturn(false); when(mSpiedOneHandedController.isSwipeToNotificationEnabled()).thenReturn(true); mSpiedOneHandedController.setOneHandedEnabled(true); mSpiedOneHandedController.notifyExpandNotification(); // Verify no NPE crash and mMockShellMainExecutor never be execute. verify(mMockShellMainExecutor, never()).execute(any()); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java +3 −1 Original line number Diff line number Diff line Loading @@ -482,8 +482,10 @@ public class OneHandedController implements RemoteCallable<OneHandedController> @VisibleForTesting void notifyExpandNotification() { if (mEventCallback != null) { mMainExecutor.execute(() -> mEventCallback.notifyExpandNotification()); } } @VisibleForTesting void notifyUserConfigChanged(boolean success) { Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedControllerTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -435,4 +435,17 @@ public class OneHandedControllerTest extends OneHandedTestCase { verify(mSpiedOneHandedController).notifyShortcutState(anyInt()); } @Test public void testNotifyExpandNotification_withNullCheckProtection() { when(mSpiedOneHandedController.isOneHandedEnabled()).thenReturn(false); when(mSpiedTransitionState.getState()).thenReturn(STATE_NONE); when(mSpiedTransitionState.isTransitioning()).thenReturn(false); when(mSpiedOneHandedController.isSwipeToNotificationEnabled()).thenReturn(true); mSpiedOneHandedController.setOneHandedEnabled(true); mSpiedOneHandedController.notifyExpandNotification(); // Verify no NPE crash and mMockShellMainExecutor never be execute. verify(mMockShellMainExecutor, never()).execute(any()); } }