Loading services/java/com/android/server/ConnectivityService.java +9 −2 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.atomic.AtomicBoolean; import java.util.GregorianCalendar; import java.util.List; Loading Loading @@ -113,6 +114,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { private boolean mTestMode; private static ConnectivityService sServiceInstance; private AtomicBoolean mBackgroundDataEnabled = new AtomicBoolean(true); private static final int ENABLED = 1; private static final int DISABLED = 0; Loading Loading @@ -261,6 +264,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { handlerThread.start(); mHandler = new MyHandler(handlerThread.getLooper()); mBackgroundDataEnabled.set(Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.BACKGROUND_DATA, 1) == 1); // setup our unique device name if (TextUtils.isEmpty(SystemProperties.get("net.hostname"))) { String id = Settings.Secure.getString(context.getContentResolver(), Loading Loading @@ -954,8 +960,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { * @see ConnectivityManager#getBackgroundDataSetting() */ public boolean getBackgroundDataSetting() { return Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.BACKGROUND_DATA, 1) == 1; return mBackgroundDataEnabled.get(); } /** Loading @@ -966,6 +971,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { android.Manifest.permission.CHANGE_BACKGROUND_DATA_SETTING, "ConnectivityService"); mBackgroundDataEnabled.set(allowBackgroundDataUsage); mHandler.sendMessage(mHandler.obtainMessage(EVENT_SET_BACKGROUND_DATA, (allowBackgroundDataUsage ? ENABLED : DISABLED), 0)); } Loading Loading
services/java/com/android/server/ConnectivityService.java +9 −2 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.atomic.AtomicBoolean; import java.util.GregorianCalendar; import java.util.List; Loading Loading @@ -113,6 +114,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { private boolean mTestMode; private static ConnectivityService sServiceInstance; private AtomicBoolean mBackgroundDataEnabled = new AtomicBoolean(true); private static final int ENABLED = 1; private static final int DISABLED = 0; Loading Loading @@ -261,6 +264,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { handlerThread.start(); mHandler = new MyHandler(handlerThread.getLooper()); mBackgroundDataEnabled.set(Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.BACKGROUND_DATA, 1) == 1); // setup our unique device name if (TextUtils.isEmpty(SystemProperties.get("net.hostname"))) { String id = Settings.Secure.getString(context.getContentResolver(), Loading Loading @@ -954,8 +960,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { * @see ConnectivityManager#getBackgroundDataSetting() */ public boolean getBackgroundDataSetting() { return Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.BACKGROUND_DATA, 1) == 1; return mBackgroundDataEnabled.get(); } /** Loading @@ -966,6 +971,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { android.Manifest.permission.CHANGE_BACKGROUND_DATA_SETTING, "ConnectivityService"); mBackgroundDataEnabled.set(allowBackgroundDataUsage); mHandler.sendMessage(mHandler.obtainMessage(EVENT_SET_BACKGROUND_DATA, (allowBackgroundDataUsage ? ENABLED : DISABLED), 0)); } Loading