am dbb0b824: Merge "wifi-display: add a global setting to force WPS config method" into klp-dev
* commit 'dbb0b824a7e1dc6909988ec06a46158c05d26a92': wifi-display: add a global setting to force WPS config method
This commit is contained in:
@@ -5106,6 +5106,21 @@ public final class Settings {
|
||||
public static final String WIFI_DISPLAY_CERTIFICATION_ON =
|
||||
"wifi_display_certification_on";
|
||||
|
||||
/**
|
||||
* WPS Configuration method used by Wifi display, this setting only
|
||||
* takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
|
||||
*
|
||||
* Possible values are:
|
||||
*
|
||||
* WpsInfo.INVALID: use default WPS method chosen by framework
|
||||
* WpsInfo.PBC : use Push button
|
||||
* WpsInfo.KEYPAD : use Keypad
|
||||
* WpsInfo.DISPLAY: use Display
|
||||
* @hide
|
||||
*/
|
||||
public static final String WIFI_DISPLAY_WPS_CONFIG =
|
||||
"wifi_display_wps_config";
|
||||
|
||||
/**
|
||||
* Whether to notify the user of open networks.
|
||||
* <p>
|
||||
|
||||
@@ -150,6 +150,8 @@ final class WifiDisplayController implements DumpUtils.Dump {
|
||||
|
||||
// Certification
|
||||
private boolean mWifiDisplayCertMode;
|
||||
private int mWifiDisplayWpsConfig = WpsInfo.INVALID;
|
||||
|
||||
private WifiP2pDevice mThisDevice;
|
||||
|
||||
public WifiDisplayController(Context context, Handler handler, Listener listener) {
|
||||
@@ -179,6 +181,8 @@ final class WifiDisplayController implements DumpUtils.Dump {
|
||||
Settings.Global.WIFI_DISPLAY_ON), false, settingsObserver);
|
||||
resolver.registerContentObserver(Settings.Global.getUriFor(
|
||||
Settings.Global.WIFI_DISPLAY_CERTIFICATION_ON), false, settingsObserver);
|
||||
resolver.registerContentObserver(Settings.Global.getUriFor(
|
||||
Settings.Global.WIFI_DISPLAY_WPS_CONFIG), false, settingsObserver);
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
@@ -189,6 +193,12 @@ final class WifiDisplayController implements DumpUtils.Dump {
|
||||
mWifiDisplayCertMode = Settings.Global.getInt(resolver,
|
||||
Settings.Global.WIFI_DISPLAY_CERTIFICATION_ON, 0) != 0;
|
||||
|
||||
mWifiDisplayWpsConfig = WpsInfo.INVALID;
|
||||
if (mWifiDisplayCertMode) {
|
||||
mWifiDisplayWpsConfig = Settings.Global.getInt(resolver,
|
||||
Settings.Global.WIFI_DISPLAY_WPS_CONFIG, WpsInfo.INVALID);
|
||||
}
|
||||
|
||||
updateWfdEnableState();
|
||||
}
|
||||
|
||||
@@ -608,7 +618,9 @@ final class WifiDisplayController implements DumpUtils.Dump {
|
||||
mConnectingDevice = mDesiredDevice;
|
||||
WifiP2pConfig config = new WifiP2pConfig();
|
||||
WpsInfo wps = new WpsInfo();
|
||||
if (mConnectingDevice.wpsPbcSupported()) {
|
||||
if (mWifiDisplayWpsConfig != WpsInfo.INVALID) {
|
||||
wps.setup = mWifiDisplayWpsConfig;
|
||||
} else if (mConnectingDevice.wpsPbcSupported()) {
|
||||
wps.setup = WpsInfo.PBC;
|
||||
} else if (mConnectingDevice.wpsDisplaySupported()) {
|
||||
// We do keypad if peer does display
|
||||
|
||||
Reference in New Issue
Block a user