Add a shared library for setting flags in SysUI.
This adds the FlagManager class which currently has 3 methods:
- #getFlagsFuture
- #setFlagValue
- #eraseFlag
The first makes an async call to SystemUI to retrieve the flags
it knows about. It returns a collection of Flag objects from which
one can get the id, type, and default values.
The other two are fairly self-explanatory, sending intents to
SystemUI telling to set or erase flags. Any app calling these
methods must have the FLAGS_PERMISSION defined in the FlagManager
library.
Only boolean flags are supported at the moment.
Bug: 203548827
Test: manual
Change-Id: Id15ff481edcb83c67ce4cdad6cdda27d28a40652
diff --git a/packages/SystemUI/shared/Android.bp b/packages/SystemUI/shared/Android.bp
index 23307de..7cf22a3 100644
--- a/packages/SystemUI/shared/Android.bp
+++ b/packages/SystemUI/shared/Android.bp
@@ -45,9 +45,40 @@
":wm_shell-aidls",
":wm_shell_util-sources",
],
+ libs: [
+ "SystemUI-flags",
+ ],
static_libs: [
"PluginCoreLib",
"androidx.dynamicanimation_dynamicanimation",
+ "androidx.concurrent_concurrent-futures",
+ ],
+ java_version: "1.8",
+ min_sdk_version: "current",
+}
+
+java_library {
+ name: "SystemUI-flag-types",
+ srcs: [
+ "src/com/android/systemui/flags/Flag.kt",
+ ],
+ static_kotlin_stdlib: false,
+ java_version: "1.8",
+ min_sdk_version: "current",
+}
+
+java_library {
+ name: "SystemUIFlagsLib",
+ srcs: [
+ "src/com/android/systemui/flags/**/*.kt",
+ ],
+ static_kotlin_stdlib: false,
+ libs: [
+ "androidx.concurrent_concurrent-futures",
+ "SystemUI-flags",
+ ],
+ static_libs: [
+ "SystemUI-flag-types",
],
java_version: "1.8",
min_sdk_version: "current",