Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bbbe545 authored by joshmccloskey's avatar joshmccloskey Committed by Joshua Mccloskey
Browse files

Favor setup face in search settings.

Test: Manual.
Fixes: 137135217
Change-Id: I5e0a72a117e2af6d9262d07616cc539ee7a7e55e
parent 85081a4f
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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;
        }
    }
}