diff options
author | Adrian Roos <roosa@google.com> | 2014-08-20 20:07:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-08-20 20:07:27 +0000 |
commit | ad2cff74634777c9d54d883a4670b503fc64acb0 (patch) | |
tree | 13a072dbb6a920ba58f70d4ec7ab1b82b8a48299 /packages/Keyguard | |
parent | bc31136802f8577bda928e8fc010b4f6afea44ba (diff) | |
parent | 4a4101714dbd17bdabc67812e7e2449613b3f5bb (diff) | |
download | frameworks_base-ad2cff74634777c9d54d883a4670b503fc64acb0.zip frameworks_base-ad2cff74634777c9d54d883a4670b503fc64acb0.tar.gz frameworks_base-ad2cff74634777c9d54d883a4670b503fc64acb0.tar.bz2 |
am e0f85cb7: Only show face unlock indication if it applies
* commit 'e0f85cb7ab0431f627f5c14f7b85db38903a44ae':
Only show face unlock indication if it applies
Diffstat (limited to 'packages/Keyguard')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | 18 | ||||
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index 0d79ee2..dc12cc7 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -218,7 +218,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { handleFingerprintProcessed(msg.arg1); break; case MSG_FACE_UNLOCK_STATE_CHANGED: - handleFaceUnlockStateChanged(msg.arg1 != 0); + handleFaceUnlockStateChanged(msg.arg1 != 0, msg.arg2); break; } } @@ -227,6 +227,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private SparseBooleanArray mUserHasTrust = new SparseBooleanArray(); private SparseBooleanArray mUserTrustIsManaged = new SparseBooleanArray(); private SparseBooleanArray mUserFingerprintRecognized = new SparseBooleanArray(); + private SparseBooleanArray mUserFaceUnlockRunning = new SparseBooleanArray(); @Override public void onTrustChanged(boolean enabled, int userId, boolean initiatedByUser) { @@ -297,15 +298,20 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } - private void handleFaceUnlockStateChanged(boolean running) { + private void handleFaceUnlockStateChanged(boolean running, int userId) { + mUserFaceUnlockRunning.put(userId, running); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { - cb.onFaceUnlockStateChanged(running); + cb.onFaceUnlockStateChanged(running, userId); } } } + public boolean isFaceUnlockRunning(int userId) { + return mUserFaceUnlockRunning.get(userId); + } + private boolean isTrustDisabled(int userId) { final DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); @@ -398,9 +404,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } else if (Intent.ACTION_BOOT_COMPLETED.equals(action)) { dispatchBootCompleted(); } else if (ACTION_FACE_UNLOCK_STARTED.equals(action)) { - mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 1, 0)); + mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 1, + getSendingUserId())); } else if (ACTION_FACE_UNLOCK_STOPPED.equals(action)) { - mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 0, 0)); + mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 0, + getSendingUserId())); } } }; diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java index 0acb9d0..33cab8f 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java @@ -197,5 +197,5 @@ public class KeyguardUpdateMonitorCallback { /** * Called when the state of face unlock changed. */ - public void onFaceUnlockStateChanged(boolean running) { } + public void onFaceUnlockStateChanged(boolean running, int userId) { } } |