diff options
author | Jimmy Chen <jimmycmchen@google.com> | 2019-03-18 02:17:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-03-18 02:17:15 +0000 |
commit | 49699036a7956b28c9183a12132942b965927f1f (patch) | |
tree | 0b30a401ac9f513048cf4e3b3aabdd6438cc0c82 | |
parent | 23fbc914af24385ddf4bf6567cb01bc3f73fe360 (diff) | |
parent | 613eb9b8498edfe97b92f34d2045c499a86aecbf (diff) |
Merge "Add null check on getting p2p iface name"
-rw-r--r-- | service/java/com/android/server/wifi/p2p/WifiP2pNative.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pNative.java b/service/java/com/android/server/wifi/p2p/WifiP2pNative.java index 58ebb60e8..7eba9d34c 100644 --- a/service/java/com/android/server/wifi/p2p/WifiP2pNative.java +++ b/service/java/com/android/server/wifi/p2p/WifiP2pNative.java @@ -17,6 +17,7 @@ package com.android.server.wifi.p2p; import android.annotation.NonNull; +import android.annotation.Nullable; import android.hardware.wifi.V1_0.IWifiP2pIface; import android.hardware.wifi.V1_0.IfaceType; import android.net.wifi.p2p.WifiP2pConfig; @@ -87,8 +88,10 @@ public class WifiP2pNative { mValid = true; } - public void teardownAndInvalidate(@NonNull String ifaceName) { - mSupplicantP2pIfaceHal.teardownIface(ifaceName); + public void teardownAndInvalidate(@Nullable String ifaceName) { + if (!TextUtils.isEmpty(ifaceName)) { + mSupplicantP2pIfaceHal.teardownIface(ifaceName); + } mIWifiP2pIface = null; mValid = false; } |