diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/provider/Settings.java | 13 | ||||
| -rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 24 |
2 files changed, 25 insertions, 12 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index cda0f36..074460a 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3216,20 +3216,27 @@ public final class Settings { /** - * This preference contains the string that shows for owner info on LockScren. + * This preference contains the string that shows for owner info on LockScreen. * @hide */ public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; /** - * Id of the user-selected appwidget on the lockscreen, or -1 if none + * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). * @hide */ public static final String LOCK_SCREEN_APPWIDGET_IDS = "lock_screen_appwidget_ids"; /** - * This preference enables showing the owner info on LockScren. + * Index of the lockscreen appwidget to restore, -1 if none. + * @hide + */ + public static final String LOCK_SCREEN_STICKY_APPWIDGET = + "lock_screen_sticky_appwidget"; + + /** + * This preference enables showing the owner info on LockScreen. * @hide */ public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index f6ae83c..f8c3b4d 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -150,7 +150,6 @@ public class LockPatternUtils { private final ContentResolver mContentResolver; private DevicePolicyManager mDevicePolicyManager; private ILockSettings mLockSettingsService; - private int mStickyWidgetIndex = -1; // The current user is set by KeyguardViewMediator and shared by all LockPatternUtils. private static volatile int sCurrentUserId = UserHandle.USER_NULL; @@ -1162,6 +1161,21 @@ public class LockPatternUtils { return true; } + public int getStickyAppWidgetIndex() { + return Settings.Secure.getIntForUser( + mContentResolver, + Settings.Secure.LOCK_SCREEN_STICKY_APPWIDGET, + -1, + UserHandle.USER_CURRENT); + } + + public void setStickyAppWidgetIndex(int value) { + Settings.Secure.putIntForUser(mContentResolver, + Settings.Secure.LOCK_SCREEN_STICKY_APPWIDGET, + value, + UserHandle.USER_CURRENT); + } + private long getLong(String secureSettingKey, long defaultValue) { try { return getLockSettings().getLong(secureSettingKey, defaultValue, @@ -1311,12 +1325,4 @@ public class LockPatternUtils { return getBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, true); } - public int getStickyWidgetIndex() { - return mStickyWidgetIndex; - } - - public void setStickyWidgetIndex(int stickyWidgetIndex) { - mStickyWidgetIndex = stickyWidgetIndex; - } - } |
