Merge changes from topic "aosp_trunk_stable_cp" into udc-dev-plus-aosp am: 4d6b500150

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/24642593

Change-Id: Ief80344bbb1367fc347ef1c3dcfea5209f4533cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index a82a421..f1dd956 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -103,9 +103,15 @@
     framework_compatibility_matrix.6.xml \
     framework_compatibility_matrix.7.xml \
     framework_compatibility_matrix.8.xml \
-    framework_compatibility_matrix.9.xml \
     framework_compatibility_matrix.device.xml \
 
+# Only allow the use of the unreleased compatibility matrix when we can use unfrozen
+# interfaces (in the `next` release configuration).
+ifeq ($(RELEASE_AIDL_USE_UNFROZEN),true)
+my_system_matrix_deps += \
+    framework_compatibility_matrix.9.xml
+endif
+
 my_framework_matrix_deps += \
     $(my_system_matrix_deps)