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

Commit 5bebea43 authored by Jeff Brown's avatar Jeff Brown
Browse files

Rename remove callback methods.

Change-Id: Ib9ef32fedbe0db2ea5efd250693915d626d7d8ae
parent 2b6cb9a2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ public final class Choreographer {
    }

    /**
     * Removes an animation callback.
     * Removes animation callbacks for the specified runnable.
     * Does nothing if the specified animation callback has not been posted or has already
     * been removed.
     *
@@ -205,12 +205,12 @@ public final class Choreographer {
     * @see #postAnimationCallback
     * @see #postAnimationCallbackDelayed
     */
    public void removeAnimationCallback(Runnable runnable) {
    public void removeAnimationCallbacks(Runnable runnable) {
        if (runnable == null) {
            throw new IllegalArgumentException("runnable must not be null");
        }
        synchronized (mLock) {
            mAnimationCallbacks = removeCallbackLocked(mAnimationCallbacks, runnable);
            mAnimationCallbacks = removeCallbacksLocked(mAnimationCallbacks, runnable);
        }
        mHandler.removeMessages(MSG_POST_DELAYED_ANIMATION, runnable);
    }
@@ -260,7 +260,7 @@ public final class Choreographer {
    }

    /**
     * Removes a draw callback.
     * Removes draw callbacks for the specified runnable.
     * Does nothing if the specified draw callback has not been posted or has already
     * been removed.
     *
@@ -269,12 +269,12 @@ public final class Choreographer {
     * @see #postDrawCallback
     * @see #postDrawCallbackDelayed
     */
    public void removeDrawCallback(Runnable runnable) {
    public void removeDrawCallbacks(Runnable runnable) {
        if (runnable == null) {
            throw new IllegalArgumentException("runnable must not be null");
        }
        synchronized (mLock) {
            mDrawCallbacks = removeCallbackLocked(mDrawCallbacks, runnable);
            mDrawCallbacks = removeCallbacksLocked(mDrawCallbacks, runnable);
        }
        mHandler.removeMessages(MSG_POST_DELAYED_DRAW, runnable);
    }
@@ -427,7 +427,7 @@ public final class Choreographer {
        return head;
    }

    private Callback removeCallbackLocked(Callback head, Runnable runnable) {
    private Callback removeCallbacksLocked(Callback head, Runnable runnable) {
        Callback predecessor = null;
        for (Callback callback = head; callback != null;) {
            final Callback next = callback.next;
+2 −2
Original line number Diff line number Diff line
@@ -876,7 +876,7 @@ public final class ViewRootImpl implements ViewParent,

        if (mFrameScheduled) {
            mFrameScheduled = false;
            mChoreographer.removeDrawCallback(mFrameRunnable);
            mChoreographer.removeDrawCallbacks(mFrameRunnable);
        }
    }

@@ -4027,7 +4027,7 @@ public final class ViewRootImpl implements ViewParent,
                }

                if (mPosted && mViews.isEmpty() && mViewRects.isEmpty()) {
                    mChoreographer.removeAnimationCallback(this);
                    mChoreographer.removeAnimationCallbacks(this);
                    mPosted = false;
                }
            }