/framework/java/jd-gui/android/net/ConnectivityManager.java

https://bitbucket.org/chaos_rom/miui_frameworks · Java · 696 lines · 644 code · 48 blank · 4 comment · 40 complexity · a87b651f87c885f2be4dde4b9e99add3 MD5 · raw file

  1. package android.net;
  2. import android.content.Context;
  3. import android.os.Binder;
  4. import android.os.RemoteException;
  5. import com.android.internal.util.Preconditions;
  6. import java.net.InetAddress;
  7. public class ConnectivityManager
  8. {
  9. @Deprecated
  10. public static final String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
  11. public static final String ACTION_TETHER_STATE_CHANGED = "android.net.conn.TETHER_STATE_CHANGED";
  12. public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
  13. public static final String CONNECTIVITY_ACTION_IMMEDIATE = "android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE";
  14. public static final int DEFAULT_NETWORK_PREFERENCE = 1;
  15. public static final String EXTRA_ACTIVE_TETHER = "activeArray";
  16. public static final String EXTRA_AVAILABLE_TETHER = "availableArray";
  17. public static final String EXTRA_ERRORED_TETHER = "erroredArray";
  18. public static final String EXTRA_EXTRA_INFO = "extraInfo";
  19. public static final String EXTRA_INET_CONDITION = "inetCondition";
  20. public static final String EXTRA_IS_FAILOVER = "isFailover";
  21. @Deprecated
  22. public static final String EXTRA_NETWORK_INFO = "networkInfo";
  23. public static final String EXTRA_NO_CONNECTIVITY = "noConnectivity";
  24. public static final String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
  25. public static final String EXTRA_REASON = "reason";
  26. public static final String INET_CONDITION_ACTION = "android.net.conn.INET_CONDITION_ACTION";
  27. public static final int MAX_NETWORK_TYPE = 13;
  28. public static final int MAX_RADIO_TYPE = 13;
  29. private static final String TAG = "ConnectivityManager";
  30. public static final int TETHER_ERROR_DISABLE_NAT_ERROR = 9;
  31. public static final int TETHER_ERROR_ENABLE_NAT_ERROR = 8;
  32. public static final int TETHER_ERROR_IFACE_CFG_ERROR = 10;
  33. public static final int TETHER_ERROR_MASTER_ERROR = 5;
  34. public static final int TETHER_ERROR_NO_ERROR = 0;
  35. public static final int TETHER_ERROR_SERVICE_UNAVAIL = 2;
  36. public static final int TETHER_ERROR_TETHER_IFACE_ERROR = 6;
  37. public static final int TETHER_ERROR_UNAVAIL_IFACE = 4;
  38. public static final int TETHER_ERROR_UNKNOWN_IFACE = 1;
  39. public static final int TETHER_ERROR_UNSUPPORTED = 3;
  40. public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR = 7;
  41. public static final int TYPE_BLUETOOTH = 7;
  42. public static final int TYPE_DUMMY = 8;
  43. public static final int TYPE_ETHERNET = 9;
  44. public static final int TYPE_MOBILE = 0;
  45. public static final int TYPE_MOBILE_CBS = 12;
  46. public static final int TYPE_MOBILE_DUN = 4;
  47. public static final int TYPE_MOBILE_FOTA = 10;
  48. public static final int TYPE_MOBILE_HIPRI = 5;
  49. public static final int TYPE_MOBILE_IMS = 11;
  50. public static final int TYPE_MOBILE_MMS = 2;
  51. public static final int TYPE_MOBILE_SUPL = 3;
  52. public static final int TYPE_NONE = -1;
  53. public static final int TYPE_WIFI = 1;
  54. public static final int TYPE_WIFI_P2P = 13;
  55. public static final int TYPE_WIMAX = 6;
  56. private final IConnectivityManager mService;
  57. public ConnectivityManager(IConnectivityManager paramIConnectivityManager)
  58. {
  59. this.mService = ((IConnectivityManager)Preconditions.checkNotNull(paramIConnectivityManager, "missing IConnectivityManager"));
  60. }
  61. public static ConnectivityManager from(Context paramContext)
  62. {
  63. return (ConnectivityManager)paramContext.getSystemService("connectivity");
  64. }
  65. public static String getNetworkTypeName(int paramInt)
  66. {
  67. String str;
  68. switch (paramInt)
  69. {
  70. default:
  71. str = Integer.toString(paramInt);
  72. case 0:
  73. case 1:
  74. case 2:
  75. case 3:
  76. case 4:
  77. case 5:
  78. case 6:
  79. case 7:
  80. case 8:
  81. case 9:
  82. case 10:
  83. case 11:
  84. case 12:
  85. case 13:
  86. }
  87. while (true)
  88. {
  89. return str;
  90. str = "MOBILE";
  91. continue;
  92. str = "WIFI";
  93. continue;
  94. str = "MOBILE_MMS";
  95. continue;
  96. str = "MOBILE_SUPL";
  97. continue;
  98. str = "MOBILE_DUN";
  99. continue;
  100. str = "MOBILE_HIPRI";
  101. continue;
  102. str = "WIMAX";
  103. continue;
  104. str = "BLUETOOTH";
  105. continue;
  106. str = "DUMMY";
  107. continue;
  108. str = "ETHERNET";
  109. continue;
  110. str = "MOBILE_FOTA";
  111. continue;
  112. str = "MOBILE_IMS";
  113. continue;
  114. str = "MOBILE_CBS";
  115. continue;
  116. str = "WIFI_P2P";
  117. }
  118. }
  119. public static boolean isNetworkTypeMobile(int paramInt)
  120. {
  121. switch (paramInt)
  122. {
  123. case 1:
  124. case 6:
  125. case 7:
  126. case 8:
  127. case 9:
  128. default:
  129. case 0:
  130. case 2:
  131. case 3:
  132. case 4:
  133. case 5:
  134. case 10:
  135. case 11:
  136. case 12:
  137. }
  138. for (boolean bool = false; ; bool = true)
  139. return bool;
  140. }
  141. public static boolean isNetworkTypeValid(int paramInt)
  142. {
  143. if ((paramInt >= 0) && (paramInt <= 13));
  144. for (boolean bool = true; ; bool = false)
  145. return bool;
  146. }
  147. public LinkProperties getActiveLinkProperties()
  148. {
  149. try
  150. {
  151. LinkProperties localLinkProperties2 = this.mService.getActiveLinkProperties();
  152. localLinkProperties1 = localLinkProperties2;
  153. return localLinkProperties1;
  154. }
  155. catch (RemoteException localRemoteException)
  156. {
  157. while (true)
  158. LinkProperties localLinkProperties1 = null;
  159. }
  160. }
  161. public NetworkInfo getActiveNetworkInfo()
  162. {
  163. try
  164. {
  165. NetworkInfo localNetworkInfo2 = this.mService.getActiveNetworkInfo();
  166. localNetworkInfo1 = localNetworkInfo2;
  167. return localNetworkInfo1;
  168. }
  169. catch (RemoteException localRemoteException)
  170. {
  171. while (true)
  172. NetworkInfo localNetworkInfo1 = null;
  173. }
  174. }
  175. public NetworkInfo getActiveNetworkInfoForUid(int paramInt)
  176. {
  177. try
  178. {
  179. NetworkInfo localNetworkInfo2 = this.mService.getActiveNetworkInfoForUid(paramInt);
  180. localNetworkInfo1 = localNetworkInfo2;
  181. return localNetworkInfo1;
  182. }
  183. catch (RemoteException localRemoteException)
  184. {
  185. while (true)
  186. NetworkInfo localNetworkInfo1 = null;
  187. }
  188. }
  189. public NetworkQuotaInfo getActiveNetworkQuotaInfo()
  190. {
  191. try
  192. {
  193. NetworkQuotaInfo localNetworkQuotaInfo2 = this.mService.getActiveNetworkQuotaInfo();
  194. localNetworkQuotaInfo1 = localNetworkQuotaInfo2;
  195. return localNetworkQuotaInfo1;
  196. }
  197. catch (RemoteException localRemoteException)
  198. {
  199. while (true)
  200. NetworkQuotaInfo localNetworkQuotaInfo1 = null;
  201. }
  202. }
  203. public NetworkInfo[] getAllNetworkInfo()
  204. {
  205. try
  206. {
  207. NetworkInfo[] arrayOfNetworkInfo2 = this.mService.getAllNetworkInfo();
  208. arrayOfNetworkInfo1 = arrayOfNetworkInfo2;
  209. return arrayOfNetworkInfo1;
  210. }
  211. catch (RemoteException localRemoteException)
  212. {
  213. while (true)
  214. NetworkInfo[] arrayOfNetworkInfo1 = null;
  215. }
  216. }
  217. @Deprecated
  218. public boolean getBackgroundDataSetting()
  219. {
  220. return true;
  221. }
  222. public ProxyProperties getGlobalProxy()
  223. {
  224. try
  225. {
  226. ProxyProperties localProxyProperties2 = this.mService.getGlobalProxy();
  227. localProxyProperties1 = localProxyProperties2;
  228. return localProxyProperties1;
  229. }
  230. catch (RemoteException localRemoteException)
  231. {
  232. while (true)
  233. ProxyProperties localProxyProperties1 = null;
  234. }
  235. }
  236. public int getLastTetherError(String paramString)
  237. {
  238. try
  239. {
  240. int j = this.mService.getLastTetherError(paramString);
  241. i = j;
  242. return i;
  243. }
  244. catch (RemoteException localRemoteException)
  245. {
  246. while (true)
  247. int i = 2;
  248. }
  249. }
  250. public LinkProperties getLinkProperties(int paramInt)
  251. {
  252. try
  253. {
  254. LinkProperties localLinkProperties2 = this.mService.getLinkProperties(paramInt);
  255. localLinkProperties1 = localLinkProperties2;
  256. return localLinkProperties1;
  257. }
  258. catch (RemoteException localRemoteException)
  259. {
  260. while (true)
  261. LinkProperties localLinkProperties1 = null;
  262. }
  263. }
  264. public boolean getMobileDataEnabled()
  265. {
  266. try
  267. {
  268. boolean bool2 = this.mService.getMobileDataEnabled();
  269. bool1 = bool2;
  270. return bool1;
  271. }
  272. catch (RemoteException localRemoteException)
  273. {
  274. while (true)
  275. boolean bool1 = true;
  276. }
  277. }
  278. public NetworkInfo getNetworkInfo(int paramInt)
  279. {
  280. try
  281. {
  282. NetworkInfo localNetworkInfo2 = this.mService.getNetworkInfo(paramInt);
  283. localNetworkInfo1 = localNetworkInfo2;
  284. return localNetworkInfo1;
  285. }
  286. catch (RemoteException localRemoteException)
  287. {
  288. while (true)
  289. NetworkInfo localNetworkInfo1 = null;
  290. }
  291. }
  292. public int getNetworkPreference()
  293. {
  294. try
  295. {
  296. int j = this.mService.getNetworkPreference();
  297. i = j;
  298. return i;
  299. }
  300. catch (RemoteException localRemoteException)
  301. {
  302. while (true)
  303. int i = -1;
  304. }
  305. }
  306. public ProxyProperties getProxy()
  307. {
  308. try
  309. {
  310. ProxyProperties localProxyProperties2 = this.mService.getProxy();
  311. localProxyProperties1 = localProxyProperties2;
  312. return localProxyProperties1;
  313. }
  314. catch (RemoteException localRemoteException)
  315. {
  316. while (true)
  317. ProxyProperties localProxyProperties1 = null;
  318. }
  319. }
  320. public String[] getTetherableBluetoothRegexs()
  321. {
  322. try
  323. {
  324. String[] arrayOfString2 = this.mService.getTetherableBluetoothRegexs();
  325. arrayOfString1 = arrayOfString2;
  326. return arrayOfString1;
  327. }
  328. catch (RemoteException localRemoteException)
  329. {
  330. while (true)
  331. String[] arrayOfString1 = new String[0];
  332. }
  333. }
  334. public String[] getTetherableIfaces()
  335. {
  336. try
  337. {
  338. String[] arrayOfString2 = this.mService.getTetherableIfaces();
  339. arrayOfString1 = arrayOfString2;
  340. return arrayOfString1;
  341. }
  342. catch (RemoteException localRemoteException)
  343. {
  344. while (true)
  345. String[] arrayOfString1 = new String[0];
  346. }
  347. }
  348. public String[] getTetherableUsbRegexs()
  349. {
  350. try
  351. {
  352. String[] arrayOfString2 = this.mService.getTetherableUsbRegexs();
  353. arrayOfString1 = arrayOfString2;
  354. return arrayOfString1;
  355. }
  356. catch (RemoteException localRemoteException)
  357. {
  358. while (true)
  359. String[] arrayOfString1 = new String[0];
  360. }
  361. }
  362. public String[] getTetherableWifiRegexs()
  363. {
  364. try
  365. {
  366. String[] arrayOfString2 = this.mService.getTetherableWifiRegexs();
  367. arrayOfString1 = arrayOfString2;
  368. return arrayOfString1;
  369. }
  370. catch (RemoteException localRemoteException)
  371. {
  372. while (true)
  373. String[] arrayOfString1 = new String[0];
  374. }
  375. }
  376. public String[] getTetheredIfaces()
  377. {
  378. try
  379. {
  380. String[] arrayOfString2 = this.mService.getTetheredIfaces();
  381. arrayOfString1 = arrayOfString2;
  382. return arrayOfString1;
  383. }
  384. catch (RemoteException localRemoteException)
  385. {
  386. while (true)
  387. String[] arrayOfString1 = new String[0];
  388. }
  389. }
  390. public String[] getTetheringErroredIfaces()
  391. {
  392. try
  393. {
  394. String[] arrayOfString2 = this.mService.getTetheringErroredIfaces();
  395. arrayOfString1 = arrayOfString2;
  396. return arrayOfString1;
  397. }
  398. catch (RemoteException localRemoteException)
  399. {
  400. while (true)
  401. String[] arrayOfString1 = new String[0];
  402. }
  403. }
  404. public boolean isActiveNetworkMetered()
  405. {
  406. try
  407. {
  408. boolean bool2 = this.mService.isActiveNetworkMetered();
  409. bool1 = bool2;
  410. return bool1;
  411. }
  412. catch (RemoteException localRemoteException)
  413. {
  414. while (true)
  415. boolean bool1 = false;
  416. }
  417. }
  418. public boolean isNetworkSupported(int paramInt)
  419. {
  420. try
  421. {
  422. boolean bool2 = this.mService.isNetworkSupported(paramInt);
  423. bool1 = bool2;
  424. return bool1;
  425. }
  426. catch (RemoteException localRemoteException)
  427. {
  428. while (true)
  429. boolean bool1 = false;
  430. }
  431. }
  432. public boolean isTetheringSupported()
  433. {
  434. try
  435. {
  436. boolean bool2 = this.mService.isTetheringSupported();
  437. bool1 = bool2;
  438. return bool1;
  439. }
  440. catch (RemoteException localRemoteException)
  441. {
  442. while (true)
  443. boolean bool1 = false;
  444. }
  445. }
  446. public void reportInetCondition(int paramInt1, int paramInt2)
  447. {
  448. try
  449. {
  450. this.mService.reportInetCondition(paramInt1, paramInt2);
  451. label11: return;
  452. }
  453. catch (RemoteException localRemoteException)
  454. {
  455. break label11;
  456. }
  457. }
  458. public boolean requestNetworkTransitionWakelock(String paramString)
  459. {
  460. try
  461. {
  462. this.mService.requestNetworkTransitionWakelock(paramString);
  463. bool = true;
  464. return bool;
  465. }
  466. catch (RemoteException localRemoteException)
  467. {
  468. while (true)
  469. boolean bool = false;
  470. }
  471. }
  472. public boolean requestRouteToHost(int paramInt1, int paramInt2)
  473. {
  474. InetAddress localInetAddress = NetworkUtils.intToInetAddress(paramInt2);
  475. if (localInetAddress == null);
  476. for (boolean bool = false; ; bool = requestRouteToHostAddress(paramInt1, localInetAddress))
  477. return bool;
  478. }
  479. public boolean requestRouteToHostAddress(int paramInt, InetAddress paramInetAddress)
  480. {
  481. byte[] arrayOfByte = paramInetAddress.getAddress();
  482. try
  483. {
  484. boolean bool2 = this.mService.requestRouteToHostAddress(paramInt, arrayOfByte);
  485. bool1 = bool2;
  486. return bool1;
  487. }
  488. catch (RemoteException localRemoteException)
  489. {
  490. while (true)
  491. boolean bool1 = false;
  492. }
  493. }
  494. @Deprecated
  495. public void setBackgroundDataSetting(boolean paramBoolean)
  496. {
  497. }
  498. public void setDataDependency(int paramInt, boolean paramBoolean)
  499. {
  500. try
  501. {
  502. this.mService.setDataDependency(paramInt, paramBoolean);
  503. label11: return;
  504. }
  505. catch (RemoteException localRemoteException)
  506. {
  507. break label11;
  508. }
  509. }
  510. public void setGlobalProxy(ProxyProperties paramProxyProperties)
  511. {
  512. try
  513. {
  514. this.mService.setGlobalProxy(paramProxyProperties);
  515. label10: return;
  516. }
  517. catch (RemoteException localRemoteException)
  518. {
  519. break label10;
  520. }
  521. }
  522. public void setMobileDataEnabled(boolean paramBoolean)
  523. {
  524. try
  525. {
  526. this.mService.setMobileDataEnabled(paramBoolean);
  527. label10: return;
  528. }
  529. catch (RemoteException localRemoteException)
  530. {
  531. break label10;
  532. }
  533. }
  534. public void setNetworkPreference(int paramInt)
  535. {
  536. try
  537. {
  538. this.mService.setNetworkPreference(paramInt);
  539. label10: return;
  540. }
  541. catch (RemoteException localRemoteException)
  542. {
  543. break label10;
  544. }
  545. }
  546. public boolean setRadio(int paramInt, boolean paramBoolean)
  547. {
  548. try
  549. {
  550. boolean bool2 = this.mService.setRadio(paramInt, paramBoolean);
  551. bool1 = bool2;
  552. return bool1;
  553. }
  554. catch (RemoteException localRemoteException)
  555. {
  556. while (true)
  557. boolean bool1 = false;
  558. }
  559. }
  560. public boolean setRadios(boolean paramBoolean)
  561. {
  562. try
  563. {
  564. boolean bool2 = this.mService.setRadios(paramBoolean);
  565. bool1 = bool2;
  566. return bool1;
  567. }
  568. catch (RemoteException localRemoteException)
  569. {
  570. while (true)
  571. boolean bool1 = false;
  572. }
  573. }
  574. public int setUsbTethering(boolean paramBoolean)
  575. {
  576. try
  577. {
  578. int j = this.mService.setUsbTethering(paramBoolean);
  579. i = j;
  580. return i;
  581. }
  582. catch (RemoteException localRemoteException)
  583. {
  584. while (true)
  585. int i = 2;
  586. }
  587. }
  588. public int startUsingNetworkFeature(int paramInt, String paramString)
  589. {
  590. try
  591. {
  592. int j = this.mService.startUsingNetworkFeature(paramInt, paramString, new Binder());
  593. i = j;
  594. return i;
  595. }
  596. catch (RemoteException localRemoteException)
  597. {
  598. while (true)
  599. int i = -1;
  600. }
  601. }
  602. public int stopUsingNetworkFeature(int paramInt, String paramString)
  603. {
  604. try
  605. {
  606. int j = this.mService.stopUsingNetworkFeature(paramInt, paramString);
  607. i = j;
  608. return i;
  609. }
  610. catch (RemoteException localRemoteException)
  611. {
  612. while (true)
  613. int i = -1;
  614. }
  615. }
  616. public int tether(String paramString)
  617. {
  618. try
  619. {
  620. int j = this.mService.tether(paramString);
  621. i = j;
  622. return i;
  623. }
  624. catch (RemoteException localRemoteException)
  625. {
  626. while (true)
  627. int i = 2;
  628. }
  629. }
  630. public int untether(String paramString)
  631. {
  632. try
  633. {
  634. int j = this.mService.untether(paramString);
  635. i = j;
  636. return i;
  637. }
  638. catch (RemoteException localRemoteException)
  639. {
  640. while (true)
  641. int i = 2;
  642. }
  643. }
  644. }
  645. /* Location: /home/lithium/miui/chameleon/2.11.16/framework_dex2jar.jar
  646. * Qualified Name: android.net.ConnectivityManager
  647. * JD-Core Version: 0.6.2
  648. */