diff options
Diffstat (limited to 'packages/Keyguard/src/com/android')
-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); |