Set volume handling of the default route properly

The volume handling of the default route of the devices which use
fixed volume should be set PLAYBACK_VOLUME_FIXED instead of
PLAYBACK_VOLUME_VARIABLE.

Bug: 36492333
Test: passed CTS of MediaRouterTest
Change-Id: I4bc42063b71ae9087b36f1529b7689b96d9e53e7
This commit is contained in:
Sungsoo
2017-03-20 14:39:34 +09:00
parent 6099e75df2
commit bd6118ffb4

View File

@@ -141,6 +141,11 @@ public class MediaRouter {
mDefaultAudioVideo.mNameResId = com.android.internal.R.string.default_audio_route_name;
mDefaultAudioVideo.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO;
mDefaultAudioVideo.updatePresentationDisplay();
if (((AudioManager) appContext.getSystemService(Context.AUDIO_SERVICE))
.isVolumeFixed()) {
mDefaultAudioVideo.mVolumeHandling = RouteInfo.PLAYBACK_VOLUME_FIXED;
}
addRouteStatic(mDefaultAudioVideo);
// This will select the active wifi display route if there is one.