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

Commit 8784be6f authored by Chong Zhang's avatar Chong Zhang
Browse files

Add a few trace points for animation loading.

Also make sure focusMayChange is set as before commit 8c5d42.
We only want to skip the applyAnimationLocked if animation is
already set, make sure the rest are equivalent.

bug: 29405575

Change-Id: I8342b82d9e6e02fab002e16ffcde4a7479bf6867
parent 2cd8281a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3003,8 +3003,8 @@ public class WindowManagerService extends IWindowManager.Stub
        if (win.mAttrs.type == TYPE_APPLICATION_STARTING) {
            transit = WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
        }
        if (win.isWinVisibleLw() && !winAnimator.isAnimationSet()
                && winAnimator.applyAnimationLocked(transit, false)) {
        if (win.isWinVisibleLw() && (winAnimator.isAnimationSet() ||
                winAnimator.applyAnimationLocked(transit, false))) {
            focusMayChange = isDefaultDisplay;
            win.mAnimatingExit = true;
            win.mWinAnimator.mAnimating = true;
@@ -3170,6 +3170,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // frozen, there is no reason to animate and it can cause strange
        // artifacts when we unfreeze the display if some different animation
        // is running.
        Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "WM#applyAnimationLocked");
        if (okToDisplay()) {
            DisplayInfo displayInfo = getDefaultDisplayInfoLocked();
            final int width = displayInfo.appWidth;
@@ -3221,6 +3222,7 @@ public class WindowManagerService extends IWindowManager.Stub
        } else {
            atoken.mAppAnimator.clearAnimation();
        }
        Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);

        return atoken.mAppAnimator.animation != null;
    }
+4 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.graphics.RectF;
import android.graphics.Region;
import android.os.Debug;
import android.os.RemoteException;
import android.os.Trace;
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.MagnificationSpec;
@@ -1863,6 +1864,7 @@ class WindowStateAnimator {
        // frozen, there is no reason to animate and it can cause strange
        // artifacts when we unfreeze the display if some different animation
        // is running.
        Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "WSA#applyAnimationLocked");
        if (mService.okToDisplay()) {
            int anim = mPolicy.selectAnimationLw(mWin, transit);
            int attr = -1;
@@ -1902,6 +1904,8 @@ class WindowStateAnimator {
        } else {
            clearAnimation();
        }
        Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);

        if (mWin.mAttrs.type == TYPE_INPUT_METHOD) {
            mService.adjustForImeIfNeeded(mWin.mDisplayContent);
            if (isEntrance) {
+5 −0
Original line number Diff line number Diff line
@@ -1074,6 +1074,8 @@ class WindowSurfacePlacer {
        if (!transitionGoodToGo(appsCount)) {
            return 0;
        }
        Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "AppTransitionReady");

        if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO");
        int transit = mService.mAppTransition.getAppTransition();
        if (mService.mSkipAppTransitionAnimation) {
@@ -1207,6 +1209,9 @@ class WindowSurfacePlacer {
                true /*updateInputWindows*/);
        mService.mFocusMayChange = false;
        mService.notifyActivityDrawnForKeyguard();

        Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);

        return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG;
    }