Source:
<code>public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService, INetworkPolicyManager policyManager, Looper looper, MockableSystemProperties systemProperties, TetheringDependencies deps) { mLog.mark("constructed"); mContext = context; mNMService = nmService; mStatsService = statsService; mPolicyManager = policyManager; mLooper = looper; mSystemProperties = systemProperties; mPublicSync = new Object(); mTetherStates = new ArrayMap<>(); mTetherMasterSM = new TetherMasterSM("TetherMaster", mLooper); mTetherMasterSM.start(); final Handler smHandler = mTetherMasterSM.getHandler(); mOffloadController = new OffloadController(smHandler, deps.getOffloadHardwareInterface(smHandler, mLog), mContext.getContentResolver(), mLog); mUpstreamNetworkMonitor = new UpstreamNetworkMonitor( mContext, mTetherMasterSM, TetherMasterSM.EVENT_UPSTREAM_CALLBACK, mLog); mForwardedDownstreams = new HashSet<>(); mSimChange = new SimChangeListener( mContext, mTetherMasterSM.getHandler(), () -> reevaluateSimCardProvisioning()); mStateReceiver = new StateReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction(UsbManager.ACTION_USB_STATE); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION); filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); mContext.registerReceiver(mStateReceiver, filter, null, mTetherMasterSM.getHandler()); filter = new IntentFilter(); filter.addAction(Intent.ACTION_MEDIA_SHARED); filter.addAction(Intent.ACTION_MEDIA_UNSHARED); filter.addDataScheme("file"); mContext.registerReceiver(mStateReceiver, filter, null, mTetherMasterSM.getHandler()); mUserManagerInternal = LocalServices.getService(UserManagerInternal.class); mUserRestrictionsListener = new TetheringUserRestrictionListener(this); <START> if (mUserManagerInternal != null) <END> mUserManagerInternal.addUserRestrictionsListener(mUserRestrictionsListener); updateConfiguration(); }</code><technical_language>style: add curly braces avoid a "goto fail" (Apple SSL bug) style bug</technical_language>

Target:
public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService, INetworkPolicyManager policyManager, Looper looper, MockableSystemProperties systemProperties, TetheringDependencies deps) { mLog.mark("constructed"); mContext = context; mNMService = nmService; mStatsService = statsService; mPolicyManager = policyManager; mLooper = looper; mSystemProperties = systemProperties; mPublicSync = new Object(); mTetherStates = new ArrayMap<>(); mTetherMasterSM = new TetherMasterSM("TetherMaster", mLooper); mTetherMasterSM.start(); final Handler smHandler = mTetherMasterSM.getHandler(); mOffloadController = new OffloadController(smHandler, deps.getOffloadHardwareInterface(smHandler, mLog), mContext.getContentResolver(), mLog); mUpstreamNetworkMonitor = new UpstreamNetworkMonitor( mContext, mTetherMasterSM, TetherMasterSM.EVENT_UPSTREAM_CALLBACK, mLog); mForwardedDownstreams = new HashSet<>(); mSimChange = new SimChangeListener( mContext, mTetherMasterSM.getHandler(), () -> reevaluateSimCardProvisioning()); mStateReceiver = new StateReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction(UsbManager.ACTION_USB_STATE); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION); filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); mContext.registerReceiver(mStateReceiver, filter, null, mTetherMasterSM.getHandler()); filter = new IntentFilter(); filter.addAction(Intent.ACTION_MEDIA_SHARED); filter.addAction(Intent.ACTION_MEDIA_UNSHARED); filter.addDataScheme("file"); mContext.registerReceiver(mStateReceiver, filter, null, mTetherMasterSM.getHandler()); UserManagerInternal userManagerIntern = LocalServices.getService(UserManagerInternal.class); if (userManagerIntern != null) { userManagerIntern.addUserRestrictionsListener(new TetheringUserRestrictionListener(this)); } updateConfiguration(); }