From a5b0211303abd95e010da5b97c4cdb92e0185234 Mon Sep 17 00:00:00 2001 From: Wysie Date: Wed, 18 Aug 2010 00:48:36 +0800 Subject: Added code to allow changing of custom message's colour. --- core/java/android/provider/Settings.java | 12 +++++++ .../android/internal/widget/LockPatternUtils.java | 42 +++++++++++++--------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index d997737..6170c90 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2924,6 +2924,18 @@ public final class Settings { public static final String LOCK_CUSTOM_MSG = "lock_screen_custom_msg"; /** + * LOCK_CUSTOM_MSG_COLOR + * @hide + */ + public static final String CUSTOM_MSG_COLOR = "lock_screen_custom_msg_color"; + + /** + * LOCK_CUSTOM_MSG_COLOR + * @hide + */ + public static final String CUSTOM_MSG_COLOR = "lock_screen_custom_msg_color"; + + /** * Whether assisted GPS should be enabled or not. * @hide */ diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index b227d67..0c88eb4 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -90,7 +90,7 @@ public class LockPatternUtils { private final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline"; private final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen"; public final static String PASSWORD_TYPE_KEY = "lockscreen.password_type"; - private final static String LOCK_PASSWORD_SALT_KEY = "lockscreen.password_salt"; + private final static String LOCK_PASSWORD_SALT_KEY = "lockscreen.password_salt"; private final Context mContext; private final ContentResolver mContentResolver; @@ -572,59 +572,67 @@ public class LockPatternUtils { public void setTactileFeedbackEnabled(boolean enabled) { setBoolean(Settings.Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, enabled); } - + public void setVisibleDotsEnabled(boolean enabled) { - setBoolean(Settings.Secure.LOCK_DOTS_VISIBLE, enabled); + setBoolean(Settings.Secure.LOCK_DOTS_VISIBLE, enabled); } - + public boolean isVisibleDotsEnabled() { return getBoolean(Settings.Secure.LOCK_DOTS_VISIBLE, true); } - + public void setShowErrorPath(boolean enabled) { - setBoolean(Settings.Secure.LOCK_SHOW_ERROR_PATH, enabled); + setBoolean(Settings.Secure.LOCK_SHOW_ERROR_PATH, enabled); } - + public boolean isShowErrorPath() { return getBoolean(Settings.Secure.LOCK_SHOW_ERROR_PATH, true); } - + public void setShowCustomMsg(boolean enabled) { setBoolean(Settings.Secure.LOCK_SHOW_CUSTOM_MSG, enabled); } - + public boolean isShowCustomMsg() { return getBoolean(Settings.Secure.LOCK_SHOW_CUSTOM_MSG, false); } - + public void setCustomMsg(String msg) { setString(Settings.Secure.LOCK_CUSTOM_MSG, msg); } - + public String getCustomMsg() { return getString(Settings.Secure.LOCK_CUSTOM_MSG); } - + + public void setCustomMsgColor(int color) { + setInt(Settings.Secure.CUSTOM_MSG_COLOR, color); + } + + public int getCustomMsgColor() { + return getInt(Settings.Secure.CUSTOM_MSG_COLOR, -1); + } + public int getIncorrectDelay() { return getInt(Settings.Secure.LOCK_INCORRECT_DELAY, 2000); } - + public void setIncorrectDelay(int delay) { setInt(Settings.Secure.LOCK_INCORRECT_DELAY, delay); } - + public void setShowUnlockMsg(boolean enabled) { setBoolean(Settings.Secure.SHOW_UNLOCK_TEXT, enabled); } - + public boolean isShowUnlockMsg() { return getBoolean(Settings.Secure.SHOW_UNLOCK_TEXT, true); } - + public void setShowUnlockErrMsg(boolean enabled) { setBoolean(Settings.Secure.SHOW_UNLOCK_ERR_TEXT, enabled); } - + public boolean isShowUnlockErrMsg() { return getBoolean(Settings.Secure.SHOW_UNLOCK_ERR_TEXT, true); } -- cgit v1.1