[automotive] Use new jsoncpp API

Reader / StyledWriter are deprecated upstream

Bug: 170642246
Change-Id: I9d2a764261e2124a4e99e065446b4946305a914d
This commit is contained in:
Haibo Huang 2021-02-25 11:50:49 -08:00
parent 0b12cea833
commit 0684d40451

View file

@ -96,11 +96,12 @@ bool JsonFakeValueGenerator::hasNext() {
std::vector<VehiclePropValue> JsonFakeValueGenerator::parseFakeValueJson(std::istream& is) {
std::vector<VehiclePropValue> 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;
}