Merge "p2p: Close the channel when onStop is called." into tm-dev

This commit is contained in:
TreeHugger Robot
2022-03-07 06:40:05 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 3 deletions

View File

@@ -319,12 +319,18 @@ public class WifiP2pSettingsTest {
assertThat(mFragment.onCreateDialog(-1 /* id */)).isNull();
}
@Test
public void onStop_notLastGroupFormed_shouldCloseChannel() {
mFragment.onStop();
assertThat(mFragment.mChannel).isNull();
}
@Test
public void peerDiscovery_whenOnPause_shouldStop() {
mFragment.onPause();
verify(mWifiP2pManager, times(1)).stopPeerDiscovery(any(), any());
assertThat(mFragment.mChannel).isNull();
}
@Test
@@ -332,7 +338,6 @@ public class WifiP2pSettingsTest {
mFragment.onPause();
verify(mWifiP2pManager, times(1)).stopPeerDiscovery(any(), any());
assertThat(mFragment.mChannel).isNull();
mFragment.onResume();
assertThat(mFragment.mChannel).isNotNull();