diff options
author | Jeff Brown <jeffbrown@google.com> | 2013-11-09 17:48:23 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2013-11-10 14:39:19 -0800 |
commit | 0abd3a6ce83ed23abe614155e776b600ef2a66c3 (patch) | |
tree | 0e1e4612ad24b020e63d494608defaf298ef8909 /packages/SystemUI | |
parent | e2126baf72f007d079efcabd45c7a546db34361a (diff) | |
download | frameworks_base-0abd3a6ce83ed23abe614155e776b600ef2a66c3.zip frameworks_base-0abd3a6ce83ed23abe614155e776b600ef2a66c3.tar.gz frameworks_base-0abd3a6ce83ed23abe614155e776b600ef2a66c3.tar.bz2 |
Update the media router dialogs and integrate into system UI.
Port the new style UI back into the framework from the support library.
There are now two dialogs: a chooser and a controller. We use the
same dialogs for selecting routes within app and within quick settings.
Note that the new UI does not support any grouping features since they
are deprecated and unused.
Bug: 11257292
Change-Id: I64e936a18d25ab75f0c470cbc1e7085f67004863
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java | 19 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java | 6 |
2 files changed, 20 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 2e40ddf..e7b8fa1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -37,8 +37,8 @@ import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.graphics.drawable.LevelListDrawable; import android.hardware.display.DisplayManager; +import android.media.MediaRouter; import android.net.wifi.WifiManager; import android.os.AsyncTask; import android.os.Handler; @@ -61,6 +61,7 @@ import android.view.WindowManagerGlobal; import android.widget.ImageView; import android.widget.TextView; +import com.android.internal.app.MediaRouteDialogPresenter; import com.android.systemui.R; import com.android.systemui.statusbar.phone.QuickSettingsModel.ActivityState; import com.android.systemui.statusbar.phone.QuickSettingsModel.BluetoothState; @@ -676,7 +677,21 @@ class QuickSettings { remoteDisplayTile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - startSettingsActivity(android.provider.Settings.ACTION_WIFI_DISPLAY_SETTINGS); + collapsePanels(); + + final Dialog[] dialog = new Dialog[1]; + dialog[0] = MediaRouteDialogPresenter.createDialog(mContext, + MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY, + new View.OnClickListener() { + @Override + public void onClick(View v) { + dialog[0].dismiss(); + startSettingsActivity( + android.provider.Settings.ACTION_WIFI_DISPLAY_SETTINGS); + } + }); + dialog[0].getWindow().setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY); + dialog[0].show(); } }); mModel.addRemoteDisplayTile(remoteDisplayTile, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java index 5567e7d..e59dfaa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java @@ -684,8 +684,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, private void updateRemoteDisplays() { MediaRouter.RouteInfo connectedRoute = mMediaRouter.getSelectedRoute( MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY); - boolean enabled = connectedRoute != null && (connectedRoute.getSupportedTypes() - & MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY) != 0; + boolean enabled = connectedRoute != null + && connectedRoute.matchesTypes(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY); boolean connecting; if (enabled) { connecting = connectedRoute.isConnecting(); @@ -695,7 +695,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, final int count = mMediaRouter.getRouteCount(); for (int i = 0; i < count; i++) { MediaRouter.RouteInfo route = mMediaRouter.getRouteAt(i); - if ((route.getSupportedTypes() & MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY) != 0) { + if (route.matchesTypes(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY)) { enabled = true; break; } |