fix unit test failure by running on a separate process am: 6027979436
am: 690f7f509b
Change-Id: Ic0e50679b65c47f64e7038a77562314181de973b
diff --git a/Android.bp b/Android.bp
index bef85be..5675fa2 100644
--- a/Android.bp
+++ b/Android.bp
@@ -16,9 +16,19 @@
},
}
+// used to share common constants between cellbroadcastservice and cellbroadcastreceier
filegroup {
name: "cellbroadcast-constants-shared-srcs",
srcs: [
"src/com/android/cellbroadcastservice/SmsCbConstants.java",
],
-}
\ No newline at end of file
+}
+
+// used to share src with unit test app
+filegroup {
+ name: "cellbroadcast-shared-srcs",
+ srcs: [
+ "src/**/*.java",
+ ":framework-cellbroadcast-shared-srcs",
+ ],
+}
diff --git a/tests/Android.bp b/tests/Android.bp
index 1097217..f59dde6 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -13,7 +13,7 @@
"android.test.base",
"android.test.mock",
],
- srcs: ["src/**/*.java"],
+ srcs: ["src/**/*.java", ":cellbroadcast-shared-srcs"],
platform_apis: true,
test_suites: ["device-tests"],
certificate: "platform",
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 445a960..7403d26 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -22,7 +22,7 @@
</application>
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
- android:targetPackage="com.android.cellbroadcastservice"
+ android:targetPackage="com.android.cellbroadcastservice.tests"
android:label="Tests for CellBroadcastService">
</instrumentation>
</manifest>
diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml
index 8b61a43..022ff36 100644
--- a/tests/AndroidTest.xml
+++ b/tests/AndroidTest.xml
@@ -20,7 +20,7 @@
<option name="test-suite-tag" value="apct" />
<option name="test-tag" value="CellBroadcastServiceTests" />
- <test class="com.android.tradefed.testtype.InstrumentationTest" >
+ <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.cellbroadcastservice.tests" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>