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

Commit 8f799dc0 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in Snapshot#startAnimation" into sc-v2-dev

parents d159eccc 8127ce57
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import android.annotation.NonNull;
import android.util.proto.ProtoOutputStream;
import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
@@ -52,7 +53,7 @@ interface AnimationAdapter {
     * @param finishCallback The callback to be invoked when the animation has finished.
     */
    void startAnimation(SurfaceControl animationLeash, Transaction t, @AnimationType int type,
            OnAnimationFinishedCallback finishCallback);
            @NonNull OnAnimationFinishedCallback finishCallback);

    /**
     * Called when the animation that was started with {@link #startAnimation} was cancelled by the
+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ class InsetsSourceProvider {

        @Override
        public void startAnimation(SurfaceControl animationLeash, Transaction t,
                @AnimationType int type, OnAnimationFinishedCallback finishCallback) {
                @AnimationType int type, @NonNull OnAnimationFinishedCallback finishCallback) {
            // TODO(b/166736352): Check if we still need to control the IME visibility here.
            if (mSource.getType() == ITYPE_IME) {
                // TODO: use 0 alpha and remove t.hide() once b/138459974 is fixed.
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.wm;
import static com.android.server.wm.AnimationAdapterProto.LOCAL;
import static com.android.server.wm.LocalAnimationAdapterProto.ANIMATION_SPEC;

import android.annotation.NonNull;
import android.os.SystemClock;
import android.util.proto.ProtoOutputStream;
import android.view.SurfaceControl;
@@ -51,7 +52,7 @@ class LocalAnimationAdapter implements AnimationAdapter {

    @Override
    public void startAnimation(SurfaceControl animationLeash, Transaction t,
            @AnimationType int type, OnAnimationFinishedCallback finishCallback) {
            @AnimationType int type, @NonNull OnAnimationFinishedCallback finishCallback) {
        mAnimator.startAnimation(mSpec, animationLeash, t,
                () -> finishCallback.onAnimationFinished(type, this));
    }
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.wm;

import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;

import android.annotation.NonNull;
import android.view.SurfaceControl;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
@@ -144,7 +145,7 @@ public class NavBarFadeAnimationController extends FadeAnimationController{

        @Override
        public void startAnimation(SurfaceControl animationLeash, SurfaceControl.Transaction t,
                int type, SurfaceAnimator.OnAnimationFinishedCallback finishCallback) {
                int type, @NonNull SurfaceAnimator.OnAnimationFinishedCallback finishCallback) {
            super.startAnimation(animationLeash, t, type, finishCallback);
            if (mParent != null && mParent.isValid()) {
                t.reparent(animationLeash, mParent);
+2 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static com.android.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;

import android.annotation.NonNull;
import android.graphics.Rect;
import android.os.SystemClock;
import android.util.proto.ProtoOutputStream;
@@ -145,7 +146,7 @@ class NonAppWindowAnimationAdapter implements AnimationAdapter {

    @Override
    public void startAnimation(SurfaceControl animationLeash, SurfaceControl.Transaction t,
            int type, SurfaceAnimator.OnAnimationFinishedCallback finishCallback) {
            int type, @NonNull SurfaceAnimator.OnAnimationFinishedCallback finishCallback) {
        ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "startAnimation");
        mCapturedLeash = animationLeash;
        mCapturedLeashFinishCallback = finishCallback;
Loading