Loading packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java +3 −2 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class OutputChooserDialog extends Dialog private final MediaRouterWrapper mRouter; private final MediaRouterCallback mRouterCallback; private long mLastUpdateTime; static final boolean INCLUDE_MEDIA_ROUTES = false; private boolean mIsInCall; protected boolean isAttached; Loading Loading @@ -174,7 +175,7 @@ public class OutputChooserDialog extends Dialog public void onAttachedToWindow() { super.onAttachedToWindow(); if (!mIsInCall) { if (!mIsInCall && INCLUDE_MEDIA_ROUTES) { mRouter.addCallback(mRouteSelector, mRouterCallback, MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN); } Loading Loading @@ -272,7 +273,7 @@ public class OutputChooserDialog extends Dialog addBluetoothDevices(items); // Add remote displays if (!mIsInCall) { if (!mIsInCall && INCLUDE_MEDIA_ROUTES) { addRemoteDisplayRoutes(items); } Loading packages/SystemUI/tests/src/com/android/systemui/volume/OutputChooserDialogTest.java +5 −9 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.volume; import static com.android.systemui.volume.OutputChooserDialog.INCLUDE_MEDIA_ROUTES; import static junit.framework.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; Loading Loading @@ -148,20 +150,14 @@ public class OutputChooserDialogTest extends SysuiTestCase { verify(mRouter, never()).addCallback(any(), any(), anyInt()); } @Test public void testMediaScanIfNotInCall() { mDialog.setIsInCall(false); mDialog.onAttachedToWindow(); verify(mRouter, times(1)).addCallback(any(), any(), anyInt()); } @Test public void testRegisterCallbacks() { mDialog.setIsInCall(false); mDialog.onAttachedToWindow(); if (INCLUDE_MEDIA_ROUTES) { verify(mRouter, times(1)).addCallback(any(), any(), anyInt()); } verify(mController, times(1)).addCallback(any()); verify(mVolumeController, times(1)).addCallback(any(), any()); } Loading Loading
packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java +3 −2 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class OutputChooserDialog extends Dialog private final MediaRouterWrapper mRouter; private final MediaRouterCallback mRouterCallback; private long mLastUpdateTime; static final boolean INCLUDE_MEDIA_ROUTES = false; private boolean mIsInCall; protected boolean isAttached; Loading Loading @@ -174,7 +175,7 @@ public class OutputChooserDialog extends Dialog public void onAttachedToWindow() { super.onAttachedToWindow(); if (!mIsInCall) { if (!mIsInCall && INCLUDE_MEDIA_ROUTES) { mRouter.addCallback(mRouteSelector, mRouterCallback, MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN); } Loading Loading @@ -272,7 +273,7 @@ public class OutputChooserDialog extends Dialog addBluetoothDevices(items); // Add remote displays if (!mIsInCall) { if (!mIsInCall && INCLUDE_MEDIA_ROUTES) { addRemoteDisplayRoutes(items); } Loading
packages/SystemUI/tests/src/com/android/systemui/volume/OutputChooserDialogTest.java +5 −9 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.volume; import static com.android.systemui.volume.OutputChooserDialog.INCLUDE_MEDIA_ROUTES; import static junit.framework.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; Loading Loading @@ -148,20 +150,14 @@ public class OutputChooserDialogTest extends SysuiTestCase { verify(mRouter, never()).addCallback(any(), any(), anyInt()); } @Test public void testMediaScanIfNotInCall() { mDialog.setIsInCall(false); mDialog.onAttachedToWindow(); verify(mRouter, times(1)).addCallback(any(), any(), anyInt()); } @Test public void testRegisterCallbacks() { mDialog.setIsInCall(false); mDialog.onAttachedToWindow(); if (INCLUDE_MEDIA_ROUTES) { verify(mRouter, times(1)).addCallback(any(), any(), anyInt()); } verify(mController, times(1)).addCallback(any()); verify(mVolumeController, times(1)).addCallback(any(), any()); } Loading