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

Commit e3605f67 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Limit input routing to config_enableInputRouting" into main

parents f7b969bb bd4fb847
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1174,6 +1174,9 @@
    <!-- Whether to enable the desktop specific audio tile details view. -->
    <bool name="config_enableDesktopAudioTileDetailsView">false</bool>

    <!-- Whether to enable audio input routing. -->
    <bool name="config_enableInputRouting">false</bool>

    <!-- If AOD can show an ambient version of the wallpaper (-1 means ignore) -->
    <integer name="config_dozeSupportsAodWallpaperOverride">-1</integer>

+2 −1
Original line number Diff line number Diff line
@@ -662,7 +662,8 @@ public class MediaSwitchingController
    }

    private boolean enableInputRouting() {
        return Flags.enableAudioInputDeviceRoutingAndVolumeControl();
        return Flags.enableAudioInputDeviceRoutingAndVolumeControl()
                && mContext.getResources().getBoolean(R.bool.config_enableInputRouting);
    }

    private void buildInputMediaItems(List<MediaDevice> devices) {
+5 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.media.AudioDeviceAttributes;
@@ -235,6 +236,10 @@ public class MediaSwitchingControllerTest extends SysuiTestCase {
        MockitoAnnotations.initMocks(this);
        mContext.setMockPackageManager(mPackageManager);
        mSpyContext = spy(mContext);
        Resources spyResources = spy(mContext.getResources());
        when(mSpyContext.getResources()).thenReturn(spyResources);
        when(spyResources.getBoolean(
                R.bool.config_enableInputRouting)).thenReturn(true);
        final UserHandle userHandle = mock(UserHandle.class);
        when(mUserTracker.getUserHandle()).thenReturn(userHandle);
        when(mSessionMediaController.getPackageName()).thenReturn(mPackageName);