Merge "Check whether the device support DPP for public intent"
This commit is contained in:
committed by
Android (Google) Code Review
commit
61447c7b88
@@ -142,7 +142,11 @@ public class WifiDppConfiguratorActivity extends InstrumentedActivity implements
|
|||||||
case ACTION_PROCESS_WIFI_DPP_QR_CODE:
|
case ACTION_PROCESS_WIFI_DPP_QR_CODE:
|
||||||
String qrCode = intent.getStringExtra(WifiDppUtils.EXTRA_QR_CODE);
|
String qrCode = intent.getStringExtra(WifiDppUtils.EXTRA_QR_CODE);
|
||||||
mWifiDppQrCode = getValidWifiDppQrCodeOrNull(qrCode);
|
mWifiDppQrCode = getValidWifiDppQrCodeOrNull(qrCode);
|
||||||
if (mWifiDppQrCode == null) {
|
final boolean isDppSupported = WifiDppUtils.isWifiDppEnabled(this);
|
||||||
|
if (!isDppSupported) {
|
||||||
|
Log.d(TAG, "Device doesn't support Wifi DPP");
|
||||||
|
}
|
||||||
|
if (mWifiDppQrCode == null || !isDppSupported) {
|
||||||
cancelActivity = true;
|
cancelActivity = true;
|
||||||
} else {
|
} else {
|
||||||
showChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
|
showChooseSavedWifiNetworkFragment(/* addToBackStack */ false);
|
||||||
|
@@ -78,6 +78,14 @@ public class WifiDppUtils {
|
|||||||
com.android.settings.core.FeatureFlags.WIFI_SHARING);
|
com.android.settings.core.FeatureFlags.WIFI_SHARING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the device support WiFi DPP.
|
||||||
|
*/
|
||||||
|
public static boolean isWifiDppEnabled(Context context) {
|
||||||
|
final WifiManager manager = context.getSystemService(WifiManager.class);
|
||||||
|
return manager.isEasyConnectSupported();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an intent to launch QR code scanner for Wi-Fi DPP enrollee.
|
* Returns an intent to launch QR code scanner for Wi-Fi DPP enrollee.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user