Loading src/com/android/settings/wifi/WifiNoInternetDialog.java +3 −3 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ public final class WifiNoInternetDialog extends AlertActivity implements private boolean mButtonClicked; private boolean isKnownAction(Intent intent) { return intent.getAction().equals(ACTION_PROMPT_UNVALIDATED) || intent.getAction().equals(ACTION_PROMPT_LOST_VALIDATION) || intent.getAction().equals(ACTION_PROMPT_PARTIAL_CONNECTIVITY); return ACTION_PROMPT_UNVALIDATED.equals(intent.getAction()) || ACTION_PROMPT_LOST_VALIDATION.equals(intent.getAction()) || ACTION_PROMPT_PARTIAL_CONNECTIVITY.equals(intent.getAction()); } @Override Loading src/com/android/settings/wifi/WifiScanModeActivity.java +2 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ public class WifiScanModeActivity extends FragmentActivity { super.onCreate(savedInstanceState); Intent intent = getIntent(); if (savedInstanceState == null) { if (intent != null && intent.getAction() .equals(WifiManager.ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE)) { if (intent != null && WifiManager.ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE .equals(intent.getAction())) { ApplicationInfo ai; mApp = getCallingPackage(); try { Loading src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java +7 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java +7 −1 Original line number Diff line number Diff line Loading @@ -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); Loading tests/robotests/src/com/android/settings/wifi/WifiNoInternetDialogTest.java 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.android.settings.wifi; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; @RunWith(RobolectricTestRunner.class) public class WifiNoInternetDialogTest { @Test public void launchActivity_noIntentAction_shouldNotFatalException() { WifiNoInternetDialog wifiNoInternetDialog = Robolectric.setupActivity(WifiNoInternetDialog.class); } } Loading
src/com/android/settings/wifi/WifiNoInternetDialog.java +3 −3 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ public final class WifiNoInternetDialog extends AlertActivity implements private boolean mButtonClicked; private boolean isKnownAction(Intent intent) { return intent.getAction().equals(ACTION_PROMPT_UNVALIDATED) || intent.getAction().equals(ACTION_PROMPT_LOST_VALIDATION) || intent.getAction().equals(ACTION_PROMPT_PARTIAL_CONNECTIVITY); return ACTION_PROMPT_UNVALIDATED.equals(intent.getAction()) || ACTION_PROMPT_LOST_VALIDATION.equals(intent.getAction()) || ACTION_PROMPT_PARTIAL_CONNECTIVITY.equals(intent.getAction()); } @Override Loading
src/com/android/settings/wifi/WifiScanModeActivity.java +2 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ public class WifiScanModeActivity extends FragmentActivity { super.onCreate(savedInstanceState); Intent intent = getIntent(); if (savedInstanceState == null) { if (intent != null && intent.getAction() .equals(WifiManager.ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE)) { if (intent != null && WifiManager.ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE .equals(intent.getAction())) { ApplicationInfo ai; mApp = getCallingPackage(); try { Loading
src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java +7 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java +7 −1 Original line number Diff line number Diff line Loading @@ -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); Loading
tests/robotests/src/com/android/settings/wifi/WifiNoInternetDialogTest.java 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.android.settings.wifi; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; @RunWith(RobolectricTestRunner.class) public class WifiNoInternetDialogTest { @Test public void launchActivity_noIntentAction_shouldNotFatalException() { WifiNoInternetDialog wifiNoInternetDialog = Robolectric.setupActivity(WifiNoInternetDialog.class); } }