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

Commit f6d87ec1 authored by Alan Viverette's avatar Alan Viverette
Browse files

Add consistent @NonNull annotations for drawable callbacks

Bug: 27599515
Change-Id: I33fdc5392302403bfff9cc74a8226173ec962af6
parent 95b69f82
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.app;
import com.android.internal.R;
import com.android.internal.app.MediaRouteDialogPresenter;

import android.annotation.NonNull;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.TypedArray;
@@ -279,7 +280,7 @@ public class MediaRouteButton extends View {
    }

    @Override
    protected boolean verifyDrawable(Drawable who) {
    protected boolean verifyDrawable(@NonNull Drawable who) {
        return super.verifyDrawable(who) || who == mRemoteIndicator;
    }

+3 −3
Original line number Diff line number Diff line
@@ -17505,7 +17505,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *        {@link SystemClock#uptimeMillis} timebase.
     */
    @Override
    public void scheduleDrawable(Drawable who, Runnable what, long when) {
    public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
        if (verifyDrawable(who) && what != null) {
            final long delay = when - SystemClock.uptimeMillis();
            if (mAttachInfo != null) {
@@ -17527,7 +17527,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param what the action to cancel
     */
    @Override
    public void unscheduleDrawable(Drawable who, Runnable what) {
    public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
        if (verifyDrawable(who) && what != null) {
            if (mAttachInfo != null) {
                mAttachInfo.mViewRootImpl.mChoreographer.removeCallbacks(
@@ -17637,7 +17637,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @see #drawableStateChanged()
     */
    @CallSuper
    protected boolean verifyDrawable(Drawable who) {
    protected boolean verifyDrawable(@NonNull Drawable who) {
        // Avoid verifying the scroll bar drawable so that we don't end up in
        // an invalidation loop. This effectively prevents the scroll bar
        // drawable from triggering invalidations and scheduling runnables.
+2 −2
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ public class ViewOverlay {
        }

        @Override
        protected boolean verifyDrawable(Drawable who) {
        protected boolean verifyDrawable(@NonNull Drawable who) {
            return super.verifyDrawable(who) || (mDrawables != null && mDrawables.contains(who));
        }

@@ -229,7 +229,7 @@ public class ViewOverlay {
        }

        @Override
        public void invalidateDrawable(Drawable drawable) {
        public void invalidateDrawable(@NonNull Drawable drawable) {
            invalidate(drawable.getBounds());
        }

+1 −1
Original line number Diff line number Diff line
@@ -2864,7 +2864,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
    }

    @Override
    public boolean verifyDrawable(Drawable dr) {
    public boolean verifyDrawable(@NonNull Drawable dr) {
        return mSelector == dr || super.verifyDrawable(dr);
    }

+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.widget;

import com.android.internal.R;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -485,7 +486,7 @@ public abstract class AbsSeekBar extends ProgressBar {
    }

    @Override
    protected boolean verifyDrawable(Drawable who) {
    protected boolean verifyDrawable(@NonNull Drawable who) {
        return who == mThumb || who == mTickMark || super.verifyDrawable(who);
    }

Loading