Loading services/core/java/com/android/server/NetworkManagementService.java +9 −13 Original line number Diff line number Diff line Loading @@ -641,12 +641,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0"); try { mConnector.execute("strict", "enable"); mStrictEnabled = true; } catch (NativeDaemonConnectorException e) { Log.wtf(TAG, "Failed strict enable", e); } setDataSaverModeEnabled(mDataSaverMode); Loading Loading @@ -1804,26 +1799,26 @@ public class NetworkManagementService extends INetworkManagementService.Stub } private void applyUidCleartextNetworkPolicy(int uid, int policy) { final String policyString; final int policyValue; switch (policy) { case StrictMode.NETWORK_POLICY_ACCEPT: policyString = "accept"; policyValue = INetd.PENALTY_POLICY_ACCEPT; break; case StrictMode.NETWORK_POLICY_LOG: policyString = "log"; policyValue = INetd.PENALTY_POLICY_LOG; break; case StrictMode.NETWORK_POLICY_REJECT: policyString = "reject"; policyValue = INetd.PENALTY_POLICY_REJECT; break; default: throw new IllegalArgumentException("Unknown policy " + policy); } try { mConnector.execute("strict", "set_uid_cleartext_policy", uid, policyString); mNetdService.strictUidCleartextPenalty(uid, policyValue); mUidCleartextPolicy.put(uid, policy); } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } } Loading @@ -1841,6 +1836,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub return; } // TODO: remove this code after removing prepareNativeDaemon() if (!mStrictEnabled) { // Module isn't enabled yet; stash the requested policy away to // apply later once the daemon is connected. Loading Loading
services/core/java/com/android/server/NetworkManagementService.java +9 −13 Original line number Diff line number Diff line Loading @@ -641,12 +641,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0"); try { mConnector.execute("strict", "enable"); mStrictEnabled = true; } catch (NativeDaemonConnectorException e) { Log.wtf(TAG, "Failed strict enable", e); } setDataSaverModeEnabled(mDataSaverMode); Loading Loading @@ -1804,26 +1799,26 @@ public class NetworkManagementService extends INetworkManagementService.Stub } private void applyUidCleartextNetworkPolicy(int uid, int policy) { final String policyString; final int policyValue; switch (policy) { case StrictMode.NETWORK_POLICY_ACCEPT: policyString = "accept"; policyValue = INetd.PENALTY_POLICY_ACCEPT; break; case StrictMode.NETWORK_POLICY_LOG: policyString = "log"; policyValue = INetd.PENALTY_POLICY_LOG; break; case StrictMode.NETWORK_POLICY_REJECT: policyString = "reject"; policyValue = INetd.PENALTY_POLICY_REJECT; break; default: throw new IllegalArgumentException("Unknown policy " + policy); } try { mConnector.execute("strict", "set_uid_cleartext_policy", uid, policyString); mNetdService.strictUidCleartextPenalty(uid, policyValue); mUidCleartextPolicy.put(uid, policy); } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } } Loading @@ -1841,6 +1836,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub return; } // TODO: remove this code after removing prepareNativeDaemon() if (!mStrictEnabled) { // Module isn't enabled yet; stash the requested policy away to // apply later once the daemon is connected. Loading