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

Commit 67e6070f authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Change method of tracking moving AppWindowTokens." into jb-dev

parents 9cf5831f ef25d7a0
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -134,10 +134,11 @@ public class WindowAnimator {
    }
    }


    private void updateWindowsAppsAndRotationAnimationsLocked() {
    private void updateWindowsAppsAndRotationAnimationsLocked() {
        final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
        int i;
        int i;
        final int NAT = mService.mAppTokens.size();
        final int NAT = appTokens.size();
        for (i=0; i<NAT; i++) {
        for (i=0; i<NAT; i++) {
            final AppWindowAnimator appAnimator = mService.mAppTokens.get(i).mAppAnimator;
            final AppWindowAnimator appAnimator = appTokens.get(i).mAppAnimator;
            final boolean wasAnimating = appAnimator.animation != null
            final boolean wasAnimating = appAnimator.animation != null
                    && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
                    && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
            if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
            if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
@@ -401,9 +402,10 @@ public class WindowAnimator {
    private void testTokenMayBeDrawnLocked() {
    private void testTokenMayBeDrawnLocked() {
        // See if any windows have been drawn, so they (and others
        // See if any windows have been drawn, so they (and others
        // associated with them) can now be shown.
        // associated with them) can now be shown.
        final int NT = mService.mAppTokens.size();
        final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
        final int NT = appTokens.size();
        for (int i=0; i<NT; i++) {
        for (int i=0; i<NT; i++) {
            AppWindowToken wtoken = mService.mAppTokens.get(i);
            AppWindowToken wtoken = appTokens.get(i);
            if (wtoken.mAppAnimator.freezingScreen) {
            if (wtoken.mAppAnimator.freezingScreen) {
                int numInteresting = wtoken.numInterestingWindows;
                int numInteresting = wtoken.numInterestingWindows;
                if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
                if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
+128 −89

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Original line Diff line number Diff line
@@ -841,7 +841,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
        }
    }
    }


    /** Returns true if this window desires key events. */
    /** Returns true if this window desires key events.
     * TODO(cmautner): Is this the same as {@link WindowManagerService#canBeImeTarget}
     */
    public final boolean canReceiveKeys() {
    public final boolean canReceiveKeys() {
        return     isVisibleOrAdding()
        return     isVisibleOrAdding()
                && (mViewVisibility == View.VISIBLE)
                && (mViewVisibility == View.VISIBLE)
+8 −5
Original line number Original line Diff line number Diff line
@@ -403,8 +403,8 @@ class WindowStateAnimator {


    boolean finishDrawingLocked() {
    boolean finishDrawingLocked() {
        if (mDrawState == DRAW_PENDING) {
        if (mDrawState == DRAW_PENDING) {
            if (DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(
            if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
                TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in "
                Slog.v(TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in "
                        + mSurface);
                        + mSurface);
            mDrawState = COMMIT_DRAW_PENDING;
            mDrawState = COMMIT_DRAW_PENDING;
            return true;
            return true;
@@ -417,7 +417,7 @@ class WindowStateAnimator {
        if (mDrawState != COMMIT_DRAW_PENDING) {
        if (mDrawState != COMMIT_DRAW_PENDING) {
            return false;
            return false;
        }
        }
        if (DEBUG_ANIM)
        if (DEBUG_SURFACE_TRACE || DEBUG_ANIM)
            Slog.i(TAG, "commitFinishDrawingLocked: mDrawState=READY_TO_SHOW " + mSurface);
            Slog.i(TAG, "commitFinishDrawingLocked: mDrawState=READY_TO_SHOW " + mSurface);
        mDrawState = READY_TO_SHOW;
        mDrawState = READY_TO_SHOW;
        final boolean starting = mWin.mAttrs.type == TYPE_APPLICATION_STARTING;
        final boolean starting = mWin.mAttrs.type == TYPE_APPLICATION_STARTING;
@@ -504,7 +504,9 @@ class WindowStateAnimator {
        @Override
        @Override
        public void setWindowCrop(Rect crop) {
        public void setWindowCrop(Rect crop) {
            super.setWindowCrop(crop);
            super.setWindowCrop(crop);
            if (crop != null) {
                mWindowCrop.set(crop);
                mWindowCrop.set(crop);
            }
            Slog.v(SURFACE_TAG, "setWindowCrop: " + this + ". Called by "
            Slog.v(SURFACE_TAG, "setWindowCrop: " + this + ". Called by "
                    + Debug.getCallers(3));
                    + Debug.getCallers(3));
        }
        }
@@ -1232,7 +1234,8 @@ class WindowStateAnimator {


            // Force the show in the next prepareSurfaceLocked() call.
            // Force the show in the next prepareSurfaceLocked() call.
            mLastAlpha = -1;
            mLastAlpha = -1;
            if (DEBUG_ANIM) Slog.v(TAG, "performShowLocked: mDrawState=HAS_DRAWN");
            if (DEBUG_SURFACE_TRACE || DEBUG_ANIM)
                Slog.v(TAG, "performShowLocked: mDrawState=HAS_DRAWN in " + this);
            mDrawState = HAS_DRAWN;
            mDrawState = HAS_DRAWN;
            mService.scheduleAnimationLocked();
            mService.scheduleAnimationLocked();


+1 −6
Original line number Original line Diff line number Diff line
@@ -71,10 +71,6 @@ class WindowToken {
    // windows will be put to the bottom of the list.
    // windows will be put to the bottom of the list.
    boolean sendingToBottom;
    boolean sendingToBottom;


    // Set to true when this token is in a pending transaction where its
    // windows will be put to the top of the list.
    boolean sendingToTop;

    WindowToken(WindowManagerService _service, IBinder _token, int type, boolean _explicit) {
    WindowToken(WindowManagerService _service, IBinder _token, int type, boolean _explicit) {
        service = _service;
        service = _service;
        token = _token;
        token = _token;
@@ -88,11 +84,10 @@ class WindowToken {
        pw.print(prefix); pw.print("windowType="); pw.print(windowType);
        pw.print(prefix); pw.print("windowType="); pw.print(windowType);
                pw.print(" hidden="); pw.print(hidden);
                pw.print(" hidden="); pw.print(hidden);
                pw.print(" hasVisible="); pw.println(hasVisible);
                pw.print(" hasVisible="); pw.println(hasVisible);
        if (waitingToShow || waitingToHide || sendingToBottom || sendingToTop) {
        if (waitingToShow || waitingToHide || sendingToBottom) {
            pw.print(prefix); pw.print("waitingToShow="); pw.print(waitingToShow);
            pw.print(prefix); pw.print("waitingToShow="); pw.print(waitingToShow);
                    pw.print(" waitingToHide="); pw.print(waitingToHide);
                    pw.print(" waitingToHide="); pw.print(waitingToHide);
                    pw.print(" sendingToBottom="); pw.print(sendingToBottom);
                    pw.print(" sendingToBottom="); pw.print(sendingToBottom);
                    pw.print(" sendingToTop="); pw.println(sendingToTop);
        }
        }
    }
    }