summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid van Tonder <david.vantonder@gmail.com>2013-04-03 17:31:40 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-04-03 17:31:40 -0700
commit29b548a4d160af91c0932ed3ab3603cc53022dc0 (patch)
tree0e110816daf0baf46b56ae3e6454ca21d67c30bf
parent8a96d5d16b83a31572e9f891eb6c0a10451d4127 (diff)
parentccab0c0b90d0b0a185557d727198df0b7c420087 (diff)
downloadframeworks_base-29b548a4d160af91c0932ed3ab3603cc53022dc0.zip
frameworks_base-29b548a4d160af91c0932ed3ab3603cc53022dc0.tar.gz
frameworks_base-29b548a4d160af91c0932ed3ab3603cc53022dc0.tar.bz2
Merge "LockPatternUtils: isSecure: respect profile settings" into cm-10.1
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 8961150..08c3537 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -18,6 +18,8 @@
package com.android.internal.widget;
import android.app.ActivityManagerNative;
+import android.app.Profile;
+import android.app.ProfileManager;
import android.app.admin.DevicePolicyManager;
import android.appwidget.AppWidgetManager;
import android.content.ContentResolver;
@@ -158,6 +160,7 @@ public class LockPatternUtils {
private final ContentResolver mContentResolver;
private DevicePolicyManager mDevicePolicyManager;
private ILockSettings mLockSettingsService;
+ private ProfileManager mProfileManager;
// The current user is set by KeyguardViewMediator and shared by all LockPatternUtils.
private static volatile int sCurrentUserId = UserHandle.USER_NULL;
@@ -180,6 +183,7 @@ public class LockPatternUtils {
public LockPatternUtils(Context context) {
mContext = context;
mContentResolver = context.getContentResolver();
+ mProfileManager = (ProfileManager) context.getSystemService(Context.PROFILE_SERVICE);
}
private ILockSettings getLockSettings() {
@@ -1275,8 +1279,9 @@ public class LockPatternUtils {
|| mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC
|| mode == DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC
|| mode == DevicePolicyManager.PASSWORD_QUALITY_COMPLEX;
- final boolean secure = isPattern && isLockPatternEnabled() && savedPatternExists()
- || isPassword && savedPasswordExists();
+ final boolean isProfileSecure = mProfileManager.getActiveProfile().getScreenLockMode() == Profile.LockMode.DEFAULT;
+ final boolean secure = (isPattern && isLockPatternEnabled() && savedPatternExists()
+ || isPassword && savedPasswordExists()) && isProfileSecure;
return secure;
}