Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 023bd651 authored by Devin Moore's avatar Devin Moore
Browse files

Create a null HIDL wrapper if AIDL is registered

On upgrading devices the codec mainline module needs to be able to
register either HIDL or AIDL based on a sysprop. When one is selected,
the other is registered with a small null implementation.

Test: m
Bug: none
Change-Id: Ic9b69da991e030d6abf6a3e90c99cc7181bfeb20
parent 5cfdd429
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -858,6 +858,14 @@ extern "C" void RegisterCodecServices() {
    // If the software component store isn't declared in the manifest, we don't
    // need to create the service and register it.
    if (hidlStore) {
        if (registered && aidlSelected) {
            LOG(INFO) << "Both HIDL and AIDL software codecs are declared in the vintf "
                      << "manifest, but AIDL was selected. "
                      << "Creating a null HIDL service so it's not accidentally "
                      << "used. The AIDL software codec is already registered.";
            hidlStore = ::android::sp<V1_2::utils::ComponentStore>::make(
                    std::make_shared<H2C2ComponentStore>(nullptr));
        }
        if (hidlStore->registerAsService("software") == android::OK) {
            registered = true;
        } else {