Snap for 11224086 from dc6eff193d61657e4c6c6a33daf0808add91986c to mainline-tzdata5-release

Change-Id: I25c68e11efb308f076018b62d64b928d2af0bfdb
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 17a31d4..35a11fd 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -9,7 +9,10 @@
       ]
     },
     {
-      "name": "libtextclassifier_tests"
+      "name": "libtextclassifier_tests-tplus"
+    },
+    {
+      "name": "libtextclassifier_tests-sminus"
     },
     {
       "name": "libtextclassifier_java_tests"
@@ -36,7 +39,10 @@
       ]
     },
     {
-      "name": "libtextclassifier_tests"
+      "name": "libtextclassifier_tests-tplus"
+    },
+    {
+      "name": "libtextclassifier_tests-sminus"
     },
     {
       "name": "libtextclassifier_java_tests"
@@ -47,13 +53,25 @@
   ],
   "mainline-presubmit": [
     {
+      "name": "TextClassifierNotificationTests[com.google.android.extservices_tplus.apex]"
+    },
+    {
+      "name": "TextClassifierServiceTest[com.google.android.extservices_tplus.apex]"
+    },
+    {
+      "name": "libtextclassifier_tests-tplus[com.google.android.extservices_tplus.apex]"
+    },
+    {
+      "name": "libtextclassifier_java_tests[com.google.android.extservices_tplus.apex]"
+    },
+    {
       "name": "TextClassifierNotificationTests[com.google.android.extservices.apex]"
     },
     {
       "name": "TextClassifierServiceTest[com.google.android.extservices.apex]"
     },
     {
-      "name": "libtextclassifier_tests[com.google.android.extservices.apex]"
+      "name": "libtextclassifier_tests-sminus[com.google.android.extservices.apex]"
     },
     {
       "name": "libtextclassifier_java_tests[com.google.android.extservices.apex]"
diff --git a/native/Android.bp b/native/Android.bp
index efea632..a57df61 100644
--- a/native/Android.bp
+++ b/native/Android.bp
@@ -30,6 +30,7 @@
         "//apex_available:platform",
         "com.android.neuralnetworks",
         "test_com.android.neuralnetworks",
+        "com.android.ondevicepersonalization",
     ],
     min_sdk_version: "apex_inherit",
     sdk_version: "current",
@@ -69,6 +70,7 @@
         "test_com.android.neuralnetworks",
         "com.android.extservices",
         "com.android.adservices",
+        "com.android.ondevicepersonalization",
     ],
 }
 
@@ -252,7 +254,7 @@
 // libtextclassifier_tests
 // -----------------------
 cc_test {
-    name: "libtextclassifier_tests",
+    name: "libtextclassifier_tests-tplus",
     defaults: ["libtextclassifier_defaults"],
 
     test_suites: ["general-tests", "mts-extservices"],
@@ -289,6 +291,48 @@
     },
     // A workaround for code coverage. See b/166040889#comment23
     sdk_variant_only: true,
+    test_config: "AndroidTest-tplus.xml",
+}
+
+cc_test {
+    name: "libtextclassifier_tests-sminus",
+    defaults: ["libtextclassifier_defaults"],
+
+    test_suites: ["general-tests", "mts-extservices"],
+
+    data: [
+        "**/test_data/*",
+        "**/*.bfbs",
+    ],
+
+    srcs: ["**/*.cc"],
+    exclude_srcs: [":libtextclassifier_java_test_sources"],
+
+    header_libs: ["jni_headers"],
+
+    static_libs: [
+        "libgmock_ndk",
+        "libgtest_ndk_c++",
+        "libbase_ndk",
+    ],
+
+    generated_headers: [
+        "libtextclassifier_fbgen_utils_flatbuffers_flatbuffers_test",
+        "libtextclassifier_fbgen_utils_lua_utils_tests",
+    ],
+
+    compile_multilib: "both",
+    multilib: {
+        lib32: {
+            suffix: "32",
+        },
+        lib64: {
+            suffix: "64",
+        },
+    },
+    // A workaround for code coverage. See b/166040889#comment23
+    sdk_variant_only: true,
+    test_config: "AndroidTest-sminus.xml",
 }
 
 // ------------------------------------
diff --git a/native/AndroidTest.xml b/native/AndroidTest-sminus.xml
similarity index 78%
copy from native/AndroidTest.xml
copy to native/AndroidTest-sminus.xml
index 15ce73e..b4c8628 100644
--- a/native/AndroidTest.xml
+++ b/native/AndroidTest-sminus.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 The Android Open Source Project
+<!-- Copyright (C) 2023 The Android Open Source Project
 
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
@@ -13,14 +13,14 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Config for libtextclassifier_tests">
+<configuration description="Config for libtextclassifier_tests-sminus">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices.apex" />
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="mts" />
 
     <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="push" value="libtextclassifier_tests-sminus->/data/local/tmp/libtextclassifier_tests-sminus" />
         <option name="append-bitness" value="true" />
     </target_preparer>
 
@@ -33,9 +33,15 @@
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="libtextclassifier_tests" />
+        <option name="module-name" value="libtextclassifier_tests-sminus" />
     </test>
 
+    <!-- Prevent test from running on Android T+ -->
+    <object type="module_controller"
+            class="com.android.tradefed.testtype.suite.module.MaxSdkModuleController">
+        <option name="max-sdk-level" value="32"/>
+    </object>
+
     <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
         <option name="mainline-module-package-name" value="com.google.android.extservices" />
     </object>
diff --git a/native/AndroidTest.xml b/native/AndroidTest-tplus.xml
similarity index 81%
rename from native/AndroidTest.xml
rename to native/AndroidTest-tplus.xml
index 15ce73e..ab2749c 100644
--- a/native/AndroidTest.xml
+++ b/native/AndroidTest-tplus.xml
@@ -13,14 +13,14 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Config for libtextclassifier_tests">
-    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices.apex" />
+<configuration description="Config for libtextclassifier_tests-tplus">
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.extservices_tplus.apex" />
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="mts" />
 
     <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="push" value="libtextclassifier_tests-tplus->/data/local/tmp/libtextclassifier_tests-tplus" />
         <option name="append-bitness" value="true" />
     </target_preparer>
 
@@ -33,9 +33,13 @@
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="libtextclassifier_tests" />
+        <option name="module-name" value="libtextclassifier_tests-tplus" />
     </test>
 
+    <!-- Prevent tests from running on Android S- -->
+    <object type="module_controller"
+            class="com.android.tradefed.testtype.suite.module.Sdk33ModuleController"/>
+
     <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
         <option name="mainline-module-package-name" value="com.google.android.extservices" />
     </object>