Show security screen for ACTION_PROCESS_WIFI_EASY_CONNECT_URI intent
Bug: 183181987 Test: manual test make RunSettingsRoboTests ROBOTEST_FILTER=WifiDppConfiguratorActivityTest Change-Id: I26e97142cc1c30909bd14eb85d466442274446a9
This commit is contained in:
@@ -144,31 +144,8 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Settings.ACTION_PROCESS_WIFI_EASY_CONNECT_URI:
|
case Settings.ACTION_PROCESS_WIFI_EASY_CONNECT_URI:
|
||||||
final Uri uri = intent.getData();
|
WifiDppUtils.showLockScreen(this,
|
||||||
final String uriString = (uri == null) ? null : uri.toString();
|
() -> handleActionProcessWifiEasyConnectUriIntent(intent));
|
||||||
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.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;
|
|
||||||
} else {
|
|
||||||
final WifiNetworkConfig connectedConfig = getConnectedWifiNetworkConfigOrNull();
|
|
||||||
if (connectedConfig == null || !connectedConfig.isSupportWifiDpp(this)) {
|
|
||||||
showChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
|
|
||||||
} else {
|
|
||||||
mWifiNetworkConfig = connectedConfig;
|
|
||||||
showAddDeviceFragment(/* addToBackStack */ false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cancelActivity = true;
|
cancelActivity = true;
|
||||||
@@ -180,6 +157,34 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleActionProcessWifiEasyConnectUriIntent(Intent intent) {
|
||||||
|
final Uri uri = intent.getData();
|
||||||
|
final String uriString = (uri == null) ? null : uri.toString();
|
||||||
|
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.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) {
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
final WifiNetworkConfig connectedConfig = getConnectedWifiNetworkConfigOrNull();
|
||||||
|
if (connectedConfig == null || !connectedConfig.isSupportWifiDpp(this)) {
|
||||||
|
showChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
|
||||||
|
} else {
|
||||||
|
mWifiNetworkConfig = connectedConfig;
|
||||||
|
showAddDeviceFragment(/* addToBackStack */ false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void showQrCodeScannerFragment() {
|
private void showQrCodeScannerFragment() {
|
||||||
WifiDppQrCodeScannerFragment fragment =
|
WifiDppQrCodeScannerFragment fragment =
|
||||||
(WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag(
|
(WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag(
|
||||||
|
Reference in New Issue
Block a user