Support aapt2 resources flagging

This change modifies the aconfig and aapt2 build rules to support
resources flagging in aapt2.

Implementation details:
- Modify the aconfig text rule to include flag permission in the output
  text file
- Pass the `--flags-packages` argument to `aapt2 compile` command,
  similar to what is currently being done in the `aapt2 link` command

Bug: 344979955
Test: m nothing --no-skip-soong-tests
Change-Id: I3b0b1fd6dcd691b7cc50ba3d081ecafd82c2c904
diff --git a/aconfig/init.go b/aconfig/init.go
index 256b213..de155ab 100644
--- a/aconfig/init.go
+++ b/aconfig/init.go
@@ -47,7 +47,7 @@
 	// For create-device-config-sysprops: Generate aconfig flag value map text file
 	aconfigTextRule = pctx.AndroidStaticRule("aconfig_text",
 		blueprint.RuleParams{
-			Command: `${aconfig} dump-cache --dedup --format='{fully_qualified_name}={state:bool}'` +
+			Command: `${aconfig} dump-cache --dedup --format='{fully_qualified_name}:{permission}={state:bool}'` +
 				` --cache ${in}` +
 				` --out ${out}.tmp` +
 				` && ( if cmp -s ${out}.tmp ${out} ; then rm ${out}.tmp ; else mv ${out}.tmp ${out} ; fi )`,