diff options
author | Adam Powell <adamp@google.com> | 2012-06-12 12:04:24 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-12 12:04:24 -0700 |
commit | 579ec3086c9ce3616735bc3cf63246f052973a7f (patch) | |
tree | ebc1f2f7a6f5894a6f4dec682253d7aae695de6e /media | |
parent | ceb8067920043a430478be386c56c244355d4c9f (diff) | |
parent | b35c445f34e1a18e17aef3e3dfbc1c39b4d1815c (diff) | |
download | frameworks_base-579ec3086c9ce3616735bc3cf63246f052973a7f.zip frameworks_base-579ec3086c9ce3616735bc3cf63246f052973a7f.tar.gz frameworks_base-579ec3086c9ce3616735bc3cf63246f052973a7f.tar.bz2 |
Merge "MediaRouter work" into jb-dev
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/MediaRouter.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/media/java/android/media/MediaRouter.java b/media/java/android/media/MediaRouter.java index 7c74f0a..38fe363 100644 --- a/media/java/android/media/MediaRouter.java +++ b/media/java/android/media/MediaRouter.java @@ -45,21 +45,21 @@ public class MediaRouter { private static final String TAG = "MediaRouter"; static class Static { - private final Resources mResources; - private final AudioManager mAudioManager; - private final Handler mHandler; - private final ArrayList<CallbackInfo> mCallbacks = new ArrayList<CallbackInfo>(); + final Resources mResources; + final AudioManager mAudioManager; + final Handler mHandler; + final ArrayList<CallbackInfo> mCallbacks = new ArrayList<CallbackInfo>(); - private final ArrayList<RouteInfo> mRoutes = new ArrayList<RouteInfo>(); - private final ArrayList<RouteCategory> mCategories = new ArrayList<RouteCategory>(); + final ArrayList<RouteInfo> mRoutes = new ArrayList<RouteInfo>(); + final ArrayList<RouteCategory> mCategories = new ArrayList<RouteCategory>(); - private final RouteCategory mSystemCategory; - private final HeadphoneChangedBroadcastReceiver mHeadphoneChangedReceiver; + final RouteCategory mSystemCategory; + final HeadphoneChangedBroadcastReceiver mHeadphoneChangedReceiver; - private RouteInfo mDefaultAudio; - private RouteInfo mBluetoothA2dpRoute; + RouteInfo mDefaultAudio; + RouteInfo mBluetoothA2dpRoute; - private RouteInfo mSelectedRoute; + RouteInfo mSelectedRoute; Static(Context appContext) { mResources = Resources.getSystem(); @@ -78,7 +78,10 @@ public class MediaRouter { speakerFilter.addAction(Intent.ACTION_HDMI_AUDIO_PLUG); mHeadphoneChangedReceiver = new HeadphoneChangedBroadcastReceiver(); appContext.registerReceiver(mHeadphoneChangedReceiver, speakerFilter); + } + // Called after sStatic is initialized + void initDefaultRoutes() { mDefaultAudio = new RouteInfo(mSystemCategory); mDefaultAudio.mName = mResources.getText( com.android.internal.R.string.default_audio_route_name); @@ -130,6 +133,7 @@ public class MediaRouter { synchronized (Static.class) { if (sStatic == null) { sStatic = new Static(context.getApplicationContext()); + sStatic.initDefaultRoutes(); } } } |