summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-11-21 16:42:03 -0800
committerJeff Brown <jeffbrown@google.com>2013-11-21 19:32:59 -0800
commitce468a35b388ca46578934706b38dbae94941643 (patch)
tree0e403cf705d7b938c0f0f77d09052486b7e14fb3 /packages
parent90e9b1d3dc15e97bb7ecb88289c3707fe03fb1a6 (diff)
downloadframeworks_base-ce468a35b388ca46578934706b38dbae94941643.zip
frameworks_base-ce468a35b388ca46578934706b38dbae94941643.tar.gz
frameworks_base-ce468a35b388ca46578934706b38dbae94941643.tar.bz2
Stop wifi display discovery when no longer needed.
Keep track of how many clients are requesting scans and scan continuously until all of them are gone then explicitly terminate the scan instead of letting it time out as before. Suspend wifi display scans while connecting or connected to a remote display. This is handled by both the display manager and media router since neither has complete information about what is happening. Much of this code will no longer be needed once wifi display support is integrated directly into the media router service. Ensure that we don't attempt to scan or connect to wifi displays while the wifi display feature is off. Infer when a connection attempt fails and unselect the wifi display route automatically so it doesn't appear to be connecting forever. Fix issues around correctly canceling and retrying connection attempts. Often we would cancel but not retry. Improved connection reliability somewhat. It seems that discovery must already be in progress in order for a connection attempt to succeed. Ensure QuickSettings uses exactly the same logic as the MediaRouteButton to determine when the remote display tile should be made visible. Bug: 11717053 Change-Id: I18afc977b0e8c26204b8c96adaa79f05225f7b6e
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java10
1 files changed, 2 insertions, 8 deletions
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 e1a20ec..42201c5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
@@ -692,14 +692,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
} else {
connectedRoute = null;
connecting = false;
- final int count = mMediaRouter.getRouteCount();
- for (int i = 0; i < count; i++) {
- MediaRouter.RouteInfo route = mMediaRouter.getRouteAt(i);
- if (route.matchesTypes(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY)) {
- enabled = true;
- break;
- }
- }
+ enabled = mMediaRouter.isRouteAvailable(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY,
+ MediaRouter.AVAILABILITY_FLAG_IGNORE_DEFAULT_ROUTE);
}
mRemoteDisplayState.enabled = enabled;