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

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

Snap for 7995257 from 3b3e39f6 to sc-v2-release

Change-Id: I89a859aa8143d6cf8bccde7f7759302aa8f7a21e
parents 1fd0e0e6 3b3e39f6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2685,6 +2685,16 @@ public final class ActivityThread extends ClientTransactionHandler
        }
    }

    void onSystemUiContextCleanup(ContextImpl context) {
        synchronized (this) {
            if (mDisplaySystemUiContexts == null) return;
            final int index = mDisplaySystemUiContexts.indexOfValue(context);
            if (index >= 0) {
                mDisplaySystemUiContexts.removeAt(index);
            }
        }
    }

    public void installSystemApplicationInfo(ApplicationInfo info, ClassLoader classLoader) {
        synchronized (this) {
            getSystemContext().installSystemApplicationInfo(info, classLoader);
+4 −0
Original line number Diff line number Diff line
@@ -3191,6 +3191,10 @@ class ContextImpl extends Context {
    final void performFinalCleanup(String who, String what) {
        //Log.i(TAG, "Cleanup up context: " + this);
        mPackageInfo.removeContextRegistrations(getOuterContext(), who, what);
        if (mContextType == CONTEXT_TYPE_SYSTEM_OR_SYSTEM_UI
                && mToken instanceof WindowTokenClient) {
            mMainThread.onSystemUiContextCleanup(this);
        }
    }

    @UnsupportedAppUsage
+1 −0
Original line number Diff line number Diff line
@@ -5810,6 +5810,7 @@ public class Notification implements Parcelable
                    p, result);
            buildCustomContentIntoTemplate(mContext, standard, customContent,
                    p, result);
            makeHeaderExpanded(standard);
            return standard;
        }

+4 −1
Original line number Diff line number Diff line
@@ -435,7 +435,10 @@ public class UiTranslationController {
                    if (view.getViewTranslationResponse() != null
                            && view.getViewTranslationResponse().equals(response)) {
                        if (callback instanceof TextViewTranslationCallback) {
                            if (((TextViewTranslationCallback) callback).isShowingTranslation()) {
                            TextViewTranslationCallback textViewCallback =
                                    (TextViewTranslationCallback) callback;
                            if (textViewCallback.isShowingTranslation()
                                    || textViewCallback.isAnimationRunning()) {
                                if (DEBUG) {
                                    Log.d(TAG, "Duplicate ViewTranslationResponse for " + autofillId
                                            + ". Ignoring.");
+11 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {

    private TranslationTransformationMethod mTranslationTransformation;
    private boolean mIsShowingTranslation = false;
    private boolean mAnimationRunning = false;
    private boolean mIsTextPaddingEnabled = false;
    private CharSequence mPaddedText;
    private int mAnimationDurationMillis = 250; // default value
@@ -92,6 +93,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
                (TextView) view,
                () -> {
                    mIsShowingTranslation = true;
                    mAnimationRunning = false;
                    // TODO(b/178353965): well-handle setTransformationMethod.
                    ((TextView) view).setTransformationMethod(transformation);
                });
@@ -124,6 +126,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
                    (TextView) view,
                    () -> {
                        mIsShowingTranslation = false;
                        mAnimationRunning = false;
                        ((TextView) view).setTransformationMethod(transformation);
                    });
            if (!TextUtils.isEmpty(mContentDescription)) {
@@ -162,6 +165,13 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
        return mIsShowingTranslation;
    }

    /**
     * Returns whether the view is running animation to show or hide the translation.
     */
    public boolean isAnimationRunning() {
        return mAnimationRunning;
    }

    @Override
    public void enableContentPadding() {
        mIsTextPaddingEnabled = true;
@@ -230,6 +240,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
            mAnimator.end();
            // Note: mAnimator is now null; do not use again here.
        }
        mAnimationRunning = true;
        int fadedOutColor = colorWithAlpha(view.getCurrentTextColor(), 0);
        mAnimator = ValueAnimator.ofArgb(view.getCurrentTextColor(), fadedOutColor);
        mAnimator.addUpdateListener(
Loading