From 172f2a03d8d8c8f6961de3014012e895d76b024e Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Fri, 18 Oct 2024 11:03:02 -0700 Subject: 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 --- .../android/platform/test/ravenwood/RavenwoodConfig.java | 9 +++++++++ .../platform/test/ravenwood/RavenwoodSystemProperties.java | 6 ++++++ 2 files changed, 15 insertions(+) (limited to 'ravenwood/junit-src') 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; @@ -149,6 +150,14 @@ public final class RavenwoodConfig { return this; } + /** + * 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); } -- cgit v1.2.3-59-g8ed1b