summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java15
2 files changed, 16 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index b5f517d..82e59c0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -237,6 +237,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
? R.drawable.ic_lock_open_24dp
: R.drawable.ic_lock_24dp;
mLockIcon.setImageResource(iconRes);
+ boolean trustManaged = mUnlockMethodCache.isTrustManaged();
+ mLockIcon.setBackgroundResource(trustManaged ? R.drawable.trust_circle : 0);
}
public KeyguardAffordanceView getPhoneView() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
index c9e0db6..58196f7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
@@ -37,6 +37,7 @@ public class UnlockMethodCache {
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private final ArrayList<OnUnlockMethodChangedListener> mListeners = new ArrayList<>();
private boolean mMethodInsecure;
+ private boolean mTrustManaged;
private UnlockMethodCache(Context ctx) {
mLockPatternUtils = new LockPatternUtils(ctx);
@@ -71,9 +72,11 @@ public class UnlockMethodCache {
int user = mLockPatternUtils.getCurrentUser();
boolean methodInsecure = !mLockPatternUtils.isSecure() ||
mKeyguardUpdateMonitor.getUserHasTrust(user);
- boolean changed = methodInsecure != mMethodInsecure;
+ boolean trustManaged = mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
+ boolean changed = methodInsecure != mMethodInsecure || trustManaged != mTrustManaged;
if (changed || updateAlways) {
mMethodInsecure = methodInsecure;
+ mTrustManaged = trustManaged;
notifyListeners(mMethodInsecure);
}
}
@@ -96,15 +99,25 @@ public class UnlockMethodCache {
}
@Override
+ public void onTrustManagedChanged(int userId) {
+ updateMethodSecure(false /* updateAlways */);
+ }
+
+ @Override
public void onScreenTurnedOn() {
updateMethodSecure(false /* updateAlways */);
}
+ @Override
public void onFingerprintRecognized(int userId) {
updateMethodSecure(false /* updateAlways */);
}
};
+ public boolean isTrustManaged() {
+ return mTrustManaged;
+ }
+
public static interface OnUnlockMethodChangedListener {
void onMethodSecureChanged(boolean methodSecure);
}