diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-09-26 20:19:32 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-26 20:19:32 -0700 |
commit | 031c410adc368a6242a834e23741afa09db69fa0 (patch) | |
tree | aab4f5125870569e1620618e0f9c1a391de4b416 /services | |
parent | 177bb01c7d23dfb08eb59adbf89af5ebbea7801a (diff) | |
parent | 68b7a6d14b68b38324ffd275c7227805c7d99b2d (diff) | |
download | frameworks_base-031c410adc368a6242a834e23741afa09db69fa0.zip frameworks_base-031c410adc368a6242a834e23741afa09db69fa0.tar.gz frameworks_base-031c410adc368a6242a834e23741afa09db69fa0.tar.bz2 |
am 68b7a6d1: Merge "First step towards cleaning up Global settings." into jb-mr1-dev
* commit '68b7a6d14b68b38324ffd275c7227805c7d99b2d':
First step towards cleaning up Global settings.
Diffstat (limited to 'services')
3 files changed, 38 insertions, 38 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index ceb17c7..891cac7 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -1509,8 +1509,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { // which is where we store the value and maybe make this // asynchronous. enforceAccessPermission(); - boolean retVal = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.MOBILE_DATA, 1) == 1; + boolean retVal = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.MOBILE_DATA, 1) == 1; if (VDBG) log("getMobileDataEnabled returning " + retVal); return retVal; } diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java index f36d73a..75eb3c4 100644 --- a/services/java/com/android/server/ThrottleService.java +++ b/services/java/com/android/server/ThrottleService.java @@ -211,20 +211,20 @@ public class ThrottleService extends IThrottleManager.Stub { void register(Context context) { ContentResolver resolver = context.getContentResolver(); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_POLLING_SEC), false, this); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_THRESHOLD_BYTES), false, this); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_VALUE_KBITSPS), false, this); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_RESET_DAY), false, this); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_NOTIFICATION_TYPE), false, this); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_HELP_URI), false, this); - resolver.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.THROTTLE_MAX_NTP_CACHE_AGE_SEC), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_POLLING_SEC), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_THRESHOLD_BYTES), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_VALUE_KBITSPS), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_RESET_DAY), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_NOTIFICATION_TYPE), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_HELP_URI), false, this); + resolver.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.THROTTLE_MAX_NTP_CACHE_AGE_SEC), false, this); } void unregister(Context context) { @@ -297,8 +297,8 @@ public class ThrottleService extends IThrottleManager.Stub { public String getHelpUri() { enforceAccessPermission(); - return Settings.Secure.getString(mContext.getContentResolver(), - Settings.Secure.THROTTLE_HELP_URI); + return Settings.Global.getString(mContext.getContentResolver(), + Settings.Global.THROTTLE_HELP_URI); } // TODO - fetch for the iface @@ -436,18 +436,18 @@ public class ThrottleService extends IThrottleManager.Stub { int pollingPeriod = mContext.getResources().getInteger( R.integer.config_datause_polling_period_sec); - mPolicyPollPeriodSec = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.THROTTLE_POLLING_SEC, pollingPeriod); + mPolicyPollPeriodSec = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.THROTTLE_POLLING_SEC, pollingPeriod); // TODO - remove testing stuff? long defaultThreshold = mContext.getResources().getInteger( R.integer.config_datause_threshold_bytes); int defaultValue = mContext.getResources().getInteger( R.integer.config_datause_throttle_kbitsps); - long threshold = Settings.Secure.getLong(mContext.getContentResolver(), - Settings.Secure.THROTTLE_THRESHOLD_BYTES, defaultThreshold); - int value = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.THROTTLE_VALUE_KBITSPS, defaultValue); + long threshold = Settings.Global.getLong(mContext.getContentResolver(), + Settings.Global.THROTTLE_THRESHOLD_BYTES, defaultThreshold); + int value = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.THROTTLE_VALUE_KBITSPS, defaultValue); mPolicyThreshold.set(threshold); mPolicyThrottleValue.set(value); @@ -456,14 +456,14 @@ public class ThrottleService extends IThrottleManager.Stub { mPolicyThreshold.set(TESTING_THRESHOLD); } - mPolicyResetDay = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.THROTTLE_RESET_DAY, -1); + mPolicyResetDay = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.THROTTLE_RESET_DAY, -1); if (mPolicyResetDay == -1 || ((mPolicyResetDay < 1) || (mPolicyResetDay > 28))) { Random g = new Random(); mPolicyResetDay = 1 + g.nextInt(28); // 1-28 - Settings.Secure.putInt(mContext.getContentResolver(), - Settings.Secure.THROTTLE_RESET_DAY, mPolicyResetDay); + Settings.Global.putInt(mContext.getContentResolver(), + Settings.Global.THROTTLE_RESET_DAY, mPolicyResetDay); } if (mIface == null) { mPolicyThreshold.set(0); @@ -471,11 +471,11 @@ public class ThrottleService extends IThrottleManager.Stub { int defaultNotificationType = mContext.getResources().getInteger( R.integer.config_datause_notification_type); - mPolicyNotificationsAllowedMask = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.THROTTLE_NOTIFICATION_TYPE, defaultNotificationType); + mPolicyNotificationsAllowedMask = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.THROTTLE_NOTIFICATION_TYPE, defaultNotificationType); - final int maxNtpCacheAgeSec = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.THROTTLE_MAX_NTP_CACHE_AGE_SEC, + final int maxNtpCacheAgeSec = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.THROTTLE_MAX_NTP_CACHE_AGE_SEC, (int) (MAX_NTP_CACHE_AGE / 1000)); mMaxNtpCacheAge = maxNtpCacheAgeSec * 1000; diff --git a/services/tests/servicestests/src/com/android/server/ThrottleServiceTest.java b/services/tests/servicestests/src/com/android/server/ThrottleServiceTest.java index afa0eec..569acee 100644 --- a/services/tests/servicestests/src/com/android/server/ThrottleServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/ThrottleServiceTest.java @@ -242,9 +242,9 @@ public class ThrottleServiceTest extends AndroidTestCase { */ public void setThrottlePolicy(long thresholdBytes, int valueKbitps, int resetDay) { final ContentResolver resolver = getContext().getContentResolver(); - Settings.Secure.putLong(resolver, Settings.Secure.THROTTLE_THRESHOLD_BYTES, thresholdBytes); - Settings.Secure.putInt(resolver, Settings.Secure.THROTTLE_VALUE_KBITSPS, valueKbitps); - Settings.Secure.putInt(resolver, Settings.Secure.THROTTLE_RESET_DAY, resetDay); + Settings.Global.putLong(resolver, Settings.Global.THROTTLE_THRESHOLD_BYTES, thresholdBytes); + Settings.Global.putInt(resolver, Settings.Global.THROTTLE_VALUE_KBITSPS, valueKbitps); + Settings.Global.putInt(resolver, Settings.Global.THROTTLE_RESET_DAY, resetDay); } /** @@ -252,9 +252,9 @@ public class ThrottleServiceTest extends AndroidTestCase { */ public void clearThrottlePolicy() { final ContentResolver resolver = getContext().getContentResolver(); - Settings.Secure.putString(resolver, Settings.Secure.THROTTLE_THRESHOLD_BYTES, null); - Settings.Secure.putString(resolver, Settings.Secure.THROTTLE_VALUE_KBITSPS, null); - Settings.Secure.putString(resolver, Settings.Secure.THROTTLE_RESET_DAY, null); + Settings.Global.putString(resolver, Settings.Global.THROTTLE_THRESHOLD_BYTES, null); + Settings.Global.putString(resolver, Settings.Global.THROTTLE_VALUE_KBITSPS, null); + Settings.Global.putString(resolver, Settings.Global.THROTTLE_RESET_DAY, null); } /** |