Quellcode durchsuchen

do not use P2P Wifi connections. Fixes issue on samsung

Cristiano Coelho vor 5 Jahren
Ursprung
Commit
52aa5ecd7a
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5
    2
      android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 5
- 2
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java Datei anzeigen

@@ -252,8 +252,11 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
252 252
                             continue;
253 253
                         }
254 254
 
255
-                        // netinfo is deprecated
256
-                        //if (netInfo.getType() == ConnectivityManager.TYPE_WIFI && netInfo.getState() == NetworkInfo.State.CONNECTED) {
255
+                        // Don't use P2P Wi-Fi on recent samsung devices
256
+                        if(caps.hasTransport(NetworkCapabilities.NET_CAPABILITY_WIFI_P2P)){
257
+                            continue;
258
+                        }
259
+
257 260
                         if(caps.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)){
258 261
                             clientBuilder.proxy(Proxy.NO_PROXY);
259 262
                             clientBuilder.socketFactory(network.getSocketFactory());