diff options
author | Adam Powell <adamp@google.com> | 2012-06-21 19:59:53 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2012-06-21 19:59:53 -0700 |
commit | 4dd21c8e77c0d369ee835f50cba1701e76aa18c4 (patch) | |
tree | 406a3e86769c4dc182e9302f36995d146d4ab665 /core | |
parent | 9ce1ea3aa744fdd5a63ecedd07859fb2faa6f8e1 (diff) | |
download | frameworks_base-4dd21c8e77c0d369ee835f50cba1701e76aa18c4.zip frameworks_base-4dd21c8e77c0d369ee835f50cba1701e76aa18c4.tar.gz frameworks_base-4dd21c8e77c0d369ee835f50cba1701e76aa18c4.tar.bz2 |
Volume changes in MediaRouteChooserDialog
Use the max volume reported by the selected route as the max value to set.
Change-Id: I9848dfb201387843e7ed398ac61e2d13e14e3f51
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java index b747694..2da8bf1 100644 --- a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java +++ b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java @@ -70,7 +70,6 @@ public class MediaRouteChooserDialogFragment extends DialogFragment { }; MediaRouter mRouter; - AudioManager mAudio; private int mRouteTypes; private LayoutInflater mInflater; @@ -98,7 +97,6 @@ public class MediaRouteChooserDialogFragment extends DialogFragment { public void onAttach(Activity activity) { super.onAttach(activity); mRouter = (MediaRouter) activity.getSystemService(Context.MEDIA_ROUTER_SERVICE); - mAudio = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE); } @Override @@ -150,7 +148,7 @@ public class MediaRouteChooserDialogFragment extends DialogFragment { final RouteInfo selectedRoute = mRouter.getSelectedRoute(mRouteTypes); if (selectedRoute.getVolumeHandling() == RouteInfo.PLAYBACK_VOLUME_VARIABLE) { - final int maxVolume = mAudio.getStreamMaxVolume(AudioManager.STREAM_MUSIC); + final int maxVolume = selectedRoute.getVolumeMax(); newValue = Math.max(0, Math.min(newValue, maxVolume)); selectedRoute.requestSetVolume(newValue); } |