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

Commit ca66eb53 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove temporary workarounds in AIDL HAL config processing" am:...

Merge "Remove temporary workarounds in AIDL HAL config processing" am: 258d815d am: f5a9b5f4 am: 08fae3ef

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2593305



Change-Id: I9116a19a0b9f8a8e92b94afc6a0a62f40919813a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4f2b46cd 08fae3ef
Loading
Loading
Loading
Loading
+7 −16
Original line number Diff line number Diff line
@@ -83,24 +83,15 @@ status_t DevicesFactoryHalAidl::openDevice(const char *name, sp<DeviceHalInterfa
    if (name == nullptr || device == nullptr) {
        return BAD_VALUE;
    }

    // FIXME: Remove this call and the check for the supported module names
    // after implementing retrieval of module names on the framework side.
    // Currently it is still using the legacy XML config.
    std::vector<std::string> deviceNames;
    if (status_t status = getDeviceNames(&deviceNames); status != OK) {
        return status;
    }
    std::shared_ptr<IModule> service;
    if (std::find(deviceNames.begin(), deviceNames.end(), name) != deviceNames.end()) {
    if (strcmp(name, "primary") == 0) name = "default";
    auto serviceName = std::string(IModule::descriptor) + "/" + name;
    service = IModule::fromBinder(
            ndk::SpAIBinder(AServiceManager_waitForService(serviceName.c_str())));
        ALOGE_IF(service == nullptr, "%s fromBinder %s failed", __func__, serviceName.c_str());
    if (service == nullptr) {
        ALOGE("%s fromBinder %s failed", __func__, serviceName.c_str());
        return NO_INIT;
    }
    // If the service is a nullptr, the device object will not be really functional,
    // but will not crash either.
    *device = sp<DeviceHalAidl>::make(name, service);
    return OK;
}
+0 −4
Original line number Diff line number Diff line
@@ -256,10 +256,6 @@ status_t AudioPolicyConfig::loadFromAidl(const media::AudioPolicyConfig& aidl) {
            media::audio::common::AudioMode::CALL_SCREEN) != aidl.supportedModes.end();
    mSurroundFormats = VALUE_OR_RETURN_STATUS(
            aidl2legacy_SurroundSoundConfig_SurroundFormats(aidl.surroundSoundConfig));
    // TODO(b/205884982): Remove after landing aosp/2353423.
    if (mSurroundFormats.empty()) {
        setDefaultSurroundFormats();
    }
    mSource = kAidlConfigSource;
    // No need to augmentData() as AIDL HAL must provide correct mic addresses.
    return NO_ERROR;