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

Commit 9e1af767 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Disable media route scanning

Change-Id: Icc308d1df76f0a3f0fd33de9f21c3b0db16cfda0
Fixes: 72951601
Test: runtest systemui
parent b04b70c9
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());
    }