Merge changes I5e0a72a1,Iefcbf498 into qt-r1-dev
* changes: Favor setup face in search settings. Remove highlighting for work profile
This commit is contained in:
committed by
Android (Google) Code Review
commit
0839185647
@@ -31,6 +31,13 @@ public class FaceProfileStatusPreferenceController extends FaceStatusPreferenceC
|
||||
super(context, KEY_FACE_SETTINGS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
// Make the profile unsearchable so the user preference controller gets highlighted
|
||||
// when searched for.
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isUserSupported() {
|
||||
return mProfileChallengeUserId != UserHandle.USER_NULL
|
||||
|
@@ -78,6 +78,19 @@ public class FaceSettingsAppPreferenceController extends FaceSettingsPreferenceC
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if(mFaceManager == null){
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
|
||||
// By only allowing this preference controller to be searchable when the feature is turned
|
||||
// off, it will give preference to the face setup controller.
|
||||
final boolean hasEnrolledUser = mFaceManager.hasEnrolledTemplates(getUserId());
|
||||
final boolean appUnlockEnabled = Settings.Secure.getIntForUser(
|
||||
mContext.getContentResolver(), FACE_UNLOCK_APP_ENABLED, OFF, getUserId()) == ON;
|
||||
if (hasEnrolledUser && !appUnlockEnabled) {
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user