summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2015-01-08 16:20:49 +0100
committerAdrian Roos <roosa@google.com>2015-01-14 22:51:31 +0100
commit9dd16ebcf2a25c189a39b72847d3db2b1189cb4d (patch)
tree60c9fb47640b61107721f04d09a3eb91eb95cbd3 /packages/Keyguard
parentdce0122ea2d27474890d5e18ba4b7e4d06303e53 (diff)
downloadframeworks_base-9dd16ebcf2a25c189a39b72847d3db2b1189cb4d.zip
frameworks_base-9dd16ebcf2a25c189a39b72847d3db2b1189cb4d.tar.gz
frameworks_base-9dd16ebcf2a25c189a39b72847d3db2b1189cb4d.tar.bz2
LockPatternUtils clean up continued
- Deprecate Settings.Secure.LOCK_PATTERN_ENABLED - Remove unused permanent lock out - Disallow empty/null arguments to saveLockPattern and saveLockPassword - Refactor repeated quality checks Change-Id: I6f369eb60f8f6bb1e33384cd06534c713ab52e79
Diffstat (limited to 'packages/Keyguard')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
index 318fdd6..af6360a 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
@@ -22,7 +22,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.provider.AlarmClock;
+import android.os.UserHandle;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.AttributeSet;
@@ -42,7 +42,8 @@ public class KeyguardStatusView extends GridLayout {
private static final boolean DEBUG = KeyguardConstants.DEBUG;
private static final String TAG = "KeyguardStatusView";
- private LockPatternUtils mLockPatternUtils;
+ private final LockPatternUtils mLockPatternUtils;
+ private final AlarmManager mAlarmManager;
private TextView mAlarmStatusView;
private TextClock mDateView;
@@ -92,6 +93,8 @@ public class KeyguardStatusView extends GridLayout {
public KeyguardStatusView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
+ mLockPatternUtils = new LockPatternUtils(getContext());
}
private void setEnableMarquee(boolean enabled) {
@@ -109,7 +112,7 @@ public class KeyguardStatusView extends GridLayout {
mDateView.setShowCurrentUserTime(true);
mClockView.setShowCurrentUserTime(true);
mOwnerInfo = (TextView) findViewById(R.id.owner_info);
- mLockPatternUtils = new LockPatternUtils(getContext());
+
final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
setEnableMarquee(screenOn);
refresh();
@@ -140,7 +143,8 @@ public class KeyguardStatusView extends GridLayout {
}
private void refresh() {
- AlarmManager.AlarmClockInfo nextAlarm = mLockPatternUtils.getNextAlarm();
+ AlarmManager.AlarmClockInfo nextAlarm =
+ mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT);
Patterns.update(mContext, nextAlarm != null);
refreshTime();