Force update wifi QS when opening.

This changes expands on ag/2608526 by forcing a refresh of AccessPoints
when the QuickSettings picker is opened. This consolidates logic between
QS and Settings, where in WifiSettings we forceUpdate on cold start.

Bug: b/62680006
Test: 1. Open the quick settings picker
2. Minimize the picker
3. Walk out of range of the networks you say listed in the picker
4. Re-open picker
5. Stale networks should not be shown, latest scan results should be.

Change-Id: Ia944dd3dbeff7d9c3774f04129c07f1ffd4466b2
This commit is contained in:
Sundeep Ghuman
2017-07-26 20:23:32 -07:00
parent 4451b6ae19
commit c09b7f789b
2 changed files with 4 additions and 5 deletions

View File

@@ -311,12 +311,10 @@ public class WifiTile extends QSTileImpl<SignalState> {
public View createDetailView(Context context, View convertView, ViewGroup parent) {
if (DEBUG) Log.d(TAG, "createDetailView convertView=" + (convertView != null));
mAccessPoints = null;
mWifiController.scanForAccessPoints();
fireScanStateChanged(true);
mItems = QSDetailItems.convertOrInflate(context, convertView, parent);
mItems.setTagSuffix("Wifi");
mItems.setCallback(this);
updateItems();
mWifiController.scanForAccessPoints(); // updates APs and items
setItemsVisible(mState.value);
return mItems;
}

View File

@@ -97,8 +97,9 @@ public class AccessPointControllerImpl
@Override
public void scanForAccessPoints() {
if (DEBUG) Log.d(TAG, "scan!");
mWifiTracker.forceScan();
if (DEBUG) Log.d(TAG, "force update APs!");
mWifiTracker.forceUpdate();
fireAcccessPointsCallback(mWifiTracker.getAccessPoints());
}
@Override