OSDN Git Service

Sanity check while updating volume in MediaRouteChooserDialog
authorAdam Powell <adamp@google.com>
Sat, 23 Jun 2012 03:41:31 +0000 (20:41 -0700)
committerAdam Powell <adamp@google.com>
Sat, 23 Jun 2012 03:41:31 +0000 (20:41 -0700)
Bug 6720224

When a window dies it's possible to receive a lingering ACTION_CANCEL
event to the SeekBar for volume. Be sure that we don't try to mess
with something that's already gone by that point.

Change-Id: I4f6119718fc21204d9013d591bc984b785b698b4

core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java

index 2da8bf1..f010d7b 100644 (file)
@@ -122,6 +122,8 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
     }
 
     void updateVolume() {
+        if (mRouter == null) return;
+
         final RouteInfo selectedRoute = mRouter.getSelectedRoute(mRouteTypes);
         mVolumeIcon.setImageResource(
                 selectedRoute.getPlaybackType() == RouteInfo.PLAYBACK_TYPE_LOCAL ?