Loading services/java/com/android/server/net/NetworkPolicyManagerService.java +5 −15 Original line number Original line Diff line number Diff line Loading @@ -225,8 +225,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { /** Set of currently active {@link Notification} tags. */ /** Set of currently active {@link Notification} tags. */ private HashSet<String> mActiveNotifs = Sets.newHashSet(); private HashSet<String> mActiveNotifs = Sets.newHashSet(); /** Current values from {@link #setPolicyDataEnable(int, boolean)}. */ private SparseBooleanArray mActiveNetworkEnabled = new SparseBooleanArray(); /** Foreground at both UID and PID granularity. */ /** Foreground at both UID and PID granularity. */ private SparseBooleanArray mUidForeground = new SparseBooleanArray(); private SparseBooleanArray mUidForeground = new SparseBooleanArray(); Loading Loading @@ -1519,22 +1517,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } } /** /** * Control {@link IConnectivityManager#setPolicyDataEnable(int, boolean)}, * Control {@link IConnectivityManager#setPolicyDataEnable(int, boolean)}. * dispatching only when actually changed. */ */ private void setPolicyDataEnable(int networkType, boolean enabled) { private void setPolicyDataEnable(int networkType, boolean enabled) { synchronized (mActiveNetworkEnabled) { final boolean prevEnabled = mActiveNetworkEnabled.get(networkType, true); if (prevEnabled == enabled) return; try { try { mConnManager.setPolicyDataEnable(networkType, enabled); mConnManager.setPolicyDataEnable(networkType, enabled); } catch (RemoteException e) { } catch (RemoteException e) { // ignored; service lives in system_server // ignored; service lives in system_server } } mActiveNetworkEnabled.put(networkType, enabled); } } } private String getActiveSubscriberId() { private String getActiveSubscriberId() { Loading telephony/java/com/android/internal/telephony/DataConnectionTracker.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -167,7 +167,9 @@ public abstract class DataConnectionTracker extends Handler { // independent of mInternalDataEnabled and requests for APN access // independent of mInternalDataEnabled and requests for APN access // persisted // persisted protected boolean mUserDataEnabled = true; protected boolean mUserDataEnabled = true; protected boolean mPolicyDataEnabled = true; // TODO: move away from static state once 5587429 is fixed. protected static boolean sPolicyDataEnabled = true; private boolean[] dataEnabled = new boolean[APN_NUM_TYPES]; private boolean[] dataEnabled = new boolean[APN_NUM_TYPES]; Loading Loading @@ -766,7 +768,7 @@ public abstract class DataConnectionTracker extends Handler { public boolean getAnyDataEnabled() { public boolean getAnyDataEnabled() { final boolean result; final boolean result; synchronized (mDataEnabledLock) { synchronized (mDataEnabledLock) { result = (mInternalDataEnabled && mUserDataEnabled && mPolicyDataEnabled result = (mInternalDataEnabled && mUserDataEnabled && sPolicyDataEnabled && (enabledCount != 0)); && (enabledCount != 0)); } } if (!result && DBG) log("getAnyDataEnabled " + result); if (!result && DBG) log("getAnyDataEnabled " + result); Loading Loading @@ -1132,8 +1134,8 @@ public abstract class DataConnectionTracker extends Handler { protected void onSetPolicyDataEnabled(boolean enabled) { protected void onSetPolicyDataEnabled(boolean enabled) { synchronized (mDataEnabledLock) { synchronized (mDataEnabledLock) { final boolean prevEnabled = getAnyDataEnabled(); final boolean prevEnabled = getAnyDataEnabled(); if (mPolicyDataEnabled != enabled) { if (sPolicyDataEnabled != enabled) { mPolicyDataEnabled = enabled; sPolicyDataEnabled = enabled; if (prevEnabled != getAnyDataEnabled()) { if (prevEnabled != getAnyDataEnabled()) { if (!prevEnabled) { if (!prevEnabled) { resetAllRetryCounts(); resetAllRetryCounts(); Loading telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -549,7 +549,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { @Override @Override public boolean getAnyDataEnabled() { public boolean getAnyDataEnabled() { synchronized (mDataEnabledLock) { synchronized (mDataEnabledLock) { if (!(mInternalDataEnabled && mUserDataEnabled && mPolicyDataEnabled)) return false; if (!(mInternalDataEnabled && mUserDataEnabled && sPolicyDataEnabled)) return false; for (ApnContext apnContext : mApnContexts.values()) { for (ApnContext apnContext : mApnContexts.values()) { // Make sure we dont have a context that going down // Make sure we dont have a context that going down // and is explicitly disabled. // and is explicitly disabled. Loading Loading
services/java/com/android/server/net/NetworkPolicyManagerService.java +5 −15 Original line number Original line Diff line number Diff line Loading @@ -225,8 +225,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { /** Set of currently active {@link Notification} tags. */ /** Set of currently active {@link Notification} tags. */ private HashSet<String> mActiveNotifs = Sets.newHashSet(); private HashSet<String> mActiveNotifs = Sets.newHashSet(); /** Current values from {@link #setPolicyDataEnable(int, boolean)}. */ private SparseBooleanArray mActiveNetworkEnabled = new SparseBooleanArray(); /** Foreground at both UID and PID granularity. */ /** Foreground at both UID and PID granularity. */ private SparseBooleanArray mUidForeground = new SparseBooleanArray(); private SparseBooleanArray mUidForeground = new SparseBooleanArray(); Loading Loading @@ -1519,22 +1517,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } } /** /** * Control {@link IConnectivityManager#setPolicyDataEnable(int, boolean)}, * Control {@link IConnectivityManager#setPolicyDataEnable(int, boolean)}. * dispatching only when actually changed. */ */ private void setPolicyDataEnable(int networkType, boolean enabled) { private void setPolicyDataEnable(int networkType, boolean enabled) { synchronized (mActiveNetworkEnabled) { final boolean prevEnabled = mActiveNetworkEnabled.get(networkType, true); if (prevEnabled == enabled) return; try { try { mConnManager.setPolicyDataEnable(networkType, enabled); mConnManager.setPolicyDataEnable(networkType, enabled); } catch (RemoteException e) { } catch (RemoteException e) { // ignored; service lives in system_server // ignored; service lives in system_server } } mActiveNetworkEnabled.put(networkType, enabled); } } } private String getActiveSubscriberId() { private String getActiveSubscriberId() { Loading
telephony/java/com/android/internal/telephony/DataConnectionTracker.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -167,7 +167,9 @@ public abstract class DataConnectionTracker extends Handler { // independent of mInternalDataEnabled and requests for APN access // independent of mInternalDataEnabled and requests for APN access // persisted // persisted protected boolean mUserDataEnabled = true; protected boolean mUserDataEnabled = true; protected boolean mPolicyDataEnabled = true; // TODO: move away from static state once 5587429 is fixed. protected static boolean sPolicyDataEnabled = true; private boolean[] dataEnabled = new boolean[APN_NUM_TYPES]; private boolean[] dataEnabled = new boolean[APN_NUM_TYPES]; Loading Loading @@ -766,7 +768,7 @@ public abstract class DataConnectionTracker extends Handler { public boolean getAnyDataEnabled() { public boolean getAnyDataEnabled() { final boolean result; final boolean result; synchronized (mDataEnabledLock) { synchronized (mDataEnabledLock) { result = (mInternalDataEnabled && mUserDataEnabled && mPolicyDataEnabled result = (mInternalDataEnabled && mUserDataEnabled && sPolicyDataEnabled && (enabledCount != 0)); && (enabledCount != 0)); } } if (!result && DBG) log("getAnyDataEnabled " + result); if (!result && DBG) log("getAnyDataEnabled " + result); Loading Loading @@ -1132,8 +1134,8 @@ public abstract class DataConnectionTracker extends Handler { protected void onSetPolicyDataEnabled(boolean enabled) { protected void onSetPolicyDataEnabled(boolean enabled) { synchronized (mDataEnabledLock) { synchronized (mDataEnabledLock) { final boolean prevEnabled = getAnyDataEnabled(); final boolean prevEnabled = getAnyDataEnabled(); if (mPolicyDataEnabled != enabled) { if (sPolicyDataEnabled != enabled) { mPolicyDataEnabled = enabled; sPolicyDataEnabled = enabled; if (prevEnabled != getAnyDataEnabled()) { if (prevEnabled != getAnyDataEnabled()) { if (!prevEnabled) { if (!prevEnabled) { resetAllRetryCounts(); resetAllRetryCounts(); Loading
telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -549,7 +549,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { @Override @Override public boolean getAnyDataEnabled() { public boolean getAnyDataEnabled() { synchronized (mDataEnabledLock) { synchronized (mDataEnabledLock) { if (!(mInternalDataEnabled && mUserDataEnabled && mPolicyDataEnabled)) return false; if (!(mInternalDataEnabled && mUserDataEnabled && sPolicyDataEnabled)) return false; for (ApnContext apnContext : mApnContexts.values()) { for (ApnContext apnContext : mApnContexts.values()) { // Make sure we dont have a context that going down // Make sure we dont have a context that going down // and is explicitly disabled. // and is explicitly disabled. Loading