Make bypass controller consistent with rest of face unlock settings
1) Should only be shown for owner profile 2) Should be disabled if A) not enrolled, B) DevicePolicyManager, C) HAL issue Fixes: 134700640 Test: Manual test of conditions above Change-Id: Id72db59c662df6c529c98aafd610de8c86c77ebd
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
|
||||
package com.android.settings.biometrics.face;
|
||||
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
|
||||
@@ -38,4 +40,13 @@ public abstract class FaceSettingsPreferenceController extends TogglePreferenceC
|
||||
protected int getUserId() {
|
||||
return mUserId;
|
||||
}
|
||||
|
||||
protected boolean adminDisabled() {
|
||||
DevicePolicyManager dpm =
|
||||
(DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
|
||||
return dpm != null &&
|
||||
(dpm.getKeyguardDisabledFeatures(null, UserHandle.myUserId())
|
||||
& DevicePolicyManager.KEYGUARD_DISABLE_FACE)
|
||||
!= 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user