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

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16986446

Change-Id: Ic323b7acee01ff8c7526ea10804de1395bd92f93
This commit is contained in:
TreeHugger Robot
2022-03-07 07:00:55 +00:00
committed by Automerger Merge Worker
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();