From 68ed69dd7c125c94fc28ed57f0462305a3dd9e24 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 1 Aug 2023 15:32:49 -0700 Subject: [PATCH 1/3] fcm_exclude: Aidl HALs contains versions. ShouldCheckMissingAidlHalsInFcm now accepts arguments of the format android.hardware.foo@1. Test: TH Bug: 255383566 Change-Id: I891f749190a8db8725ec1e05b190e73ab4468254 --- .../exclude/fcm_exclude.cpp | 45 ++++++++++--------- .../exclude/include/vintf/fcm_exclude.h | 4 +- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index cfc8345922..6db0b2193b 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -104,7 +104,7 @@ bool ShouldCheckMissingHidlHalsInFcm(const std::string& packageAndVersion) { } // The predicate to VintfObject::checkMissingHalsInMatrices. -bool ShouldCheckMissingAidlHalsInFcm(const std::string& package) { +bool ShouldCheckMissingAidlHalsInFcm(const std::string& packageAndVersion) { static std::vector included_prefixes{ // Other AOSP HALs (e.g. android.frameworks.*) are not added because only framework // matrix is checked. @@ -112,36 +112,38 @@ bool ShouldCheckMissingAidlHalsInFcm(const std::string& package) { }; static std::vector excluded_prefixes{ + // Packages without top level interfaces (including types-only packages) are exempted. + "android.hardware.audio.common@", + "android.hardware.biometrics.common@", + "android.hardware.camera.metadata@", + "android.hardware.camera.device@", + "android.hardware.camera.common@", + "android.hardware.common@", + "android.hardware.common.fmq@", + "android.hardware.graphics.common@", + "android.hardware.input.common@", + "android.hardware.keymaster@", + "android.hardware.media.bufferpool2@", + "android.hardware.radio@", + "android.hardware.uwb.fira_android@", + // Test packages are exempted. "android.hardware.tests.", + + // Fastboot HAL is only used by recovery. Recovery is owned by OEM. Framework + // does not depend on this HAL, hence it is not declared in any manifests or matrices. + "android.hardware.fastboot@", }; static std::vector excluded_exact{ // Packages without top level interfaces (including types-only packages) are exempted. // AIDL - "android.hardware.audio.common", - "android.hardware.audio.core.sounddose", - "android.hardware.biometrics.common", - "android.hardware.camera.metadata", - "android.hardware.camera.device", - "android.hardware.camera.common", - "android.hardware.common", - "android.hardware.common.fmq", - "android.hardware.graphics.common", - "android.hardware.input.common", - "android.hardware.keymaster", - "android.hardware.media.bufferpool2", - "android.hardware.radio", - "android.hardware.uwb.fira_android", - - // Fastboot HAL is only used by recovery. Recovery is owned by OEM. Framework - // does not depend on this HAL, hence it is not declared in any manifests or matrices. - "android.hardware.fastboot", + "android.hardware.audio.core.sounddose@1", }; auto package_has_prefix = [&](const std::string& prefix) { - return android::base::StartsWith(package, prefix); + return android::base::StartsWith(packageAndVersion, prefix); }; // Only check packageAndVersions that are in the include list and not in the exclude list. @@ -149,7 +151,8 @@ bool ShouldCheckMissingAidlHalsInFcm(const std::string& package) { return false; } - if (std::find(excluded_exact.begin(), excluded_exact.end(), package) != excluded_exact.end()) { + if (std::find(excluded_exact.begin(), excluded_exact.end(), packageAndVersion) != + excluded_exact.end()) { return false; } diff --git a/compatibility_matrices/exclude/include/vintf/fcm_exclude.h b/compatibility_matrices/exclude/include/vintf/fcm_exclude.h index 9ee057bb5d..e7ef4a08a1 100644 --- a/compatibility_matrices/exclude/include/vintf/fcm_exclude.h +++ b/compatibility_matrices/exclude/include/vintf/fcm_exclude.h @@ -24,8 +24,8 @@ namespace android::vintf::details { // Determine whether VINTF checks |package| is missing from FCMs. // |package| can be a HIDL package and version like // "android.hardware.foo@1.0", or an AIDL package name like -// "android.hardware.foo". +// "android.hardware.foo@1". bool ShouldCheckMissingHidlHalsInFcm(const std::string& packageAndVersion); -bool ShouldCheckMissingAidlHalsInFcm(const std::string& package); +bool ShouldCheckMissingAidlHalsInFcm(const std::string& packageAndVersion); } // namespace android::vintf::details From a3975a563f6d773184309a5df95188760de642ae Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 1 Aug 2023 12:20:12 -0700 Subject: [PATCH 2/3] matrices: Add gnss.* to fcm_exclude. They aren't top level interfaces. Test: TH Bug: 255383566 Change-Id: I8265f531880d1dcff1bf7edfd035a25f9e2a4d70 --- compatibility_matrices/exclude/fcm_exclude.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 6db0b2193b..67b42ca998 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -120,6 +120,8 @@ bool ShouldCheckMissingAidlHalsInFcm(const std::string& packageAndVersion) { "android.hardware.camera.common@", "android.hardware.common@", "android.hardware.common.fmq@", + "android.hardware.gnss.measurement_corrections@", + "android.hardware.gnss.visibility_control@", "android.hardware.graphics.common@", "android.hardware.input.common@", "android.hardware.keymaster@", From 19d015a45e7a1c68e5d29a703bef9bccfca092e5 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 1 Aug 2023 15:35:34 -0700 Subject: [PATCH 3/3] fcm_exclude: mark bluetooth.audio@1 as deprecated. It never shows up in any matrices. Only bluetooth.audio@2 and beyond are accepted. Test: TH Bug: 255383566 Change-Id: I110b73b2ed610d86aa351216fe46d9f803f8c3cf --- compatibility_matrices/exclude/fcm_exclude.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 67b42ca998..d92c0b97a3 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -142,6 +142,9 @@ bool ShouldCheckMissingAidlHalsInFcm(const std::string& packageAndVersion) { // AIDL "android.hardware.audio.core.sounddose@1", + + // Deprecated HALs. + "android.hardware.bluetooth.audio@1", }; auto package_has_prefix = [&](const std::string& prefix) {