Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 391a299e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Disable media route scanning"

parents ea26b2a4 9e1af767
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;

@@ -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);
        }
@@ -272,7 +273,7 @@ public class OutputChooserDialog extends Dialog
        addBluetoothDevices(items);

        // Add remote displays
        if (!mIsInCall) {
        if (!mIsInCall && INCLUDE_MEDIA_ROUTES) {
            addRemoteDisplayRoutes(items);
        }

+5 −9
Original line number Diff line number Diff line
@@ -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;
@@ -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());
    }