| | | |
Offset 95, 27 lines modified | Offset 95, 27 lines modified |
95 | ····private·final·TetheringNotificationUpdater·mNotificationUpdater; | 95 | ····private·final·TetheringNotificationUpdater·mNotificationUpdater; |
96 | ····private·final·OffloadController·mOffloadController; | 96 | ····private·final·OffloadController·mOffloadController; |
97 | ····private·int·mOffloadStatus; | 97 | ····private·int·mOffloadStatus; |
98 | ····private·final·PrivateAddressCoordinator·mPrivateAddressCoordinator; | 98 | ····private·final·PrivateAddressCoordinator·mPrivateAddressCoordinator; |
99 | ····private·final·Object·mPublicSync; | 99 | ····private·final·Object·mPublicSync; |
100 | ····private·boolean·mRndisEnabled; | 100 | ····private·boolean·mRndisEnabled; |
101 | ····private·final·BroadcastReceiver·mStateReceiver; | 101 | ····private·final·BroadcastReceiver·mStateReceiver; |
102 | ····private·final·StateMachine·mTetherMainSM; | 102 | ····private·final·StateMachine·mTetherMasterSM; |
103 | ····private·final·ArrayMap·mTetherStates; | 103 | ····private·final·ArrayMap·mTetherStates; |
104 | ····private·TetherStatesParcel·mTetherStatesParcel; | 104 | ····private·TetherStatesParcel·mTetherStatesParcel; |
105 | ····private·Network·mTetherUpstream; | 105 | ····private·Network·mTetherUpstream; |
106 | ····private·final·RemoteCallbackList·mTetheringEventCallbacks; | 106 | ····private·final·RemoteCallbackList·mTetheringEventCallbacks; |
107 | ····private·final·Tethering$UserRestrictionActionListener·mTetheringRestriction; | 107 | ····private·final·Tethering$UserRestrictionActionListener·mTetheringRestriction; |
108 | ····private·final·UpstreamNetworkMonitor·mUpstreamNetworkMonitor; | 108 | ····private·final·UpstreamNetworkMonitor·mUpstreamNetworkMonitor; |
109 | ····private·final·UserManager·mUserManager; | 109 | ····private·final·UserManager·mUserManager; |
110 | ····private·String·mWifiP2pTetherInterface; | 110 | ····private·String·mWifiP2pTetherInterface; |
111 | ····private·boolean·mWifiTetherRequested; | 111 | ····private·boolean·mWifiTetherRequested; |
112 | ···· | 112 | ···· |
113 | ····static·{ | 113 | ····static·{ |
114 | ········sMagicDecoderRing·=·MessageUtils.findMessageNames(sMessageClasses·=·new·Class[]·{·Tethering.class,·Tethering$TetherMainSM.class,·IpServer.class·}); | 114 | ········sMagicDecoderRing·=·MessageUtils.findMessageNames(sMessageClasses·=·new·Class[]·{·Tethering.class,·Tethering$TetherMasterSM.class,·IpServer.class·}); |
115 | ····} | 115 | ····} |
116 | ···· | 116 | ···· |
117 | ····public·Tethering(TetheringDependencies·mDeps)·{ | 117 | ····public·Tethering(TetheringDependencies·mDeps)·{ |
118 | ········this.mLog·=·new·SharedLog(Tethering.TAG); | 118 | ········this.mLog·=·new·SharedLog(Tethering.TAG); |
119 | ········this.mTetheringEventCallbacks·=·new·RemoteCallbackList(); | 119 | ········this.mTetheringEventCallbacks·=·new·RemoteCallbackList(); |
120 | ········this.mActiveTetheringRequests·=·new·SparseArray(); | 120 | ········this.mActiveTetheringRequests·=·new·SparseArray(); |
121 | ········this.mActiveDataSubId·=·-1; | 121 | ········this.mActiveDataSubId·=·-1; |
Offset 129, 38 lines modified | Offset 129, 37 lines modified |
129 | ········this.mNetd·=·this.mDeps.getINetd(context); | 129 | ········this.mNetd·=·this.mDeps.getINetd(context); |
130 | ········final·Looper·tetheringLooper·=·this.mDeps.getTetheringLooper(); | 130 | ········final·Looper·tetheringLooper·=·this.mDeps.getTetheringLooper(); |
131 | ········this.mLooper·=·tetheringLooper; | 131 | ········this.mLooper·=·tetheringLooper; |
132 | ········this.mNotificationUpdater·=·this.mDeps.getNotificationUpdater(this.mContext,·tetheringLooper); | 132 | ········this.mNotificationUpdater·=·this.mDeps.getNotificationUpdater(this.mContext,·tetheringLooper); |
133 | ········this.mPublicSync·=·new·Object(); | 133 | ········this.mPublicSync·=·new·Object(); |
134 | ········this.mTetherStates·=·new·ArrayMap(); | 134 | ········this.mTetherStates·=·new·ArrayMap(); |
135 | ········this.mConnectedClientsTracker·=·new·ConnectedClientsTracker(); | 135 | ········this.mConnectedClientsTracker·=·new·ConnectedClientsTracker(); |
136 | ········(this.mTetherMainSM·=·(StateMachine)new·Tethering$TetherMainSM(this,·"TetherMain",·this.mLooper,·mDeps)).start(); | 136 | ········(this.mTetherMasterSM·=·(StateMachine)new·Tethering$TetherMasterSM(this,·"TetherMaster",·this.mLooper,·mDeps)).start(); |
137 | ········final·Handler·handler·=·this.mTetherMainSM.getHandler(); | 137 | ········final·Handler·handler·=·this.mTetherMasterSM.getHandler(); |
138 | ········this.mHandler·=·handler; | 138 | ········this.mHandler·=·handler; |
139 | ········this.mOffloadController·=·this.mDeps.getOffloadController(handler,·this.mLog,·(OffloadController$Dependencies)new·Tethering$1(this)); | 139 | ········this.mOffloadController·=·this.mDeps.getOffloadController(handler,·this.mLog,·(OffloadController$Dependencies)new·Tethering$1(this)); |
140 | ········mDeps·=·this.mDeps; | 140 | ········mDeps·=·this.mDeps; |
141 | ········this.mUpstreamNetworkMonitor·=·mDeps.getUpstreamNetworkMonitor(this.mContext,·this.mTetherMainSM,·this.mLog,·5); | 141 | ········this.mUpstreamNetworkMonitor·=·mDeps.getUpstreamNetworkMonitor(this.mContext,·this.mTetherMasterSM,·this.mLog,·5); |
142 | ········this.mForwardedDownstreams·=·new·LinkedHashSet(); | 142 | ········this.mForwardedDownstreams·=·new·LinkedHashSet(); |
143 | ········final·IntentFilter·intentFilter·=·new·IntentFilter(); | 143 | ········final·IntentFilter·intentFilter·=·new·IntentFilter(); |
144 | ········intentFilter.addAction("android.telephony.action.CARRIER_CONFIG_CHANGED"); | 144 | ········intentFilter.addAction("android.telephony.action.CARRIER_CONFIG_CHANGED"); |
145 | ········mDeps·=·this.mDeps; | 145 | ········mDeps·=·this.mDeps; |
146 | ········(this.mEntitlementMgr·=·mDeps.getEntitlementManager(this.mContext,·this.mHandler,·this.mLog,·(Runnable)new·-$$Lambda$Tethering$kFbDg5fumH6uWvWOX-JoDKX9Zq4(this))).setOnUiEntitlementFailedListener((EntitlementManager$OnUiEntitlementFailedListener)new·-$$Lambda$Tethering$QFNaW1CjiNjZ1tucwWM4UmgI89c(this)); | 146 | ········(this.mEntitlementMgr·=·mDeps.getEntitlementManager(this.mContext,·this.mHandler,·this.mLog,·(Runnable)new·-$$Lambda$Tethering$kFbDg5fumH6uWvWOX-JoDKX9Zq4(this))).setOnUiEntitlementFailedListener((EntitlementManager$OnUiEntitlementFailedListener)new·-$$Lambda$Tethering$QFNaW1CjiNjZ1tucwWM4UmgI89c(this)); |
147 | ········this.mEntitlementMgr.setTetheringConfigurationFetcher((EntitlementManager$TetheringConfigurationFetcher)new·-$$Lambda$Tethering$8-Ib-Vl0fbKc9GA57Tv_pqRMDOs(this)); | 147 | ········this.mEntitlementMgr.setTetheringConfigurationFetcher((EntitlementManager$TetheringConfigurationFetcher)new·-$$Lambda$Tethering$8-Ib-Vl0fbKc9GA57Tv_pqRMDOs(this)); |
148 | ········this.mCarrierConfigChange·=·new·VersionedBroadcastListener("CarrierConfigChangeListener",·this.mContext,·this.mHandler,·intentFilter,·(Consumer)new·-$$Lambda$Tethering$bXlvpAMLdjY8zDVZz31dr37qjos(this)); | 148 | ········this.mCarrierConfigChange·=·new·VersionedBroadcastListener("CarrierConfigChangeListener",·this.mContext,·this.mHandler,·intentFilter,·(Consumer)new·-$$Lambda$Tethering$bXlvpAMLdjY8zDVZz31dr37qjos(this)); |
149 | ········this.mStateReceiver·=·(BroadcastReceiver)new·Tethering$StateReceiver(this,·(Tethering$1)null); | 149 | ········this.mStateReceiver·=·(BroadcastReceiver)new·Tethering$StateReceiver(this,·(Tethering$1)null); |
150 | ········final·UserManager·mUserManager·=·(UserManager)this.mContext.getSystemService("user"); | 150 | ········final·UserManager·mUserManager·=·(UserManager)this.mContext.getSystemService("user"); |
151 | ········this.mUserManager·=·mUserManager; | 151 | ········this.mUserManager·=·mUserManager; |
152 | ········this.mTetheringRestriction·=·new·Tethering$UserRestrictionActionListener(mUserManager,·this,·this.mNotificationUpdater); | 152 | ········this.mTetheringRestriction·=·new·Tethering$UserRestrictionActionListener(mUserManager,·this,·this.mNotificationUpdater); |
153 | ········this.mExecutor·=·new·Tethering$TetheringThreadExecutor(this,·this.mHandler); | 153 | ········this.mExecutor·=·new·Tethering$TetheringThreadExecutor(this,·this.mHandler); |
154 | ········this.mActiveDataSubIdListener·=·new·Tethering$ActiveDataSubIdListener(this,·(Executor)this.mExecutor); | 154 | ········this.mActiveDataSubIdListener·=·new·Tethering$ActiveDataSubIdListener(this,·(Executor)this.mExecutor); |
155 | ········this.mNetdCallback·=·new·Tethering$NetdCallback(this,·(Tethering$1)null); | 155 | ········this.mNetdCallback·=·new·Tethering$NetdCallback(this,·(Tethering$1)null); |
| 156 | ········this.mPrivateAddressCoordinator·=·new·PrivateAddressCoordinator(this.mContext); |
156 | ········this.updateConfiguration(); | 157 | ········this.updateConfiguration(); |
157 | ········mDeps·=·this.mDeps; | 158 | ········mDeps·=·this.mDeps; |
158 | ········this.mPrivateAddressCoordinator·=·mDeps.getPrivateAddressCoordinator(this.mContext,·this.mConfig); | |
159 | ········mDeps·=·this.mDeps; | |
160 | ········this.mBpfCoordinator·=·mDeps.getBpfCoordinator((BpfCoordinator$Dependencies)new·Tethering$2(this)); | 159 | ········this.mBpfCoordinator·=·mDeps.getBpfCoordinator((BpfCoordinator$Dependencies)new·Tethering$2(this)); |
161 | ········this.startStateMachineUpdaters(); | 160 | ········this.startStateMachineUpdaters(); |
162 | ····} | 161 | ····} |
163 | ···· | 162 | ···· |
164 | ····private·static·boolean·argsContain(final·String[]·array,·final·String·s)·{ | 163 | ····private·static·boolean·argsContain(final·String[]·array,·final·String·s)·{ |
165 | ········for·(int·length·=·array.length,·i·=·0;·i·<·length;·++i)·{ | 164 | ········for·(int·length·=·array.length,·i·=·0;·i·<·length;·++i)·{ |
166 | ············if·(s.equals(array[i]))·{ | 165 | ············if·(s.equals(array[i]))·{ |
Offset 349, 15 lines modified | Offset 348, 15 lines modified |
349 | ····} | 348 | ····} |
350 | ···· | 349 | ···· |
351 | ····private·WifiManager·getWifiManager()·{ | 350 | ····private·WifiManager·getWifiManager()·{ |
352 | ········return·(WifiManager)this.mContext.getSystemService("wifi"); | 351 | ········return·(WifiManager)this.mContext.getSystemService("wifi"); |
353 | ····} | 352 | ····} |
354 | ···· | 353 | ···· |
355 | ····private·boolean·hasCallingPermission(final·String·s)·{ | 354 | ····private·boolean·hasCallingPermission(final·String·s)·{ |
356 | ········return·this.mContext.checkCallingOrSelfPermission(s)·==·0; | 355 | ········return·this.mContext.checkCallingPermission(s)·==·0; |
357 | ····} | 356 | ····} |
358 | ···· | 357 | ···· |
359 | ····private·int·ifaceNameToType(final·String·s)·{ | 358 | ····private·int·ifaceNameToType(final·String·s)·{ |
360 | ········final·TetheringConfiguration·mConfig·=·this.mConfig; | 359 | ········final·TetheringConfiguration·mConfig·=·this.mConfig; |
361 | ········if·(mConfig.isWifi(s))·{ | 360 | ········if·(mConfig.isWifi(s))·{ |
362 | ············return·0; | 361 | ············return·0; |
363 | ········} | 362 | ········} |
Offset 455, 45 lines modified | Offset 454, 45 lines modified |
455 | ············int·n3·=·1; | 454 | ············int·n3·=·1; |
456 | ············args[n3]·=·value; | 455 | ············args[n3]·=·value; |
457 | ············final·Integer·value2·=·n; | 456 | ············final·Integer·value2·=·n; |
458 | ············final·int·n4·=·2; | 457 | ············final·int·n4·=·2; |
459 | ············args[n4]·=·value2; | 458 | ············args[n4]·=·value2; |
460 | ············((SharedLog)o).log(String.format("OBSERVED·iface=%s·state=%s·error=%s",·args)); | 459 | ············((SharedLog)o).log(String.format("OBSERVED·iface=%s·state=%s·error=%s",·args)); |
461 | ············if·(n·==·5)·{ | 460 | ············if·(n·==·5)·{ |
462 | ················this.mTetherMainSM.sendMessage(6,·(Object)obj); | 461 | ················this.mTetherMasterSM.sendMessage(6,·(Object)obj); |
463 | ············} | 462 | ············} |
464 | ············if·(i·!=·0·&&·i·!=·n3)·{ | 463 | ············if·(i·!=·0·&&·i·!=·n3)·{ |
465 | ················if·(i·!=·n4·&&·i·!=·n2)·{ | 464 | ················if·(i·!=·n4·&&·i·!=·n2)·{ |
466 | ····················final·String·tag·=·Tethering.TAG; | 465 | ····················final·String·tag·=·Tethering.TAG; |
467 | ····················final·StringBuilder·sb·=·new·StringBuilder(); | 466 | ····················final·StringBuilder·sb·=·new·StringBuilder(); |
468 | ····················sb.append("Unknown·interface·state:·"); | 467 | ····················sb.append("Unknown·interface·state:·"); |
469 | ····················sb.append(i); | 468 | ····················sb.append(i); |
470 | ····················Log.wtf(tag,·sb.toString()); | 469 | ····················Log.wtf(tag,·sb.toString()); |
471 | ····················return; | 470 | ····················return; |
472 | ················} | 471 | ················} |
473 | ············} | 472 | ············} |
474 | ············else·{ | 473 | ············else·{ |
475 | ················n3·=·n4; | 474 | ················n3·=·n4; |
476 | ············} | 475 | ············} |
477 | ············this.mTetherMainSM.sendMessage(n3,·i,·0,·(Object)obj); | 476 | ············this.mTetherMasterSM.sendMessage(n3,·i,·0,·(Object)obj); |
478 | ············this.sendTetherStateChangedBroadcast(); | 477 | ············this.sendTetherStateChangedBroadcast(); |
479 | ········} | 478 | ········} |
480 | ····} | 479 | ····} |
481 | ···· | 480 | ···· |
482 | ····private·void·notifyLinkPropertiesChanged(final·IpServer·obj,·final·LinkProperties·linkProperties)·{ | 481 | ····private·void·notifyLinkPropertiesChanged(final·IpServer·obj,·final·LinkProperties·linkProperties)·{ |
483 | ········final·String·interfaceName·=·obj.interfaceName(); | 482 | ········final·String·interfaceName·=·obj.interfaceName(); |
484 | ········Object·o·=·this.mPublicSync; | 483 | ········Object·o·=·this.mPublicSync; |
485 | ········synchronized·(o)·{ | 484 | ········synchronized·(o)·{ |
486 | ············final·Tethering$TetherState·tethering$TetherState·=·(Tethering$TetherState)this.mTetherStates.get((Object)interfaceName); | 485 | ············final·Tethering$TetherState·tethering$TetherState·=·(Tethering$TetherState)this.mTetherStates.get((Object)interfaceName); |
487 | ············if·(tethering$TetherState·!=·null·&&·tethering$TetherState.ipServer.equals(obj))·{ | 486 | ············if·(tethering$TetherState·!=·null·&&·tethering$TetherState.ipServer.equals(obj))·{ |
488 | ················final·int·lastState·=·tethering$TetherState.lastState; | 487 | ················final·int·lastState·=·tethering$TetherState.lastState; |
489 | ················//·monitorexit(o) | 488 | ················//·monitorexit(o) |
490 | ················o·=·this.mLog; | 489 | ················o·=·this.mLog; |
491 | ················((SharedLog)o).log(String.format("OBSERVED·LinkProperties·update·iface=%s·state=%s·lp=%s",·interfaceName,·IpServer.getStateString(lastState),·linkProperties)); | 490 | ················((SharedLog)o).log(String.format("OBSERVED·LinkProperties·update·iface=%s·state=%s·lp=%s",·interfaceName,·IpServer.getStateString(lastState),·linkProperties)); |
492 | ················this.mTetherMainSM.sendMessage(7,·lastState,·0,·(Object)linkProperties); | 491 | ················this.mTetherMasterSM.sendMessage(7,·lastState,·0,·(Object)linkProperties); |
493 | ················return; | 492 | ················return; |
494 | ············} | 493 | ············} |
495 | ············final·SharedLog·mLog·=·this.mLog; | 494 | ············final·SharedLog·mLog·=·this.mLog; |
496 | ············final·StringBuilder·sb·=·new·StringBuilder(); | 495 | ············final·StringBuilder·sb·=·new·StringBuilder(); |
497 | ············sb.append("got·notification·from·stale·iface·"); | 496 | ············sb.append("got·notification·from·stale·iface·"); |
498 | ············sb.append(interfaceName); | 497 | ············sb.append(interfaceName); |
499 | ············mLog.log(sb.toString()); | 498 | ············mLog.log(sb.toString()); |
Offset 1089, 17 lines modified | Offset 1088, 21 lines modified |
1089 | ················break·Label_0019; | 1088 | ················break·Label_0019; |
1090 | ············} | 1089 | ············} |
1091 | ············try·{ | 1090 | ············try·{ |
1092 | ················this.maybeTrackNewInterfaceLocked(s); | 1091 | ················this.maybeTrackNewInterfaceLocked(s); |
1093 | ················Label_0055:·{ | 1092 | ················Label_0055:·{ |
1094 | ····················return; | 1093 | ····················return; |
1095 | ················} | 1094 | ················} |
1096 | ················//·iftrue(Label_0055:,·this.ifaceNameToType(s)·!=·2·&&·this.ifaceNameToType(s)·!=·6) | 1095 | ················while·(true)·{ |
1097 | ················this.stopTrackingInterfaceLocked(s); | 1096 | ····················this.stopTrackingInterfaceLocked(s); |
| 1097 | ····················return; |
| 1098 | ····················continue; |
| 1099 | ················} |
1098 | ············} | 1100 | ············} |
| 1101 | ············//·iftrue(Label_0055:,·this.ifaceNameToType(s)·!=·2·&&·this.ifaceNameToType(s)·!=·6) |
1099 | ············finally·{ | 1102 | ············finally·{ |
1100 | ············} | 1103 | ············} |
1101 | ············//·monitorexit(mPublicSync) | 1104 | ············//·monitorexit(mPublicSync) |
1102 | ········} | 1105 | ········} |
1103 | ····} | 1106 | ····} |
1104 | ···· | 1107 | ···· |
1105 | ····boolean·isTetherProvisioningRequired()·{ | 1108 | ····boolean·isTetherProvisioningRequired()·{ |