From 0684d40451946c08112af2dd76790efe80ad799d Mon Sep 17 00:00:00 2001 From: Haibo Huang Date: Thu, 25 Feb 2021 11:50:49 -0800 Subject: [PATCH] [automotive] Use new jsoncpp API Reader / StyledWriter are deprecated upstream Bug: 170642246 Change-Id: I9d2a764261e2124a4e99e065446b4946305a914d --- .../2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp index 890eb33643..b62918f61e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp @@ -96,11 +96,12 @@ bool JsonFakeValueGenerator::hasNext() { std::vector JsonFakeValueGenerator::parseFakeValueJson(std::istream& is) { std::vector fakeVhalEvents; - Json::Reader reader; + Json::CharReaderBuilder builder; Json::Value rawEvents; - if (!reader.parse(is, rawEvents)) { + std::string errorMessage; + if (!Json::parseFromStream(builder, is, &rawEvents, &errorMessage)) { ALOGE("%s: Failed to parse fake data JSON file. Error: %s", __func__, - reader.getFormattedErrorMessages().c_str()); + errorMessage.c_str()); return fakeVhalEvents; }