Files
Marybeth Fair e2403da780 Connect record-finalized-flags & finalize-non-api-flags.
Including some fixes: *Allow record-finalized-flags to take as input the
non-api finalized flags list. Debating just adding to the
finalized-flags list, but I think having separate intermediate objects
will make debugging a lot easier. *Remove unnecessary arg from
finalize-non-api-flags. *Make the exception list arg optional, to allow
just loading from the path. *Print flags to stdout.

Test: Manual using m all_aconfig_declarations (with lunch next)]

NOTE: There was some issue getting the env variable. Since this was
already going to use the hard-coded path, just went fully to use CP2A to
unblock getting the rest of this in on time.

Test: Manual using m all_aconfig_declarations (with lunch next)]
Bug: 445461092
Flag: build.RELEASE_ACONFIG_FINALIZE_NON_API_FLAGS
Change-Id: I14febf12a7177fd340ccc14cc2c48a2ff86eb0c5
2026-02-11 16:06:45 -08:00
..
2025-12-19 11:20:09 -08:00
2025-12-19 11:20:09 -08:00

Record Finalized Flags

Used by build/make/tools/record-finalized-flags to add flags in build/make/tools/aconfig/exported_flag_check/non_api_flags_list.txt (exported flags which do not guard APIs) to prebuilts/sdk/<level>/finalized-flags.txt.

finalized-flags.txt is used by build/make/tools/aconfig/convert_finalized_flags to add the SDK check in the aconfig flag accessor.

Workflow

The following diagram illustrates the data flow for finalizing flags and generating SDK checks.

/-----------------------------------------------------------------------------\
|                                                                             |
|   1: NON-API FLAGS (once at finalization)                                   |
|   +-----------------------+   +------------------------+                    |
|   | Flag + Release Config |   | non_api_flags_list.txt |                    |
|   |                       |   | (Non-API flags)        |                    |
|   +-----------+-----------+   +-----------+------------+                    |
|       |       |                           |                                 |
|       |       +-------------> v <---------+                                 |
|       |                       |                                             |
|       |           [ finalize_non_api_flags ]                                |
|       |                       |                                             |
|       |                       |                                             |
|       |                       |                                             |
|   2: API FLAGS (once at finalization)                                       |
|       |                       |                                             |
|       |                       |                                             |
|       v                       |                                             |
|   +-----------------------+   |   +-----------------------+                 |
|   | metalava              |   |   | finalized-flags.txt   |                 |
|   | (API & @FlaggedApi)   |   |   | (Previously Finalized)|                 |
|   +-----------+-----------+   |   +-----------+-----------+                 |
|               |               |               |                             |
|               +-------------> v <-------------+                             |
|                               |                                             |
|                   [ record_finalized_flags ]                                |
|                               |                                             |
|                               v                                             |
|                 +---------------------------+                               |
|                 |    finalized-flags.txt    |                               |
|                 | (prebuilts/sdk/<level>/)  |                               |
|                 +-------------+-------------+                               |
|                               |                                             |
|   3: ACONFIG CODEGEN (every build)                                          |
|                               |                                             |
|                               v                                             |
|                  [ convert_finalized_flags ]                                |
|                               |                                             |
|                               v                                             |
|                    ( Generated SDK Check )                                  |
|                      In Flag Accessor                                       |
|                                                                             |
\-----------------------------------------------------------------------------/