summaryrefslogtreecommitdiffstats
path: root/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-09-08 13:23:42 -0400
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-02-05 14:56:52 +0000
commit8bf3c50ab7eb48f8db63ea41d6a12e32f3633dee (patch)
treeacf5541f19ca2a40ef1361e0757485d91e0b05c6 /meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch
parentd369fae7ef2e0bcbd934c838145b08a443b414ff (diff)
Changes: - Mask out the duplicate libopus recipe, the same version is available from a recipe in meta-oe. - Update BBFILES addition for the audio module in the feature template to work with yet another new audio output backend. - Update the AlexaAutoCoreEngineConfig.json.in template based on the new sample JSON in 2.3. - Update alexa-voiceagent-config recipe to add new configuration variables ALEXA_LOCALE, ALEXA_TIMEZONE, ALEXA_MFG_NAME, and ALEXA_DESCRIPTION to match requirements of the updated configuration JSON. - Remove local alexa-voiceagent-service patches merged by Amazon, and update 0001-remove-library-dependency-copying.patch for 2.3. - Update SDK module DEPENDS for alexa-voiceagent-service recipe to match what seems required now with 2.3. - Remove avs-device-sdk patch for building with g++ 9.x, as it is no longer required. - Add avs-device-sdk patch to workaround hang seen on first connection. - Add bbappends for aac-module-car-control and aac-module-messaging recipes to fix their nlohmann-json DEPENDS to work with the recipe that is available in meta-oe. - Rework aac-module-system-audio.bbappend to enable the PipeWire support that has been merged into the module. Bug-AGL: SPEC-3783 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I18c910f9cbf874fef85d1d84508f6666d53629ed (cherry picked from commit e0d5ad833e89f47c88601e15158015319e568af8)
Diffstat (limited to 'meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch')
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch183
1 files changed, 0 insertions, 183 deletions
diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch
deleted file mode 100644
index 8c6f1e4b..00000000
--- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-Fix event argument JSON
-
-It was discovered while trying to use some of the capabilities events
-that the argument JSON was incorrectly formatted, with instances of
-all or part of it being double-quoted as strings with escaping. A
-couple instances of this had previously been worked around by hacks
-involving reparsing all or some parts of the arguments a second time
-with a JSON parser, but it seems better to fix it at the source so
-that the events match documentation and are usable as is.
-
-Note that it is ATM not clear if all affected event argument payloads
-are correct, e.g. LocalMediaSource may need some more work.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Murray <scott.murray@konsulko.com>
-
-diff --git a/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp b/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp
-index 6aea920..23ed90c 100644
---- a/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp
-+++ b/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp
-@@ -17,6 +17,8 @@
-
- #include <sstream>
-
-+#include <json-c/json.h>
-+
- #include <aasb/Consts.h>
-
- #include "AlexaConsts.h"
-@@ -322,7 +324,16 @@ void AlexaCapabilityDirectiveRouterImpl::processTemplateRuntimeAction(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-@@ -343,24 +354,40 @@ void AlexaCapabilityDirectiveRouterImpl::processCBLAction(
- const std::string& payload) {
- m_logger->log(Level::DEBUG, TAG, "Processing CBL action: " + action);
-
-- json_object* eventDataJ = json_object_new_object();
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
-+ // The payload string may already be of the form of a document like
-+ // "{ "payload" : { ... } }", the simplest way to handle that is to use
-+ // it as the event json_object if that's the case, that way we avoid
-+ // having to worry about copying.
-+ json_object* eventDataJ = NULL;
-+ if(json_object_object_get_ex(payloadJ, "payload", NULL)) {
-+ eventDataJ = payloadJ;
-+ } else {
-+ eventDataJ = json_object_new_object();
-+ json_object_object_add(eventDataJ, JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-+ }
- json_object* vaIdJ = json_object_new_string(m_alexaVoiceAgentId.c_str());
--
- json_object_object_add(eventDataJ, JSON_ATTR_VOICEAGENT_ID.c_str(), vaIdJ);
-
- int observers = 0;
- if (action == aasb::bridge::ACTION_CBL_CODEPAIR_RECEIVED) {
- m_logger->log(Level::INFO, TAG, "CBL codepair received: " + payload);
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-- json_object_object_add(eventDataJ, JSON_ATTR_PAYLOAD.c_str(), payloadJ);
- observers = m_cblCodePairReceivedEvent->publishEvent(eventDataJ);
- } else if (action == aasb::bridge::ACTION_CBL_CODEPAIR_EXPIRED) {
- m_logger->log(Level::INFO, TAG, "CBL codepair expired: " + payload);
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-- json_object_object_add(eventDataJ, JSON_ATTR_PAYLOAD.c_str(), payloadJ);
- observers = m_cblCodePairExpiredEvent->publishEvent(eventDataJ);
- } else {
- m_logger->log(Level::INFO, TAG, "Unhandled action: " + action);
-+ json_object_put(eventDataJ);
- }
-
- std::stringstream logMsg;
-diff --git a/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp b/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp
-index 096f72f..75108d4 100644
---- a/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp
-+++ b/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp
-@@ -72,7 +72,16 @@ void CarControlDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-diff --git a/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp b/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp
-index c261a56..04ac10c 100644
---- a/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp
-+++ b/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp
-@@ -71,7 +71,16 @@ void LocalMediaSourceDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-diff --git a/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp b/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp
-index 55a6017..283b42b 100644
---- a/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp
-+++ b/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp
-@@ -68,7 +68,16 @@ void NavigationDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-diff --git a/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp b/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp
-index 29ad96a..3432892 100644
---- a/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp
-+++ b/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp
-@@ -86,7 +86,16 @@ void PhoneCallDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-