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

Commit fdb17f64 authored by François Gaffie's avatar François Gaffie Committed by Eric Laurent
Browse files

audio policy: configurable engine: remove unecessary function



The policy plugin does not connect with any HW and does not need to
perform a backward synchronisation at startup. This patch removes
uncessary function linked with this functionality.

Change-Id: Ie0d729f0eb4ea10d9a8450902dabba1fbbf199ef
Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@intel.com>
parent 754cabcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ status_t AudioRouteVector::dump(int fd) const
    const size_t SIZE = 256;
    char buffer[SIZE];

    snprintf(buffer, SIZE, "\nAudio Route dump (%d):\n", size());
    snprintf(buffer, SIZE, "\nAudio Route dump (%zu):\n", size());
    write(fd, buffer, strlen(buffer));
    for (size_t i = 0; i < size(); i++) {
        snprintf(buffer, SIZE, "- Route %zu:\n", i + 1);
+2 −10
Original line number Diff line number Diff line
@@ -30,24 +30,16 @@ InputSource::InputSource(const string &mappingValue,
                                context),
      mPolicySubsystem(static_cast<const PolicySubsystem *>(
                           instanceConfigurableElement->getBelongingSubsystem())),
      mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
      mApplicableInputDevice(mDefaultApplicableInputDevice)
      mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface())
{
    mId = static_cast<audio_source_t>(context.getItemAsInteger(MappingKeyIdentifier));
    // Declares the strategy to audio policy engine
    mPolicyPluginInterface->addInputSource(getFormattedMappingValue(), mId);
}

bool InputSource::receiveFromHW(string & /*error*/)
{
    blackboardWrite(&mApplicableInputDevice, sizeof(mApplicableInputDevice));
    return true;
}

bool InputSource::sendToHW(string & /*error*/)
{
    uint32_t applicableInputDevice;
    blackboardRead(&applicableInputDevice, sizeof(applicableInputDevice));
    mApplicableInputDevice = applicableInputDevice;
    return mPolicyPluginInterface->setDeviceForInputSource(mId, mApplicableInputDevice);
    return mPolicyPluginInterface->setDeviceForInputSource(mId, applicableInputDevice);
}
+0 −3
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ public:
             const CMappingContext &context);

protected:
    virtual bool receiveFromHW(std::string &error);
    virtual bool sendToHW(std::string &error);

private:
@@ -44,6 +43,4 @@ private:
    android::AudioPolicyPluginInterface *mPolicyPluginInterface;

    audio_source_t mId; /**< input source identifier to link with audio.h. */
    uint32_t mApplicableInputDevice; /**< applicable input device for this strategy. */
    static const uint32_t mDefaultApplicableInputDevice = 0; /**< default input device. */
};
+1 −8
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ Strategy::Strategy(const string &mappingValue,
                                context),
      mPolicySubsystem(static_cast<const PolicySubsystem *>(
                           instanceConfigurableElement->getBelongingSubsystem())),
      mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
      mApplicableOutputDevice(mDefaultApplicableOutputDevice)
      mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface())
{
    mId = static_cast<routing_strategy>(context.getItemAsInteger(MappingKeyIdentifier));

@@ -40,12 +39,6 @@ Strategy::Strategy(const string &mappingValue,
    mPolicyPluginInterface->addStrategy(getFormattedMappingValue(), mId);
}

bool Strategy::receiveFromHW(string & /*error*/)
{
    blackboardWrite(&mApplicableOutputDevice, sizeof(mApplicableOutputDevice));
    return true;
}

bool Strategy::sendToHW(string & /*error*/)
{
    uint32_t applicableOutputDevice;
+0 −3
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ public:
             const CMappingContext &context);

protected:
    virtual bool receiveFromHW(std::string &error);
    virtual bool sendToHW(std::string &error);

private:
@@ -44,6 +43,4 @@ private:
    android::AudioPolicyPluginInterface *mPolicyPluginInterface;

    android::routing_strategy mId; /**< strategy identifier to link with audio.h.*/
    uint32_t mApplicableOutputDevice; /**< applicable output device for this strategy. */
    static const uint32_t mDefaultApplicableOutputDevice = 0; /**< default output device. */
};
Loading