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

Commit e9201876 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7757388 from ea07bec3 to sc-qpr1-release

Change-Id: I402e5738cbd06ee7403a8bcebdf927b1f4488e3d
parents 4146a63b ea07bec3
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
    private CryptoObject mCryptoObject;
    @Nullable private RemoveTracker mRemoveTracker;
    private Handler mHandler;
    @Nullable private float[] mEnrollStageThresholds;

    /**
     * Retrieves a list of properties for all fingerprint sensors on the device.
@@ -1326,6 +1327,46 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        }
    }

    /**
     * @hide
     */
    public int getEnrollStageCount() {
        if (mEnrollStageThresholds == null) {
            mEnrollStageThresholds = createEnrollStageThresholds(mContext);
        }
        return mEnrollStageThresholds.length + 1;
    }

    /**
     * @hide
     */
    public float getEnrollStageThreshold(int index) {
        if (mEnrollStageThresholds == null) {
            mEnrollStageThresholds = createEnrollStageThresholds(mContext);
        }

        if (index < 0 || index > mEnrollStageThresholds.length) {
            Slog.w(TAG, "Unsupported enroll stage index: " + index);
            return index < 0 ? 0f : 1f;
        }

        // The implicit threshold for the final stage is always 1.
        return index == mEnrollStageThresholds.length ? 1f : mEnrollStageThresholds[index];
    }

    @NonNull
    private static float[] createEnrollStageThresholds(@NonNull Context context) {
        // TODO(b/200604947): Fetch this value from FingerprintService, rather than internal config
        final String[] enrollStageThresholdStrings = context.getResources().getStringArray(
                com.android.internal.R.array.config_udfps_enroll_stage_thresholds);

        final float[] enrollStageThresholds = new float[enrollStageThresholdStrings.length];
        for (int i = 0; i < enrollStageThresholds.length; i++) {
            enrollStageThresholds[i] = Float.parseFloat(enrollStageThresholdStrings[i]);
        }
        return enrollStageThresholds;
    }

    /**
     * @hide
     */
+58 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ public class TranslateAnimation extends Animation {
    /** @hide */
    protected float mToYDelta;

    private int mWidth;
    private int mParentWidth;

    /**
     * Constructor used when a TranslateAnimation is loaded from a resource.
     *
@@ -179,5 +182,60 @@ public class TranslateAnimation extends Animation {
        mToXDelta = resolveSize(mToXType, mToXValue, width, parentWidth);
        mFromYDelta = resolveSize(mFromYType, mFromYValue, height, parentHeight);
        mToYDelta = resolveSize(mToYType, mToYValue, height, parentHeight);

        mWidth = width;
        mParentWidth = parentWidth;
    }

    /**
     * Checks whether or not the translation is exclusively an x axis translation.
     *
     * @hide
     */
    public boolean isXAxisTransition() {
        return mFromXDelta - mToXDelta != 0 && mFromYDelta - mToYDelta == 0;
    }

    /**
     * Checks whether or not the translation is a full width x axis slide in or out translation.
     *
     * @hide
     */
    public boolean isFullWidthTranslate() {
        boolean isXAxisSlideTransition =
                isSlideInLeft() || isSlideOutRight() || isSlideInRight() || isSlideOutLeft();
        return mWidth == mParentWidth && isXAxisSlideTransition;
    }

    private boolean isSlideInLeft() {
        boolean startsOutOfParentOnLeft = mFromXDelta <= -mWidth;
        return startsOutOfParentOnLeft && endsXEnclosedWithinParent();
    }

    private boolean isSlideOutRight() {
        boolean endOutOfParentOnRight = mToXDelta >= mParentWidth;
        return startsXEnclosedWithinParent() && endOutOfParentOnRight;
    }

    private boolean isSlideInRight() {
        boolean startsOutOfParentOnRight = mFromXDelta >= mParentWidth;
        return startsOutOfParentOnRight && endsXEnclosedWithinParent();
    }

    private boolean isSlideOutLeft() {
        boolean endOutOfParentOnLeft = mToXDelta <= -mWidth;
        return startsXEnclosedWithinParent() && endOutOfParentOnLeft;
    }

    private boolean endsXEnclosedWithinParent() {
        return mWidth <= mParentWidth
                && mToXDelta + mWidth <= mParentWidth
                && mToXDelta >= 0;
    }

    private boolean startsXEnclosedWithinParent() {
        return mWidth <= mParentWidth
                && mFromXDelta + mWidth <= mParentWidth
                && mFromXDelta >= 0;
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -4565,6 +4565,13 @@
    <!-- Indicates whether device has a power button fingerprint sensor. -->
    <bool name="config_is_powerbutton_fps" translatable="false" >false</bool>

    <!-- When each intermediate UDFPS enroll stage ends, as a fraction of total progress. -->
    <string-array name="config_udfps_enroll_stage_thresholds" translatable="false">
        <item>0.25</item>
        <item>0.5</item>
        <item>0.75</item>
    </string-array>

    <!-- Messages that should not be shown to the user during face auth enrollment. This should be
         used to hide messages that may be too chatty or messages that the user can't do much about.
         Entries are defined in android.hardware.biometrics.face@1.0 types.hal -->
+2 −1
Original line number Diff line number Diff line
@@ -2608,6 +2608,7 @@
  <java-symbol type="array" name="config_udfps_sensor_props" />
  <java-symbol type="integer" name="config_udfps_illumination_transition_ms" />
  <java-symbol type="bool" name="config_is_powerbutton_fps" />
  <java-symbol type="array" name="config_udfps_enroll_stage_thresholds" />

  <java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_vendor_enroll_ignorelist" />
+2 −2
Original line number Diff line number Diff line
@@ -303,13 +303,13 @@ public class PipController implements PipTransitionController.PipTransitionCallb
        mOneHandedController = oneHandedController;
        mPipTransitionController = pipTransitionController;
        mTaskStackListener = taskStackListener;
        mPipInputConsumer = new PipInputConsumer(WindowManagerGlobal.getWindowManagerService(),
                INPUT_CONSUMER_PIP, mainExecutor);
        //TODO: move this to ShellInit when PipController can be injected
        mMainExecutor.execute(this::init);
    }

    public void init() {
        mPipInputConsumer = new PipInputConsumer(WindowManagerGlobal.getWindowManagerService(),
                INPUT_CONSUMER_PIP, mMainExecutor);
        mPipTransitionController.registerPipTransitionCallback(this);
        mPipTaskOrganizer.registerOnDisplayIdChangeCallback((int displayId) -> {
            mPipBoundsState.setDisplayId(displayId);
Loading