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

Commit 24843fdf authored by Paul Duffin's avatar Paul Duffin Committed by Android (Google) Code Review
Browse files

Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate"

parents 08c9ca52 ca4964cc
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@ import android.view.MotionEvent.PointerCoords;
import android.view.MotionEvent.PointerProperties;
import android.view.accessibility.AccessibilityEvent;

import com.android.internal.util.Predicate;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeoutException;
@@ -261,7 +259,7 @@ class InteractionController {
    }

    /**
     * Returns a Runnable for use in {@link #runAndWaitForEvents(Runnable, Predicate, long) to
     * Returns a Runnable for use in {@link #runAndWaitForEvents(Runnable, AccessibilityEventFilter, long) to
     * perform a click.
     *
     * @param x coordinate
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import android.view.accessibility.IAccessibilityInteractionConnectionCallback;

import com.android.internal.R;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.Predicate;

import java.util.ArrayList;
import java.util.HashMap;
@@ -51,6 +50,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.function.Predicate;

/**
 * Class for managing accessibility interactions initiated from the system
@@ -1205,7 +1205,7 @@ final class AccessibilityInteractionController {
        }

        @Override
        public boolean apply(View view) {
        public boolean test(View view) {
            if (view.getId() == mViewId && isShown(view)) {
                mInfos.add(view.createAccessibilityNodeInfo());
            }
+7 −7
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ import android.widget.FrameLayout;
import android.widget.ScrollBarDrawable;
import com.android.internal.R;
import com.android.internal.util.Predicate;
import com.android.internal.view.TooltipPopup;
import com.android.internal.view.menu.MenuBuilder;
import com.android.internal.widget.ScrollBarUtils;
@@ -140,6 +139,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Predicate;
/**
 * <p>
@@ -9325,7 +9325,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                final int id = mID;
                return root.findViewByPredicateInsideOut(this, new Predicate<View>() {
                    @Override
                    public boolean apply(View t) {
                    public boolean test(View t) {
                        return t.mNextFocusForwardId == id;
                    }
                });
@@ -20002,7 +20002,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @hide
     */
    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
        if (predicate.apply(this)) {
        if (predicate.test(this)) {
            return this;
        }
        return null;
@@ -24448,20 +24448,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
    }
    private class MatchIdPredicate implements Predicate<View> {
    private static class MatchIdPredicate implements Predicate<View> {
        public int mId;
        @Override
        public boolean apply(View view) {
        public boolean test(View view) {
            return (view.mID == mId);
        }
    }
    private class MatchLabelForPredicate implements Predicate<View> {
    private static class MatchLabelForPredicate implements Predicate<View> {
        private int mLabeledId;
        @Override
        public boolean apply(View view) {
        public boolean test(View view) {
            return (view.mLabelForId == mLabeledId);
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ import android.view.animation.LayoutAnimationController;
import android.view.animation.Transformation;

import com.android.internal.R;
import com.android.internal.util.Predicate;

import java.util.ArrayList;
import java.util.Arrays;
@@ -66,6 +65,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;

/**
 * <p>
@@ -4275,7 +4275,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     */
    @Override
    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
        if (predicate.apply(this)) {
        if (predicate.test(this)) {
            return this;
        }

+2 −2
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;

import com.android.internal.util.Predicate;
import com.android.internal.widget.ViewPager;

import java.util.ArrayList;
import java.util.function.Predicate;

/**
 * This displays a list of months in a calendar format with selectable days.
@@ -138,7 +138,7 @@ class DayPickerViewPager extends ViewPager {

    @Override
    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
        if (predicate.apply(this)) {
        if (predicate.test(this)) {
            return this;
        }

Loading