Migrate more Secure settings to Global.
Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.
Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d
diff --git a/api/current.txt b/api/current.txt
index ea26c9a..e8f911b 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -18816,6 +18816,7 @@
field public static final java.lang.String DATA_ROAMING = "data_roaming";
field public static final java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
field public static final java.lang.String DEVICE_PROVISIONED = "device_provisioned";
+ field public static final java.lang.String HTTP_PROXY = "http_proxy";
field public static final java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
field public static final java.lang.String MODE_RINGER = "mode_ringer";
field public static final java.lang.String NETWORK_PREFERENCE = "network_preference";
@@ -18879,7 +18880,7 @@
field public static final deprecated java.lang.String DEVICE_PROVISIONED = "device_provisioned";
field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services";
field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods";
- field public static final java.lang.String HTTP_PROXY = "http_proxy";
+ field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy";
field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility";
field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
field public static final java.lang.String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
@@ -19038,12 +19039,12 @@
field public static final deprecated int WIFI_SLEEP_POLICY_DEFAULT = 0; // 0x0
field public static final deprecated int WIFI_SLEEP_POLICY_NEVER = 2; // 0x2
field public static final deprecated int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; // 0x1
- field public static final java.lang.String WIFI_STATIC_DNS1 = "wifi_static_dns1";
- field public static final java.lang.String WIFI_STATIC_DNS2 = "wifi_static_dns2";
- field public static final java.lang.String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
- field public static final java.lang.String WIFI_STATIC_IP = "wifi_static_ip";
- field public static final java.lang.String WIFI_STATIC_NETMASK = "wifi_static_netmask";
- field public static final java.lang.String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
+ field public static final deprecated java.lang.String WIFI_STATIC_DNS1 = "wifi_static_dns1";
+ field public static final deprecated java.lang.String WIFI_STATIC_DNS2 = "wifi_static_dns2";
+ field public static final deprecated java.lang.String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
+ field public static final deprecated java.lang.String WIFI_STATIC_IP = "wifi_static_ip";
+ field public static final deprecated java.lang.String WIFI_STATIC_NETMASK = "wifi_static_netmask";
+ field public static final deprecated java.lang.String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
field public static final deprecated java.lang.String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = "wifi_watchdog_acceptable_packet_loss_percentage";
field public static final deprecated java.lang.String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
field public static final deprecated java.lang.String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = "wifi_watchdog_background_check_delay_ms";
diff --git a/core/java/android/app/ApplicationErrorReport.java b/core/java/android/app/ApplicationErrorReport.java
index ebf42619..954476d 100644
--- a/core/java/android/app/ApplicationErrorReport.java
+++ b/core/java/android/app/ApplicationErrorReport.java
@@ -158,8 +158,8 @@
public static ComponentName getErrorReportReceiver(Context context,
String packageName, int appFlags) {
// check if error reporting is enabled in secure settings
- int enabled = Settings.Secure.getInt(context.getContentResolver(),
- Settings.Secure.SEND_ACTION_APP_ERROR, 0);
+ int enabled = Settings.Global.getInt(context.getContentResolver(),
+ Settings.Global.SEND_ACTION_APP_ERROR, 0);
if (enabled == 0) {
return null;
}
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 4999a2d..564a804 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -777,8 +777,8 @@
}
// Cap the delay
- long maxSyncRetryTimeInSeconds = Settings.Secure.getLong(mContext.getContentResolver(),
- Settings.Secure.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
+ long maxSyncRetryTimeInSeconds = Settings.Global.getLong(mContext.getContentResolver(),
+ Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
DEFAULT_MAX_SYNC_RETRY_TIME_IN_SECONDS);
if (newDelayInMs > maxSyncRetryTimeInSeconds * 1000) {
newDelayInMs = maxSyncRetryTimeInSeconds * 1000;
diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java
index 24dc898..9b11094 100644
--- a/core/java/android/net/CaptivePortalTracker.java
+++ b/core/java/android/net/CaptivePortalTracker.java
@@ -89,12 +89,12 @@
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
mContext.registerReceiver(mReceiver, filter);
- mServer = Settings.Secure.getString(mContext.getContentResolver(),
- Settings.Secure.CAPTIVE_PORTAL_SERVER);
+ mServer = Settings.Global.getString(mContext.getContentResolver(),
+ Settings.Global.CAPTIVE_PORTAL_SERVER);
if (mServer == null) mServer = DEFAULT_SERVER;
- mIsCaptivePortalCheckEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.CAPTIVE_PORTAL_DETECTION_ENABLED, 1) == 1;
+ mIsCaptivePortalCheckEnabled = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED, 1) == 1;
addState(mDefaultState);
addState(mNoActiveNetworkState, mDefaultState);
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index a570473..6ff1a33 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -330,6 +330,14 @@
public static final int DEFAULT_NETWORK_PREFERENCE = TYPE_WIFI;
+ /**
+ * Default value for {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY} in
+ * milliseconds.
+ *
+ * @hide
+ */
+ public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000;
+
private final IConnectivityManager mService;
public static boolean isNetworkTypeValid(int networkType) {
diff --git a/core/java/android/net/DnsPinger.java b/core/java/android/net/DnsPinger.java
index 11acabe..66f0fd0 100644
--- a/core/java/android/net/DnsPinger.java
+++ b/core/java/android/net/DnsPinger.java
@@ -295,8 +295,8 @@
}
private InetAddress getDefaultDns() {
- String dns = Settings.Secure.getString(mContext.getContentResolver(),
- Settings.Secure.DEFAULT_DNS_SERVER);
+ String dns = Settings.Global.getString(mContext.getContentResolver(),
+ Settings.Global.DEFAULT_DNS_SERVER);
if (dns == null || dns.length() == 0) {
dns = mContext.getResources().getString(
com.android.internal.R.string.config_default_dns_server);
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 0d980c0..794d0d7 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -32,16 +32,19 @@
import android.content.res.Resources;
import android.database.Cursor;
import android.database.SQLException;
+import android.net.ConnectivityManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.BatteryManager;
import android.os.Bundle;
+import android.os.DropBoxManager;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
+import android.os.Build.VERSION_CODES;
import android.speech.tts.TextToSpeech;
import android.text.TextUtils;
import android.util.AndroidException;
@@ -917,6 +920,7 @@
MOVED_TO_GLOBAL.add(Global.DEVICE_PROVISIONED);
MOVED_TO_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
MOVED_TO_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
+ MOVED_TO_GLOBAL.add(Global.HTTP_PROXY);
// these are moving directly from system to global
MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
@@ -1487,47 +1491,64 @@
@Deprecated
public static final String MODE_RINGER = Global.MODE_RINGER;
- //TODO: deprecate static IP constants
/**
* Whether to use static IP and other static network attributes.
* <p>
* Set to 1 for true and 0 for false.
+ *
+ * @deprecated Use {@link WifiManager} instead
*/
+ @Deprecated
public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
/**
* The static IP address.
* <p>
* Example: "192.168.1.51"
+ *
+ * @deprecated Use {@link WifiManager} instead
*/
+ @Deprecated
public static final String WIFI_STATIC_IP = "wifi_static_ip";
/**
* If using static IP, the gateway's IP address.
* <p>
* Example: "192.168.1.1"
+ *
+ * @deprecated Use {@link WifiManager} instead
*/
+ @Deprecated
public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
/**
* If using static IP, the net mask.
* <p>
* Example: "255.255.255.0"
+ *
+ * @deprecated Use {@link WifiManager} instead
*/
+ @Deprecated
public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
/**
* If using static IP, the primary DNS's IP address.
* <p>
* Example: "192.168.1.1"
+ *
+ * @deprecated Use {@link WifiManager} instead
*/
+ @Deprecated
public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
/**
* If using static IP, the secondary DNS's IP address.
* <p>
* Example: "192.168.1.2"
+ *
+ * @deprecated Use {@link WifiManager} instead
*/
+ @Deprecated
public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
@@ -2326,10 +2347,10 @@
public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
/**
- * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
+ * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
*/
@Deprecated
- public static final String HTTP_PROXY = Secure.HTTP_PROXY;
+ public static final String HTTP_PROXY = Global.HTTP_PROXY;
/**
* @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
@@ -2633,10 +2654,8 @@
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
- MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_NUM_ARP_PINGS);
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
- MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS);
MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
@@ -2645,6 +2664,37 @@
MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
+ MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
+ MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
+ MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
+ MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
+ MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
+ MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
+ MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
+ MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
+ MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
+ MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
+ MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
+ MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
+ MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
+ MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
+ MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
+ MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
+ MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
+ MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
+ MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
+ MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
+ MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
+ MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
+ MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
+ MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
+ MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
+ MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
+ MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
+ MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
+ MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
+ MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
+ MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
}
/**
@@ -3106,45 +3156,13 @@
public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
/**
- * Host name and port for global http proxy. Uses ':' seperator for between host and port
- * TODO - deprecate in favor of global_http_proxy_host, etc
+ * Host name and port for global http proxy. Uses ':' seperator for
+ * between host and port.
+ *
+ * @deprecated Use {@link Global#HTTP_PROXY}
*/
- public static final String HTTP_PROXY = "http_proxy";
-
- /**
- * Host name for global http proxy. Set via ConnectivityManager.
- * @hide
- */
- public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
-
- /**
- * Integer host port for global http proxy. Set via ConnectivityManager.
- * @hide
- */
- public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
-
- /**
- * Exclusion list for global proxy. This string contains a list of comma-separated
- * domains where the global proxy does not apply. Domains should be listed in a comma-
- * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com"
- * Use ConnectivityManager to set/get.
- * @hide
- */
- public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST =
- "global_http_proxy_exclusion_list";
-
- /**
- * Enables the UI setting to allow the user to specify the global HTTP proxy
- * and associated exclusion list.
- * @hide
- */
- public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
-
- /**
- * Setting for default DNS in case nobody suggests one
- * @hide
- */
- public static final String DEFAULT_DNS_SERVER = "default_dns_server";
+ @Deprecated
+ public static final String HTTP_PROXY = Global.HTTP_PROXY;
/**
* @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
@@ -3626,21 +3644,6 @@
public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
/**
- * Setting to turn off captive portal detection. Feature is enabled by default and
- * the setting needs to be set to 0 to disable it.
- * @hide
- */
- public static final String CAPTIVE_PORTAL_DETECTION_ENABLED =
- "captive_portal_detection_enabled";
-
- /**
- * The server used for captive portal detection upon a new conection. A 204 response
- * code from the server is used for validation.
- * @hide
- */
- public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
-
- /**
* @deprecated Use
* {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
*/
@@ -3649,14 +3652,13 @@
Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
/**
- * Whether network service discovery is enabled.
- * @hide
- */
- public static final String NSD_ON = "nsd_on";
-
- /**
- * Whether background data usage is allowed by the user. See
- * ConnectivityManager for more info.
+ * Whether background data usage is allowed.
+ *
+ * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
+ * availability of background data depends on several
+ * combined factors. When background data is unavailable,
+ * {@link ConnectivityManager#getActiveNetworkInfo()} will
+ * now appear disconnected.
*/
@Deprecated
public static final String BACKGROUND_DATA = "background_data";
@@ -3717,18 +3719,6 @@
public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
/**
- * The number of milliseconds to delay before sending out Connectivyt Change broadcasts
- * @hide
- */
- public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
-
- /**
- * Default value for CONNECTIVITY_CHANGE_DELAY in milliseconds.
- * @hide
- */
- public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000;
-
- /**
* Controls whether settings backup is enabled.
* Type: int ( 0 = disabled, 1 = enabled )
* @hide
@@ -3764,118 +3754,6 @@
public static final String LAST_SETUP_SHOWN = "last_setup_shown";
/**
- * Threshold values for the duration and level of a discharge cycle, under
- * which we log discharge cycle info.
- * @hide
- */
- public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
- "battery_discharge_duration_threshold";
- /** @hide */
- public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
-
- /**
- * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
- * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
- * will never display the "Report" button.
- * Type: int ( 0 = disallow, 1 = allow )
- * @hide
- */
- public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
-
- /**
- * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
- * @hide
- */
- public static final String DROPBOX_AGE_SECONDS =
- "dropbox_age_seconds";
- /**
- * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
- * @hide
- */
- public static final String DROPBOX_MAX_FILES =
- "dropbox_max_files";
- /**
- * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
- * @hide
- */
- public static final String DROPBOX_QUOTA_KB =
- "dropbox_quota_kb";
- /**
- * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
- * @hide
- */
- public static final String DROPBOX_QUOTA_PERCENT =
- "dropbox_quota_percent";
- /**
- * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
- * @hide
- */
- public static final String DROPBOX_RESERVE_PERCENT =
- "dropbox_reserve_percent";
- /**
- * Prefix for per-tag dropbox disable/enable settings.
- * @hide
- */
- public static final String DROPBOX_TAG_PREFIX =
- "dropbox:";
- /**
- * Lines of logcat to include with system crash/ANR/etc. reports,
- * as a prefix of the dropbox tag of the report type.
- * For example, "logcat_for_system_server_anr" controls the lines
- * of logcat captured with system server ANR reports. 0 to disable.
- * @hide
- */
- public static final String ERROR_LOGCAT_PREFIX =
- "logcat_for_";
-
- /**
- * The interval in minutes after which the amount of free storage left on the
- * device is logged to the event log
- * @hide
- */
- public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
- "sys_free_storage_log_interval";
-
- /**
- * Threshold for the amount of change in disk free space required to report the amount of
- * free space. Used to prevent spamming the logs when the disk free space isn't changing
- * frequently.
- * @hide
- */
- public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
- "disk_free_change_reporting_threshold";
-
-
- /**
- * Minimum percentage of free storage on the device that is used to determine if
- * the device is running low on storage. The default is 10.
- * <p>Say this value is set to 10, the device is considered running low on storage
- * if 90% or more of the device storage is filled up.
- * @hide
- */
- public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
- "sys_storage_threshold_percentage";
-
- /**
- * Maximum byte size of the low storage threshold. This is to ensure
- * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
- * an overly large threshold for large storage devices. Currently this
- * must be less than 2GB. This default is 500MB.
- * @hide
- */
- public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
- "sys_storage_threshold_max_bytes";
-
- /**
- * Minimum bytes of free storage on the device before the data
- * partition is considered full. By default, 1 MB is reserved
- * to avoid system-wide SQLite disk full exceptions.
- * @hide
- */
- public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
- "sys_storage_full_threshold_bytes";
-
- /**
* The interval in milliseconds after which Wi-Fi is considered idle.
* When idle, it is possible for the device to be switched from Wi-Fi to
* the mobile data network.
@@ -3887,14 +3765,6 @@
public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
/**
- * The maximum reconnect delay for short network outages or when the network is suspended
- * due to phone use.
- * @hide
- */
- public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
- "sync_max_retry_delay_in_seconds";
-
- /**
* The global search provider chosen by the user (if multiple global
* search providers are installed). This will be the provider returned
* by {@link SearchManager#getGlobalSearchActivity()} if it's still
@@ -4114,37 +3984,6 @@
public static final String UI_NIGHT_MODE = "ui_night_mode";
/**
- * Let user pick default install location.
- * @hide
- */
- public static final String SET_INSTALL_LOCATION = "set_install_location";
-
- /**
- * Default install location value.
- * 0 = auto, let system decide
- * 1 = internal
- * 2 = sdcard
- * @hide
- */
- public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
-
- /**
- * ms during which to consume extra events related to Inet connection condition
- * after a transtion to fully-connected
- * @hide
- */
- public static final String INET_CONDITION_DEBOUNCE_UP_DELAY =
- "inet_condition_debounce_up_delay";
-
- /**
- * ms during which to consume extra events related to Inet connection condtion
- * after a transtion to partly-connected
- * @hide
- */
- public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY =
- "inet_condition_debounce_down_delay";
-
- /**
* Whether screensavers are enabled.
* @hide
*/
@@ -4179,10 +4018,6 @@
*/
public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
- /** {@hide} */
- public static final String
- READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
-
/**
* This are the settings to be backed up.
*
@@ -4959,19 +4794,6 @@
public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
/**
- * ms delay interval between rssi polling when the signal is known to be weak
- * @hide
- */
- public static final String WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS =
- "wifi_watchdog_rssi_fetch_interval_ms";
-
- /**
- * Number of ARP pings per check.
- * @hide
- */
- public static final String WIFI_WATCHDOG_NUM_ARP_PINGS = "wifi_watchdog_num_arp_pings";
-
- /**
* Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
* the setting needs to be set to 0 to disable it.
* @hide
@@ -5074,6 +4896,262 @@
*/
public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
+ /**
+ * Threshold values for the duration and level of a discharge cycle,
+ * under which we log discharge cycle info.
+ *
+ * @hide
+ */
+ public static final String
+ BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
+
+ /** @hide */
+ public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
+
+ /**
+ * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
+ * intents on application crashes and ANRs. If this is disabled, the
+ * crash/ANR dialog will never display the "Report" button.
+ * <p>
+ * Type: int (0 = disallow, 1 = allow)
+ *
+ * @hide
+ */
+ public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
+
+ /**
+ * Maximum age of entries kept by {@link DropBoxManager}.
+ *
+ * @hide
+ */
+ public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
+
+ /**
+ * Maximum number of entry files which {@link DropBoxManager} will keep
+ * around.
+ *
+ * @hide
+ */
+ public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
+
+ /**
+ * Maximum amount of disk space used by {@link DropBoxManager} no matter
+ * what.
+ *
+ * @hide
+ */
+ public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
+
+ /**
+ * Percent of free disk (excluding reserve) which {@link DropBoxManager}
+ * will use.
+ *
+ * @hide
+ */
+ public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
+
+ /**
+ * Percent of total disk which {@link DropBoxManager} will never dip
+ * into.
+ *
+ * @hide
+ */
+ public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
+
+ /**
+ * Prefix for per-tag dropbox disable/enable settings.
+ *
+ * @hide
+ */
+ public static final String DROPBOX_TAG_PREFIX = "dropbox:";
+
+ /**
+ * Lines of logcat to include with system crash/ANR/etc. reports, as a
+ * prefix of the dropbox tag of the report type. For example,
+ * "logcat_for_system_server_anr" controls the lines of logcat captured
+ * with system server ANR reports. 0 to disable.
+ *
+ * @hide
+ */
+ public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
+
+ /**
+ * The interval in minutes after which the amount of free storage left
+ * on the device is logged to the event log
+ *
+ * @hide
+ */
+ public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
+
+ /**
+ * Threshold for the amount of change in disk free space required to
+ * report the amount of free space. Used to prevent spamming the logs
+ * when the disk free space isn't changing frequently.
+ *
+ * @hide
+ */
+ public static final String
+ DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
+
+ /**
+ * Minimum percentage of free storage on the device that is used to
+ * determine if the device is running low on storage. The default is 10.
+ * <p>
+ * Say this value is set to 10, the device is considered running low on
+ * storage if 90% or more of the device storage is filled up.
+ *
+ * @hide
+ */
+ public static final String
+ SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
+
+ /**
+ * Maximum byte size of the low storage threshold. This is to ensure
+ * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
+ * overly large threshold for large storage devices. Currently this must
+ * be less than 2GB. This default is 500MB.
+ *
+ * @hide
+ */
+ public static final String
+ SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
+
+ /**
+ * Minimum bytes of free storage on the device before the data partition
+ * is considered full. By default, 1 MB is reserved to avoid system-wide
+ * SQLite disk full exceptions.
+ *
+ * @hide
+ */
+ public static final String
+ SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
+
+ /**
+ * The maximum reconnect delay for short network outages or when the
+ * network is suspended due to phone use.
+ *
+ * @hide
+ */
+ public static final String
+ SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
+
+ /**
+ * The number of milliseconds to delay before sending out
+ * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
+ *
+ * @hide
+ */
+ public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
+
+ /**
+ * Setting to turn off captive portal detection. Feature is enabled by
+ * default and the setting needs to be set to 0 to disable it.
+ *
+ * @hide
+ */
+ public static final String
+ CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
+
+ /**
+ * The server used for captive portal detection upon a new conection. A
+ * 204 response code from the server is used for validation.
+ *
+ * @hide
+ */
+ public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
+
+ /**
+ * Whether network service discovery is enabled.
+ *
+ * @hide
+ */
+ public static final String NSD_ON = "nsd_on";
+
+ /**
+ * Let user pick default install location.
+ *
+ * @hide
+ */
+ public static final String SET_INSTALL_LOCATION = "set_install_location";
+
+ /**
+ * Default install location value.
+ * 0 = auto, let system decide
+ * 1 = internal
+ * 2 = sdcard
+ * @hide
+ */
+ public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
+
+ /**
+ * ms during which to consume extra events related to Inet connection
+ * condition after a transtion to fully-connected
+ *
+ * @hide
+ */
+ public static final String
+ INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
+
+ /**
+ * ms during which to consume extra events related to Inet connection
+ * condtion after a transtion to partly-connected
+ *
+ * @hide
+ */
+ public static final String
+ INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
+
+ /** {@hide} */
+ public static final String
+ READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
+
+ /**
+ * Host name and port for global http proxy. Uses ':' seperator for
+ * between host and port.
+ */
+ public static final String HTTP_PROXY = "http_proxy";
+
+ /**
+ * Host name for global http proxy. Set via ConnectivityManager.
+ *
+ * @hide
+ */
+ public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
+
+ /**
+ * Integer host port for global http proxy. Set via ConnectivityManager.
+ *
+ * @hide
+ */
+ public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
+
+ /**
+ * Exclusion list for global proxy. This string contains a list of
+ * comma-separated domains where the global proxy does not apply.
+ * Domains should be listed in a comma- separated list. Example of
+ * acceptable formats: ".domain1.com,my.domain2.com" Use
+ * ConnectivityManager to set/get.
+ *
+ * @hide
+ */
+ public static final String
+ GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
+
+ /**
+ * Enables the UI setting to allow the user to specify the global HTTP
+ * proxy and associated exclusion list.
+ *
+ * @hide
+ */
+ public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
+
+ /**
+ * Setting for default DNS in case nobody suggests one
+ *
+ * @hide
+ */
+ public static final String DEFAULT_DNS_SERVER = "default_dns_server";
+
// Populated lazily, guarded by class object:
private static NameValueCache sNameValueCache = new NameValueCache(
SYS_PROP_SETTING_VERSION,
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index 5881aa1..56070ee 100755
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -1668,16 +1668,16 @@
private int getDefaultInstallLoc() {
int origDefaultLoc = PackageInfo.INSTALL_LOCATION_AUTO;
try {
- origDefaultLoc = Settings.System.getInt(mContext.getContentResolver(),
- Settings.Secure.DEFAULT_INSTALL_LOCATION);
+ origDefaultLoc = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.DEFAULT_INSTALL_LOCATION);
} catch (SettingNotFoundException e1) {
}
return origDefaultLoc;
}
private void setInstallLoc(int loc) {
- Settings.System.putInt(mContext.getContentResolver(),
- Settings.Secure.DEFAULT_INSTALL_LOCATION, loc);
+ Settings.Global.putInt(mContext.getContentResolver(),
+ Settings.Global.DEFAULT_INSTALL_LOCATION, loc);
}
/*
@@ -2555,16 +2555,16 @@
*/
private boolean getUserSettingSetInstallLocation() {
try {
- return Settings.System.getInt(mContext.getContentResolver(), Settings.Secure.SET_INSTALL_LOCATION) != 0;
-
+ return Settings.Global.getInt(
+ mContext.getContentResolver(), Settings.Global.SET_INSTALL_LOCATION) != 0;
} catch (SettingNotFoundException e1) {
}
return false;
}
private void setUserSettingSetInstallLocation(boolean value) {
- Settings.System.putInt(mContext.getContentResolver(),
- Settings.Secure.SET_INSTALL_LOCATION, value ? 1 : 0);
+ Settings.Global.putInt(mContext.getContentResolver(),
+ Settings.Global.SET_INSTALL_LOCATION, value ? 1 : 0);
}
private void setUserX(boolean enable, int userSetting, int iloc) throws Exception {
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
index 24a9d71..76b1ec6 100644
--- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
+++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
@@ -672,9 +672,9 @@
}
// Pick user preference
- int installPreference = Settings.System.getInt(getApplicationContext()
+ int installPreference = Settings.Global.getInt(getApplicationContext()
.getContentResolver(),
- Settings.Secure.DEFAULT_INSTALL_LOCATION,
+ Settings.Global.DEFAULT_INSTALL_LOCATION,
PackageHelper.APP_INSTALL_AUTO);
if (installPreference == PackageHelper.APP_INSTALL_INTERNAL) {
prefer = PREFER_INTERNAL;
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index dc4213e..c8ce3cd 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -34,6 +34,7 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
+import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@@ -67,7 +68,7 @@
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 88;
+ private static final int DATABASE_VERSION = 89;
private Context mContext;
private int mUserHandle;
@@ -721,8 +722,8 @@
if (upgradeVersion == 55) {
/* Move the install location settings. */
String[] settingsToMove = {
- Secure.SET_INSTALL_LOCATION,
- Secure.DEFAULT_INSTALL_LOCATION
+ Global.SET_INSTALL_LOCATION,
+ Global.DEFAULT_INSTALL_LOCATION
};
moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_SECURE, settingsToMove, false);
db.beginTransaction();
@@ -730,8 +731,8 @@
try {
stmt = db.compileStatement("INSERT INTO system(name,value)"
+ " VALUES(?,?);");
- loadSetting(stmt, Secure.SET_INSTALL_LOCATION, 0);
- loadSetting(stmt, Secure.DEFAULT_INSTALL_LOCATION,
+ loadSetting(stmt, Global.SET_INSTALL_LOCATION, 0);
+ loadSetting(stmt, Global.DEFAULT_INSTALL_LOCATION,
PackageHelper.APP_INSTALL_AUTO);
db.setTransactionSuccessful();
} finally {
@@ -1333,6 +1334,52 @@
upgradeVersion = 88;
}
+ if (upgradeVersion == 88) {
+ if (mUserHandle == UserHandle.USER_OWNER) {
+ db.beginTransaction();
+ try {
+ String[] settingsToMove = {
+ Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD,
+ Settings.Global.BATTERY_DISCHARGE_THRESHOLD,
+ Settings.Global.SEND_ACTION_APP_ERROR,
+ Settings.Global.DROPBOX_AGE_SECONDS,
+ Settings.Global.DROPBOX_MAX_FILES,
+ Settings.Global.DROPBOX_QUOTA_KB,
+ Settings.Global.DROPBOX_QUOTA_PERCENT,
+ Settings.Global.DROPBOX_RESERVE_PERCENT,
+ Settings.Global.DROPBOX_TAG_PREFIX,
+ Settings.Global.ERROR_LOGCAT_PREFIX,
+ Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL,
+ Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD,
+ Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE,
+ Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES,
+ Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES,
+ Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
+ Settings.Global.CONNECTIVITY_CHANGE_DELAY,
+ Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED,
+ Settings.Global.CAPTIVE_PORTAL_SERVER,
+ Settings.Global.NSD_ON,
+ Settings.Global.SET_INSTALL_LOCATION,
+ Settings.Global.DEFAULT_INSTALL_LOCATION,
+ Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY,
+ Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY,
+ Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT,
+ Settings.Global.HTTP_PROXY,
+ Settings.Global.GLOBAL_HTTP_PROXY_HOST,
+ Settings.Global.GLOBAL_HTTP_PROXY_PORT,
+ Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
+ Settings.Global.SET_GLOBAL_HTTP_PROXY,
+ Settings.Global.DEFAULT_DNS_SERVER,
+ };
+ moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ }
+ upgradeVersion = 89;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
@@ -1741,8 +1788,8 @@
loadBooleanSetting(stmt, Settings.System.NOTIFICATION_LIGHT_PULSE,
R.bool.def_notification_pulse);
- loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 0);
- loadSetting(stmt, Settings.Secure.DEFAULT_INSTALL_LOCATION,
+ loadSetting(stmt, Settings.Global.SET_INSTALL_LOCATION, 0);
+ loadSetting(stmt, Settings.Global.DEFAULT_INSTALL_LOCATION,
PackageHelper.APP_INSTALL_AUTO);
loadUISoundEffectsSettings(stmt);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 2c0bf75..10f96cc 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -186,10 +186,8 @@
sSecureGlobalKeys.add(Settings.Global.WIFI_SAVED_STATE);
sSecureGlobalKeys.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
sSecureGlobalKeys.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
- sSecureGlobalKeys.add(Settings.Global.WIFI_WATCHDOG_NUM_ARP_PINGS);
sSecureGlobalKeys.add(Settings.Global.WIFI_WATCHDOG_ON);
sSecureGlobalKeys.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
- sSecureGlobalKeys.add(Settings.Global.WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS);
sSecureGlobalKeys.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
sSecureGlobalKeys.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
sSecureGlobalKeys.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
@@ -198,27 +196,59 @@
sSecureGlobalKeys.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
sSecureGlobalKeys.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
sSecureGlobalKeys.add(Settings.Global.WTF_IS_FATAL);
+ sSecureGlobalKeys.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
+ sSecureGlobalKeys.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
+ sSecureGlobalKeys.add(Settings.Global.SEND_ACTION_APP_ERROR);
+ sSecureGlobalKeys.add(Settings.Global.DROPBOX_AGE_SECONDS);
+ sSecureGlobalKeys.add(Settings.Global.DROPBOX_MAX_FILES);
+ sSecureGlobalKeys.add(Settings.Global.DROPBOX_QUOTA_KB);
+ sSecureGlobalKeys.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
+ sSecureGlobalKeys.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
+ sSecureGlobalKeys.add(Settings.Global.DROPBOX_TAG_PREFIX);
+ sSecureGlobalKeys.add(Settings.Global.ERROR_LOGCAT_PREFIX);
+ sSecureGlobalKeys.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
+ sSecureGlobalKeys.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
+ sSecureGlobalKeys.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
+ sSecureGlobalKeys.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
+ sSecureGlobalKeys.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
+ sSecureGlobalKeys.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
+ sSecureGlobalKeys.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
+ sSecureGlobalKeys.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
+ sSecureGlobalKeys.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
+ sSecureGlobalKeys.add(Settings.Global.NSD_ON);
+ sSecureGlobalKeys.add(Settings.Global.SET_INSTALL_LOCATION);
+ sSecureGlobalKeys.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
+ sSecureGlobalKeys.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
+ sSecureGlobalKeys.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
+ sSecureGlobalKeys.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
+ sSecureGlobalKeys.add(Settings.Global.HTTP_PROXY);
+ sSecureGlobalKeys.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
+ sSecureGlobalKeys.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
+ sSecureGlobalKeys.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
+ sSecureGlobalKeys.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
+ sSecureGlobalKeys.add(Settings.Global.DEFAULT_DNS_SERVER);
// Keys from the 'system' table now moved to 'global'
// These must match Settings.System.MOVED_TO_GLOBAL
sSystemGlobalKeys = new HashSet<String>();
- sSystemGlobalKeys.add(Settings.System.AIRPLANE_MODE_ON);
- sSystemGlobalKeys.add(Settings.System.AIRPLANE_MODE_RADIOS);
- sSystemGlobalKeys.add(Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
- sSystemGlobalKeys.add(Settings.System.AUTO_TIME);
- sSystemGlobalKeys.add(Settings.System.AUTO_TIME_ZONE);
- sSystemGlobalKeys.add(Settings.System.CAR_DOCK_SOUND);
- sSystemGlobalKeys.add(Settings.System.CAR_UNDOCK_SOUND);
- sSystemGlobalKeys.add(Settings.System.DESK_DOCK_SOUND);
- sSystemGlobalKeys.add(Settings.System.DESK_UNDOCK_SOUND);
- sSystemGlobalKeys.add(Settings.System.DOCK_SOUNDS_ENABLED);
- sSystemGlobalKeys.add(Settings.System.LOCK_SOUND);
- sSystemGlobalKeys.add(Settings.System.UNLOCK_SOUND);
- sSystemGlobalKeys.add(Settings.System.LOW_BATTERY_SOUND);
- sSystemGlobalKeys.add(Settings.System.POWER_SOUNDS_ENABLED);
- sSystemGlobalKeys.add(Settings.System.STAY_ON_WHILE_PLUGGED_IN);
- sSystemGlobalKeys.add(Settings.System.WIFI_SLEEP_POLICY);
+ sSystemGlobalKeys.add(Settings.Global.AIRPLANE_MODE_ON);
+ sSystemGlobalKeys.add(Settings.Global.AIRPLANE_MODE_RADIOS);
+ sSystemGlobalKeys.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
+ sSystemGlobalKeys.add(Settings.Global.AUTO_TIME);
+ sSystemGlobalKeys.add(Settings.Global.AUTO_TIME_ZONE);
+ sSystemGlobalKeys.add(Settings.Global.CAR_DOCK_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.CAR_UNDOCK_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.DESK_DOCK_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.DESK_UNDOCK_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.DOCK_SOUNDS_ENABLED);
+ sSystemGlobalKeys.add(Settings.Global.LOCK_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.UNLOCK_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.LOW_BATTERY_SOUND);
+ sSystemGlobalKeys.add(Settings.Global.POWER_SOUNDS_ENABLED);
+ sSystemGlobalKeys.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
+ sSystemGlobalKeys.add(Settings.Global.WIFI_SLEEP_POLICY);
+ sSystemGlobalKeys.add(Settings.Global.MODE_RINGER);
}
private boolean settingMovedToGlobal(final String name) {
diff --git a/services/java/com/android/server/BatteryService.java b/services/java/com/android/server/BatteryService.java
index fe8529b..0b4871d 100644
--- a/services/java/com/android/server/BatteryService.java
+++ b/services/java/com/android/server/BatteryService.java
@@ -463,10 +463,10 @@
private final void logOutlier(long duration) {
ContentResolver cr = mContext.getContentResolver();
- String dischargeThresholdString = Settings.Secure.getString(cr,
- Settings.Secure.BATTERY_DISCHARGE_THRESHOLD);
- String durationThresholdString = Settings.Secure.getString(cr,
- Settings.Secure.BATTERY_DISCHARGE_DURATION_THRESHOLD);
+ String dischargeThresholdString = Settings.Global.getString(cr,
+ Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
+ String durationThresholdString = Settings.Global.getString(cr,
+ Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
if (dischargeThresholdString != null && durationThresholdString != null) {
try {
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 891cac7..033aa1e 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -378,8 +378,8 @@
}
// read our default dns server ip
- String dns = Settings.Secure.getString(context.getContentResolver(),
- Settings.Secure.DEFAULT_DNS_SERVER);
+ String dns = Settings.Global.getString(context.getContentResolver(),
+ Settings.Global.DEFAULT_DNS_SERVER);
if (dns == null || dns.length() == 0) {
dns = context.getResources().getString(
com.android.internal.R.string.config_default_dns_server);
@@ -715,9 +715,9 @@
/** Check system properties for the default value then use secure settings value, if any. */
int defaultDelay = SystemProperties.getInt(
- "conn." + Settings.Secure.CONNECTIVITY_CHANGE_DELAY,
- Settings.Secure.CONNECTIVITY_CHANGE_DELAY_DEFAULT);
- return Settings.Secure.getInt(cr, Settings.Secure.CONNECTIVITY_CHANGE_DELAY,
+ "conn." + Settings.Global.CONNECTIVITY_CHANGE_DELAY,
+ ConnectivityManager.CONNECTIVITY_CHANGE_DELAY_DEFAULT);
+ return Settings.Global.getInt(cr, Settings.Global.CONNECTIVITY_CHANGE_DELAY,
defaultDelay);
}
@@ -2997,11 +2997,11 @@
if (VDBG) log("handleInetConditionChange: starting a change hold");
// setup a new hold to debounce this
if (mDefaultInetCondition > 50) {
- delay = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.INET_CONDITION_DEBOUNCE_UP_DELAY, 500);
+ delay = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY, 500);
} else {
- delay = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.INET_CONDITION_DEBOUNCE_DOWN_DELAY, 3000);
+ delay = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY, 3000);
}
mInetConditionChangeInFlight = true;
mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_INET_CONDITION_HOLD_END,
@@ -3070,9 +3070,9 @@
mGlobalProxy = null;
}
ContentResolver res = mContext.getContentResolver();
- Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_HOST, host);
- Settings.Secure.putInt(res, Settings.Secure.GLOBAL_HTTP_PROXY_PORT, port);
- Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
+ Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_HOST, host);
+ Settings.Global.putInt(res, Settings.Global.GLOBAL_HTTP_PROXY_PORT, port);
+ Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
exclList);
}
@@ -3084,10 +3084,10 @@
private void loadGlobalProxy() {
ContentResolver res = mContext.getContentResolver();
- String host = Settings.Secure.getString(res, Settings.Secure.GLOBAL_HTTP_PROXY_HOST);
- int port = Settings.Secure.getInt(res, Settings.Secure.GLOBAL_HTTP_PROXY_PORT, 0);
- String exclList = Settings.Secure.getString(res,
- Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
+ String host = Settings.Global.getString(res, Settings.Global.GLOBAL_HTTP_PROXY_HOST);
+ int port = Settings.Global.getInt(res, Settings.Global.GLOBAL_HTTP_PROXY_PORT, 0);
+ String exclList = Settings.Global.getString(res,
+ Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
if (!TextUtils.isEmpty(host)) {
ProxyProperties proxyProperties = new ProxyProperties(host, port, exclList);
synchronized (mGlobalProxyLock) {
@@ -3118,8 +3118,8 @@
}
private void handleDeprecatedGlobalHttpProxy() {
- String proxy = Settings.Secure.getString(mContext.getContentResolver(),
- Settings.Secure.HTTP_PROXY);
+ String proxy = Settings.Global.getString(mContext.getContentResolver(),
+ Settings.Global.HTTP_PROXY);
if (!TextUtils.isEmpty(proxy)) {
String data[] = proxy.split(":");
String proxyHost = data[0];
@@ -3162,8 +3162,8 @@
void observe(Context context) {
ContentResolver resolver = context.getContentResolver();
- resolver.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.HTTP_PROXY), false, this);
+ resolver.registerContentObserver(Settings.Global.getUriFor(
+ Settings.Global.HTTP_PROXY), false, this);
}
@Override
diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java
index 83fa55b..9607624 100644
--- a/services/java/com/android/server/DevicePolicyManagerService.java
+++ b/services/java/com/android/server/DevicePolicyManagerService.java
@@ -2124,9 +2124,9 @@
}
exclusionList = exclusionList.trim();
ContentResolver res = mContext.getContentResolver();
- Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_HOST, data[0]);
- Settings.Secure.putInt(res, Settings.Secure.GLOBAL_HTTP_PROXY_PORT, proxyPort);
- Settings.Secure.putString(res, Settings.Secure.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
+ Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_HOST, data[0]);
+ Settings.Global.putInt(res, Settings.Global.GLOBAL_HTTP_PROXY_PORT, proxyPort);
+ Settings.Global.putString(res, Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST,
exclusionList);
}
diff --git a/services/java/com/android/server/DeviceStorageMonitorService.java b/services/java/com/android/server/DeviceStorageMonitorService.java
index 750a2fb..a4c376d 100644
--- a/services/java/com/android/server/DeviceStorageMonitorService.java
+++ b/services/java/com/android/server/DeviceStorageMonitorService.java
@@ -163,8 +163,8 @@
mFreeMem = Long.parseLong(debugFreeMem);
}
// Read the log interval from secure settings
- long freeMemLogInterval = Settings.Secure.getLong(mContentResolver,
- Settings.Secure.SYS_FREE_STORAGE_LOG_INTERVAL,
+ long freeMemLogInterval = Settings.Global.getLong(mContentResolver,
+ Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL,
DEFAULT_FREE_STORAGE_LOG_INTERVAL_IN_MINUTES)*60*1000;
//log the amount of free memory in event log
long currTime = SystemClock.elapsedRealtime();
@@ -190,8 +190,8 @@
mFreeMem, mFreeSystem, mFreeCache);
}
// Read the reporting threshold from secure settings
- long threshold = Settings.Secure.getLong(mContentResolver,
- Settings.Secure.DISK_FREE_CHANGE_REPORTING_THRESHOLD,
+ long threshold = Settings.Global.getLong(mContentResolver,
+ Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD,
DEFAULT_DISK_FREE_CHANGE_REPORTING_THRESHOLD);
// If mFree changed significantly log the new value
long delta = mFreeMem - mLastReportedFreeMem;
@@ -309,15 +309,15 @@
* any way
*/
private long getMemThreshold() {
- long value = Settings.Secure.getInt(
+ long value = Settings.Global.getInt(
mContentResolver,
- Settings.Secure.SYS_STORAGE_THRESHOLD_PERCENTAGE,
+ Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE,
DEFAULT_THRESHOLD_PERCENTAGE);
if(localLOGV) Slog.v(TAG, "Threshold Percentage="+value);
value = (value*mTotalMemory)/100;
- long maxValue = Settings.Secure.getInt(
+ long maxValue = Settings.Global.getInt(
mContentResolver,
- Settings.Secure.SYS_STORAGE_THRESHOLD_MAX_BYTES,
+ Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES,
DEFAULT_THRESHOLD_MAX_BYTES);
//evaluate threshold value
return value < maxValue ? value : maxValue;
@@ -329,9 +329,9 @@
* any way
*/
private int getMemFullThreshold() {
- int value = Settings.Secure.getInt(
+ int value = Settings.Global.getInt(
mContentResolver,
- Settings.Secure.SYS_STORAGE_FULL_THRESHOLD_BYTES,
+ Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES,
DEFAULT_FULL_THRESHOLD_BYTES);
if(localLOGV) Slog.v(TAG, "Full Threshold Bytes="+value);
return value;
diff --git a/services/java/com/android/server/DropBoxManagerService.java b/services/java/com/android/server/DropBoxManagerService.java
index 0b12410..5008270 100644
--- a/services/java/com/android/server/DropBoxManagerService.java
+++ b/services/java/com/android/server/DropBoxManagerService.java
@@ -146,7 +146,7 @@
context.registerReceiver(mReceiver, filter);
mContentResolver.registerContentObserver(
- Settings.Secure.CONTENT_URI, true,
+ Settings.Global.CONTENT_URI, true,
new ContentObserver(new Handler()) {
@Override
public void onChange(boolean selfChange) {
@@ -265,8 +265,8 @@
}
public boolean isTagEnabled(String tag) {
- return !"disabled".equals(Settings.Secure.getString(
- mContentResolver, Settings.Secure.DROPBOX_TAG_PREFIX + tag));
+ return !"disabled".equals(Settings.Global.getString(
+ mContentResolver, Settings.Global.DROPBOX_TAG_PREFIX + tag));
}
public synchronized DropBoxManager.Entry getNextEntry(String tag, long millis) {
@@ -688,10 +688,10 @@
private synchronized long trimToFit() {
// Expunge aged items (including tombstones marking deleted data).
- int ageSeconds = Settings.Secure.getInt(mContentResolver,
- Settings.Secure.DROPBOX_AGE_SECONDS, DEFAULT_AGE_SECONDS);
- int maxFiles = Settings.Secure.getInt(mContentResolver,
- Settings.Secure.DROPBOX_MAX_FILES, DEFAULT_MAX_FILES);
+ int ageSeconds = Settings.Global.getInt(mContentResolver,
+ Settings.Global.DROPBOX_AGE_SECONDS, DEFAULT_AGE_SECONDS);
+ int maxFiles = Settings.Global.getInt(mContentResolver,
+ Settings.Global.DROPBOX_MAX_FILES, DEFAULT_MAX_FILES);
long cutoffMillis = System.currentTimeMillis() - ageSeconds * 1000;
while (!mAllFiles.contents.isEmpty()) {
EntryFile entry = mAllFiles.contents.first();
@@ -710,12 +710,12 @@
long uptimeMillis = SystemClock.uptimeMillis();
if (uptimeMillis > mCachedQuotaUptimeMillis + QUOTA_RESCAN_MILLIS) {
- int quotaPercent = Settings.Secure.getInt(mContentResolver,
- Settings.Secure.DROPBOX_QUOTA_PERCENT, DEFAULT_QUOTA_PERCENT);
- int reservePercent = Settings.Secure.getInt(mContentResolver,
- Settings.Secure.DROPBOX_RESERVE_PERCENT, DEFAULT_RESERVE_PERCENT);
- int quotaKb = Settings.Secure.getInt(mContentResolver,
- Settings.Secure.DROPBOX_QUOTA_KB, DEFAULT_QUOTA_KB);
+ int quotaPercent = Settings.Global.getInt(mContentResolver,
+ Settings.Global.DROPBOX_QUOTA_PERCENT, DEFAULT_QUOTA_PERCENT);
+ int reservePercent = Settings.Global.getInt(mContentResolver,
+ Settings.Global.DROPBOX_RESERVE_PERCENT, DEFAULT_RESERVE_PERCENT);
+ int quotaKb = Settings.Global.getInt(mContentResolver,
+ Settings.Global.DROPBOX_QUOTA_KB, DEFAULT_QUOTA_KB);
mStatFs.restat(mDropBoxDir.getPath());
int available = mStatFs.getAvailableBlocks();
diff --git a/services/java/com/android/server/NsdService.java b/services/java/com/android/server/NsdService.java
index 2a7a2eb..1b9742c 100644
--- a/services/java/com/android/server/NsdService.java
+++ b/services/java/com/android/server/NsdService.java
@@ -131,7 +131,7 @@
};
mContext.getContentResolver().registerContentObserver(
- Settings.Secure.getUriFor(Settings.Secure.NSD_ON),
+ Settings.Global.getUriFor(Settings.Global.NSD_ON),
false, contentObserver);
}
@@ -433,7 +433,7 @@
public void setEnabled(boolean enable) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL,
"NsdService");
- Settings.Secure.putInt(mContentResolver, Settings.Secure.NSD_ON, enable ? 1 : 0);
+ Settings.Global.putInt(mContentResolver, Settings.Global.NSD_ON, enable ? 1 : 0);
if (enable) {
mNsdStateMachine.sendMessage(NsdManager.ENABLE);
} else {
@@ -453,7 +453,7 @@
}
private boolean isNsdEnabled() {
- boolean ret = Settings.Secure.getInt(mContentResolver, Settings.Secure.NSD_ON, 1) == 1;
+ boolean ret = Settings.Global.getInt(mContentResolver, Settings.Global.NSD_ON, 1) == 1;
if (DBG) Slog.d(TAG, "Network service discovery enabled " + ret);
return ret;
}
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 0221245..bfefe67 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -8464,8 +8464,8 @@
sb.append(crashInfo.stackTrace);
}
- String setting = Settings.Secure.ERROR_LOGCAT_PREFIX + dropboxTag;
- int lines = Settings.Secure.getInt(mContext.getContentResolver(), setting, 0);
+ String setting = Settings.Global.ERROR_LOGCAT_PREFIX + dropboxTag;
+ int lines = Settings.Global.getInt(mContext.getContentResolver(), setting, 0);
if (lines > 0) {
sb.append("\n");
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index f2748a3..0efdead 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -104,7 +104,7 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
-import android.provider.Settings.Secure;
+import android.provider.Settings.Global;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.EventLog;
@@ -696,7 +696,7 @@
/**
* Update {@link NetworkStatsRecorder} and {@link #mGlobalAlertBytes} to
* reflect current {@link #mPersistThreshold} value. Always defers to
- * {@link Secure} values when defined.
+ * {@link Global} values when defined.
*/
private void updatePersistThresholds() {
mDevRecorder.setPersistThreshold(mSettings.getDevPersistBytes(mPersistThreshold));
@@ -1263,7 +1263,7 @@
/**
* Default external settings that read from
- * {@link android.provider.Settings.Secure}.
+ * {@link android.provider.Settings.Global}.
*/
private static class DefaultNetworkStatsSettings implements NetworkStatsSettings {
private final ContentResolver mResolver;
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index c4cdd07..6accb39 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -10015,16 +10015,16 @@
}
if (loc == PackageHelper.APP_INSTALL_AUTO || loc == PackageHelper.APP_INSTALL_INTERNAL
|| loc == PackageHelper.APP_INSTALL_EXTERNAL) {
- android.provider.Settings.System.putInt(mContext.getContentResolver(),
- android.provider.Settings.Secure.DEFAULT_INSTALL_LOCATION, loc);
+ android.provider.Settings.Global.putInt(mContext.getContentResolver(),
+ android.provider.Settings.Global.DEFAULT_INSTALL_LOCATION, loc);
return true;
}
return false;
}
public int getInstallLocation() {
- return android.provider.Settings.System.getInt(mContext.getContentResolver(),
- android.provider.Settings.Secure.DEFAULT_INSTALL_LOCATION,
+ return android.provider.Settings.Global.getInt(mContext.getContentResolver(),
+ android.provider.Settings.Global.DEFAULT_INSTALL_LOCATION,
PackageHelper.APP_INSTALL_AUTO);
}
@@ -10116,8 +10116,9 @@
*/
private boolean isPermissionEnforcedDefault(String permission) {
if (READ_EXTERNAL_STORAGE.equals(permission)) {
- return Secure.getInt(mContext.getContentResolver(),
- Secure.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT, 0) != 0;
+ return android.provider.Settings.Global.getInt(mContext.getContentResolver(),
+ android.provider.Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT, 0)
+ != 0;
} else {
return true;
}
diff --git a/services/tests/servicestests/src/com/android/server/DropBoxTest.java b/services/tests/servicestests/src/com/android/server/DropBoxTest.java
index f3baff4..6ce0a48 100644
--- a/services/tests/servicestests/src/com/android/server/DropBoxTest.java
+++ b/services/tests/servicestests/src/com/android/server/DropBoxTest.java
@@ -45,10 +45,10 @@
public class DropBoxTest extends AndroidTestCase {
public void tearDown() throws Exception {
ContentResolver cr = getContext().getContentResolver();
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_AGE_SECONDS, "");
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_MAX_FILES, "");
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_QUOTA_KB, "");
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_TAG_PREFIX + "DropBoxTest", "");
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_AGE_SECONDS, "");
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_MAX_FILES, "");
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_QUOTA_KB, "");
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_TAG_PREFIX + "DropBoxTest", "");
}
public void testAddText() throws Exception {
@@ -254,13 +254,13 @@
assertTrue(dropbox.isTagEnabled("DropBoxTest"));
ContentResolver cr = getContext().getContentResolver();
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_TAG_PREFIX + "DropBoxTest",
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_TAG_PREFIX + "DropBoxTest",
"disabled");
dropbox.addText("DropBoxTest", "TEST-DISABLED");
assertFalse(dropbox.isTagEnabled("DropBoxTest"));
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_TAG_PREFIX + "DropBoxTest",
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_TAG_PREFIX + "DropBoxTest",
"");
dropbox.addText("DropBoxTest", "TEST-ENABLED-AGAIN");
@@ -330,7 +330,7 @@
// Limit storage to 10 blocks
int kb = blockSize * 10 / 1024;
ContentResolver cr = getContext().getContentResolver();
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_QUOTA_KB, Integer.toString(kb));
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_QUOTA_KB, Integer.toString(kb));
// Three tags using a total of 12 blocks:
// DropBoxTest0 [ ][ ]
@@ -432,8 +432,8 @@
// Limit storage to 10 blocks with an expiration of 1 second
int kb = blockSize * 10 / 1024;
ContentResolver cr = getContext().getContentResolver();
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_AGE_SECONDS, "1");
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_QUOTA_KB, Integer.toString(kb));
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_AGE_SECONDS, "1");
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_QUOTA_KB, Integer.toString(kb));
// Write one normal entry and another so big that it is instantly tombstoned
long before = System.currentTimeMillis();
@@ -497,7 +497,7 @@
// Limit to 3 files and add one more entry
ContentResolver cr = getContext().getContentResolver();
- Settings.Secure.putString(cr, Settings.Secure.DROPBOX_MAX_FILES, "3");
+ Settings.Global.putString(cr, Settings.Global.DROPBOX_MAX_FILES, "3");
dropbox.addText("DropBoxTest", "TEST6");
// Verify only 3 files left