aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-28 17:30:16 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-28 17:30:16 +0000
commit28531c7c8e5cd08256489e8bcae8a016c2e2c59b (patch)
treed07a2d88402a8ce5359168224b98acec6e7564e8
parent355d9222a5c8cc52545cfdf549fd4b926b86b15a (diff)
parentbb0c1138c4096cd7da668e38222cbc725e9cfc51 (diff)
downloadplatform-compat-28531c7c8e5cd08256489e8bcae8a016c2e2c59b.tar.gz
Snap for 9834661 from bb0c1138c4096cd7da668e38222cbc725e9cfc51 to mainline-wifi-releaseaml_wif_331910020aml_wif_331810010android13-mainline-wifi-release
Change-Id: I24b78d6db264f8bcd390221a17e8be23ec4c601b
-rw-r--r--java/android/compat/testing/app/SharedLibraryInfoDeviceTest.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/java/android/compat/testing/app/SharedLibraryInfoDeviceTest.java b/java/android/compat/testing/app/SharedLibraryInfoDeviceTest.java
index 054f51f..64e2337 100644
--- a/java/android/compat/testing/app/SharedLibraryInfoDeviceTest.java
+++ b/java/android/compat/testing/app/SharedLibraryInfoDeviceTest.java
@@ -29,6 +29,7 @@ import androidx.test.runner.AndroidJUnit4;
import com.android.modules.utils.build.SdkLevel;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
import org.junit.After;
import org.junit.Before;
@@ -40,6 +41,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Locale;
+import java.util.Set;
/**
* Device-side helper app for obtaining shared libraries.
@@ -51,6 +53,11 @@ import java.util.Locale;
public class SharedLibraryInfoDeviceTest {
private static final String TAG = "SharedLibraryInfoDeviceTest";
+ private static final Set<String> T_PLUS_EXCLUDES = ImmutableSet.of(
+ // This shared library's code is added to the bootclasspath in T+ by the
+ // AdServices mainline module.
+ "android.ext.adservices"
+ );
private final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
private final Context context = instrumentation.getTargetContext();
@@ -76,7 +83,7 @@ public class SharedLibraryInfoDeviceTest {
ImmutableList.Builder<String> content = ImmutableList.builder();
for (SharedLibraryInfo sharedLibrary : sharedLibraries) {
- if (!sharedLibrary.isNative()) {
+ if (!canSafelyIgnoreSharedLibrary(sharedLibrary)) {
content.add(String.format(Locale.US, "%s %d %d %s",
sharedLibrary.getName(),
sharedLibrary.getType(),
@@ -92,4 +99,14 @@ public class SharedLibraryInfoDeviceTest {
Files.write(detailsFilepath, lines);
}
+ private boolean canSafelyIgnoreSharedLibrary(SharedLibraryInfo sharedLibrary) {
+ if (sharedLibrary.isNative()) {
+ return true;
+ }
+ if (SdkLevel.isAtLeastT()) {
+ return T_PLUS_EXCLUDES.contains(sharedLibrary.getName());
+ }
+ return false;
+ }
+
}