MediaRouter: Handle volume thumb color for SDK_INT < 16

Change-Id: I72c0710c182907b0693c110ee6c1057bb9b47dab
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java
index a760ccd..9254274 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java
@@ -25,7 +25,6 @@
 import android.content.res.TypedArray;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.graphics.Color;
 import android.graphics.PorterDuff;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
@@ -330,7 +329,7 @@
             }
         });
         mVolumeSliderColor = MediaRouterThemeHelper.getVolumeSliderColor(getContext());
-        setVolumeSliderColor(mVolumeSlider, mVolumeSliderColor);
+        setVolumeSliderColor(getContext(), mVolumeSlider, mVolumeSliderColor);
 
         TypedArray styledAttributes = getContext().obtainStyledAttributes(new int[] {
                 R.attr.mediaRouteExpandGroupDrawable,
@@ -621,10 +620,16 @@
         }
     }
 
-    private static void setVolumeSliderColor(SeekBar volumeSlider, int color) {
+    private static void setVolumeSliderColor(Context context, SeekBar volumeSlider, int color) {
         volumeSlider.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);
         if (Build.VERSION.SDK_INT >= 16) {
             SeekBarJellybean.getThumb(volumeSlider).setColorFilter(color, PorterDuff.Mode.SRC_IN);
+        } else {
+            // In case getThumb() isn't available, use the thumb drawable from AppCompat.
+            Drawable thumb =
+                    context.getResources().getDrawable(R.drawable.abc_seekbar_thumb_material);
+            thumb.setColorFilter(color, PorterDuff.Mode.SRC_IN);
+            volumeSlider.setThumb(thumb);
         }
     }
 
@@ -740,8 +745,8 @@
             if (v == null) {
                 v = LayoutInflater.from(getContext()).inflate(
                         R.layout.mr_controller_volume_item, null);
-                setVolumeSliderColor(
-                        (SeekBar) v.findViewById(R.id.mr_volume_slider), mVolumeSliderColor);
+                setVolumeSliderColor(getContext(), (SeekBar) v.findViewById(R.id.mr_volume_slider),
+                        mVolumeSliderColor);
             }
             MediaRouter.RouteInfo route = getItem(position);
             if (route != null) {