From cfd438e0fdaef4a4ed63dc529f0151ce114c925b Mon Sep 17 00:00:00 2001 From: Christopher Wiley Date: Fri, 16 Sep 2016 11:14:36 -0700 Subject: [PATCH] Notify NetworkPolicyManagerService on tethering changes (cherry-pick of d73faf07606d40d3915d22a72fa14f7ba956d459) No longer do this in ConnectivityService#tether/untether. Instead, have Tethering do it when an interface is actually tethered. Bug: 31405407 Test: Toggling hotspot now disables data saver Change-Id: I9910a2e488c30c92d45f817c8f5df0fac5510de6 --- .../com/android/server/ConnectivityService.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index b7dfd19627..c61a90b2e6 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -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); @@ -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; @@ -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;