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

Commit 08391856 authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Android (Google) Code Review
Browse files

Merge changes I5e0a72a1,Iefcbf498 into qt-r1-dev

* changes:
  Favor setup face in search settings.
  Remove highlighting for work profile
parents 49175304 8bbbe545
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;
        }
    }
}