Merge "[Wi-Fi] Prevent fatal exception for null intent action"

This commit is contained in:
TreeHugger Robot
2019-08-22 09:51:01 +00:00
committed by Android (Google) Code Review
8 changed files with 143 additions and 7 deletions

View File

@@ -109,9 +109,15 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements
@Override
protected void handleIntent(Intent intent) {
String action = intent != null ? intent.getAction() : null;
if (action == null) {
finish();
return;
}
boolean cancelActivity = false;
WifiNetworkConfig config;
switch (intent.getAction()) {
switch (action) {
case ACTION_CONFIGURATOR_QR_CODE_SCANNER:
config = WifiNetworkConfig.getValidConfigOrNull(intent);
if (config == null) {

View File

@@ -44,7 +44,13 @@ public class WifiDppEnrolleeActivity extends WifiDppBaseActivity implements
@Override
protected void handleIntent(Intent intent) {
switch (intent.getAction()) {
String action = intent != null ? intent.getAction() : null;
if (action == null) {
finish();
return;
}
switch (action) {
case ACTION_ENROLLEE_QR_CODE_SCANNER:
String ssid = intent.getStringExtra(WifiDppUtils.EXTRA_WIFI_SSID);
showQrCodeScannerFragment(ssid);