Fix flaky tests due to shared system property
The system property is shared within JVM, change system property in a
test case might break test cases in another test class. To address the
issue, introduce SystemProperty helper class to back up and restore the
system properties in tests.
Bug: 373177618
Flag: EXEMPT Test only
Test: atest SettingsRoboTests
Change-Id: I15539ce5ac425f35571d796baa25f259df1b601f
diff --git a/tests/robotests/Android.bp b/tests/robotests/Android.bp
index 84c84b0..1cac363 100644
--- a/tests/robotests/Android.bp
+++ b/tests/robotests/Android.bp
@@ -109,7 +109,10 @@
java_library {
name: "Settings-robo-testutils",
- srcs: ["testutils/**/*.java"],
+ srcs: [
+ "testutils/**/*.java",
+ "testutils/**/*.kt",
+ ],
libs: [
"Robolectric_all-target_upstream",
"Settings-core",