Fix crash issue when click 'Share' button

Hide 'Share' button if access point return null wifi config.

Change-Id: I554ce8c3214c94892d57c213d0588c70aad97439
Fixes: 123172888
Test: robotests
This commit is contained in:
Johnson Lu
2019-01-21 17:30:25 +08:00
parent 61447c7b88
commit 69b31596a2
2 changed files with 14 additions and 4 deletions

View File

@@ -685,6 +685,15 @@ public class WifiDetailPreferenceControllerTest {
verify(mockButtonsPref).setButton1Visible(false);
}
@Test
public void canShareNetwork_noNetwork() {
when(mockAccessPoint.getConfig()).thenReturn(null);
displayAndResume();
verify(mockButtonsPref).setButton3Visible(false);
}
@Test
public void canModifyNetwork_saved() {
assertThat(mController.canModifyNetwork()).isTrue();