diff options
author | Jim Miller <jaggies@google.com> | 2014-07-17 14:46:05 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2014-07-18 20:48:34 +0000 |
commit | 06e345089a0425c6cd5a5596835113fb229b7d41 (patch) | |
tree | dd6dda2525d92824189d99b493b260709c50e148 /packages/Keyguard | |
parent | 9d59a76dd0e850558e83ef1a48fefd865fac1336 (diff) | |
download | frameworks_base-06e345089a0425c6cd5a5596835113fb229b7d41.zip frameworks_base-06e345089a0425c6cd5a5596835113fb229b7d41.tar.gz frameworks_base-06e345089a0425c6cd5a5596835113fb229b7d41.tar.bz2 |
Add DevicePolicyManager flag for fingerprint.
Change-Id: Icb3e4b98d97487179acefabc7a3b747d3d0fa23a
Diffstat (limited to 'packages/Keyguard')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index 5e80dfc..a5dbbcb 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -26,6 +26,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.pm.UserInfo; import android.database.ContentObserver; import android.graphics.Bitmap; @@ -36,6 +37,7 @@ import static android.os.BatteryManager.EXTRA_STATUS; import static android.os.BatteryManager.EXTRA_PLUGGED; import static android.os.BatteryManager.EXTRA_LEVEL; import static android.os.BatteryManager.EXTRA_HEALTH; + import android.media.AudioManager; import android.media.IRemoteControlDisplay; import android.os.BatteryManager; @@ -247,6 +249,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { Log.e(TAG, "Failed to get current user id: ", e); return; } + if (isFingerprintDisabled(userId)) { + Log.d(TAG, "Fingerprint disabled by DPM for userId: " + userId); + return; + } final ContentResolver res = mContext.getContentResolver(); final int ids[] = FingerprintUtils.getFingerprintIdsForUser(res, userId); for (int i = 0; i < ids.length; i++) { @@ -286,6 +292,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { return false; } + private boolean isFingerprintDisabled(int userId) { + final DevicePolicyManager dpm = + (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); + return dpm != null && (dpm.getKeyguardDisabledFeatures(null, userId) + & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0; + } + public boolean getUserHasTrust(int userId) { return !isTrustDisabled(userId) && mUserHasTrust.get(userId) || mUserFingerprintRecognized.get(userId); |