From af76fb83a208928e7f7f0ca3d2a042d2d06f6e7b Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Sun, 12 Jan 2020 11:49:59 -0800 Subject: [PATCH] [DPP] Read the remote band support EXTRA Bug: 139381558 Test: use demo app (WifiEasyConnect.apk) to send information, observe logs Change-Id: I23a6e90c450c4b094000fb16c3c2f89eea3b0ef9 --- .../wifi/dpp/WifiDppConfiguratorActivity.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java index cb72a6dfb62..b19e3b8c4c9 100644 --- a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java +++ b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java @@ -78,6 +78,16 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements /** The Wi-Fi DPP QR code from intent ACTION_PROCESS_WIFI_EASY_CONNECT_URI */ private WifiQrCode mWifiDppQrCode; + /** + * The remote device's band support obtained as an (optional) extra + * EXTRA_EASY_CONNECT_BAND_LIST from the intent ACTION_PROCESS_WIFI_EASY_CONNECT_URI. + * + * The band support is provided as IEEE 802.11 Global Operating Classes. There may be a single + * or multiple operating classes specified. The array may also be a null if the extra wasn't + * specified. + */ + private int[] mWifiDppRemoteBandSupport; + /** Secret extra that allows fake networks to show in UI for testing purposes */ private boolean mIsTest; @@ -141,9 +151,16 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements final String uriString = (uri == null) ? null : uri.toString(); mIsTest = intent.getBooleanExtra(WifiDppUtils.EXTRA_TEST, false); mWifiDppQrCode = WifiQrCode.getValidWifiDppQrCodeOrNull(uriString); + mWifiDppRemoteBandSupport = intent.getIntArrayExtra( + Settings.EXTRA_EASY_CONNECT_BAND_LIST); // returns null if none final boolean isDppSupported = WifiDppUtils.isWifiDppEnabled(this); if (!isDppSupported) { - Log.d(TAG, "Device doesn't support Wifi DPP"); + Log.e(TAG, + "ACTION_PROCESS_WIFI_EASY_CONNECT_URI for a device that doesn't " + + "support Wifi DPP - use WifiManager#isEasyConnectSupported"); + } + if (mWifiDppQrCode == null) { + Log.e(TAG, "ACTION_PROCESS_WIFI_EASY_CONNECT_URI with null URI!"); } if (mWifiDppQrCode == null || !isDppSupported) { cancelActivity = true;