diff options
| author | 2022-12-16 10:55:47 +0100 | |
|---|---|---|
| committer | 2022-12-21 14:27:28 +0100 | |
| commit | 68e91829f8c26dfc91ef22f109694827e5d065b6 (patch) | |
| tree | 6a718560e38001b143143cae518d1510db711c80 /api/api.go | |
| parent | ff576d73419fc06ae3d8abcd899a7a68f7829a2d (diff) | |
Add SystemUI build flag for Compose code (1/3)
This CL adds a Soong build flag that enables Compose code when building
SystemUI, or anything depending on SystemUI-core. The flag is disabled
by default, and will be first used to measure the impact of Compose on
our apk and system health. It will be turned on for one/many/all targets
once agreed with the Android System Health & Performance team.
To turn this flag on, one simply have to
`export SYSTEMUI_USE_COMPOSE=true` before compiling.
This flag is implemented such that:
 - When it is enabled, SystemUI-core depends on the SystemUIComposeCore
   library and compiles the source files of SystemUIComposeFeatures. In
   an ideal world, SystemUI-core would also just depend on
   SystemUIComposeFeatures instead of recompiling its sources, but given
   that the code in SystemUIComposeFeatures depends on code in
   SystemUI-core, this would lead to a cyclic dependency. Therefore,
   when this flag is enabled, we compile those files together.
   SystemUIComposeFeatures also contains a ComposeFacade object that is
   the bridge between SystemUI-core code and SystemUIComposeFeatures
   code.
 - When it is disabled, we only add another ComposeFacade object with
   the same API as the ComposeFacade object in SystemUIComposeFeatures,
   which throws when its functions are called (except for
   ComposeFacade#isComposeAvailable(), which returns false).
This way, any code in SystemUI-core can check
ComposeFacade#isComposeAvailable() first then call other functions to
indirectly access Compose code. See http://ag/20759151 for an example.
Bug: 242304109
Test: Builds
Change-Id: Ibd895a73041c163816e779273ec0b6588aabef76
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions