summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:10:07 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:10:07 +0000
commita5a4d9725746aaaa0c5f7f88dc67e1549a2e6443 (patch)
tree68f6e96c5973defdb5db5e14e0e7ec4cc9df4d9d
parent4c93154158bcfe4174924851b688f443dc8cb8e5 (diff)
parent30c4f7914598ea987d8c430a344a1bc916aee338 (diff)
downloadlibtextclassifier-a5a4d9725746aaaa0c5f7f88dc67e1549a2e6443.tar.gz
Snap for 10453563 from 30c4f7914598ea987d8c430a344a1bc916aee338 to mainline-sdkext-release
Change-Id: I8344995f5d0e7d80f98f7c707939f15094e3cd27
-rw-r--r--TEST_MAPPING7
-rw-r--r--java/tests/instrumentation/src/com/android/textclassifier/downloader/ModelDownloaderIntegrationTest.java6
-rw-r--r--native/Android.bp18
-rw-r--r--native/AndroidTest.xml5
4 files changed, 32 insertions, 4 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 370acd6..17a31d4 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -18,7 +18,12 @@
"name": "TextClassifierNotificationTests"
},
{
- "name": "TCSModelDownloaderIntegrationTest"
+ "name": "TCSModelDownloaderIntegrationTest",
+ "options": [
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
}
],
"hwasan-postsubmit": [
diff --git a/java/tests/instrumentation/src/com/android/textclassifier/downloader/ModelDownloaderIntegrationTest.java b/java/tests/instrumentation/src/com/android/textclassifier/downloader/ModelDownloaderIntegrationTest.java
index e74c7db..2d06afd 100644
--- a/java/tests/instrumentation/src/com/android/textclassifier/downloader/ModelDownloaderIntegrationTest.java
+++ b/java/tests/instrumentation/src/com/android/textclassifier/downloader/ModelDownloaderIntegrationTest.java
@@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat;
import android.view.textclassifier.TextClassification;
import android.view.textclassifier.TextClassification.Request;
+import androidx.test.filters.FlakyTest;
import com.android.textclassifier.testing.ExtServicesTextClassifierRule;
import org.junit.After;
import org.junit.Before;
@@ -69,6 +70,7 @@ public class ModelDownloaderIntegrationTest {
}
@Test
+ @FlakyTest(bugId = 284901878)
public void smokeTest() throws Exception {
extServicesTextClassifierRule.addDeviceConfigOverride(
"manifest_url_annotator_en", V804_EN_ANNOTATOR_MANIFEST_URL);
@@ -77,6 +79,7 @@ public class ModelDownloaderIntegrationTest {
}
@Test
+ @FlakyTest(bugId = 284901878)
public void downgradeModel() throws Exception {
// Download an experimental model.
extServicesTextClassifierRule.addDeviceConfigOverride(
@@ -92,6 +95,7 @@ public class ModelDownloaderIntegrationTest {
}
@Test
+ @FlakyTest(bugId = 284901878)
public void upgradeModel() throws Exception {
// Download a model.
extServicesTextClassifierRule.addDeviceConfigOverride(
@@ -107,6 +111,7 @@ public class ModelDownloaderIntegrationTest {
}
@Test
+ @FlakyTest(bugId = 284901878)
public void clearFlag() throws Exception {
// Download a new model.
extServicesTextClassifierRule.addDeviceConfigOverride(
@@ -122,6 +127,7 @@ public class ModelDownloaderIntegrationTest {
}
@Test
+ @FlakyTest(bugId = 267344737)
public void modelsForMultipleLanguagesDownloaded() throws Exception {
extServicesTextClassifierRule.addDeviceConfigOverride("multi_language_support_enabled", "true");
extServicesTextClassifierRule.addDeviceConfigOverride(
diff --git a/native/Android.bp b/native/Android.bp
index ed514da..efea632 100644
--- a/native/Android.bp
+++ b/native/Android.bp
@@ -31,6 +31,7 @@ cc_library_headers {
"com.android.neuralnetworks",
"test_com.android.neuralnetworks",
],
+ min_sdk_version: "apex_inherit",
sdk_version: "current",
}
@@ -61,6 +62,7 @@ cc_library_static {
defaults: ["libtextclassifier_hash_defaults"],
sdk_version: "current",
stl: "libc++_static",
+ min_sdk_version: "apex_inherit",
apex_available: [
"//apex_available:platform",
"com.android.neuralnetworks",
@@ -235,7 +237,9 @@ cc_library {
"**/*_test-include.*",
"**/*unittest.*",
],
-
+ static_libs: [
+ "libflatbuffers-cpp",
+ ],
version_script: "jni.lds",
apex_available: [
@@ -274,8 +278,15 @@ cc_test {
"libtextclassifier_fbgen_utils_lua_utils_tests",
],
- compile_multilib: "prefer32",
-
+ compile_multilib: "both",
+ multilib: {
+ lib32: {
+ suffix: "32",
+ },
+ lib64: {
+ suffix: "64",
+ },
+ },
// A workaround for code coverage. See b/166040889#comment23
sdk_variant_only: true,
}
@@ -296,6 +307,7 @@ cc_test_library {
],
version_script: "jni.lds",
static_libs: [
+ "libflatbuffers-cpp",
"libgmock_ndk",
"libgtest_ndk_c++",
"libbase_ndk",
diff --git a/native/AndroidTest.xml b/native/AndroidTest.xml
index 11893f5..15ce73e 100644
--- a/native/AndroidTest.xml
+++ b/native/AndroidTest.xml
@@ -21,6 +21,11 @@
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
<option name="cleanup" value="true" />
<option name="push" value="libtextclassifier_tests->/data/local/tmp/libtextclassifier_tests" />
+ <option name="append-bitness" value="true" />
+ </target_preparer>
+
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <option name="cleanup" value="true" />
<option name="push" value="actions->/data/local/tmp/actions" />
<option name="push" value="annotator->/data/local/tmp/annotator" />
<option name="push" value="utils->/data/local/tmp/utils" />