Remove workaround for broken vshl-core event JSON 30/23530/1
authorScott Murray <scott.murray@konsulko.com>
Thu, 2 Jan 2020 21:51:12 +0000 (16:51 -0500)
committerScott Murray <scott.murray@konsulko.com>
Fri, 3 Jan 2020 15:52:28 +0000 (15:52 +0000)
Now that the broken event argument JSON from the vshl-core binding has
a fix, the workaround of reparsing the voice event arguments needs to
be removed, as it breaks with the corrected events.

Bug-AGL: SPEC-3084

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I47b6369d9924102252c4690dda38d721276c69b8
(cherry picked from commit f9fd82d04fba32b9f540f592bfa8b49d60e63851)

homescreen/src/chromecontroller.cpp

index 34895bf..e944b2d 100644 (file)
@@ -116,7 +116,7 @@ ChromeController::ChromeController(const QUrl &bindingUrl, QObject *parent) :
     connect(m_aglSocket, &AglSocketWrapper::eventReceived,
             this, [this](const QString &eventName, const QJsonValue &data) -> void {
         if (eventName.compare(vshl::VOICE_DIALOG_STATE_EVENT + m_voiceAgentId) == 0) {
-            const QJsonObject dataObj = QJsonDocument::fromJson(data.toString().toUtf8()).object();
+            const QJsonObject dataObj = data.toObject();
             auto objIt = dataObj.find(vshl::STATE_TAG);
             if (objIt == dataObj.constEnd()) {
                 qWarning() << "Voice dialog state event state missing.";