Merge "media: Fix Android.bp format" into main
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..098a576
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,5 @@
+[Builtin Hooks]
+bpfmt = true
+
+[Builtin Hooks Options]
+bpfmt = -s
diff --git a/alsa_utils/Android.bp b/alsa_utils/Android.bp
index 7c3a8ce..9d96c42 100644
--- a/alsa_utils/Android.bp
+++ b/alsa_utils/Android.bp
@@ -26,8 +26,8 @@
     srcs: [
         "alsa_device_profile.c",
         "alsa_device_proxy.c",
-        "alsa_logging.c",
         "alsa_format.c",
+        "alsa_logging.c",
     ],
     export_include_dirs: ["include"],
     header_libs: [
@@ -37,13 +37,13 @@
         "libaudio_system_headers",
     ],
     shared_libs: [
-        "liblog",
-        "libcutils",
         "libaudioutils",
+        "libcutils",
+        "liblog",
     ],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
         "-Wno-unused-parameter",
     ],
 }
diff --git a/audio/Android.bp b/audio/Android.bp
index 5859f7e..d0714e7 100644
--- a/audio/Android.bp
+++ b/audio/Android.bp
@@ -34,9 +34,9 @@
     min_sdk_version: "29",
     apex_available: [
         "//apex_available:platform",
+        "com.android.btservices",
         "com.android.media",
         "com.android.media.swcodec",
-        "com.android.btservices",
     ],
 }
 
@@ -48,7 +48,6 @@
     path: "include",
 }
 
-
 filegroup {
     name: "libaudio_system_audio_common_base",
     srcs: [
diff --git a/audio_route/Android.bp b/audio_route/Android.bp
index 7ba7b6a..d3c287b 100644
--- a/audio_route/Android.bp
+++ b/audio_route/Android.bp
@@ -13,14 +13,14 @@
     srcs: ["audio_route.c"],
     export_include_dirs: ["include"],
     shared_libs: [
-        "liblog",
         "libcutils",
-        "libutils",
         "libexpat",
+        "liblog",
+        "libutils",
     ],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
 }
 
diff --git a/audio_utils/Android.bp b/audio_utils/Android.bp
index 45ae6e8..26a7c37 100644
--- a/audio_utils/Android.bp
+++ b/audio_utils/Android.bp
@@ -15,8 +15,8 @@
     export_include_dirs: ["include"],
 
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
 }
 
@@ -44,26 +44,26 @@
 
     srcs: [
         "Balance.cpp",
-        "channels.cpp",
         "ErrorLog.cpp",
+        "MelAggregator.cpp",
+        "MelProcessor.cpp",
+        "Metadata.cpp",
+        "PowerLog.cpp",
+        "channels.cpp",
         "fifo.cpp",
         "fifo_index.cpp",
         "fifo_writer_T.cpp",
         "format.c",
+        "hal_smoothness.c",
         "limiter.c",
-        "MelAggregator.cpp",
-        "MelProcessor.cpp",
-        "Metadata.cpp",
         "minifloat.c",
         "mono_blend.cpp",
         "mutex.cpp",
         "power.cpp",
-        "PowerLog.cpp",
         "primitives.c",
         "roundup.c",
         "sample.c",
         "threads.cpp",
-        "hal_smoothness.c",
     ],
 
     header_libs: [
@@ -94,8 +94,8 @@
         android: {
             srcs: [
                 // "mono_blend.cpp",
-                "resampler.c",
                 "echo_reference.c",
+                "resampler.c",
             ],
             whole_static_libs: ["libaudioutils_fixedfft"],
             shared_libs: [
@@ -215,10 +215,10 @@
     defaults: ["audio_utils_defaults"],
 
     srcs: [
-        "spdif/BitFieldParser.cpp",
-        "spdif/FrameScanner.cpp",
         "spdif/AC3FrameScanner.cpp",
+        "spdif/BitFieldParser.cpp",
         "spdif/DTSFrameScanner.cpp",
+        "spdif/FrameScanner.cpp",
         "spdif/SPDIFDecoder.cpp",
         "spdif/SPDIFEncoder.cpp",
         "spdif/SPDIFFrameScanner.cpp",
diff --git a/audio_utils/benchmarks/Android.bp b/audio_utils/benchmarks/Android.bp
index 78d4d03..ee5b146 100644
--- a/audio_utils/benchmarks/Android.bp
+++ b/audio_utils/benchmarks/Android.bp
@@ -50,11 +50,11 @@
 
     srcs: ["biquad_filter_benchmark.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
         "-ffast-math",
-      //  "-fno-vectorize",      // (test only)
-      //  "-fno-slp-vectorize",  // (test only)
+        //  "-fno-vectorize",      // (test only)
+        //  "-fno-slp-vectorize",  // (test only)
     ],
     static_libs: [
         "libaudioutils",
@@ -83,11 +83,11 @@
 
     srcs: ["intrinsic_benchmark.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
         "-ffast-math",
-      //  "-fno-vectorize",      // (test only)
-      //  "-fno-slp-vectorize",  // (test only)
+        //  "-fno-vectorize",      // (test only)
+        //  "-fno-slp-vectorize",  // (test only)
     ],
     static_libs: [
         "libaudioutils",
@@ -105,8 +105,8 @@
 
     srcs: ["primitives_benchmark.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
     static_libs: [
         "libaudioutils",
@@ -119,8 +119,8 @@
 
     srcs: ["statistics_benchmark.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
     static_libs: [
         "libaudioutils",
diff --git a/audio_utils/fuzz/audioutilsfiforeaderwriter_fuzzer/Android.bp b/audio_utils/fuzz/audioutilsfiforeaderwriter_fuzzer/Android.bp
index 046e220..8a0a637 100644
--- a/audio_utils/fuzz/audioutilsfiforeaderwriter_fuzzer/Android.bp
+++ b/audio_utils/fuzz/audioutilsfiforeaderwriter_fuzzer/Android.bp
@@ -16,4 +16,4 @@
         "liblog",
     ],
     host_supported: true,
-}
\ No newline at end of file
+}
diff --git a/audio_utils/tests/Android.bp b/audio_utils/tests/Android.bp
index fbf0961..cc32160 100644
--- a/audio_utils/tests/Android.bp
+++ b/audio_utils/tests/Android.bp
@@ -13,7 +13,7 @@
     host_supported: true,
 
     srcs: [
-        "audio_math_tests.cpp"
+        "audio_math_tests.cpp",
     ],
 
     shared_libs: [
@@ -123,7 +123,7 @@
     host_supported: true,
 
     srcs: [
-        "biquad_filter.cpp"
+        "biquad_filter.cpp",
     ],
 
     shared_libs: [
@@ -161,7 +161,7 @@
     host_supported: true,
 
     srcs: [
-        "mel_aggregator_tests.cpp"
+        "mel_aggregator_tests.cpp",
     ],
 
     shared_libs: [
@@ -186,7 +186,7 @@
     host_supported: true,
 
     srcs: [
-        "mel_processor_tests.cpp"
+        "mel_processor_tests.cpp",
     ],
 
     shared_libs: [
@@ -312,13 +312,13 @@
     host_supported: true,
 
     shared_libs: [
-        "liblog",
         "libcutils",
+        "liblog",
     ],
     srcs: ["primitives_tests.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
     target: {
         android: {
@@ -327,7 +327,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_binary {
@@ -337,8 +337,8 @@
     shared_libs: ["libaudioutils"],
     static_libs: ["libsndfile"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
 }
 
@@ -346,11 +346,14 @@
     name: "fifo_multiprocess",
     host_supported: true,
     srcs: ["fifo_multiprocess.cpp"],
-    shared_libs: ["libaudioutils", "libcutils"],
+    shared_libs: [
+        "libaudioutils",
+        "libcutils",
+    ],
     static_libs: ["libsndfile"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
 }
 
@@ -366,8 +369,8 @@
         "liblog",
     ],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
 }
 
@@ -376,9 +379,9 @@
     srcs: ["limiter_tests.c"],
     static_libs: ["libaudioutils"],
     cflags: [
-        "-Werror",
-        "-Wall",
         "-UNDEBUG",
+        "-Wall",
+        "-Werror",
     ],
 }
 
@@ -403,7 +406,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -427,7 +430,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -451,7 +454,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_binary {
@@ -487,7 +490,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -511,7 +514,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -534,7 +537,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -551,7 +554,7 @@
         host: {
             shared_libs: ["libcutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -563,8 +566,8 @@
     ],
     srcs: ["format_tests.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
     target: {
         android: {
@@ -573,7 +576,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -620,13 +623,13 @@
     host_supported: true,
 
     shared_libs: [
-        "liblog",
         "libcutils",
+        "liblog",
     ],
     srcs: ["logplot_tests.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
     target: {
         android: {
@@ -635,7 +638,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -643,13 +646,13 @@
     host_supported: true,
 
     shared_libs: [
-        "liblog",
         "libcutils",
+        "liblog",
     ],
     srcs: ["sample_tests.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
     target: {
         android: {
@@ -658,7 +661,7 @@
         host: {
             static_libs: ["libaudioutils"],
         },
-    }
+    },
 }
 
 cc_test {
@@ -682,14 +685,14 @@
     host_supported: true,
 
     shared_libs: [
-        "libaudioutils",
         "libaudiospdif",
-        "liblog",
+        "libaudioutils",
         "libcutils",
+        "liblog",
     ],
     srcs: ["spdif_tests.cpp"],
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
     ],
 }
diff --git a/camera/Android.bp b/camera/Android.bp
index f144e29..13d69db 100644
--- a/camera/Android.bp
+++ b/camera/Android.bp
@@ -39,8 +39,8 @@
 
     cflags: [
         "-Wall",
-        "-Wextra",
         "-Werror",
+        "-Wextra",
         "-fvisibility=hidden",
         "-std=c11",
     ],
@@ -49,8 +49,8 @@
         eng: {
             // Enable assert()
             cflags: [
-                "-UNDEBUG",
                 "-DLOG_NDEBUG=1",
+                "-UNDEBUG",
             ],
         },
     },
@@ -72,8 +72,8 @@
 
     cflags: [
         "-Wall",
-        "-Wextra",
         "-Werror",
+        "-Wextra",
         "-fvisibility=hidden",
         "-std=c11",
     ],
diff --git a/camera/fuzz/Android.bp b/camera/fuzz/Android.bp
index c42bb93..0b12b02 100644
--- a/camera/fuzz/Android.bp
+++ b/camera/fuzz/Android.bp
@@ -7,13 +7,13 @@
 }
 
 cc_fuzz {
-  name: "libcamera_metadata_fuzzer",
-  srcs: [
-    "libcamera_metadata_fuzzer.cpp",
-  ],
-  shared_libs: [
-    "libutils",
-    "libcamera_metadata",
-  ],
-  include_dirs: ["system/media/private/camera/include"],
+    name: "libcamera_metadata_fuzzer",
+    srcs: [
+        "libcamera_metadata_fuzzer.cpp",
+    ],
+    shared_libs: [
+        "libcamera_metadata",
+        "libutils",
+    ],
+    include_dirs: ["system/media/private/camera/include"],
 }
diff --git a/camera/tests/Android.bp b/camera/tests/Android.bp
index b922f10..e1065e7 100644
--- a/camera/tests/Android.bp
+++ b/camera/tests/Android.bp
@@ -13,16 +13,16 @@
     test_suites: ["device-tests"],
 
     shared_libs: [
-        "libutils",
         "libcamera_metadata",
+        "libutils",
     ],
 
     include_dirs: ["system/media/private/camera/include"],
 
     cflags: [
         "-Wall",
-        "-Wextra",
         "-Werror",
+        "-Wextra",
     ],
 
     multilib: {
diff --git a/radio/Android.bp b/radio/Android.bp
index d526162..60378b7 100644
--- a/radio/Android.bp
+++ b/radio/Android.bp
@@ -14,13 +14,13 @@
     },
 
     srcs: [
-        "src/radio_metadata.c",
         "src/RadioMetadataWrapper.cpp",
+        "src/radio_metadata.c",
     ],
 
     cflags: [
-        "-Werror",
         "-Wall",
+        "-Werror",
         "-fvisibility=hidden",
     ],
 
diff --git a/tests/Android.bp b/tests/Android.bp
index 448c2b4..4b8e292 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -73,8 +73,8 @@
     header_libs: ["libmedia_headers"],
 
     srcs: [
-        "static_checks_c.c",
         "static_checks.cpp",
+        "static_checks_c.c",
         "systemaudio_tests.cpp",
     ],