Communicate flags from systemui async
Flags are no longer statically compiled into the shared library.
A "GET_FLAGS" api has been added to SystemUI that returns a list
of Flag objects, as defined in SystemUI.
Communication happens via a simple "ordered" broadcast.
FlagManager#getFlagsFuture() returns a ListenableFuture pointing at
the list of flags. Be sure not to call Future#get on the main
thread - the call will block indefinitely as the broadcast receiver
is handled on the main thread.
Instead, add a listener to the future or call #get on a separate
thread.
Bug: 203548827
Test: manual
Change-Id: I8720e0905662a6371e7aabf04341df46b8943a9c
diff --git a/packages/SystemUI/shared/Android.bp b/packages/SystemUI/shared/Android.bp
index 25db478..2909043 100644
--- a/packages/SystemUI/shared/Android.bp
+++ b/packages/SystemUI/shared/Android.bp
@@ -62,6 +62,7 @@
srcs: [
"src/com/android/systemui/flags/Flag.kt",
],
+ include_srcs: true,
static_kotlin_stdlib: false,
java_version: "1.8",
min_sdk_version: "current",
@@ -74,11 +75,11 @@
],
static_kotlin_stdlib: false,
libs: [
+ "SystemUI-flags",
"androidx.concurrent_concurrent-futures",
],
static_libs: [
"SystemUI-flag-types",
- "SystemUI-flags",
],
java_version: "1.8",
min_sdk_version: "current",