Favor setup face in search settings.
Test: Manual. Fixes: 137135217 Change-Id: I5e0a72a117e2af6d9262d07616cc539ee7a7e55e
This commit is contained in:
committed by
Joshua Mccloskey
parent
85081a4f7e
commit
8bbbe545f2
@@ -78,6 +78,19 @@ public class FaceSettingsAppPreferenceController extends FaceSettingsPreferenceC
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
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;
|
return AVAILABLE;
|
||||||
|
} else {
|
||||||
|
return AVAILABLE_UNSEARCHABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user