Move the framework manifest freeze step after HAL freeze

Because these scripts are using the fina_0 release config that inherits
from `next`, we need to freeze the interfaces before freezing the
device compatibility matrix (from the framework manifest).

Ignore-AOSP-First: finalization is done internally
Test: ./build-step-0.sh
Bug: 388072383
Change-Id: Ic1f2d2a87ceca1cc49d2d46bfc165890df416da6
diff --git a/tools/finalization/finalize-vintf-resources.sh b/tools/finalization/finalize-vintf-resources.sh
index c633dab..9660e3f 100755
--- a/tools/finalization/finalize-vintf-resources.sh
+++ b/tools/finalization/finalize-vintf-resources.sh
@@ -41,12 +41,11 @@
     # system/sepolicy
     "$top/system/sepolicy/tools/finalize-vintf-resources.sh" "$top" "$FINAL_BOARD_API_LEVEL"
 
-    finalize_compat_matrix $build_test_only
-
-    # pre-finalization build target (trunk)
     local aidl_m="$top/build/soong/soong_ui.bash --make-mode"
     AIDL_TRANSITIVE_FREEZE=true $aidl_m aidl-freeze-api create_reference_dumps
 
+    finalize_compat_matrix $build_test_only
+
     if ! [ "$build_test_only" = "true" ]; then
         # Generate LLNDK ABI dumps
         # This command depends on ANDROID_BUILD_TOP
@@ -62,8 +61,8 @@
 
     if ! [ "$build_test_only" = "true" ]; then
         # Freeze the current framework manifest file. This relies on the
-        # aosp_cf_x86_64-trunk_staging build target to get the right manifest
-        # fragments installed.
+        # interfaces already being frozen because we are building with fina_0 which
+        # inherits from `next` where RELEASE_AIDL_USE_UNFROZEN=false
         "$top/system/libhidl/vintfdata/freeze.sh" "$CURRENT_COMPATIBILITY_MATRIX_LEVEL"
     fi
 }