File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
core/java/com/android/internal/app Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
7070 };
7171
7272 MediaRouter mRouter ;
73- AudioManager mAudio ;
7473 private int mRouteTypes ;
7574
7675 private LayoutInflater mInflater ;
@@ -98,7 +97,6 @@ public void setLauncherListener(LauncherListener listener) {
9897 public void onAttach (Activity activity ) {
9998 super .onAttach (activity );
10099 mRouter = (MediaRouter ) activity .getSystemService (Context .MEDIA_ROUTER_SERVICE );
101- mAudio = (AudioManager ) activity .getSystemService (Context .AUDIO_SERVICE );
102100 }
103101
104102 @ Override
@@ -150,7 +148,7 @@ void changeVolume(int newValue) {
150148
151149 final RouteInfo selectedRoute = mRouter .getSelectedRoute (mRouteTypes );
152150 if (selectedRoute .getVolumeHandling () == RouteInfo .PLAYBACK_VOLUME_VARIABLE ) {
153- final int maxVolume = mAudio . getStreamMaxVolume ( AudioManager . STREAM_MUSIC );
151+ final int maxVolume = selectedRoute . getVolumeMax ( );
154152 newValue = Math .max (0 , Math .min (newValue , maxVolume ));
155153 selectedRoute .requestSetVolume (newValue );
156154 }
You can’t perform that action at this time.
0 commit comments