Loading services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ PolicySubsystem::PolicySubsystem(const std::string &name, core::log::Logger &log ); addSubsystemObjectFactory( new TSubsystemObjectFactory<ProductStrategy>( mProductStrategyComponentName, (1 << MappingKeyName) | (1 << MappingKeyIdentifier)) mProductStrategyComponentName, (1 << MappingKeyName)) ); } Loading services/audiopolicy/engineconfigurable/parameter-framework/plugin/ProductStrategy.cpp +13 −8 Original line number Diff line number Diff line Loading @@ -29,9 +29,6 @@ ProductStrategy::ProductStrategy(const std::string &mappingValue, (MappingKeyAmendEnd - MappingKeyAmend1 + 1), context) { size_t id = context.getItemAsInteger(MappingKeyIdentifier); std::string nameFromStructure(context.getItem(MappingKeyName)); ALOG_ASSERT(instanceConfigurableElement != nullptr, "Invalid Configurable Element"); mPolicySubsystem = static_cast<const PolicySubsystem *>( instanceConfigurableElement->getBelongingSubsystem()); Loading @@ -40,14 +37,22 @@ ProductStrategy::ProductStrategy(const std::string &mappingValue, mPolicyPluginInterface = mPolicySubsystem->getPolicyPluginInterface(); ALOG_ASSERT(mPolicyPluginInterface != nullptr, "Invalid Policy Plugin Interface"); const std::string nameFromStructure(context.getItem(MappingKeyName)); std::string name; if (context.iSet(MappingKeyIdentifier)) { size_t id = context.getItemAsInteger(MappingKeyIdentifier); mId = static_cast<android::product_strategy_t>(id); std::string name = mPolicyPluginInterface->getProductStrategyName(mId); name = mPolicyPluginInterface->getProductStrategyName(mId); if (name.empty()) { name = nameFromStructure; mId = mPolicyPluginInterface->getProductStrategyByName(name); } } else { name = nameFromStructure; mId = mPolicyPluginInterface->getProductStrategyByName(nameFromStructure); } ALOG_ASSERT(mId != PRODUCT_STRATEGY_INVALID, "Product Strategy %s not found", name.c_str()); ALOG_ASSERT(mId != PRODUCT_STRATEGY_NONE, "Product Strategy %s not found", name.c_str()); ALOGE("Product Strategy %s added", name.c_str()); } Loading Loading
services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ PolicySubsystem::PolicySubsystem(const std::string &name, core::log::Logger &log ); addSubsystemObjectFactory( new TSubsystemObjectFactory<ProductStrategy>( mProductStrategyComponentName, (1 << MappingKeyName) | (1 << MappingKeyIdentifier)) mProductStrategyComponentName, (1 << MappingKeyName)) ); } Loading
services/audiopolicy/engineconfigurable/parameter-framework/plugin/ProductStrategy.cpp +13 −8 Original line number Diff line number Diff line Loading @@ -29,9 +29,6 @@ ProductStrategy::ProductStrategy(const std::string &mappingValue, (MappingKeyAmendEnd - MappingKeyAmend1 + 1), context) { size_t id = context.getItemAsInteger(MappingKeyIdentifier); std::string nameFromStructure(context.getItem(MappingKeyName)); ALOG_ASSERT(instanceConfigurableElement != nullptr, "Invalid Configurable Element"); mPolicySubsystem = static_cast<const PolicySubsystem *>( instanceConfigurableElement->getBelongingSubsystem()); Loading @@ -40,14 +37,22 @@ ProductStrategy::ProductStrategy(const std::string &mappingValue, mPolicyPluginInterface = mPolicySubsystem->getPolicyPluginInterface(); ALOG_ASSERT(mPolicyPluginInterface != nullptr, "Invalid Policy Plugin Interface"); const std::string nameFromStructure(context.getItem(MappingKeyName)); std::string name; if (context.iSet(MappingKeyIdentifier)) { size_t id = context.getItemAsInteger(MappingKeyIdentifier); mId = static_cast<android::product_strategy_t>(id); std::string name = mPolicyPluginInterface->getProductStrategyName(mId); name = mPolicyPluginInterface->getProductStrategyName(mId); if (name.empty()) { name = nameFromStructure; mId = mPolicyPluginInterface->getProductStrategyByName(name); } } else { name = nameFromStructure; mId = mPolicyPluginInterface->getProductStrategyByName(nameFromStructure); } ALOG_ASSERT(mId != PRODUCT_STRATEGY_INVALID, "Product Strategy %s not found", name.c_str()); ALOG_ASSERT(mId != PRODUCT_STRATEGY_NONE, "Product Strategy %s not found", name.c_str()); ALOGE("Product Strategy %s added", name.c_str()); } Loading