Merge "fcm_exclude: split HIDL and AIDL predicate." into main am: 23847d4411
am: a2f7b02a8c
am: 01a3afed45
am: 8bcce246a2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2688566 Change-Id: I07e68b78225757ea81bc479542d276b7ec92597c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
7725da1b9b
2 changed files with 57 additions and 21 deletions
|
@ -24,9 +24,7 @@
|
||||||
namespace android::vintf::details {
|
namespace android::vintf::details {
|
||||||
|
|
||||||
// The predicate to VintfObject::checkMissingHalsInMatrices.
|
// The predicate to VintfObject::checkMissingHalsInMatrices.
|
||||||
bool ShouldCheckMissingHalsInFcm(const std::string& package) {
|
bool ShouldCheckMissingHidlHalsInFcm(const std::string& packageAndVersion) {
|
||||||
using std::placeholders::_1;
|
|
||||||
|
|
||||||
static std::vector<std::string> included_prefixes{
|
static std::vector<std::string> included_prefixes{
|
||||||
// Other AOSP HALs (e.g. android.frameworks.*) are not added because only framework
|
// Other AOSP HALs (e.g. android.frameworks.*) are not added because only framework
|
||||||
// matrix is checked.
|
// matrix is checked.
|
||||||
|
@ -51,28 +49,11 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) {
|
||||||
"android.hardware.media.bufferpool@1.0",
|
"android.hardware.media.bufferpool@1.0",
|
||||||
"android.hardware.media.bufferpool@2.0",
|
"android.hardware.media.bufferpool@2.0",
|
||||||
"android.hardware.radio.config@1.2",
|
"android.hardware.radio.config@1.2",
|
||||||
// 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
|
// 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.
|
// does not depend on this HAL, hence it is not declared in any manifests or matrices.
|
||||||
"android.hardware.fastboot@1.0",
|
"android.hardware.fastboot@1.0",
|
||||||
"android.hardware.fastboot@1.1",
|
"android.hardware.fastboot@1.1",
|
||||||
// Fastboot AIDL
|
|
||||||
"android.hardware.fastboot",
|
|
||||||
|
|
||||||
// Deprecated HALs.
|
// Deprecated HALs.
|
||||||
// HIDL
|
// HIDL
|
||||||
|
@ -105,6 +86,60 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) {
|
||||||
"android.hardware.wifi.offload@1.0",
|
"android.hardware.wifi.offload@1.0",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto package_has_prefix = [&](const std::string& prefix) {
|
||||||
|
return android::base::StartsWith(packageAndVersion, prefix);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Only check packageAndVersions that are in the include list and not in the exclude list.
|
||||||
|
if (!std::any_of(included_prefixes.begin(), included_prefixes.end(), package_has_prefix)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (std::find(excluded_exact.begin(), excluded_exact.end(), packageAndVersion) !=
|
||||||
|
excluded_exact.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !std::any_of(excluded_prefixes.begin(), excluded_prefixes.end(), package_has_prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The predicate to VintfObject::checkMissingHalsInMatrices.
|
||||||
|
bool ShouldCheckMissingAidlHalsInFcm(const std::string& package) {
|
||||||
|
static std::vector<std::string> included_prefixes{
|
||||||
|
// Other AOSP HALs (e.g. android.frameworks.*) are not added because only framework
|
||||||
|
// matrix is checked.
|
||||||
|
"android.hardware.",
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::vector<std::string> excluded_prefixes{
|
||||||
|
// Test packages are exempted.
|
||||||
|
"android.hardware.tests.",
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::vector<std::string> 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",
|
||||||
|
};
|
||||||
|
|
||||||
auto package_has_prefix = [&](const std::string& prefix) {
|
auto package_has_prefix = [&](const std::string& prefix) {
|
||||||
return android::base::StartsWith(package, prefix);
|
return android::base::StartsWith(package, prefix);
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace android::vintf::details {
|
||||||
// |package| can be a HIDL package and version like
|
// |package| can be a HIDL package and version like
|
||||||
// "android.hardware.foo@1.0", or an AIDL package name like
|
// "android.hardware.foo@1.0", or an AIDL package name like
|
||||||
// "android.hardware.foo".
|
// "android.hardware.foo".
|
||||||
bool ShouldCheckMissingHalsInFcm(const std::string& package);
|
bool ShouldCheckMissingHidlHalsInFcm(const std::string& packageAndVersion);
|
||||||
|
bool ShouldCheckMissingAidlHalsInFcm(const std::string& package);
|
||||||
|
|
||||||
} // namespace android::vintf::details
|
} // namespace android::vintf::details
|
||||||
|
|
Loading…
Reference in a new issue