am 327d056d: am 656d09ed: am 0f6db1e8: Merge "Add DevicePolicyManager flag for fingerprint." into lmp-dev
* commit '327d056dca4cc804db27ae9591e20c7026cf1bd2': Add DevicePolicyManager flag for fingerprint.
This commit is contained in:
@@ -5423,6 +5423,7 @@ package android.app.admin {
|
||||
field public static int FLAG_PARENT_CAN_ACCESS_MANAGED;
|
||||
field public static final int KEYGUARD_DISABLE_FEATURES_ALL = 2147483647; // 0x7fffffff
|
||||
field public static final int KEYGUARD_DISABLE_FEATURES_NONE = 0; // 0x0
|
||||
field public static final int KEYGUARD_DISABLE_FINGERPRINT = 32; // 0x20
|
||||
field public static final int KEYGUARD_DISABLE_SECURE_CAMERA = 2; // 0x2
|
||||
field public static final int KEYGUARD_DISABLE_SECURE_NOTIFICATIONS = 4; // 0x4
|
||||
field public static final int KEYGUARD_DISABLE_TRUST_AGENTS = 16; // 0x10
|
||||
|
||||
@@ -1560,6 +1560,11 @@ public class DevicePolicyManager {
|
||||
*/
|
||||
public static final int KEYGUARD_DISABLE_TRUST_AGENTS = 1 << 4;
|
||||
|
||||
/**
|
||||
* Disable fingerprint sensor on keyguard secure screens (e.g. PIN/Pattern/Password).
|
||||
*/
|
||||
public static final int KEYGUARD_DISABLE_FINGERPRINT = 1 << 5;
|
||||
|
||||
/**
|
||||
* Disable all current and future keyguard customizations.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user