Enable statsd to perform its own hidden API processing
Previously, the hidden API encoding of the statsd boot dex jars, i.e.
those dex jars that statsd contributes to the bootclasspath were done
as part of the monolithic hidden API processing. This change causes
the encoding to be done by the statsd's bootclasspath_fragment.
This change involves the following:
* Addition of the fragments property to the statsd's
bootclasspath_fragment module to list all the other
bootclasspath_fragment modules on which this depends.
* Addition of the additional_stubs property to add stubs for APIs that
are not provided by another bootclasspath_fragment.
* Moving hidden API flag file entries related to statsd from the flag
files in frameworks/base/boot/hiddenapi directory into the statsd
directory with an appropriate OWNERS file to allow them to be managed
by the Soong and compat team.
* Addition of a PREUPLOAD.cfg hook script to ensure that the flag files
are sorted.
The build automatically checks that the hidden API flags which are
computed by statsd and encoded into its boot dex jars match those that
are generated by the monolithic processing so this is guaranteed to be
safe.
Bug: 179354495
Test: m com.android.os.statsd
- ensure that the generated APEX is byte-for-byte identical
before and after these changes.
m out/soong/hiddenapi/hiddenapi-flags.csv
- make sure that they are not changed by this.
Change-Id: Ic00a298a7460b5b05092aa7bf873ee63090916cd
diff --git a/apex/Android.bp b/apex/Android.bp
index a786d7e..bbf613f 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -83,4 +83,22 @@
name: "com.android.os.statsd-bootclasspath-fragment",
contents: ["framework-statsd"],
apex_available: ["com.android.os.statsd"],
+
+ // The bootclasspath_fragments that provide APIs on which this depends.
+ fragments: [
+ {
+ apex: "com.android.art",
+ module: "art-bootclasspath-fragment",
+ },
+ ],
+
+ // Additional stubs libraries that this fragment's contents use which are
+ // not provided by another bootclasspath_fragment.
+ additional_stubs: [
+ "android-non-updatable",
+ ],
+
+ hidden_api: {
+ max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
+ },
}