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

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

Snap for 10832001 from 710ffbed to udc-qpr1-release

Change-Id: I93fd6a63b4f34b6a4ee38ea50efa94026ead6a9c
parents 8fda98a0 710ffbed
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1507,8 +1507,9 @@ public class ActivityOptions extends ComponentOptions {
    }

    /** @hide */
    public void setRemoteTransition(@Nullable RemoteTransition remoteTransition) {
    public ActivityOptions setRemoteTransition(@Nullable RemoteTransition remoteTransition) {
        mRemoteTransition = remoteTransition;
        return this;
    }

    /** @hide */
+16 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.os.PooledStringWriter;
import android.os.RemoteException;
import android.os.SystemClock;
import android.service.autofill.FillRequest;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
@@ -1557,6 +1558,10 @@ public class AssistStructure implements Parcelable {
        /**
         * Returns any text associated with the node that is displayed to the user, or null
         * if there is none.
         *
         * <p> The text will be stripped of any spans that could potentially contain reference to
         * the activity context, to avoid memory leak. If the text contained a span, a plain
         * string version of the text will be returned.
         */
        @Nullable
        public CharSequence getText() {
@@ -1996,14 +2001,16 @@ public class AssistStructure implements Parcelable {
        @Override
        public void setText(CharSequence text) {
            ViewNodeText t = getNodeText();
            t.mText = TextUtils.trimNoCopySpans(text);
            // Strip spans from the text to avoid memory leak
            t.mText = TextUtils.trimToParcelableSize(stripAllSpansFromText(text));
            t.mTextSelectionStart = t.mTextSelectionEnd = -1;
        }

        @Override
        public void setText(CharSequence text, int selectionStart, int selectionEnd) {
            ViewNodeText t = getNodeText();
            t.mText = TextUtils.trimNoCopySpans(text);
            // Strip spans from the text to avoid memory leak
            t.mText = stripAllSpansFromText(text);
            t.mTextSelectionStart = selectionStart;
            t.mTextSelectionEnd = selectionEnd;
        }
@@ -2222,6 +2229,13 @@ public class AssistStructure implements Parcelable {
        public void setHtmlInfo(@NonNull HtmlInfo htmlInfo) {
            mNode.mHtmlInfo = htmlInfo;
        }

        private CharSequence stripAllSpansFromText(CharSequence text) {
            if (text instanceof Spanned) {
                return text.toString();
            }
            return text;
        }
    }

    private static final class HtmlInfoNode extends HtmlInfo implements Parcelable {
+5 −1
Original line number Diff line number Diff line
@@ -104,7 +104,11 @@ final class InkWindow extends PhoneWindow {
     */
    void hide(boolean remove) {
        if (getDecorView() != null) {
            getDecorView().setVisibility(remove ? View.GONE : View.INVISIBLE);
            if (remove) {
                mWindowManager.removeViewImmediate(getDecorView());
            } else {
                getDecorView().setVisibility(View.INVISIBLE);
            }
        }
    }

+4 −4
Original line number Diff line number Diff line
@@ -124,16 +124,16 @@ public class WindowLayout {
                    || cutoutMode == LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES)) {
                final Insets systemBarsInsets = state.calculateInsets(
                        displayFrame, systemBars(), requestedVisibleTypes);
                if (systemBarsInsets.left > 0) {
                if (systemBarsInsets.left >= cutout.getSafeInsetLeft()) {
                    displayCutoutSafeExceptMaybeBars.left = MIN_X;
                }
                if (systemBarsInsets.top > 0) {
                if (systemBarsInsets.top >= cutout.getSafeInsetTop()) {
                    displayCutoutSafeExceptMaybeBars.top = MIN_Y;
                }
                if (systemBarsInsets.right > 0) {
                if (systemBarsInsets.right >= cutout.getSafeInsetRight()) {
                    displayCutoutSafeExceptMaybeBars.right = MAX_X;
                }
                if (systemBarsInsets.bottom > 0) {
                if (systemBarsInsets.bottom >= cutout.getSafeInsetBottom()) {
                    displayCutoutSafeExceptMaybeBars.bottom = MAX_Y;
                }
            }
+2 −39
Original line number Diff line number Diff line
@@ -16,10 +16,7 @@

package android.widget;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.TypedArray;
import android.os.Message;
import android.util.AttributeSet;
@@ -48,7 +45,6 @@ public class AdapterViewFlipper extends AdapterViewAnimator {
    private boolean mRunning = false;
    private boolean mStarted = false;
    private boolean mVisible = false;
    private boolean mUserPresent = true;
    private boolean mAdvancedByHost = false;

    public AdapterViewFlipper(Context context) {
@@ -82,40 +78,10 @@ public class AdapterViewFlipper extends AdapterViewAnimator {
        a.recycle();
    }

    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            final String action = intent.getAction();
            if (Intent.ACTION_SCREEN_OFF.equals(action)) {
                mUserPresent = false;
                updateRunning();
            } else if (Intent.ACTION_USER_PRESENT.equals(action)) {
                mUserPresent = true;
                updateRunning(false);
            }
        }
    };

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();

        // Listen for broadcasts related to user-presence
        final IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        filter.addAction(Intent.ACTION_USER_PRESENT);

        // OK, this is gross but needed. This class is supported by the
        // remote views machanism and as a part of that the remote views
        // can be inflated by a context for another user without the app
        // having interact users permission - just for loading resources.
        // For exmaple, when adding widgets from a user profile to the
        // home screen. Therefore, we register the receiver as the current
        // user not the one the context is for.
        getContext().registerReceiverAsUser(mReceiver, android.os.Process.myUserHandle(),
                filter, null, getHandler());


        if (mAutoStart) {
            // Automatically start when requested
            startFlipping();
@@ -126,8 +92,6 @@ public class AdapterViewFlipper extends AdapterViewAnimator {
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        mVisible = false;

        getContext().unregisterReceiver(mReceiver);
        updateRunning();
    }

@@ -235,8 +199,7 @@ public class AdapterViewFlipper extends AdapterViewAnimator {
     *            true.
     */
    private void updateRunning(boolean flipNow) {
        boolean running = !mAdvancedByHost && mVisible && mStarted && mUserPresent
                && mAdapter != null;
        boolean running = !mAdvancedByHost && mVisible && mStarted && mAdapter != null;
        if (running != mRunning) {
            if (running) {
                showOnly(mWhichChild, flipNow);
@@ -248,7 +211,7 @@ public class AdapterViewFlipper extends AdapterViewAnimator {
        }
        if (LOGD) {
            Log.d(TAG, "updateRunning() mVisible=" + mVisible + ", mStarted=" + mStarted
                    + ", mUserPresent=" + mUserPresent + ", mRunning=" + mRunning);
                    + ", mRunning=" + mRunning);
        }
    }

Loading