Remove all the extra accessor methods added by javac in support-mediarouter.

Change private methods to be package protected to avoid extra methods
that get added to be able to access them from inner classes.

This CL saves 143 methods in our jar.

Bug: 31075707
Change-Id: Iddd66c7f04ae9522792a889a59b3ae7629b2983c
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteActionProvider.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteActionProvider.java
index 79fad1f..ad8fc1b 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteActionProvider.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteActionProvider.java
@@ -279,7 +279,7 @@
                 MediaRouter.AVAILABILITY_FLAG_IGNORE_DEFAULT_ROUTE);
     }
 
-    private void refreshRoute() {
+    void refreshRoute() {
         refreshVisibility();
     }
 
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteButton.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteButton.java
index c45121e..20e83aa 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteButton.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteButton.java
@@ -485,7 +485,7 @@
         }
     }
 
-    private void refreshRoute() {
+    void refreshRoute() {
         if (mAttachedToWindow) {
             final MediaRouter.RouteInfo route = mRouter.getSelectedRoute();
             final boolean isRemote = !route.isDefaultOrBluetooth()
@@ -529,6 +529,9 @@
     }
 
     private final class MediaRouterCallback extends MediaRouter.Callback {
+        MediaRouterCallback() {
+        }
+
         @Override
         public void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo info) {
             refreshRoute();
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java
index f492a9a..01cb1fd 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java
@@ -61,11 +61,11 @@
  * @see MediaRouteActionProvider
  */
 public class MediaRouteChooserDialog extends Dialog {
-    private static final String TAG = "MediaRouteChooserDialog";
+    static final String TAG = "MediaRouteChooserDialog";
 
     // Do not update the route list immediately to avoid unnatural dialog change.
     private static final long UPDATE_ROUTES_DELAY_MS = 300L;
-    private static final int MSG_UPDATE_ROUTES = 1;
+    static final int MSG_UPDATE_ROUTES = 1;
 
     private final MediaRouter mRouter;
     private final MediaRouterCallback mCallback;
@@ -226,7 +226,7 @@
         }
     }
 
-    private void updateRoutes(List<MediaRouter.RouteInfo> routes) {
+    void updateRoutes(List<MediaRouter.RouteInfo> routes) {
         mLastUpdateTime = SystemClock.uptimeMillis();
         mRoutes.clear();
         mRoutes.addAll(routes);
@@ -344,6 +344,9 @@
     }
 
     private final class MediaRouterCallback extends MediaRouter.Callback {
+        MediaRouterCallback() {
+        }
+
         @Override
         public void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo info) {
             refreshRoutes();
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java
index 4699b25..ee3d26f 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteControllerDialog.java
@@ -92,24 +92,24 @@
  */
 public class MediaRouteControllerDialog extends AlertDialog {
     // Tags should be less than 24 characters long (see docs for android.util.Log.isLoggable())
-    private static final String TAG = "MediaRouteCtrlDialog";
-    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+    static final String TAG = "MediaRouteCtrlDialog";
+    static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
     // Time to wait before updating the volume when the user lets go of the seek bar
     // to allow the route provider time to propagate the change and publish a new
     // route descriptor.
-    private static final int VOLUME_UPDATE_DELAY_MILLIS = 500;
-    private static final int CONNECTION_TIMEOUT_MILLIS = (int) TimeUnit.SECONDS.toMillis(30L);
+    static final int VOLUME_UPDATE_DELAY_MILLIS = 500;
+    static final int CONNECTION_TIMEOUT_MILLIS = (int) TimeUnit.SECONDS.toMillis(30L);
 
     private static final int BUTTON_NEUTRAL_RES_ID = android.R.id.button3;
-    private static final int BUTTON_DISCONNECT_RES_ID = android.R.id.button2;
-    private static final int BUTTON_STOP_RES_ID = android.R.id.button1;
+    static final int BUTTON_DISCONNECT_RES_ID = android.R.id.button2;
+    static final int BUTTON_STOP_RES_ID = android.R.id.button1;
 
-    private final MediaRouter mRouter;
+    final MediaRouter mRouter;
     private final MediaRouterCallback mCallback;
-    private final MediaRouter.RouteInfo mRoute;
+    final MediaRouter.RouteInfo mRoute;
 
-    private Context mContext;
+    Context mContext;
     private boolean mCreated;
     private boolean mAttachedToWindow;
 
@@ -125,7 +125,7 @@
 
     private FrameLayout mExpandableAreaLayout;
     private LinearLayout mDialogAreaLayout;
-    private FrameLayout mDefaultControlLayout;
+    FrameLayout mDefaultControlLayout;
     private FrameLayout mCustomControlLayout;
     private ImageView mArtView;
     private TextView mTitleView;
@@ -139,40 +139,40 @@
     private LinearLayout mVolumeControlLayout;
     private View mDividerView;
 
-    private OverlayListView mVolumeGroupList;
-    private VolumeGroupAdapter mVolumeGroupAdapter;
+    OverlayListView mVolumeGroupList;
+    VolumeGroupAdapter mVolumeGroupAdapter;
     private List<MediaRouter.RouteInfo> mGroupMemberRoutes;
-    private Set<MediaRouter.RouteInfo> mGroupMemberRoutesAdded;
+    Set<MediaRouter.RouteInfo> mGroupMemberRoutesAdded;
     private Set<MediaRouter.RouteInfo> mGroupMemberRoutesRemoved;
-    private Set<MediaRouter.RouteInfo> mGroupMemberRoutesAnimatingWithBitmap;
-    private SeekBar mVolumeSlider;
-    private VolumeChangeListener mVolumeChangeListener;
-    private MediaRouter.RouteInfo mRouteInVolumeSliderTouched;
+    Set<MediaRouter.RouteInfo> mGroupMemberRoutesAnimatingWithBitmap;
+    SeekBar mVolumeSlider;
+    VolumeChangeListener mVolumeChangeListener;
+    MediaRouter.RouteInfo mRouteInVolumeSliderTouched;
     private int mVolumeGroupListItemIconSize;
     private int mVolumeGroupListItemHeight;
     private int mVolumeGroupListMaxHeight;
     private final int mVolumeGroupListPaddingTop;
-    private Map<MediaRouter.RouteInfo, SeekBar> mVolumeSliderMap;
+    Map<MediaRouter.RouteInfo, SeekBar> mVolumeSliderMap;
 
-    private MediaControllerCompat mMediaController;
-    private MediaControllerCallback mControllerCallback;
-    private PlaybackStateCompat mState;
-    private MediaDescriptionCompat mDescription;
+    MediaControllerCompat mMediaController;
+    MediaControllerCallback mControllerCallback;
+    PlaybackStateCompat mState;
+    MediaDescriptionCompat mDescription;
 
-    private FetchArtTask mFetchArtTask;
-    private Bitmap mArtIconBitmap;
-    private Uri mArtIconUri;
-    private boolean mArtIconIsLoaded;
-    private Bitmap mArtIconLoadedBitmap;
-    private int mArtIconBackgroundColor;
+    FetchArtTask mFetchArtTask;
+    Bitmap mArtIconBitmap;
+    Uri mArtIconUri;
+    boolean mArtIconIsLoaded;
+    Bitmap mArtIconLoadedBitmap;
+    int mArtIconBackgroundColor;
 
-    private boolean mHasPendingUpdate;
-    private boolean mPendingUpdateAnimationNeeded;
+    boolean mHasPendingUpdate;
+    boolean mPendingUpdateAnimationNeeded;
 
-    private boolean mIsGroupExpanded;
-    private boolean mIsGroupListAnimating;
-    private boolean mIsGroupListAnimationPending;
-    private int mGroupListAnimationDurationMs;
+    boolean mIsGroupExpanded;
+    boolean mIsGroupListAnimating;
+    boolean mIsGroupListAnimationPending;
+    int mGroupListAnimationDurationMs;
     private int mGroupListFadeInDurationMs;
     private int mGroupListFadeOutDurationMs;
 
@@ -181,9 +181,9 @@
     private Interpolator mFastOutSlowInInterpolator;
     private Interpolator mAccelerateDecelerateInterpolator;
 
-    private final AccessibilityManager mAccessibilityManager;
+    final AccessibilityManager mAccessibilityManager;
 
-    private Runnable mGroupListFadeInAnimation = new Runnable() {
+    Runnable mGroupListFadeInAnimation = new Runnable() {
         @Override
         public void run() {
             startGroupListFadeInAnimation();
@@ -503,7 +503,7 @@
         return super.onKeyUp(keyCode, event);
     }
 
-    private void update(boolean animate) {
+    void update(boolean animate) {
         // Defer dialog updates if a user is adjusting a volume in the list
         if (mRouteInVolumeSliderTouched != null) {
             mHasPendingUpdate = true;
@@ -567,7 +567,7 @@
                 && !canShowPlaybackControlLayout) ? View.GONE : View.VISIBLE);
     }
 
-    private void updateLayoutHeight(final boolean animate) {
+    void updateLayoutHeight(final boolean animate) {
         // We need to defer the update until the first layout has occurred, as we don't yet know the
         // overall visible display size in which the window this view is attached to has been
         // positioned in.
@@ -589,7 +589,7 @@
     /**
      * Updates the height of views and hide artwork or metadata if space is limited.
      */
-    private void updateLayoutHeightInternal(boolean animate) {
+    void updateLayoutHeightInternal(boolean animate) {
         // Measure the size of widgets and get the height of main components.
         int oldHeight = getLayoutHeight(mMediaMainControlLayout);
         setLayoutHeight(mMediaMainControlLayout, ViewGroup.LayoutParams.MATCH_PARENT);
@@ -680,7 +680,7 @@
         rebuildVolumeGroupList(animate);
     }
 
-    private void updateVolumeGroupItemHeight(View item) {
+    void updateVolumeGroupItemHeight(View item) {
         LinearLayout container = (LinearLayout) item.findViewById(R.id.volume_item_container);
         setLayoutHeight(container, mVolumeGroupListItemHeight);
         View icon = item.findViewById(R.id.mr_volume_item_icon);
@@ -707,7 +707,7 @@
         view.startAnimation(anim);
     }
 
-    private void loadInterpolator() {
+    void loadInterpolator() {
         if (android.os.Build.VERSION.SDK_INT >= 21) {
             mInterpolator = mIsGroupExpanded ? mLinearOutSlowInInterpolator
                     : mFastOutSlowInInterpolator;
@@ -776,7 +776,7 @@
         });
     }
 
-    private void animateGroupListItemsInternal(
+    void animateGroupListItemsInternal(
             Map<MediaRouter.RouteInfo, Rect> previousRouteBoundMap,
             Map<MediaRouter.RouteInfo, BitmapDrawable> previousRouteBitmapMap) {
         if (mGroupMemberRoutesAdded == null || mGroupMemberRoutesRemoved == null) {
@@ -864,7 +864,7 @@
         }
     }
 
-    private void startGroupListFadeInAnimation() {
+    void startGroupListFadeInAnimation() {
         clearGroupListAnimation(true);
         mVolumeGroupList.requestLayout();
         ViewTreeObserver observer = mVolumeGroupList.getViewTreeObserver();
@@ -877,7 +877,7 @@
         });
     }
 
-    private void startGroupListFadeInAnimationInternal() {
+    void startGroupListFadeInAnimationInternal() {
         if (mGroupMemberRoutesAdded != null && mGroupMemberRoutesAdded.size() != 0) {
             fadeInAddedRoutes();
         } else {
@@ -885,7 +885,7 @@
         }
     }
 
-    private void finishAnimation(boolean animate) {
+    void finishAnimation(boolean animate) {
         mGroupMemberRoutesAdded = null;
         mGroupMemberRoutesRemoved = null;
         mIsGroupListAnimating = false;
@@ -1020,7 +1020,7 @@
         }
     }
 
-    private boolean isVolumeControlAvailable(MediaRouter.RouteInfo route) {
+    boolean isVolumeControlAvailable(MediaRouter.RouteInfo route) {
         return mVolumeControlEnabled && route.getVolumeHandling()
                 == MediaRouter.RouteInfo.PLAYBACK_VOLUME_VARIABLE;
     }
@@ -1029,7 +1029,7 @@
         return view.getLayoutParams().height;
     }
 
-    private static void setLayoutHeight(View view, int height) {
+    static void setLayoutHeight(View view, int height) {
         ViewGroup.LayoutParams lp = view.getLayoutParams();
         lp.height = height;
         view.setLayoutParams(lp);
@@ -1047,7 +1047,7 @@
     /**
      * Returns desired art height to fit into controller dialog.
      */
-    private int getDesiredArtHeight(int originalWidth, int originalHeight) {
+    int getDesiredArtHeight(int originalWidth, int originalHeight) {
         if (originalWidth >= originalHeight) {
             // For landscape art, fit width to dialog width.
             return (int) ((float) mDialogContentWidth * originalHeight / originalWidth + 0.5f);
@@ -1056,7 +1056,7 @@
         return (int) ((float) mDialogContentWidth * 9 / 16 + 0.5f);
     }
 
-    private void updateArtIconIfNeeded() {
+    void updateArtIconIfNeeded() {
         if (mCustomControlView != null || !isIconChanged()) {
             return;
         }
@@ -1071,7 +1071,7 @@
      * Clear the bitmap loaded by FetchArtTask. Will be called after the loaded bitmaps are applied
      * to artwork, or no longer valid.
      */
-    private void clearLoadedBitmap() {
+    void clearLoadedBitmap() {
         mArtIconIsLoaded = false;
         mArtIconLoadedBitmap = null;
         mArtIconBackgroundColor = 0;
@@ -1096,6 +1096,9 @@
     }
 
     private final class MediaRouterCallback extends MediaRouter.Callback {
+        MediaRouterCallback() {
+        }
+
         @Override
         public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route) {
             update(false);
@@ -1120,6 +1123,9 @@
     }
 
     private final class MediaControllerCallback extends MediaControllerCompat.Callback {
+        MediaControllerCallback() {
+        }
+
         @Override
         public void onSessionDestroyed() {
             if (mMediaController != null) {
@@ -1143,6 +1149,9 @@
     }
 
     private final class ClickListener implements View.OnClickListener {
+        ClickListener() {
+        }
+
         @Override
         public void onClick(View v) {
             int id = v.getId();
@@ -1192,6 +1201,9 @@
             }
         };
 
+        VolumeChangeListener() {
+        }
+
         @Override
         public void onStartTrackingTouch(SeekBar seekBar) {
             if (mRouteInVolumeSliderTouched != null) {
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteExpandCollapseButton.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteExpandCollapseButton.java
index 4c81a43..df0c944 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteExpandCollapseButton.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteExpandCollapseButton.java
@@ -31,12 +31,12 @@
  * Chevron/Caret button to expand/collapse group volume list with animation.
  */
 class MediaRouteExpandCollapseButton extends ImageButton {
-    private final AnimationDrawable mExpandAnimationDrawable;
-    private final AnimationDrawable mCollapseAnimationDrawable;
-    private final String mExpandGroupDescription;
-    private final String mCollapseGroupDescription;
-    private boolean mIsGroupExpanded;
-    private OnClickListener mListener;
+    final AnimationDrawable mExpandAnimationDrawable;
+    final AnimationDrawable mCollapseAnimationDrawable;
+    final String mExpandGroupDescription;
+    final String mCollapseGroupDescription;
+    boolean mIsGroupExpanded;
+    OnClickListener mListener;
 
     public MediaRouteExpandCollapseButton(Context context) {
         this(context, null);
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java b/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java
index e129dd7..60c878f 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouterThemeHelper.java
@@ -36,8 +36,8 @@
     @Retention(RetentionPolicy.SOURCE)
     private @interface ControllerColorType {}
 
-    private static final int COLOR_DARK_ON_LIGHT_BACKGROUND = 0xDE000000; /* Opacity of 87% */
-    private static final int COLOR_WHITE_ON_DARK_BACKGROUND = Color.WHITE;
+    static final int COLOR_DARK_ON_LIGHT_BACKGROUND = 0xDE000000; /* Opacity of 87% */
+    static final int COLOR_WHITE_ON_DARK_BACKGROUND = Color.WHITE;
 
     private MediaRouterThemeHelper() {
     }
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaItemStatus.java b/v7/mediarouter/src/android/support/v7/media/MediaItemStatus.java
index dd9ab85..c3d1c5e 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaItemStatus.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaItemStatus.java
@@ -58,13 +58,13 @@
  * </p>
  */
 public final class MediaItemStatus {
-    private static final String KEY_TIMESTAMP = "timestamp";
-    private static final String KEY_PLAYBACK_STATE = "playbackState";
-    private static final String KEY_CONTENT_POSITION = "contentPosition";
-    private static final String KEY_CONTENT_DURATION = "contentDuration";
-    private static final String KEY_EXTRAS = "extras";
+    static final String KEY_TIMESTAMP = "timestamp";
+    static final String KEY_PLAYBACK_STATE = "playbackState";
+    static final String KEY_CONTENT_POSITION = "contentPosition";
+    static final String KEY_CONTENT_DURATION = "contentDuration";
+    static final String KEY_EXTRAS = "extras";
 
-    private final Bundle mBundle;
+    final Bundle mBundle;
 
     /**
      * Playback state: Pending.
@@ -195,7 +195,7 @@
     public static final String EXTRA_HTTP_RESPONSE_HEADERS =
             "android.media.status.extra.HTTP_RESPONSE_HEADERS";
 
-    private MediaItemStatus(Bundle bundle) {
+    MediaItemStatus(Bundle bundle) {
         mBundle = bundle;
     }
 
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaRouteDescriptor.java b/v7/mediarouter/src/android/support/v7/media/MediaRouteDescriptor.java
index 93034e6..66a4c20 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaRouteDescriptor.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaRouteDescriptor.java
@@ -37,32 +37,32 @@
  * </p>
  */
 public final class MediaRouteDescriptor {
-    private static final String KEY_ID = "id";
-    private static final String KEY_GROUP_MEMBER_IDS = "groupMemberIds";
-    private static final String KEY_NAME = "name";
-    private static final String KEY_DESCRIPTION = "status";
-    private static final String KEY_ICON_URI = "iconUri";
-    private static final String KEY_ENABLED = "enabled";
-    private static final String KEY_CONNECTING = "connecting";
-    private static final String KEY_CONNECTION_STATE = "connectionState";
-    private static final String KEY_CONTROL_FILTERS = "controlFilters";
-    private static final String KEY_PLAYBACK_TYPE = "playbackType";
-    private static final String KEY_PLAYBACK_STREAM = "playbackStream";
-    private static final String KEY_DEVICE_TYPE = "deviceType";
-    private static final String KEY_VOLUME = "volume";
-    private static final String KEY_VOLUME_MAX = "volumeMax";
-    private static final String KEY_VOLUME_HANDLING = "volumeHandling";
-    private static final String KEY_PRESENTATION_DISPLAY_ID = "presentationDisplayId";
-    private static final String KEY_EXTRAS = "extras";
-    private static final String KEY_CAN_DISCONNECT = "canDisconnect";
-    private static final String KEY_SETTINGS_INTENT = "settingsIntent";
-    private static final String KEY_MIN_CLIENT_VERSION = "minClientVersion";
-    private static final String KEY_MAX_CLIENT_VERSION = "maxClientVersion";
+    static final String KEY_ID = "id";
+    static final String KEY_GROUP_MEMBER_IDS = "groupMemberIds";
+    static final String KEY_NAME = "name";
+    static final String KEY_DESCRIPTION = "status";
+    static final String KEY_ICON_URI = "iconUri";
+    static final String KEY_ENABLED = "enabled";
+    static final String KEY_CONNECTING = "connecting";
+    static final String KEY_CONNECTION_STATE = "connectionState";
+    static final String KEY_CONTROL_FILTERS = "controlFilters";
+    static final String KEY_PLAYBACK_TYPE = "playbackType";
+    static final String KEY_PLAYBACK_STREAM = "playbackStream";
+    static final String KEY_DEVICE_TYPE = "deviceType";
+    static final String KEY_VOLUME = "volume";
+    static final String KEY_VOLUME_MAX = "volumeMax";
+    static final String KEY_VOLUME_HANDLING = "volumeHandling";
+    static final String KEY_PRESENTATION_DISPLAY_ID = "presentationDisplayId";
+    static final String KEY_EXTRAS = "extras";
+    static final String KEY_CAN_DISCONNECT = "canDisconnect";
+    static final String KEY_SETTINGS_INTENT = "settingsIntent";
+    static final String KEY_MIN_CLIENT_VERSION = "minClientVersion";
+    static final String KEY_MAX_CLIENT_VERSION = "maxClientVersion";
 
-    private final Bundle mBundle;
-    private List<IntentFilter> mControlFilters;
+    final Bundle mBundle;
+    List<IntentFilter> mControlFilters;
 
-    private MediaRouteDescriptor(Bundle bundle, List<IntentFilter> controlFilters) {
+    MediaRouteDescriptor(Bundle bundle, List<IntentFilter> controlFilters) {
         mBundle = bundle;
         mControlFilters = controlFilters;
     }
@@ -189,7 +189,7 @@
         return mControlFilters;
     }
 
-    private void ensureControlFilters() {
+    void ensureControlFilters() {
         if (mControlFilters == null) {
             mControlFilters = mBundle.<IntentFilter>getParcelableArrayList(KEY_CONTROL_FILTERS);
             if (mControlFilters == null) {
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaRouteProvider.java b/v7/mediarouter/src/android/support/v7/media/MediaRouteProvider.java
index a9c3ed2..d9fc994 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaRouteProvider.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaRouteProvider.java
@@ -55,8 +55,8 @@
  * </p>
  */
 public abstract class MediaRouteProvider {
-    private static final int MSG_DELIVER_DESCRIPTOR_CHANGED = 1;
-    private static final int MSG_DELIVER_DISCOVERY_REQUEST_CHANGED = 2;
+    static final int MSG_DELIVER_DESCRIPTOR_CHANGED = 1;
+    static final int MSG_DELIVER_DISCOVERY_REQUEST_CHANGED = 2;
 
     private final Context mContext;
     private final ProviderMetadata mMetadata;
@@ -159,7 +159,7 @@
         }
     }
 
-    private void deliverDiscoveryRequestChanged() {
+    void deliverDiscoveryRequestChanged() {
         mPendingDiscoveryRequestChange = false;
         onDiscoveryRequestChanged(mDiscoveryRequest);
     }
@@ -230,7 +230,7 @@
         }
     }
 
-    private void deliverDescriptorChanged() {
+    void deliverDescriptorChanged() {
         mPendingDescriptorChange = false;
 
         if (mCallback != null) {
@@ -427,6 +427,9 @@
     }
 
     private final class ProviderHandler extends Handler {
+        ProviderHandler() {
+        }
+
         @Override
         public void handleMessage(Message msg) {
             switch (msg.what) {
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderDescriptor.java b/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderDescriptor.java
index a8909cb..ec2f7ba 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderDescriptor.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderDescriptor.java
@@ -33,10 +33,10 @@
 public final class MediaRouteProviderDescriptor {
     static final String KEY_ROUTES = "routes";
 
-    private final Bundle mBundle;
-    private List<MediaRouteDescriptor> mRoutes;
+    final Bundle mBundle;
+    List<MediaRouteDescriptor> mRoutes;
 
-    private MediaRouteProviderDescriptor(Bundle bundle,
+    MediaRouteProviderDescriptor(Bundle bundle,
             List<MediaRouteDescriptor> routes) {
         mBundle = bundle;
         mRoutes = routes;
@@ -50,7 +50,7 @@
         return mRoutes;
     }
 
-    private void ensureRoutes() {
+    void ensureRoutes() {
         if (mRoutes == null) {
             ArrayList<Bundle> routeBundles = mBundle.<Bundle>getParcelableArrayList(KEY_ROUTES);
             if (routeBundles == null || routeBundles.isEmpty()) {
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderService.java b/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderService.java
index ba40692..dc49e81 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderService.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaRouteProviderService.java
@@ -62,16 +62,16 @@
  * </pre>
  */
 public abstract class MediaRouteProviderService extends Service {
-    private static final String TAG = "MediaRouteProviderSrv"; // max. 23 chars
-    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+    static final String TAG = "MediaRouteProviderSrv"; // max. 23 chars
+    static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
     private final ArrayList<ClientRecord> mClients = new ArrayList<ClientRecord>();
     private final ReceiveHandler mReceiveHandler;
     private final Messenger mReceiveMessenger;
-    private final PrivateHandler mPrivateHandler;
+    final PrivateHandler mPrivateHandler;
     private final ProviderCallback mProviderCallback;
 
-    private MediaRouteProvider mProvider;
+    MediaRouteProvider mProvider;
     private MediaRouteDiscoveryRequest mCompositeDiscoveryRequest;
 
     /**
@@ -84,7 +84,7 @@
      * Private messages used internally.  (Yes, you can renumber these.)
      */
 
-    private static final int PRIVATE_MSG_CLIENT_DIED = 1;
+    static final int PRIVATE_MSG_CLIENT_DIED = 1;
 
     /**
      * Creates a media route provider service.
@@ -150,7 +150,7 @@
         return super.onUnbind(intent);
     }
 
-    private boolean onRegisterClient(Messenger messenger, int requestId, int version) {
+    boolean onRegisterClient(Messenger messenger, int requestId, int version) {
         if (version >= CLIENT_VERSION_1) {
             int index = findClient(messenger);
             if (index < 0) {
@@ -173,7 +173,7 @@
         return false;
     }
 
-    private boolean onUnregisterClient(Messenger messenger, int requestId) {
+    boolean onUnregisterClient(Messenger messenger, int requestId) {
         int index = findClient(messenger);
         if (index >= 0) {
             ClientRecord client = mClients.remove(index);
@@ -187,7 +187,7 @@
         return false;
     }
 
-    private void onBinderDied(Messenger messenger) {
+    void onBinderDied(Messenger messenger) {
         int index = findClient(messenger);
         if (index >= 0) {
             ClientRecord client = mClients.remove(index);
@@ -198,7 +198,7 @@
         }
     }
 
-    private boolean onCreateRouteController(Messenger messenger, int requestId,
+    boolean onCreateRouteController(Messenger messenger, int requestId,
             int controllerId, String routeId, String routeGroupId) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -214,7 +214,7 @@
         return false;
     }
 
-    private boolean onReleaseRouteController(Messenger messenger, int requestId,
+    boolean onReleaseRouteController(Messenger messenger, int requestId,
             int controllerId) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -230,7 +230,7 @@
         return false;
     }
 
-    private boolean onSelectRoute(Messenger messenger, int requestId,
+    boolean onSelectRoute(Messenger messenger, int requestId,
             int controllerId) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -249,7 +249,7 @@
         return false;
     }
 
-    private boolean onUnselectRoute(Messenger messenger, int requestId,
+    boolean onUnselectRoute(Messenger messenger, int requestId,
             int controllerId, int reason) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -268,7 +268,7 @@
         return false;
     }
 
-    private boolean onSetRouteVolume(Messenger messenger, int requestId,
+    boolean onSetRouteVolume(Messenger messenger, int requestId,
             int controllerId, int volume) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -287,7 +287,7 @@
         return false;
     }
 
-    private boolean onUpdateRouteVolume(Messenger messenger, int requestId,
+    boolean onUpdateRouteVolume(Messenger messenger, int requestId,
             int controllerId, int delta) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -306,7 +306,7 @@
         return false;
     }
 
-    private boolean onRouteControlRequest(final Messenger messenger, final int requestId,
+    boolean onRouteControlRequest(final Messenger messenger, final int requestId,
             final int controllerId, final Intent intent) {
         final ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -364,7 +364,7 @@
         return false;
     }
 
-    private boolean onSetDiscoveryRequest(Messenger messenger, int requestId,
+    boolean onSetDiscoveryRequest(Messenger messenger, int requestId,
             MediaRouteDiscoveryRequest request) {
         ClientRecord client = getClient(messenger);
         if (client != null) {
@@ -380,7 +380,7 @@
         return false;
     }
 
-    private void sendDescriptorChanged(MediaRouteProviderDescriptor descriptor) {
+    void sendDescriptorChanged(MediaRouteProviderDescriptor descriptor) {
         final int count = mClients.size();
         for (int i = 0; i < count; i++) {
             ClientRecord client = mClients.get(i);
@@ -413,7 +413,7 @@
                 .addRoutes(routes).build().asBundle();
     }
 
-    private boolean updateCompositeDiscoveryRequest() {
+    boolean updateCompositeDiscoveryRequest() {
         MediaRouteDiscoveryRequest composite = null;
         MediaRouteSelector.Builder selectorBuilder = null;
         boolean activeScan = false;
@@ -451,7 +451,7 @@
         return index >= 0 ? mClients.get(index) : null;
     }
 
-    private int findClient(Messenger messenger) {
+    int findClient(Messenger messenger) {
         final int count = mClients.size();
         for (int i = 0; i < count; i++) {
             ClientRecord client = mClients.get(i);
@@ -462,7 +462,7 @@
         return -1;
     }
 
-    private static void sendGenericFailure(Messenger messenger, int requestId) {
+    static void sendGenericFailure(Messenger messenger, int requestId) {
         if (requestId != 0) {
             sendReply(messenger, SERVICE_MSG_GENERIC_FAILURE, requestId, 0, null, null);
         }
@@ -474,7 +474,7 @@
         }
     }
 
-    private static void sendReply(Messenger messenger, int what,
+    static void sendReply(Messenger messenger, int what,
             int requestId, int arg, Object obj, Bundle data) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -491,11 +491,14 @@
         }
     }
 
-    private static String getClientId(Messenger messenger) {
+    static String getClientId(Messenger messenger) {
         return "Client connection " + messenger.getBinder().toString();
     }
 
     private final class PrivateHandler extends Handler {
+        PrivateHandler() {
+        }
+
         @Override
         public void handleMessage(Message msg) {
             switch (msg.what) {
@@ -507,6 +510,9 @@
     }
 
     private final class ProviderCallback extends MediaRouteProvider.Callback {
+        ProviderCallback() {
+        }
+
         @Override
         public void onDescriptorChanged(MediaRouteProvider provider,
                 MediaRouteProviderDescriptor descriptor) {
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaRouteSelector.java b/v7/mediarouter/src/android/support/v7/media/MediaRouteSelector.java
index 4323d69..65406da 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaRouteSelector.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaRouteSelector.java
@@ -44,17 +44,17 @@
  * </pre>
  */
 public final class MediaRouteSelector {
-    private static final String KEY_CONTROL_CATEGORIES = "controlCategories";
+    static final String KEY_CONTROL_CATEGORIES = "controlCategories";
 
     private final Bundle mBundle;
-    private List<String> mControlCategories;
+    List<String> mControlCategories;
 
     /**
      * An empty media route selector that will not match any routes.
      */
     public static final MediaRouteSelector EMPTY = new MediaRouteSelector(new Bundle(), null);
 
-    private MediaRouteSelector(Bundle bundle, List<String> controlCategories) {
+    MediaRouteSelector(Bundle bundle, List<String> controlCategories) {
         mBundle = bundle;
         mControlCategories = controlCategories;
     }
@@ -69,7 +69,7 @@
         return mControlCategories;
     }
 
-    private void ensureControlCategories() {
+    void ensureControlCategories() {
         if (mControlCategories == null) {
             mControlCategories = mBundle.getStringArrayList(KEY_CONTROL_CATEGORIES);
             if (mControlCategories == null || mControlCategories.isEmpty()) {
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaRouter.java b/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
index b8d86ad..9ee1225 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
@@ -76,8 +76,8 @@
  * </p>
  */
 public final class MediaRouter {
-    private static final String TAG = "MediaRouter";
-    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+    static final String TAG = "MediaRouter";
+    static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
     /**
      * Passed to {@link android.support.v7.media.MediaRouteProvider.RouteController#onUnselect(int)}
@@ -1882,31 +1882,31 @@
     private static final class GlobalMediaRouter
             implements SystemMediaRouteProvider.SyncCallback,
             RegisteredMediaRouteProviderWatcher.Callback {
-        private final Context mApplicationContext;
-        private final ArrayList<WeakReference<MediaRouter>> mRouters = new ArrayList<>();
+        final Context mApplicationContext;
+        final ArrayList<WeakReference<MediaRouter>> mRouters = new ArrayList<>();
         private final ArrayList<RouteInfo> mRoutes = new ArrayList<>();
         private final Map<Pair<String, String>, String> mUniqueIdMap = new HashMap<>();
         private final ArrayList<ProviderInfo> mProviders = new ArrayList<>();
         private final ArrayList<RemoteControlClientRecord> mRemoteControlClients =
                 new ArrayList<>();
-        private final RemoteControlClientCompat.PlaybackInfo mPlaybackInfo =
+        final RemoteControlClientCompat.PlaybackInfo mPlaybackInfo =
                 new RemoteControlClientCompat.PlaybackInfo();
         private final ProviderCallback mProviderCallback = new ProviderCallback();
-        private final CallbackHandler mCallbackHandler = new CallbackHandler();
+        final CallbackHandler mCallbackHandler = new CallbackHandler();
         private final DisplayManagerCompat mDisplayManager;
-        private final SystemMediaRouteProvider mSystemProvider;
+        final SystemMediaRouteProvider mSystemProvider;
         private final boolean mLowRam;
 
         private RegisteredMediaRouteProviderWatcher mRegisteredProviderWatcher;
         private RouteInfo mDefaultRoute;
-        private RouteInfo mSelectedRoute;
+        RouteInfo mSelectedRoute;
         private RouteController mSelectedRouteController;
         // A map from route descriptor ID to RouteController for the member routes in the currently
         // selected route group.
         private final Map<String, RouteController> mRouteControllerMap = new HashMap<>();
         private MediaRouteDiscoveryRequest mDiscoveryRequest;
         private MediaSessionRecord mMediaSession;
-        private MediaSessionCompat mRccMediaSession;
+        MediaSessionCompat mRccMediaSession;
         private MediaSessionCompat mCompatSession;
         private MediaSessionCompat.OnActiveChangeListener mSessionActiveListener =
                 new MediaSessionCompat.OnActiveChangeListener() {
@@ -2195,7 +2195,7 @@
             }
         }
 
-        private void updateProviderDescriptor(MediaRouteProvider providerInstance,
+        void updateProviderDescriptor(MediaRouteProvider providerInstance,
                 MediaRouteProviderDescriptor descriptor) {
             int index = findProviderInfo(providerInstance);
             if (index >= 0) {
@@ -2669,6 +2669,9 @@
         }
 
         private final class ProviderCallback extends MediaRouteProvider.Callback {
+            ProviderCallback() {
+            }
+
             @Override
             public void onDescriptorChanged(MediaRouteProvider provider,
                     MediaRouteProviderDescriptor descriptor) {
@@ -2794,6 +2797,9 @@
             public static final int MSG_PROVIDER_REMOVED = MSG_TYPE_PROVIDER | 2;
             public static final int MSG_PROVIDER_CHANGED = MSG_TYPE_PROVIDER | 3;
 
+            CallbackHandler() {
+            }
+
             public void post(int msg, Object obj) {
                 obtainMessage(msg, obj).sendToTarget();
             }
diff --git a/v7/mediarouter/src/android/support/v7/media/MediaSessionStatus.java b/v7/mediarouter/src/android/support/v7/media/MediaSessionStatus.java
index 5c6deb5..511fc55 100644
--- a/v7/mediarouter/src/android/support/v7/media/MediaSessionStatus.java
+++ b/v7/mediarouter/src/android/support/v7/media/MediaSessionStatus.java
@@ -43,12 +43,12 @@
  * </p>
  */
 public final class MediaSessionStatus {
-    private static final String KEY_TIMESTAMP = "timestamp";
-    private static final String KEY_SESSION_STATE = "sessionState";
-    private static final String KEY_QUEUE_PAUSED = "queuePaused";
-    private static final String KEY_EXTRAS = "extras";
+    static final String KEY_TIMESTAMP = "timestamp";
+    static final String KEY_SESSION_STATE = "sessionState";
+    static final String KEY_QUEUE_PAUSED = "queuePaused";
+    static final String KEY_EXTRAS = "extras";
 
-    private final Bundle mBundle;
+    final Bundle mBundle;
 
     /**
      * Session state: Active.
@@ -82,7 +82,7 @@
      */
     public static final int SESSION_STATE_INVALIDATED = 2;
 
-    private MediaSessionStatus(Bundle bundle) {
+    MediaSessionStatus(Bundle bundle) {
         mBundle = bundle;
     }
 
diff --git a/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProvider.java b/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProvider.java
index 547ff79..7942eed 100644
--- a/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProvider.java
+++ b/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProvider.java
@@ -44,11 +44,11 @@
  */
 final class RegisteredMediaRouteProvider extends MediaRouteProvider
         implements ServiceConnection {
-    private static final String TAG = "MediaRouteProviderProxy";  // max. 23 chars
-    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+    static final String TAG = "MediaRouteProviderProxy";  // max. 23 chars
+    static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
     private final ComponentName mComponentName;
-    private final PrivateHandler mPrivateHandler;
+    final PrivateHandler mPrivateHandler;
     private final ArrayList<Controller> mControllers = new ArrayList<Controller>();
 
     private boolean mStarted;
@@ -241,7 +241,7 @@
         return null;
     }
 
-    private void onConnectionReady(Connection connection) {
+    void onConnectionReady(Connection connection) {
         if (mActiveConnection == connection) {
             mConnectionReady = true;
             attachControllersToConnection();
@@ -253,7 +253,7 @@
         }
     }
 
-    private void onConnectionDied(Connection connection) {
+    void onConnectionDied(Connection connection) {
         if (mActiveConnection == connection) {
             if (DEBUG) {
                 Log.d(TAG, this + ": Service connection died");
@@ -262,7 +262,7 @@
         }
     }
 
-    private void onConnectionError(Connection connection, String error) {
+    void onConnectionError(Connection connection, String error) {
         if (mActiveConnection == connection) {
             if (DEBUG) {
                 Log.d(TAG, this + ": Service connection error - " + error);
@@ -271,7 +271,7 @@
         }
     }
 
-    private void onConnectionDescriptorChanged(Connection connection,
+    void onConnectionDescriptorChanged(Connection connection,
             MediaRouteProviderDescriptor descriptor) {
         if (mActiveConnection == connection) {
             if (DEBUG) {
@@ -291,7 +291,7 @@
         }
     }
 
-    private void onControllerReleased(Controller controller) {
+    void onControllerReleased(Controller controller) {
         mControllers.remove(controller);
         controller.detachConnection();
         updateBinding();
@@ -454,7 +454,7 @@
             });
         }
 
-        private void failPendingCallbacks() {
+        void failPendingCallbacks() {
             int count = 0;
             for (int i = 0; i < mPendingCallbacks.size(); i++) {
                 mPendingCallbacks.valueAt(i).onError(null, null);
@@ -615,6 +615,8 @@
     }
 
     private final class PrivateHandler extends Handler {
+        PrivateHandler() {
+        }
     }
 
     /**
diff --git a/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProviderWatcher.java b/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProviderWatcher.java
index 2fb01d2..e763597 100644
--- a/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProviderWatcher.java
+++ b/v7/mediarouter/src/android/support/v7/media/RegisteredMediaRouteProviderWatcher.java
@@ -85,7 +85,7 @@
         }
     }
 
-    private void scanPackages() {
+    void scanPackages() {
         if (!mRunning) {
             return;
         }
diff --git a/v7/mediarouter/src/android/support/v7/media/RemotePlaybackClient.java b/v7/mediarouter/src/android/support/v7/media/RemotePlaybackClient.java
index 1716af3..1dc556b 100644
--- a/v7/mediarouter/src/android/support/v7/media/RemotePlaybackClient.java
+++ b/v7/mediarouter/src/android/support/v7/media/RemotePlaybackClient.java
@@ -35,8 +35,8 @@
  * </p>
  */
 public class RemotePlaybackClient {
-    private static final String TAG = "RemotePlaybackClient";
-    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+    static final String TAG = "RemotePlaybackClient";
+    static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
     private final Context mContext;
     private final MediaRouter.RouteInfo mRoute;
@@ -50,9 +50,9 @@
     private boolean mRouteSupportsSessionManagement;
     private boolean mRouteSupportsMessaging;
 
-    private String mSessionId;
-    private StatusCallback mStatusCallback;
-    private OnMessageReceivedListener mOnMessageReceivedListener;
+    String mSessionId;
+    StatusCallback mStatusCallback;
+    OnMessageReceivedListener mOnMessageReceivedListener;
 
     /**
      * Creates a remote playback client for a route.
@@ -748,20 +748,20 @@
         });
     }
 
-    private void adoptSession(String sessionId) {
+    void adoptSession(String sessionId) {
         if (sessionId != null) {
             setSessionId(sessionId);
         }
     }
 
-    private void handleInvalidResult(Intent intent, ActionCallback callback,
+    void handleInvalidResult(Intent intent, ActionCallback callback,
             Bundle data) {
         Log.w(TAG, "Received invalid result data from " + intent.getAction()
                 + ": data=" + bundleToString(data));
         callback.onError(null, MediaControlIntent.ERROR_UNKNOWN, data);
     }
 
-    private void handleError(Intent intent, ActionCallback callback,
+    void handleError(Intent intent, ActionCallback callback,
             String error, Bundle data) {
         final int code;
         if (data != null) {
@@ -840,7 +840,7 @@
         }
     }
 
-    private static String inferMissingResult(String request, String result) {
+    static String inferMissingResult(String request, String result) {
         if (result == null) {
             // Result is missing.
             return request;
@@ -859,7 +859,7 @@
         }
     }
 
-    private static String bundleToString(Bundle bundle) {
+    static String bundleToString(Bundle bundle) {
         if (bundle != null) {
             bundle.size(); // force bundle to be unparcelled
             return bundle.toString();
@@ -875,6 +875,9 @@
         public static final String ACTION_MESSAGE_RECEIVED =
                 "android.support.v7.media.actions.ACTION_MESSAGE_RECEIVED";
 
+        ActionReceiver() {
+        }
+
         @Override
         public void onReceive(Context context, Intent intent) {
             String sessionId = intent.getStringExtra(MediaControlIntent.EXTRA_SESSION_ID);
diff --git a/v7/mediarouter/src/android/support/v7/media/SystemMediaRouteProvider.java b/v7/mediarouter/src/android/support/v7/media/SystemMediaRouteProvider.java
index 21ff5b4..6a2451b 100644
--- a/v7/mediarouter/src/android/support/v7/media/SystemMediaRouteProvider.java
+++ b/v7/mediarouter/src/android/support/v7/media/SystemMediaRouteProvider.java
@@ -103,7 +103,7 @@
      * Legacy implementation for platform versions prior to Jellybean.
      */
     static class LegacyImpl extends SystemMediaRouteProvider {
-        private static final int PLAYBACK_STREAM = AudioManager.STREAM_MUSIC;
+        static final int PLAYBACK_STREAM = AudioManager.STREAM_MUSIC;
 
         private static final ArrayList<IntentFilter> CONTROL_FILTERS;
         static {
@@ -115,9 +115,9 @@
             CONTROL_FILTERS.add(f);
         }
 
-        private final AudioManager mAudioManager;
+        final AudioManager mAudioManager;
         private final VolumeChangeReceiver mVolumeChangeReceiver;
-        private int mLastReportedVolume = -1;
+        int mLastReportedVolume = -1;
 
         public LegacyImpl(Context context) {
             super(context);
@@ -129,7 +129,7 @@
             publishRoutes();
         }
 
-        private void publishRoutes() {
+        void publishRoutes() {
             Resources r = getContext().getResources();
             int maxVolume = mAudioManager.getStreamMaxVolume(PLAYBACK_STREAM);
             mLastReportedVolume = mAudioManager.getStreamVolume(PLAYBACK_STREAM);