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

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

Snap for 8359595 from 140e9ba4 to sc-qpr3-release

Change-Id: I957b6d3812d71913320e2f0c32a40b36fe57f482
parents 45508a0b 140e9ba4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -512,6 +512,13 @@ public final class DeviceConfig {
    @SystemApi
    public static final String NAMESPACE_WINDOW_MANAGER_NATIVE_BOOT = "window_manager_native_boot";

    /**
     * Definitions for voice interaction related functions.
     *
     * @hide
     */
    public static final String NAMESPACE_VOICE_INTERACTION = "voice_interaction";

    /**
     * List of namespaces which can be read without READ_DEVICE_CONFIG permission
     *
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public final class GateKeeperResponse implements Parcelable {
            dest.writeInt(mTimeout);
        } else if (mResponseCode == RESPONSE_OK) {
            dest.writeInt(mShouldReEnroll ? 1 : 0);
            if (mPayload != null) {
            if (mPayload != null && mPayload.length > 0) {
                dest.writeInt(mPayload.length);
                dest.writeByteArray(mPayload);
            } else {
+3 −2
Original line number Diff line number Diff line
@@ -171,8 +171,9 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host {
    public void setSystemBarsAppearance(int appearance, int mask) {
        mViewRoot.mWindowAttributes.privateFlags |= PRIVATE_FLAG_APPEARANCE_CONTROLLED;
        final InsetsFlags insetsFlags = mViewRoot.mWindowAttributes.insetsFlags;
        if (insetsFlags.appearance != appearance) {
            insetsFlags.appearance = (insetsFlags.appearance & ~mask) | (appearance & mask);
        final int newAppearance = (insetsFlags.appearance & ~mask) | (appearance & mask);
        if (insetsFlags.appearance != newAppearance) {
            insetsFlags.appearance = newAppearance;
            mViewRoot.mWindowAttributesChanged = true;
            mViewRoot.scheduleTraversals();
        }
+4 −4
Original line number Diff line number Diff line
@@ -101,26 +101,26 @@ public final class UiTranslationManager {
    public static final String LOG_TAG = "UiTranslation";

    /**
     * The state caller request to disable utranslation,, it is no longer need to ui translation.
     * The state the caller requests to enable UI translation.
     *
     * @hide
     */
    public static final int STATE_UI_TRANSLATION_STARTED = 0;
    /**
     * The state caller request to pause ui translation, it will switch back to the original text.
     * The state caller requests to pause UI translation. It will switch back to the original text.
     *
     * @hide
     */
    public static final int STATE_UI_TRANSLATION_PAUSED = 1;
    /**
     * The state caller request to resume the paused ui translation, it will show the translated
     * The state caller requests to resume the paused UI translation. It will show the translated
     * text again if the text had been translated.
     *
     * @hide
     */
    public static final int STATE_UI_TRANSLATION_RESUMED = 2;
    /**
     * The state the caller request to enable ui translation.
     * The state the caller requests to disable UI translation when it no longer needs translation.
     *
     * @hide
     */
+12 −6
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
                    originalTranslationMethod);
        }
        final TransformationMethod transformation = mTranslationTransformation;
        runWithAnimation(
        runChangeTextWithAnimationIfNeeded(
                (TextView) view,
                () -> {
                    mIsShowingTranslation = true;
@@ -122,7 +122,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
        if (mTranslationTransformation != null) {
            final TransformationMethod transformation =
                    mTranslationTransformation.getOriginalTransformationMethod();
            runWithAnimation(
            runChangeTextWithAnimationIfNeeded(
                    (TextView) view,
                    () -> {
                        mIsShowingTranslation = false;
@@ -232,10 +232,16 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
     * Applies a simple text alpha animation when toggling between original and translated text. The
     * text is fully faded out, then swapped to the new text, then the fading is reversed.
     *
     * @param runnable the operation to run on the view after the text is faded out, to change to
     * displaying the original or translated text.
     * @param changeTextRunnable the operation to run on the view after the text is faded out, to
     * change to displaying the original or translated text.
     */
    private void runWithAnimation(TextView view, Runnable runnable) {
    private void runChangeTextWithAnimationIfNeeded(TextView view, Runnable changeTextRunnable) {
        boolean areAnimatorsEnabled = ValueAnimator.areAnimatorsEnabled();
        if (!areAnimatorsEnabled) {
            // The animation is disabled, just change display text
            changeTextRunnable.run();
            return;
        }
        if (mAnimator != null) {
            mAnimator.end();
            // Note: mAnimator is now null; do not use again here.
@@ -269,7 +275,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {

            @Override
            public void onAnimationRepeat(Animator animation) {
                runnable.run();
                changeTextRunnable.run();
            }
        });
        mAnimator.start();
Loading