summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Chen <jimmycmchen@google.com>2020-04-23 15:47:26 +0800
committerJimmy Chen <jimmycmchen@google.com>2020-04-24 02:02:41 +0000
commit031472fc8b1a0ca1f9e7bd0fd54156fb48cc24f1 (patch)
treeafe9d2dc725bc28508bc79e21dab0423cbd02b2a
parentbf5903c9c270c329aa2eaffcf777ce72752d7021 (diff)
p2p: broadcast p2p state change on interface destroy
When softap or nan are launched, p2p interface will be destroyed. However, there is no indication to the applications and. This would result in applications not being aware of p2p stop. Bug: 154471275 Test: atest FrameworksWifiTests CtsVerifier - Wi-Fi Direct CtsVerifier - Wi-Fi Aware Change-Id: If2999303fd9320cc55600a468886977747f59ba0
-rw-r--r--service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
index 00c58aa78..b65ac643a 100644
--- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
+++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
@@ -858,9 +858,6 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
// Register for interface availability from HalDeviceManager
mWifiNative.registerInterfaceAvailableListener((boolean isAvailable) -> {
mIsHalInterfaceAvailable = isAvailable;
- if (isAvailable) {
- checkAndReEnableP2p();
- }
checkAndSendP2pStateChangedBroadcast();
}, getHandler());
@@ -1390,7 +1387,9 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
break;
}
mInterfaceName = mWifiNative.setupInterface((String ifaceName) -> {
+ mIsHalInterfaceAvailable = false;
sendMessage(DISABLE_P2P);
+ checkAndSendP2pStateChangedBroadcast();
}, getHandler());
if (mInterfaceName == null) {
Log.e(TAG, "Failed to setup interface for P2P");