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

Commit 88876f4f authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5719479 from 08391856 to qt-c2f2-release

Change-Id: I4a3c58cc05aecd644f80a6ef46e3506d476b0613
parents b3127076 08391856
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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
+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;
        }
    }
}