MediaRouter: Fix for background colors of group volume controls

Bug: 25732176
Change-Id: I3b3265778894ce9c397829fea714c08fc3da7a23
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java b/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java
index f5a258c..bd5ae91 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java
@@ -94,8 +94,9 @@
             Context context, View mainControls, View groupControls, boolean hasGroup) {
         int primaryColor = getThemeColor(context, R.attr.colorPrimary);
         int primaryDarkColor = getThemeColor(context, R.attr.colorPrimaryDark);
-        if (hasGroup && ColorUtils.calculateContrast(COLOR_WHITE_ON_DARK_BACKGROUND, primaryColor)
-                < MIN_CONTRAST) {
+        int controllerColor = getControllerColor(context);
+        if (hasGroup && controllerColor == COLOR_DARK_ON_LIGHT_BACKGROUND
+                && ColorUtils.calculateContrast(controllerColor, primaryDarkColor) < MIN_CONTRAST) {
             // Instead of showing dark controls in a possibly dark (i.e. the primary dark), model
             // the white dialog and use the primary color for the group controls.
             primaryDarkColor = primaryColor;