Implement Wi-Fi DPP flow

1. As DPP configurator initiator.
2. As DPP enrollee initiator.
3. Pass whole DPP url to DPP API due to API cahnged.

Bug: 122331217
Test: manual test
Change-Id: I8005b78b82453badf253dbde8022ff20722b39fd
This commit is contained in:
Johnson Lu
2019-01-07 11:44:21 +08:00
parent ad9874e14e
commit 7bdf8b3d37
7 changed files with 121 additions and 36 deletions

View File

@@ -64,6 +64,9 @@ public class WifiDppUtils {
/** The data corresponding to {@code WifiConfiguration} hiddenSSID */
public static final String EXTRA_WIFI_HIDDEN_SSID = "hiddenSsid";
/** The data corresponding to {@code WifiConfiguration} networkId */
public static final String EXTRA_WIFI_NETWORK_ID = "networkId";
/** @see WifiQrCode */
public static final String EXTRA_QR_CODE = "qrCode";
@@ -164,6 +167,11 @@ public class WifiDppUtils {
if (!TextUtils.isEmpty(preSharedKey)) {
intent.putExtra(EXTRA_WIFI_PRE_SHARED_KEY, preSharedKey);
}
if (wifiConfig.networkId == WifiConfiguration.INVALID_NETWORK_ID) {
throw new IllegalArgumentException("Invalid network ID");
} else {
intent.putExtra(EXTRA_WIFI_NETWORK_ID, wifiConfig.networkId);
}
return intent;
}