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/src/ArrayMap.java b/tools/systemfeatures/tests/src/ArrayMap.java
new file mode 100644
index 0000000..a5ed9b0
--- /dev/null
+++ b/tools/systemfeatures/tests/src/ArrayMap.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.util;
+
+import java.util.HashMap;
+
+/** Stub for testing. */
+public final class ArrayMap<K, V> extends HashMap<K, V> {
+ public ArrayMap(int capacity) {
+ super(capacity);
+ }
+}