Integrate system feature codegen into SystemConfig
Add initial hooks from SystemConfig to query against system features
that are compiled into the framework via build flags. The behavior
is as follows:
* System features compiled as available will always be exposed
* System features compiled as unavailable will never be exposed
* Runtime parsing of system features won't override compiled features
Currently, we log a warning if there's a conflict between the set of
compiled and runtime system features, but this will likely be elevated
to an exception after additional hardening and development.
The current codegen is a no-op with respect to this behavior, as
RELEASE_USE_SYSTEM_FEATURE_BUILD_FLAGS is flagged as off.
A follow-up change will integrate RoSystemFeature queries into:
* ApplicationPackageManager - To bypass binder calls when possible
* SystemServer - For various hasSystemFeature checks
Bug: 203143243
Test: atest FrameworksServicesTests
Flag: build.RELEASE_USE_SYSTEM_FEATURE_BUILD_FLAGS
Change-Id: I1fcd2f2f86dc5605f33182e88fc98a21b57bf812
diff --git a/tools/systemfeatures/tests/golden/RoNoFeatures.java.gen b/tools/systemfeatures/tests/golden/RoNoFeatures.java.gen
index bf7a006..40c7db7 100644
--- a/tools/systemfeatures/tests/golden/RoNoFeatures.java.gen
+++ b/tools/systemfeatures/tests/golden/RoNoFeatures.java.gen
@@ -9,8 +9,7 @@
import android.content.Context;
import android.content.pm.FeatureInfo;
import android.content.pm.PackageManager;
-import java.util.HashMap;
-import java.util.Map;
+import android.util.ArrayMap;
/**
* @hide
@@ -43,8 +42,8 @@
* @hide
*/
@NonNull
- public static Map<String, FeatureInfo> getCompileTimeAvailableFeatures() {
- Map<String, FeatureInfo> features = new HashMap<>(0);
+ public static ArrayMap<String, FeatureInfo> getReadOnlySystemEnabledFeatures() {
+ ArrayMap<String, FeatureInfo> features = new ArrayMap<>(0);
return features;
}
}