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

Commit 511ec047 authored by Kshitij's avatar Kshitij Committed by Nishith Khanna
Browse files

Settings: sfps-google: Guard Google SFPS extension

parent 04e20512
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright Murena SAS 2024
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~  along with this program.  If not, see <https://www.gnu.org/licenses/>.
  -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Indicates whether device uses Google's sfps implementation -->
    <bool name="config_use_google_side_fps" translatable="false">false</bool>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {

        } else if (mCanAssumeSfps) {
            mSfpsEnrollmentFeature = FeatureFactory.getFeatureFactory()
                    .getFingerprintFeatureProvider().getSfpsEnrollmentFeature();
                    .getFingerprintFeatureProvider().getSfpsEnrollmentFeature(getApplicationContext());
            setContentView(R.layout.sfps_enroll_enrolling);
            setHelpAnimation();
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ public interface FingerprintFeatureProvider {
     * Gets the feature implementation of SFPS enrollment.
     * @return the feature implementation
     */
    SfpsEnrollmentFeature getSfpsEnrollmentFeature();
    SfpsEnrollmentFeature getSfpsEnrollmentFeature(@NonNull Context context);

    /**
     * Gets calibrator for udfps pre-enroll
+2 −2
Original line number Diff line number Diff line
@@ -35,9 +35,9 @@ public class FingerprintFeatureProviderImpl implements FingerprintFeatureProvide
    private SfpsRestToUnlockFeature mSfpsRestToUnlockFeature = null;

    @Override
    public SfpsEnrollmentFeature getSfpsEnrollmentFeature() {
    public SfpsEnrollmentFeature getSfpsEnrollmentFeature(@NonNull Context context) {
        if (mSfpsEnrollmentFeatureImpl == null) {
            mSfpsEnrollmentFeatureImpl = new SfpsEnrollmentFeatureImpl();
            mSfpsEnrollmentFeatureImpl = new SfpsEnrollmentFeatureImpl(context);
        }
        return mSfpsEnrollmentFeatureImpl;
    }
+8 −1
Original line number Diff line number Diff line
@@ -50,6 +50,11 @@ public class SfpsEnrollmentFeatureImpl implements SfpsEnrollmentFeature {
    private FingerprintManager mFingerprintManager = null;

    private static final int HELP_RESUME_ENROLL_MSG = 1000;
    private Context mContext;

    public SfpsEnrollmentFeatureImpl(Context context) {
        this.mContext = context;
    }

    @Override
    public int getCurrentSfpsEnrollStage(int progressSteps, Function<Integer, Integer> mapper) {
@@ -111,7 +116,9 @@ public class SfpsEnrollmentFeatureImpl implements SfpsEnrollmentFeature {
    }

    private void resumeEnrollmentIfNecessary(int helpMsgId, String helpString, Supplier supplier) {
        if (helpMsgId == HELP_RESUME_ENROLL_MSG) {
        final boolean useGoogleSfps = mContext.getResources().getBoolean(
                R.bool.config_use_google_side_fps);
        if (helpMsgId == HELP_RESUME_ENROLL_MSG && useGoogleSfps) {
            SfpsUtils.resumeEnroll();
        }
    }