diff options
author | Steven Moreland <smoreland@google.com> | 2017-02-28 17:53:43 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2017-02-28 17:53:43 +0000 |
commit | 8dbdf39b9ac7d82c8f5802863b461734005798dd (patch) | |
tree | 58486018ba9576d28505c71ae24819fae1963e64 /sensors/1.0 | |
parent | 4cc22a0bc8eb95a74bc7d77fd24ba5361650f227 (diff) | |
download | platform_hardware_interfaces-8dbdf39b9ac7d82c8f5802863b461734005798dd.tar.gz platform_hardware_interfaces-8dbdf39b9ac7d82c8f5802863b461734005798dd.tar.bz2 platform_hardware_interfaces-8dbdf39b9ac7d82c8f5802863b461734005798dd.zip |
Revert "Revert "Protect against null strings in hal wrapper implementation.""
This reverts commit 4cc22a0bc8eb95a74bc7d77fd24ba5361650f227.
Reason for revert: Accidental +2, still waiting on: aosp 345923
Change-Id: I57e062b267ad54632c6d7fcd464c7a0dd773de33
Diffstat (limited to 'sensors/1.0')
-rw-r--r-- | sensors/1.0/default/convert.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp index 306d3a3bc2..748a9639c6 100644 --- a/sensors/1.0/default/convert.cpp +++ b/sensors/1.0/default/convert.cpp @@ -25,8 +25,8 @@ namespace V1_0 { namespace implementation { void convertFromSensor(const sensor_t &src, SensorInfo *dst) { - dst->name = src.name; - dst->vendor = src.vendor; + dst->name = src.name == nullptr ? "" : src.name; + dst->vendor = src.vendor == nullptr ? "" : src.vendor; dst->version = src.version; dst->sensorHandle = src.handle; dst->type = (SensorType)src.type; @@ -36,8 +36,8 @@ void convertFromSensor(const sensor_t &src, SensorInfo *dst) { dst->minDelay = src.minDelay; dst->fifoReservedEventCount = src.fifoReservedEventCount; dst->fifoMaxEventCount = src.fifoMaxEventCount; - dst->typeAsString = src.stringType; - dst->requiredPermission = src.requiredPermission; + dst->typeAsString = src.stringType == nullptr ? "" : src.stringType; + dst->requiredPermission = src.requiredPermission == nullptr ? "" : src.requiredPermission; dst->maxDelay = src.maxDelay; dst->flags = src.flags; } |