Implement 'Available via Passpoint' feature
This also fixes the issues related to explicit connection to passpoint AP, and fixes occassional mention of 'connected via Wi-Fi Assistent' Change-Id: Ib4de956f2ea29709d0212fbcb392815644800e78
This commit is contained in:
@@ -1335,6 +1335,8 @@
|
|||||||
<string name="connected_via_wfa">Connected via Wi\u2011Fi assistant</string>
|
<string name="connected_via_wfa">Connected via Wi\u2011Fi assistant</string>
|
||||||
<!-- Status message of Wi-Fi when it is connected by Passpoint configuration. [CHAR LIMIT=NONE] -->
|
<!-- Status message of Wi-Fi when it is connected by Passpoint configuration. [CHAR LIMIT=NONE] -->
|
||||||
<string name="connected_via_passpoint">Connected via %1$s</string>
|
<string name="connected_via_passpoint">Connected via %1$s</string>
|
||||||
|
<!-- Status message of Wi-Fi when network has matching passpoint credentials. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="available_via_passpoint">Available via %1$s</string>
|
||||||
|
|
||||||
<!-- Wifi Display settings. The title of the screen. [CHAR LIMIT=40] -->
|
<!-- Wifi Display settings. The title of the screen. [CHAR LIMIT=40] -->
|
||||||
<string name="wifi_display_settings_title">Cast screen</string>
|
<string name="wifi_display_settings_title">Cast screen</string>
|
||||||
|
|||||||
@@ -401,6 +401,7 @@ class AccessPoint extends Preference {
|
|||||||
|
|
||||||
void update(WifiConfiguration config) {
|
void update(WifiConfiguration config) {
|
||||||
mConfig = config;
|
mConfig = config;
|
||||||
|
networkId = config.networkId;
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -631,8 +632,10 @@ class AccessPoint extends Preference {
|
|||||||
mConfig.providerFriendlyName : null;
|
mConfig.providerFriendlyName : null;
|
||||||
summary.append(Summary.get(context, getState(),
|
summary.append(Summary.get(context, getState(),
|
||||||
networkId == WifiConfiguration.INVALID_NETWORK_ID, passpointProvider));
|
networkId == WifiConfiguration.INVALID_NETWORK_ID, passpointProvider));
|
||||||
} else if (mConfig != null
|
} else if (mConfig != null && mConfig.isPasspoint()) {
|
||||||
&& mConfig.hasNoInternetAccess()) {
|
String format = context.getString(R.string.available_via_passpoint);
|
||||||
|
summary.append(String.format(format, mConfig.providerFriendlyName));
|
||||||
|
} else if (mConfig != null && mConfig.hasNoInternetAccess()) {
|
||||||
summary.append(context.getString(R.string.wifi_no_internet));
|
summary.append(context.getString(R.string.wifi_no_internet));
|
||||||
} else if (mConfig != null && ((mConfig.status == WifiConfiguration.Status.DISABLED &&
|
} else if (mConfig != null && ((mConfig.status == WifiConfiguration.Status.DISABLED &&
|
||||||
mConfig.disableReason != WifiConfiguration.DISABLED_UNKNOWN_REASON)
|
mConfig.disableReason != WifiConfiguration.DISABLED_UNKNOWN_REASON)
|
||||||
|
|||||||
@@ -269,10 +269,16 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
mConfigUi.setSubmitButton(res.getString(R.string.wifi_connect));
|
mConfigUi.setSubmitButton(res.getString(R.string.wifi_connect));
|
||||||
} else {
|
} else {
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
|
WifiConfiguration config = mAccessPoint.getConfig();
|
||||||
|
if (config != null && config.isPasspoint()) {
|
||||||
|
addRow(group, R.string.wifi_status, Summary.get(mConfigUi.getContext(),
|
||||||
|
state, false, config.providerFriendlyName));
|
||||||
|
} else {
|
||||||
addRow(group, R.string.wifi_status, Summary.get(mConfigUi.getContext(),
|
addRow(group, R.string.wifi_status, Summary.get(mConfigUi.getContext(),
|
||||||
state, mAccessPoint.networkId ==
|
state, mAccessPoint.networkId ==
|
||||||
WifiConfiguration.INVALID_NETWORK_ID));
|
WifiConfiguration.INVALID_NETWORK_ID));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (signalLevel != null) {
|
if (signalLevel != null) {
|
||||||
addRow(group, R.string.wifi_signal, signalLevel);
|
addRow(group, R.string.wifi_signal, signalLevel);
|
||||||
|
|||||||
@@ -778,6 +778,13 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
accessPoint.update(lastInfo, lastNetworkInfo);
|
accessPoint.update(lastInfo, lastNetworkInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.passpointNetwork) {
|
||||||
|
WifiConfiguration config = wifiManager.getMatchingWifiConfig(result);
|
||||||
|
if (config != null) {
|
||||||
|
accessPoint.update(config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (lastInfo != null && lastInfo.getBSSID() != null
|
if (lastInfo != null && lastInfo.getBSSID() != null
|
||||||
&& lastInfo.getBSSID().equals(result.BSSID)
|
&& lastInfo.getBSSID().equals(result.BSSID)
|
||||||
&& connectionConfig != null && connectionConfig.isPasspoint()) {
|
&& connectionConfig != null && connectionConfig.isPasspoint()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user