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

Commit 258d815d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Remove temporary workarounds in AIDL HAL config processing"

parents 99cc276a 0ee6cb9b
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;