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

Commit 78d84698 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "revert-31356655-ZFWTJUPGDA" into main

* changes:
  Revert "[Improve fill dialog] Get IME updates to autofill"
  Revert "[Fill Dialog Improvements] Using Ime animation updats"
parents 5cecb7f6 9f765b7e
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1146,14 +1146,6 @@ interface IWindowManager
     */
    KeyboardShortcutGroup getApplicationLaunchKeyboardShortcuts(int deviceId);

    /*
     * Notifies about IME insets animation.
     *
     * @param running Indicates the insets animation state.
     * @param animationType Indicates the {@link InsetsController.AnimationType}
     */
     oneway void notifyImeInsetsAnimationStateChanged(boolean running, int animationType);

    /**
     * Returns whether the display with {@code displayId} ignores orientation request.
     */
+11 −12
Original line number Diff line number Diff line
@@ -214,14 +214,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
         * Notifies when the state of running animation is changed. The state is either "running" or
         * "idle".
         *
         * @param running       {@code true} if the given insets types start running
         *                      {@code false} otherwise.
         * @param animationType {@link AnimationType}
         * @param insetsTypes   {@link Type}.
         * @param running {@code true} if there is any animation running; {@code false} otherwise.
         */
        default void notifyAnimationRunningStateChanged(boolean running,
                @AnimationType int animationType, @InsetsType int insetsTypes) {
        }
        default void notifyAnimationRunningStateChanged(boolean running) {}

        /** @see ViewRootImpl#isHandlingPointerEvent */
        default boolean isHandlingPointerEvent() {
@@ -749,8 +744,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
                    final InsetsAnimationControlRunner runner = new InsetsResizeAnimationRunner(
                            mFrame, mFromState, mToState, RESIZE_INTERPOLATOR,
                            ANIMATION_DURATION_RESIZE, mTypes, InsetsController.this);
                    mHost.notifyAnimationRunningStateChanged(true,
                            runner.getAnimationType(), mTypes);
                    if (mRunningAnimations.isEmpty()) {
                        mHost.notifyAnimationRunningStateChanged(true);
                    }
                    mRunningAnimations.add(new RunningAnimation(runner, runner.getAnimationType()));
                }
            };
@@ -1564,7 +1560,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
            }
        }
        ImeTracker.forLogging().onProgress(statsToken, ImeTracker.PHASE_CLIENT_ANIMATION_RUNNING);
        mHost.notifyAnimationRunningStateChanged(true, animationType, types);
        if (mRunningAnimations.isEmpty()) {
            mHost.notifyAnimationRunningStateChanged(true);
        }
        mRunningAnimations.add(new RunningAnimation(runner, animationType));
        if (DEBUG) Log.d(TAG, "Animation added to runner. useInsetsAnimationThread: "
                + useInsetsAnimationThread);
@@ -1844,8 +1842,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
                break;
            }
        }
        mHost.notifyAnimationRunningStateChanged(
                false, control.getAnimationType(), removedTypes);
        if (mRunningAnimations.isEmpty()) {
            mHost.notifyAnimationRunningStateChanged(false);
        }
        onAnimationStateChanged(removedTypes, false /* running */);
    }

+9 −44
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import static android.graphics.HardwareRenderer.SYNC_CONTEXT_IS_STOPPED;
import static android.graphics.HardwareRenderer.SYNC_LOST_SURFACE_REWARD_IF_FOUND;
import static android.os.IInputConstants.INVALID_INPUT_EVENT_ID;
import static android.os.Trace.TRACE_TAG_VIEW;
import static android.service.autofill.Flags.improveFillDialogAconfig;
import static android.util.SequenceUtils.getInitSeq;
import static android.util.SequenceUtils.isIncomingSeqStale;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -923,8 +922,6 @@ public final class ViewRootImpl implements ViewParent,
    private boolean mInsetsAnimationRunning;
    private int mInsetsAnimatingTypes = 0;
    private long mPreviousFrameDrawnTime = -1;
    // The largest view size percentage to the display size. Used on trace to collect metric.
    private float mLargestChildPercentage = 0.0f;
@@ -2523,52 +2520,20 @@ public final class ViewRootImpl implements ViewParent,
     * Notify the when the running state of a insets animation changed.
     */
    @VisibleForTesting
    public void notifyInsetsAnimationRunningStateChanged(boolean running,
            @InsetsController.AnimationType int animationType,
            @InsetsType int insetsTypes) {
        @InsetsType int previousInsetsType = mInsetsAnimatingTypes;
        // If improveFillDialogAconfig is disabled, we notify WindowSession of all the updates we
        // receive here
        boolean notifyWindowSession = !improveFillDialogAconfig();
        if (running) {
            mInsetsAnimatingTypes |= insetsTypes;
        } else {
            mInsetsAnimatingTypes &= ~insetsTypes;
        }
    public void notifyInsetsAnimationRunningStateChanged(boolean running) {
        if (sToolkitSetFrameRateReadOnlyFlagValue) {
            mInsetsAnimationRunning = running;
            // If improveFillDialogAconfig is enabled, we need to confirm other animations aren't
            // running to maintain the existing behavior. System server were notified previously
            // only when animation started running or stopped when there were no running animations.
            if (improveFillDialogAconfig()) {
                if ((previousInsetsType == 0 && mInsetsAnimatingTypes != 0)
                        || (previousInsetsType != 0 && mInsetsAnimatingTypes == 0)) {
                    notifyWindowSession = true;
                }
            }
            if (notifyWindowSession) {
            if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
                Trace.instant(Trace.TRACE_TAG_VIEW,
                        TextUtils.formatSimple("notifyInsetsAnimationRunningStateChanged(%s)",
                        Boolean.toString(running)));
            }
            mInsetsAnimationRunning = running;
            try {
                mWindowSession.notifyInsetsAnimationRunningStateChanged(mWindow, running);
            } catch (RemoteException e) {
            }
        }
    }
        if (improveFillDialogAconfig()) {
            // Update WindowManager for ImeAnimation
            if ((insetsTypes & WindowInsets.Type.ime()) != 0) {
                try {
                    WindowManagerGlobal.getWindowManagerService()
                            .notifyImeInsetsAnimationStateChanged(running, animationType);
                } catch (RemoteException e) {
                }
            }
        }
    }
    @Override
    public void requestLayout() {
+2 −5
Original line number Diff line number Diff line
@@ -275,12 +275,9 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host {
    }

    @Override
    public void notifyAnimationRunningStateChanged(boolean running,
            @InsetsController.AnimationType int animationType,
            @WindowInsets.Type.InsetsType int insetsTypes) {
    public void notifyAnimationRunningStateChanged(boolean running) {
        if (mViewRoot != null) {
            mViewRoot.notifyInsetsAnimationRunningStateChanged(
                    running, animationType, insetsTypes);
            mViewRoot.notifyInsetsAnimationRunningStateChanged(running);
        }
    }

+1 −2
Original line number Diff line number Diff line
@@ -1054,8 +1054,7 @@ public class ViewRootImplTest {
        ViewRootImpl viewRootImpl = mView.getViewRootImpl();
        sInstrumentation.runOnMainSync(() -> {
            mView.invalidate();
            viewRootImpl.notifyInsetsAnimationRunningStateChanged(true, 0 /* animationType */,
                    0 /* insetsTypes */  /* areOtherAnimationsRunning */);
            viewRootImpl.notifyInsetsAnimationRunningStateChanged(true);
            mView.invalidate();
        });
        sInstrumentation.waitForIdleSync();
Loading