summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/p2p/WifiP2pNative.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pNative.java b/service/java/com/android/server/wifi/p2p/WifiP2pNative.java
index 07ee11e3b..de608b133 100644
--- a/service/java/com/android/server/wifi/p2p/WifiP2pNative.java
+++ b/service/java/com/android/server/wifi/p2p/WifiP2pNative.java
@@ -24,6 +24,7 @@ import android.net.wifi.p2p.WifiP2pGroup;
import android.net.wifi.p2p.WifiP2pGroupList;
import android.net.wifi.p2p.nsd.WifiP2pServiceInfo;
import android.os.Handler;
+import android.text.TextUtils;
import android.util.Log;
import com.android.server.wifi.HalDeviceManager;
@@ -190,7 +191,13 @@ public class WifiP2pNative {
teardownInterface();
return null;
}
- if (!mSupplicantP2pIfaceHal.setupIface(HalDeviceManager.getName(mIWifiP2pIface))) {
+ String ifaceName = HalDeviceManager.getName(mIWifiP2pIface);
+ if (TextUtils.isEmpty(ifaceName)) {
+ Log.e(TAG, "Failed to get p2p iface name");
+ teardownInterface();
+ return null;
+ }
+ if (!mSupplicantP2pIfaceHal.setupIface(ifaceName)) {
Log.e(TAG, "Failed to setup P2p iface in supplicant");
teardownInterface();
return null;