diff options
author | Kai <kwangsudo@google.com> | 2018-06-06 15:35:55 -0700 |
---|---|---|
committer | Kai <kwangsudo@google.com> | 2018-06-07 12:54:17 -0700 |
commit | 4e9ba6500a120ff653f77c1f2d8bef078444094c (patch) | |
tree | 7a51be6b0daf67978017aaf57537bcd76774037d /service/src/com/android | |
parent | 9eb8e1bcd0ef89878328a2a30011b8e572c5a9ff (diff) | |
download | Car-4e9ba6500a120ff653f77c1f2d8bef078444094c.tar.gz |
Add int64_vec type to CarPropertyValue
CarPropertyValue "WHEEL_TICK" is int64_vec type.
Bug:109759390
Test: runtest -x packages/services/Car/tests/carservice_test/
launch sensors from Kitchen sink app
Change-Id: Ie3be7ec22492cf375504ebde9b88f09124cf9a42
(cherry picked from commit 6090ebbba638c4e3017fba53503efc3534d00b4b)
Diffstat (limited to 'service/src/com/android')
-rw-r--r-- | service/src/com/android/car/hal/CarPropertyUtils.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/service/src/com/android/car/hal/CarPropertyUtils.java b/service/src/com/android/car/hal/CarPropertyUtils.java index cbca08b335..d9151e202a 100644 --- a/service/src/com/android/car/hal/CarPropertyUtils.java +++ b/service/src/com/android/car/hal/CarPropertyUtils.java @@ -53,9 +53,8 @@ import java.util.List; v.int32Values.get(0) == 1); } else if (Boolean[].class == clazz) { Boolean[] values = new Boolean[v.int32Values.size()]; - int i = 0; - for (int val : v.int32Values) { - values[i] = val == 1; + for (int i = 0; i < values.length; i++) { + values[i] = v.int32Values.get(i) == 1; } return new CarPropertyValue<>(propertyId, areaId, status, timestamp, values); } else if (String.class == clazz) { @@ -63,6 +62,12 @@ import java.util.List; } else if (byte[].class == clazz) { byte[] halData = toByteArray(v.bytes); return new CarPropertyValue<>(propertyId, areaId, status, timestamp, halData); + } else if (Long[].class == clazz) { + Long[] values = new Long[v.int64Values.size()]; + for (int i = 0; i < values.length; i++) { + values[i] = v.int64Values.get(i); + } + return new CarPropertyValue<>(propertyId, areaId, status, timestamp, values); } else /* All list properties */ { Object[] values = getRawValueList(clazz, v).toArray(); return new CarPropertyValue<>(propertyId, areaId, status, timestamp, |