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

Commit ee2fb3c5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Stop using c.a.i.u.Predicate outside test-runner"

parents f7f5732e 41f81ba0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ package com.android.internal.util;
 * strongly encouraged to state this fact clearly in their API documentation.
 *
 * @deprecated Use {@code java.util.function.Predicate} instead.
 *             This must not be used outside frameworks/base/test-runner.
 */
@Deprecated
public interface Predicate<T> {
+12 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.support.test.filters.MediumTest;
import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet;

import com.android.internal.util.Predicate;
import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem;

import org.junit.Test;
@@ -176,4 +175,16 @@ public class TaskSnapshotPersisterLoaderTest extends TaskSnapshotPersisterTestBa
                new File(sFilesDir.getPath() + "/snapshots/2_reduced.jpg")};
        assertTrueForFiles(existsFiles, File::exists, " must exist");
    }

    /**
     * Private predicate definition.
     *
     * This is needed because com.android.internal.util.Predicate is deprecated
     * and can only be used with classes fron android.test.runner. This cannot
     * use java.util.function.Predicate because that is not present on all API
     * versions that this test must run on.
     */
    private interface Predicate<T> {
        boolean apply(T t);
    }
}