summaryrefslogtreecommitdiff
path: root/ravenwood/junit-src
diff options
context:
space:
mode:
author Makoto Onuki <omakoto@google.com> 2024-10-18 11:03:02 -0700
committer Makoto Onuki <omakoto@google.com> 2024-10-21 09:50:48 -0700
commit172f2a03d8d8c8f6961de3014012e895d76b024e (patch)
tree2d639685cd2913820b8b1206fb792c8b15a7f673 /ravenwood/junit-src
parenteb55496c10be60e5168ad6ac378ea6ab6b30d218 (diff)
Prepare for compat-framework support
- Create a Context for the system server - Add the target SDK level to RavenwoodConfig - Allow PropertyInvalidatedCache sysprops - Copy StatsD classes, until we get a proper support - Copy Compatibility and some annotations from libcore - Keep FrameworkStatsLog Flag: EXEMPT host test change only Bug: 292141694 Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Change-Id: Ib572d1b25c47c693b4969d12490e593dc5f48eb1
Diffstat (limited to 'ravenwood/junit-src')
-rw-r--r--ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java9
-rw-r--r--ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java6
2 files changed, 15 insertions, 0 deletions
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java
index 1f6e11dd5cf2..37b0abcceede 100644
--- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java
+++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java
@@ -67,6 +67,7 @@ public final class RavenwoodConfig {
String mTargetPackageName;
int mMinSdkLevel;
+ int mTargetSdkLevel;
boolean mProvideMainThread = false;
@@ -150,6 +151,14 @@ public final class RavenwoodConfig {
}
/**
+ * Configure the target SDK level of the test.
+ */
+ public Builder setTargetSdkLevel(int sdkLevel) {
+ mConfig.mTargetSdkLevel = sdkLevel;
+ return this;
+ }
+
+ /**
* Configure a "main" thread to be available for the duration of the test, as defined
* by {@code Looper.getMainLooper()}. Has no effect on non-Ravenwood environments.
*
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java
index ced151927fdc..9bc45bee1775 100644
--- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java
+++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java
@@ -146,6 +146,9 @@ public class RavenwoodSystemProperties {
if (root.startsWith("soc.")) return true;
if (root.startsWith("system.")) return true;
+ // For PropertyInvalidatedCache
+ if (root.startsWith("cache_key.")) return true;
+
switch (key) {
case "gsm.version.baseband":
case "no.such.thing":
@@ -170,6 +173,9 @@ public class RavenwoodSystemProperties {
if (root.startsWith("debug.")) return true;
+ // For PropertyInvalidatedCache
+ if (root.startsWith("cache_key.")) return true;
+
return mKeyWritable.contains(key);
}