Show security info in saved network list
When an access point linked to a saved network is not found, security info should be shown in dialog of saved network. Notes that in Android N this list is created with saved networks and scan result, and that causes security info is not shown for access points seen around user, but in Android O only saved networks are used to create a list. That means security info is shown for all access points listed in the screen. Bug: 38102896 Test: make RunSettingsRoboTests Change-Id: Ia0c5184ae7a1325f2628f4c08e29350c5793a08f (cherry-pick of a8382c11f58ecbfbc5b8d908b97c53d59cf774fe)
This commit is contained in:
@@ -16,10 +16,6 @@
|
||||
|
||||
package com.android.settings.wifi;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -40,6 +36,9 @@ import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
|
||||
shadows = ShadowConnectivityManager.class)
|
||||
@@ -109,6 +108,7 @@ public class WifiConfigControllerTest {
|
||||
when(mAccessPoint.isSaved()).thenReturn(true);
|
||||
assertThat(mController.isSubmittable()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSubmittable_nullAccessPoint_noException() {
|
||||
mController = new TestWifiConfigController(mConfigUiBase, mView, null,
|
||||
@@ -116,6 +116,13 @@ public class WifiConfigControllerTest {
|
||||
mController.isSubmittable();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSignalString_notReachable_shouldHaveNoSignalString() {
|
||||
when(mAccessPoint.isReachable()).thenReturn(false);
|
||||
|
||||
assertThat(mController.getSignalString()).isNull();
|
||||
}
|
||||
|
||||
public class TestWifiConfigController extends WifiConfigController {
|
||||
|
||||
public TestWifiConfigController(WifiConfigUiBase parent, View view,
|
||||
|
Reference in New Issue
Block a user