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

Commit 92ebfc76 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12361654 from 5d2d959a to 24Q4-release

Change-Id: I269ca16ec1f5244543dd2d68066db81113c58d3f
parents 0f0a7a0e 5d2d959a
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -33,13 +33,6 @@ flag {
    bug: "238348881"
}

flag {
    namespace: "camera_platform"
    name: "lazy_aidl_wait_for_service"
    description: "Use waitForService instead of getService with lazy AIDL HALs"
    bug: "285546208"
}

flag {
    namespace: "camera_platform"
    name: "session_hal_buf_manager"
@@ -187,16 +180,6 @@ flag {
    bug: "332557570"
}

flag {
    namespace: "camera_platform"
    name: "realtime_priority_bump"
    description: "Bump the scheduling priority of performance critical code paths"
    bug: "336628522"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "camera_platform"
    name: "use_system_api_for_vndk_version"
+20 −12
Original line number Diff line number Diff line
@@ -856,21 +856,31 @@ public:
    C2String getName() const override { return "android.sample.filter-plugin-store"; }
    c2_status_t createComponent(
            C2String name, std::shared_ptr<C2Component>* const component) override {
        if (mFactories.count(name) == 0) {
        auto it = std::find_if(
                mFactories.begin(), mFactories.end(),
                [&name](const std::unique_ptr<ComponentFactory> &factory) {
                    return name == factory->getTraits()->name;
                });
        if (it == mFactories.end()) {
            return C2_BAD_VALUE;
        }
        return mFactories.at(name)->createComponent(++mNodeId, component);
        return (*it)->createComponent(++mNodeId, component);
    }
    c2_status_t createInterface(
            C2String name, std::shared_ptr<C2ComponentInterface>* const interface) override {
        if (mFactories.count(name) == 0) {
        auto it = std::find_if(
                mFactories.begin(), mFactories.end(),
                [&name](const std::unique_ptr<ComponentFactory> &factory) {
                    return name == factory->getTraits()->name;
                });
        if (it == mFactories.end()) {
            return C2_BAD_VALUE;
        }
        return mFactories.at(name)->createInterface(++mNodeId, interface);
        return (*it)->createInterface(++mNodeId, interface);
    }
    std::vector<std::shared_ptr<const C2Component::Traits>> listComponents() override {
        std::vector<std::shared_ptr<const C2Component::Traits>> ret;
        for (const auto &[name, factory] : mFactories) {
        for (const auto &factory : mFactories) {
            ret.push_back(factory->getTraits());
        }
        return ret;
@@ -951,20 +961,18 @@ private:

    template <class T>
    static void AddFactory(
            std::map<C2String, std::unique_ptr<ComponentFactory>> *factories,
            std::vector<std::unique_ptr<ComponentFactory>> *factories,
            const std::shared_ptr<C2ReflectorHelper> &reflector) {
        std::shared_ptr<C2ComponentInterface> intf{new typename T::Interface(0, reflector)};
        std::shared_ptr<C2Component::Traits> traits(new (std::nothrow) C2Component::Traits);
        CHECK(C2InterfaceUtils::FillTraitsFromInterface(traits.get(), intf))
                << "Failed to fill traits from interface";
        factories->emplace(
                traits->name,
                new ComponentFactoryImpl<T>(traits, reflector));
        factories->emplace_back(new ComponentFactoryImpl<T>(traits, reflector));
    }

    static std::map<C2String, std::unique_ptr<ComponentFactory>> CreateFactories(
    static std::vector<std::unique_ptr<ComponentFactory>> CreateFactories(
            const std::shared_ptr<C2ReflectorHelper> &reflector) {
        std::map<C2String, std::unique_ptr<ComponentFactory>> factories;
        std::vector<std::unique_ptr<ComponentFactory>> factories;
        AddFactory<SampleToneMappingFilter>(&factories, reflector);
        return factories;
    }
@@ -977,7 +985,7 @@ private:
        }
    } mIntf;

    const std::map<C2String, std::unique_ptr<ComponentFactory>> mFactories;
    const std::vector<std::unique_ptr<ComponentFactory>> mFactories;

    std::atomic_int32_t mNodeId{0};
};
+15 −1
Original line number Diff line number Diff line
@@ -55,6 +55,17 @@ extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descrip

namespace aidl::android::hardware::audio::effect {

const std::vector<Range::HapticGeneratorRange> kHapticRange = {
        MAKE_RANGE(HapticGenerator, vibratorInfo,
                   HapticGenerator::VibratorInformation(
                           {.resonantFrequencyHz = 1, .qFactor = 1, .maxAmplitude = -1}),
                   HapticGenerator::VibratorInformation(
                           {.resonantFrequencyHz = std::numeric_limits<float>::max(),
                            .qFactor = std::numeric_limits<float>::max(),
                            .maxAmplitude = 1}))};

static const Capability kHapticCap = {.range = kHapticRange};

const std::string HapticGeneratorImpl::kEffectName = "Haptic Generator";
const Descriptor HapticGeneratorImpl::kDescriptor = {
        .common = {.id = {.type = getEffectTypeUuidHapticGenerator(),
@@ -62,7 +73,8 @@ const Descriptor HapticGeneratorImpl::kDescriptor = {
                          .proxy = std::nullopt},
                   .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST},
                   .name = HapticGeneratorImpl::kEffectName,
                   .implementor = "The Android Open Source Project"}};
                   .implementor = "The Android Open Source Project"},
        .capability = kHapticCap};

ndk::ScopedAStatus HapticGeneratorImpl::getDescriptor(Descriptor* _aidl_return) {
    RETURN_IF(!_aidl_return, EX_ILLEGAL_ARGUMENT, "Parameter:nullptr");
@@ -76,6 +88,8 @@ ndk::ScopedAStatus HapticGeneratorImpl::setParameterSpecific(const Parameter::Sp
    RETURN_IF(!mContext, EX_NULL_POINTER, "nullContext");

    auto& hgParam = specific.get<Parameter::Specific::hapticGenerator>();
    RETURN_IF(!inRange(hgParam, kHapticRange), EX_ILLEGAL_ARGUMENT, "outOfRange");

    auto tag = hgParam.getTag();

    switch (tag) {
+2 −2
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ float* HapticGeneratorContext::runProcessingChain(float* buf1, float* buf2, size

std::string HapticGeneratorContext::paramToString(const struct HapticGeneratorParam& param) const {
    std::stringstream ss;
    ss << "\t\ttHapticGenerator Parameters:\n";
    ss << "\t\tHapticGenerator Parameters:\n";
    ss << "\t\t- mHapticChannelCount: " << param.mHapticChannelCount << '\n';
    ss << "\t\t- mAudioChannelCount: " << param.mAudioChannelCount << '\n';
    ss << "\t\t- mHapticChannelSource: " << param.mHapticChannelSource[0] << ", "
@@ -378,7 +378,7 @@ std::string HapticGeneratorContext::contextToString() const {
    ss << "\t\t- distortion input gain: " << DEFAULT_DISTORTION_INPUT_GAIN << '\n';
    ss << "\t\t- distortion cube threshold: " << DEFAULT_DISTORTION_CUBE_THRESHOLD << '\n';
    ss << "\t\t- distortion output gain: " << getDistortionOutputGain() << '\n';
    ss << "\t\tHapticGenerator Parameters:\n" << paramToString(mParams) << "\n";
    ss << paramToString(mParams) << "\n";
    return ss.str();
}

+8 −19
Original line number Diff line number Diff line
@@ -149,11 +149,7 @@ CameraProviderManager::AidlServiceInteractionProxyImpl::getService(
    using aidl::android::hardware::camera::provider::ICameraProvider;

    AIBinder* binder = nullptr;
    if (flags::lazy_aidl_wait_for_service()) {
    binder = AServiceManager_waitForService(serviceName.c_str());
    } else {
        binder = AServiceManager_checkService(serviceName.c_str());
    }

    if (binder == nullptr) {
        ALOGE("%s: AIDL Camera provider HAL '%s' is not actually available, despite waiting "
@@ -2192,14 +2188,11 @@ status_t CameraProviderManager::addAidlProviderLocked(const std::string& newProv
    bool preexisting =
            (mAidlProviderWithBinders.find(newProvider) != mAidlProviderWithBinders.end());
    using aidl::android::hardware::camera::provider::ICameraProvider;
    std::string providerNameUsed  =
            newProvider.substr(std::string(ICameraProvider::descriptor).size() + 1);
    if (flags::lazy_aidl_wait_for_service()) {

    // 'newProvider' has the fully qualified name of the provider service in case of AIDL.
    // ProviderInfo::mProviderName also has the fully qualified name - so we just compare them
    // here.
        providerNameUsed = newProvider;
    }
    std::string providerNameUsed = newProvider;

    for (const auto& providerInfo : mProviders) {
        if (providerInfo->mProviderName == providerNameUsed) {
@@ -2305,15 +2298,11 @@ status_t CameraProviderManager::removeProvider(const std::string& provider) {
        for (const auto& providerInfo : mProviders) {
            if (providerInfo->mProviderName == removedProviderName) {
                IPCTransport providerTransport = providerInfo->getIPCTransport();
                std::string removedAidlProviderName = getFullAidlProviderName(removedProviderName);
                if (flags::lazy_aidl_wait_for_service()) {
                    removedAidlProviderName = removedProviderName;
                }
                switch(providerTransport) {
                    case IPCTransport::HIDL:
                        return tryToInitializeHidlProviderLocked(removedProviderName, providerInfo);
                    case IPCTransport::AIDL:
                        return tryToInitializeAidlProviderLocked(removedAidlProviderName,
                        return tryToInitializeAidlProviderLocked(removedProviderName,
                                providerInfo);
                    default:
                        ALOGE("%s Unsupported Transport %d", __FUNCTION__, eToI(providerTransport));
@@ -2479,7 +2468,7 @@ void CameraProviderManager::ProviderInfo::removeAllDevices() {

bool CameraProviderManager::ProviderInfo::isExternalLazyHAL() const {
    std::string providerName = mProviderName;
    if (flags::lazy_aidl_wait_for_service() && getIPCTransport() == IPCTransport::AIDL) {
    if (getIPCTransport() == IPCTransport::AIDL) {
        using aidl::android::hardware::camera::provider::ICameraProvider;
        providerName =
                mProviderName.substr(std::string(ICameraProvider::descriptor).size() + 1);
Loading