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:
Kevin Chyn
2019-06-12 12:13:06 -07:00
parent 6a4a0e7396
commit 059980d215
5 changed files with 42 additions and 17 deletions

View File

@@ -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;
}
}