Use Profiling flag at build time

This change uses the flag to toggle the Profiling module in the platform
bootclasspath.

Bug: 293957254
Bug: 325523640
Test: Built locally on trunk_food (where flag is disabled) and
trunk_staging (where flag is enabled.)

Change-Id: Id386b2d57e78362e12bd6e4cb1f0bdb2dabe3ce6
diff --git a/boot/Android.bp b/boot/Android.bp
index cdfa7c8..f60bb9e 100644
--- a/boot/Android.bp
+++ b/boot/Android.bp
@@ -31,6 +31,7 @@
         "car_bootclasspath_fragment",
         "nfc_apex_bootclasspath_fragment",
         "release_crashrecovery_module",
+        "release_package_profiling_module",
     ],
     properties: [
         "fragments",
@@ -122,10 +123,6 @@
             module: "com.android.permission-bootclasspath-fragment",
         },
         {
-            apex: "com.android.profiling",
-            module: "com.android.profiling-bootclasspath-fragment",
-        },
-        {
             apex: "com.android.scheduling",
             module: "com.android.scheduling-bootclasspath-fragment",
         },
@@ -179,6 +176,15 @@
                 },
             ],
         },
+        release_package_profiling_module: {
+            fragments: [
+                // only used if profiling is enabled.
+                {
+                    apex: "com.android.profiling",
+                    module: "com.android.profiling-bootclasspath-fragment",
+                },
+            ],
+        },
     },
 
     // Additional information needed by hidden api processing.