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

am: ee2fb3c59e

Change-Id: I197bd9e2458ff9f966754c459ee77f03c3517eb5
This commit is contained in:
Paul Duffin
2017-11-14 13:15:37 +00:00
committed by android-build-merger
2 changed files with 13 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ package com.android.internal.util;
* strongly encouraged to state this fact clearly in their API documentation. * strongly encouraged to state this fact clearly in their API documentation.
* *
* @deprecated Use {@code java.util.function.Predicate} instead. * @deprecated Use {@code java.util.function.Predicate} instead.
* This must not be used outside frameworks/base/test-runner.
*/ */
@Deprecated @Deprecated
public interface Predicate<T> { public interface Predicate<T> {

View File

@@ -31,7 +31,6 @@ import android.support.test.filters.MediumTest;
import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4;
import android.util.ArraySet; import android.util.ArraySet;
import com.android.internal.util.Predicate;
import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem; import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem;
import org.junit.Test; import org.junit.Test;
@@ -176,4 +175,16 @@ public class TaskSnapshotPersisterLoaderTest extends TaskSnapshotPersisterTestBa
new File(sFilesDir.getPath() + "/snapshots/2_reduced.jpg")}; new File(sFilesDir.getPath() + "/snapshots/2_reduced.jpg")};
assertTrueForFiles(existsFiles, File::exists, " must exist"); 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);
}
} }