From 4de9936e85696208dfe91d1c40e3e5226e57634a Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 26 Sep 2012 17:58:19 -0700 Subject: Remove unused Secure settings. Carefully leave default values intact in Watchdog for now. Bug: 7232007, 7232230 Change-Id: Id944181109305aed41e0766fdd39625b43cb1d19 --- core/java/android/provider/Settings.java | 135 ------------------------- services/java/com/android/server/Watchdog.java | 29 ++---- 2 files changed, 7 insertions(+), 157 deletions(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 0817672654b7..0d980c02c18b 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3763,133 +3763,6 @@ public final class Settings { */ public static final String LAST_SETUP_SHOWN = "last_setup_shown"; - /** - * How frequently (in seconds) to check the memory status of the - * device. - * @hide - */ - public static final String MEMCHECK_INTERVAL = "memcheck_interval"; - - /** - * Max frequency (in seconds) to log memory check stats, in realtime - * seconds. This allows for throttling of logs when the device is - * running for large amounts of time. - * @hide - */ - public static final String MEMCHECK_LOG_REALTIME_INTERVAL = - "memcheck_log_realtime_interval"; - - /** - * Boolean indicating whether rebooting due to system memory checks - * is enabled. - * @hide - */ - public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled"; - - /** - * How many bytes the system process must be below to avoid scheduling - * a soft reboot. This reboot will happen when it is next determined - * to be a good time. - * @hide - */ - public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft"; - - /** - * How many bytes the system process must be below to avoid scheduling - * a hard reboot. This reboot will happen immediately. - * @hide - */ - public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard"; - - /** - * How many bytes the phone process must be below to avoid scheduling - * a soft restart. This restart will happen when it is next determined - * to be a good time. - * @hide - */ - public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft"; - - /** - * How many bytes the phone process must be below to avoid scheduling - * a hard restart. This restart will happen immediately. - * @hide - */ - public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard"; - - /** - * Boolean indicating whether restarting the phone process due to - * memory checks is enabled. - * @hide - */ - public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled"; - - /** - * First time during the day it is okay to kill processes - * or reboot the device due to low memory situations. This number is - * in seconds since midnight. - * @hide - */ - public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time"; - - /** - * Last time during the day it is okay to kill processes - * or reboot the device due to low memory situations. This number is - * in seconds since midnight. - * @hide - */ - public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time"; - - /** - * How long the screen must have been off in order to kill processes - * or reboot. This number is in seconds. A value of -1 means to - * entirely disregard whether the screen is on. - * @hide - */ - public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off"; - - /** - * How much time there must be until the next alarm in order to kill processes - * or reboot. This number is in seconds. Note: this value must be - * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will - * always see an alarm scheduled within its time. - * @hide - */ - public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm"; - - /** - * How frequently to check whether it is a good time to restart things, - * if the device is in a bad state. This number is in seconds. Note: - * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else - * the alarm to schedule the recheck will always appear within the - * minimum "do not execute now" time. - * @hide - */ - public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval"; - - /** - * How frequently (in DAYS) to reboot the device. If 0, no reboots - * will occur. - * @hide - */ - public static final String REBOOT_INTERVAL = "reboot_interval"; - - /** - * First time during the day it is okay to force a reboot of the - * device (if REBOOT_INTERVAL is set). This number is - * in seconds since midnight. - * @hide - */ - public static final String REBOOT_START_TIME = "reboot_start_time"; - - /** - * The window of time (in seconds) after each REBOOT_INTERVAL in which - * a reboot can be executed. If 0, a reboot will always be executed at - * exactly the given time. Otherwise, it will only be executed if - * the device is idle within the window. - * @hide - */ - public static final String REBOOT_WINDOW = "reboot_window"; - /** * Threshold values for the duration and level of a discharge cycle, under * which we log discharge cycle info. @@ -4310,14 +4183,6 @@ public final class Settings { public static final String READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; - /** - * Duration in milliseconds before pre-authorized URIs for the contacts - * provider should expire. - * @hide - */ - public static final String CONTACTS_PREAUTH_URI_EXPIRATION = - "contacts_preauth_uri_expiration"; - /** * This are the settings to be backed up. * diff --git a/services/java/com/android/server/Watchdog.java b/services/java/com/android/server/Watchdog.java index 9edfad6560fb..9dbe50352d8e 100644 --- a/services/java/com/android/server/Watchdog.java +++ b/services/java/com/android/server/Watchdog.java @@ -33,7 +33,6 @@ import android.os.Process; import android.os.ServiceManager; import android.os.SystemClock; import android.os.SystemProperties; -import android.provider.Settings; import android.util.EventLog; import android.util.Log; import android.util.Slog; @@ -118,9 +117,7 @@ public class Watchdog extends Thread { case MONITOR: { // See if we should force a reboot. int rebootInterval = mReqRebootInterval >= 0 - ? mReqRebootInterval : Settings.Secure.getInt( - mResolver, Settings.Secure.REBOOT_INTERVAL, - REBOOT_DEFAULT_INTERVAL); + ? mReqRebootInterval : REBOOT_DEFAULT_INTERVAL; if (mRebootInterval != rebootInterval) { mRebootInterval = rebootInterval; // We have been running long enough that a reboot can @@ -226,9 +223,7 @@ public class Watchdog extends Thread { void checkReboot(boolean fromAlarm) { int rebootInterval = mReqRebootInterval >= 0 ? mReqRebootInterval - : Settings.Secure.getInt( - mResolver, Settings.Secure.REBOOT_INTERVAL, - REBOOT_DEFAULT_INTERVAL); + : REBOOT_DEFAULT_INTERVAL; mRebootInterval = rebootInterval; if (rebootInterval <= 0) { // No reboot interval requested. @@ -238,17 +233,11 @@ public class Watchdog extends Thread { } long rebootStartTime = mReqRebootStartTime >= 0 ? mReqRebootStartTime - : Settings.Secure.getLong( - mResolver, Settings.Secure.REBOOT_START_TIME, - REBOOT_DEFAULT_START_TIME); + : REBOOT_DEFAULT_START_TIME; long rebootWindowMillis = (mReqRebootWindow >= 0 ? mReqRebootWindow - : Settings.Secure.getLong( - mResolver, Settings.Secure.REBOOT_WINDOW, - REBOOT_DEFAULT_WINDOW)) * 1000; + : REBOOT_DEFAULT_WINDOW) * 1000; long recheckInterval = (mReqRecheckInterval >= 0 ? mReqRecheckInterval - : Settings.Secure.getLong( - mResolver, Settings.Secure.MEMCHECK_RECHECK_INTERVAL, - MEMCHECK_DEFAULT_RECHECK_INTERVAL)) * 1000; + : MEMCHECK_DEFAULT_RECHECK_INTERVAL) * 1000; retrieveBrutalityAmount(); @@ -325,13 +314,9 @@ public class Watchdog extends Thread { */ void retrieveBrutalityAmount() { mMinScreenOff = (mReqMinScreenOff >= 0 ? mReqMinScreenOff - : Settings.Secure.getInt( - mResolver, Settings.Secure.MEMCHECK_MIN_SCREEN_OFF, - MEMCHECK_DEFAULT_MIN_SCREEN_OFF)) * 1000; + : MEMCHECK_DEFAULT_MIN_SCREEN_OFF) * 1000; mMinAlarm = (mReqMinNextAlarm >= 0 ? mReqMinNextAlarm - : Settings.Secure.getInt( - mResolver, Settings.Secure.MEMCHECK_MIN_ALARM, - MEMCHECK_DEFAULT_MIN_ALARM)) * 1000; + : MEMCHECK_DEFAULT_MIN_ALARM) * 1000; } /** -- cgit v1.2.3-59-g8ed1b