Sfoglia il codice sorgente

删除ping百度,直接视为有网络

zengjiebin 7 anni fa
parent
commit
705829c1e9
1 ha cambiato i file con 11 aggiunte e 10 eliminazioni
  1. 11 10
      app/src/main/java/com/sheep/gamegroup/util/SysAppUtil.java

+ 11 - 10
app/src/main/java/com/sheep/gamegroup/util/SysAppUtil.java

@@ -246,16 +246,17 @@ public class SysAppUtil {
                 .map(new Func1<Integer, Integer>() {
                     @Override
                     public Integer call(Integer integer) {
-                        int result = -1;
-                        Runtime runtime = Runtime.getRuntime();
-                        try {
-                            Process p = runtime.exec("ping -c 1 -w 2 www.baidu.com");//-c 1,表示只发送一个icmp echo_request 包  -w 1 表示等待1s
-                            result = p.waitFor();
-                            LogUtil.println("ping", "Process:"+result);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                        return result;
+//                        int result = -1;
+//                        Runtime runtime = Runtime.getRuntime();
+//                        try {
+//                            Process p = runtime.exec("ping -c 1 -w 2 www.baidu.com");//-c 1,表示只发送一个icmp echo_request 包  -w 1 表示等待1s
+//                            result = p.waitFor();
+//                            LogUtil.println("ping", "Process:"+result);
+//                        } catch (Exception e) {
+//                            e.printStackTrace();
+//                        }
+//                        return result;
+                        return 0;
                     }
                 })
                 .subscribeOn(Schedulers.io())