Loading services/core/java/com/android/server/ConnectivityService.java +1 −13 Original line number Diff line number Diff line Loading @@ -816,7 +816,7 @@ public class ConnectivityService extends IConnectivityManager.Stub mTestMode = SystemProperties.get("cm.test.mode").equals("true") && SystemProperties.get("ro.build.type").equals("eng"); mTethering = new Tethering(mContext, mNetd, statsService); mTethering = new Tethering(mContext, mNetd, statsService, mPolicyManager); mPermissionMonitor = new PermissionMonitor(mContext, mNetd); Loading Loading @@ -3036,12 +3036,6 @@ public class ConnectivityService extends IConnectivityManager.Stub ConnectivityManager.enforceTetherChangePermission(mContext); if (isTetheringSupported()) { final int status = mTethering.tether(iface); if (status == ConnectivityManager.TETHER_ERROR_NO_ERROR) { try { mPolicyManager.onTetheringChanged(iface, true); } catch (RemoteException e) { } } return status; } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; Loading @@ -3055,12 +3049,6 @@ public class ConnectivityService extends IConnectivityManager.Stub if (isTetheringSupported()) { final int status = mTethering.untether(iface); if (status == ConnectivityManager.TETHER_ERROR_NO_ERROR) { try { mPolicyManager.onTetheringChanged(iface, false); } catch (RemoteException e) { } } return status; } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; Loading services/core/java/com/android/server/connectivity/Tethering.java +14 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.content.res.Resources; import android.hardware.usb.UsbManager; import android.net.ConnectivityManager; import android.net.ConnectivityManager.NetworkCallback; import android.net.INetworkPolicyManager; import android.net.INetworkStatsService; import android.net.LinkProperties; import android.net.Network; Loading @@ -49,6 +50,7 @@ import android.os.INetworkManagementService; import android.os.Looper; import android.os.Message; import android.os.Parcel; import android.os.RemoteException; import android.os.ResultReceiver; import android.os.SystemProperties; import android.os.UserHandle; Loading Loading @@ -123,6 +125,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering private final INetworkManagementService mNMService; private final INetworkStatsService mStatsService; private final INetworkPolicyManager mPolicyManager; private final Looper mLooper; private static class TetherState { Loading Loading @@ -177,10 +180,11 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering private boolean mWifiTetherRequested; public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService) { INetworkStatsService statsService, INetworkPolicyManager policyManager) { mContext = context; mNMService = nmService; mStatsService = statsService; mPolicyManager = policyManager; mPublicSync = new Object(); Loading Loading @@ -1908,6 +1912,15 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering " with error " + error); } try { // Notify that we're tethering (or not) this interface. // This is how data saver for instance knows if the user explicitly // turned on tethering (thus keeping us from being in data saver mode). mPolicyManager.onTetheringChanged(iface, state == IControlsTethering.STATE_TETHERED); } catch (RemoteException e) { // Not really very much we can do here. } switch (state) { case IControlsTethering.STATE_UNAVAILABLE: case IControlsTethering.STATE_AVAILABLE: Loading Loading
services/core/java/com/android/server/ConnectivityService.java +1 −13 Original line number Diff line number Diff line Loading @@ -816,7 +816,7 @@ public class ConnectivityService extends IConnectivityManager.Stub mTestMode = SystemProperties.get("cm.test.mode").equals("true") && SystemProperties.get("ro.build.type").equals("eng"); mTethering = new Tethering(mContext, mNetd, statsService); mTethering = new Tethering(mContext, mNetd, statsService, mPolicyManager); mPermissionMonitor = new PermissionMonitor(mContext, mNetd); Loading Loading @@ -3036,12 +3036,6 @@ public class ConnectivityService extends IConnectivityManager.Stub ConnectivityManager.enforceTetherChangePermission(mContext); if (isTetheringSupported()) { final int status = mTethering.tether(iface); if (status == ConnectivityManager.TETHER_ERROR_NO_ERROR) { try { mPolicyManager.onTetheringChanged(iface, true); } catch (RemoteException e) { } } return status; } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; Loading @@ -3055,12 +3049,6 @@ public class ConnectivityService extends IConnectivityManager.Stub if (isTetheringSupported()) { final int status = mTethering.untether(iface); if (status == ConnectivityManager.TETHER_ERROR_NO_ERROR) { try { mPolicyManager.onTetheringChanged(iface, false); } catch (RemoteException e) { } } return status; } else { return ConnectivityManager.TETHER_ERROR_UNSUPPORTED; Loading
services/core/java/com/android/server/connectivity/Tethering.java +14 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.content.res.Resources; import android.hardware.usb.UsbManager; import android.net.ConnectivityManager; import android.net.ConnectivityManager.NetworkCallback; import android.net.INetworkPolicyManager; import android.net.INetworkStatsService; import android.net.LinkProperties; import android.net.Network; Loading @@ -49,6 +50,7 @@ import android.os.INetworkManagementService; import android.os.Looper; import android.os.Message; import android.os.Parcel; import android.os.RemoteException; import android.os.ResultReceiver; import android.os.SystemProperties; import android.os.UserHandle; Loading Loading @@ -123,6 +125,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering private final INetworkManagementService mNMService; private final INetworkStatsService mStatsService; private final INetworkPolicyManager mPolicyManager; private final Looper mLooper; private static class TetherState { Loading Loading @@ -177,10 +180,11 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering private boolean mWifiTetherRequested; public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService) { INetworkStatsService statsService, INetworkPolicyManager policyManager) { mContext = context; mNMService = nmService; mStatsService = statsService; mPolicyManager = policyManager; mPublicSync = new Object(); Loading Loading @@ -1908,6 +1912,15 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering " with error " + error); } try { // Notify that we're tethering (or not) this interface. // This is how data saver for instance knows if the user explicitly // turned on tethering (thus keeping us from being in data saver mode). mPolicyManager.onTetheringChanged(iface, state == IControlsTethering.STATE_TETHERED); } catch (RemoteException e) { // Not really very much we can do here. } switch (state) { case IControlsTethering.STATE_UNAVAILABLE: case IControlsTethering.STATE_AVAILABLE: Loading