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: François Gaffie <francois.gaffie@intel.com>
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioCollections.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioCollections.cpp
index 6cd2b91..f66af6b 100644
--- a/services/audiopolicy/common/managerdefinitions/src/AudioCollections.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioCollections.cpp
@@ -42,7 +42,7 @@
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);
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp
index 497d555..ccb10ae 100755
--- a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp
@@ -30,24 +30,16 @@
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);
}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h
index 67c5b50..0db4f70 100755
--- a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h
@@ -32,7 +32,6 @@
const CMappingContext &context);
protected:
- virtual bool receiveFromHW(std::string &error);
virtual bool sendToHW(std::string &error);
private:
@@ -44,6 +43,4 @@
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. */
};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp
index 1848813..5c536d5 100755
--- a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp
@@ -31,8 +31,7 @@
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 @@
mPolicyPluginInterface->addStrategy(getFormattedMappingValue(), mId);
}
-bool Strategy::receiveFromHW(string & /*error*/)
-{
- blackboardWrite(&mApplicableOutputDevice, sizeof(mApplicableOutputDevice));
- return true;
-}
-
bool Strategy::sendToHW(string & /*error*/)
{
uint32_t applicableOutputDevice;
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h
index 9a9b3e4..cbb72e2 100755
--- a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h
@@ -32,7 +32,6 @@
const CMappingContext &context);
protected:
- virtual bool receiveFromHW(std::string &error);
virtual bool sendToHW(std::string &error);
private:
@@ -44,6 +43,4 @@
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. */
};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp
index 1916b9b..eb7d78f 100755
--- a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp
@@ -31,8 +31,7 @@
context),
mPolicySubsystem(static_cast<const PolicySubsystem *>(
instanceConfigurableElement->getBelongingSubsystem())),
- mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
- mApplicableStrategy(mDefaultApplicableStrategy)
+ mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface())
{
mId = static_cast<audio_usage_t>(context.getItemAsInteger(MappingKeyIdentifier));
@@ -40,17 +39,10 @@
mPolicyPluginInterface->addUsage(getFormattedMappingValue(), mId);
}
-bool Usage::receiveFromHW(string & /*error*/)
-{
- blackboardWrite(&mApplicableStrategy, sizeof(mApplicableStrategy));
- return true;
-}
-
bool Usage::sendToHW(string & /*error*/)
{
uint32_t applicableStrategy;
blackboardRead(&applicableStrategy, sizeof(applicableStrategy));
- mApplicableStrategy = applicableStrategy;
return mPolicyPluginInterface->setStrategyForUsage(mId,
- static_cast<routing_strategy>(mApplicableStrategy));
+ static_cast<routing_strategy>(applicableStrategy));
}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h
index 8e9b638..3b82f8c 100755
--- a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h
@@ -32,7 +32,6 @@
const CMappingContext &context);
protected:
- virtual bool receiveFromHW(std::string &error);
virtual bool sendToHW(std::string &error);
private:
@@ -44,6 +43,4 @@
android::AudioPolicyPluginInterface *mPolicyPluginInterface;
audio_usage_t mId; /**< usage identifier to link with audio.h. */
- uint32_t mApplicableStrategy; /**< applicable strategy for this usage. */
- static const uint32_t mDefaultApplicableStrategy = 0; /**< default strategy. */
};