Commit graph

96 commits

Author SHA1 Message Date
Steve Paik
28b9f8be0b Update VHAL types.hal
Revised types.hal:
  - Add documentation to everything
  - Remove radio property
  - Update Power Manager properties
  - Cleanup formatting

Bug: 77301298
Test: It compiles
Change-Id: I05a1b3269092c05e7f56c57166d2aebe420d7f6a
2018-04-02 22:45:20 -07:00
Ram Periathiruvadi
899d09c3ff Merge "Deprecate DRIVING_STATUS vehicle property." into pi-dev 2018-03-30 20:37:50 +00:00
Enrico Granata
e0bce7913b Merge "Teach VehiclePropertyStore to not propagate the status value when a set() operation comes from Android" into pi-dev 2018-03-30 18:07:22 +00:00
Ram Periathiruvadi
b4ec3dd5cf Deprecate DRIVING_STATUS vehicle property.
DRIVING_STATUS is not required from VHAL.  It will be derived from other
car sensor vehicle properties in higher layers.

Bug: 71793754
Test: compile and boot.
Change-Id: Ia9f9aeb0e7ff0f16c66422ecb4dc9ad9c152a844
2018-03-29 15:43:32 -07:00
Pavel Maltsev
f0cd5e146a Extend VHAL test property to allow inject events
This is needed for e2e testing, specifically to emulate steering-wheel
buttons from KitchenSink app

Bug: 74616964
Test: manual through kitchensink app
Change-Id: I08de2404f9e17af6b08c2cb1f0fbdc45c655a405
2018-03-29 14:12:59 -07:00
Enrico Granata
8acfc2246a Teach VehiclePropertyStore to not propagate the status value when a set() operation comes from Android
The status field of a property represents properties of the underlying implementation and it should thus
be read-only to Android. Add a way for VehiclePropertyStore to be told whether it does (or does not) need to
propagate the field to the stored property value.

Test: build
Bug: 76034442
Change-Id: I333fab7e296f425cf5c4a35ae136ccfbaa542379
2018-03-27 16:29:40 -07:00
TreeHugger Robot
3df7964f07 Merge "Fix AP_POWER_BOOTUP_REASON to be static" into pi-dev 2018-03-26 19:03:04 +00:00
Enrico Granata
ad7b927993 Make toInt() a little bit shorter by moving std::underlying_type to a template argument
No feature change.

Bug: b/75328113
Test: build
Change-Id: I262493821da7bb06618680932cf93ec25671cfe4
2018-03-23 22:41:40 +00:00
Steve Paik
25aa123f7d Fix AP_POWER_BOOTUP_REASON to be static
Bug: 69284418
Test: VTS passes
Change-Id: Ia4816b4d9329c8bd02bf325aed6cfe5bdda30c70
2018-03-23 14:26:35 -07:00
TreeHugger Robot
7371502a1f Merge "VehicleHal::set() should not be able to tamper with a property's AVAILABLE status Properties being (UN)AVAILABLE is used as a one-way communication mechanism from the hardware to the operating system, and not viceversa." into pi-dev 2018-03-17 03:43:20 +00:00
Enrico Granata
74268e6490 VehicleHal::set() should not be able to tamper with a property's AVAILABLE status
Properties being (UN)AVAILABLE is used as a one-way communication mechanism from the hardware
to the operating system, and not viceversa.

Add safety checks in our default HAL implementation to:
  - prevent Android from marking a property as UNAVAILABLE;
  - prevent Android from writing to an UNAVAILABLE property.

The combined effect of these two check is that only AVAILABLE properties are writable,
and they can never be flipped to UNAVAILABLE outside of the HAL implementation itself.

Bug: 74805437
Test: manual
Change-Id: Ib830427d604579015fa142f0fa76f8b73a68a452
2018-03-16 18:31:27 -07:00
Enrico Granata
0dd64f7b78 When writing a VehiclePropValue to the store, update its status
Bug: 74805437
Test: manual
Change-Id: I0269ae3b2584af3959d3fd3beaf06e3c4272f793
2018-03-15 17:16:10 -07:00
Steve Paik
1b48bba00e Add power properties
Refactor handling of property specific code in emulator.  The
AP_POWER_STATE property is different from other properties in the system
because it has different values for get/set.  Thus, it needs to be
special cased by the default emulator.

Bug: 32061842
Test: VHAL emulator
Change-Id: Ic325ef401abbcf09a7808a9eca01cbfe8b3cc94f
2018-02-26 14:51:26 -08:00
Kamaljeet Maini
8c0b8275a3 Revert "Add power properties"
This reverts commit fe360dec66.

Bug: b/73780849
Test: Build and flash locally
Change-Id: I19370fce3508439575c1e0587bcedd5ed4528e8e
2018-02-22 16:31:37 -08:00
Steve Paik
fe360dec66 Add power properties
Bug: 32061842
Test: VHAL emulator
Change-Id: I39e73b57b0951566a692339b30bdce8bf2a33d12
2018-02-21 13:40:44 -08:00
Aditi Nagaraj
666a2a22a1 AreaId is not expected for the Vms VehicleProperty
Bug: 72972190
Test: ran manager-unit-test on mojave
Change-Id: I7d7d93aca19aaa1abf67bd69b59c27e3f9140ed1
2018-02-13 11:08:42 -08:00
Steve Paik
84b5aeaaf9 Add ENGINE_OIL_LEVEL, PARKING_BRAKE_AUTO_APPLY
Bug: 62337898
Bug: 62337346
Test: Vehicle emulator test
Change-Id: If2ea2ccb0b128e7f30a747e329fd3b7bd0d0234b
2018-02-02 14:47:14 -08:00
Steve Paik
54f2ac6994 Fix missing copies of status member variable
Bug: 72348165
Test: Status appears in Embedded Kitchen Sink
Change-Id: Ia6a672fa44f0c1d5a7fe04234897d73b3f45e939
2018-01-26 11:10:45 -08:00
TreeHugger Robot
a4c3b60c2c Merge "Update emulator protobuf to include status" 2018-01-26 03:24:18 +00:00
Steve Paik
5160ba3455 Update emulator protobuf to include status
Add status
Remove supported_areas

Bug: 72348165
Test: Use python emulator to get/set values
Change-Id: Iad84305a49b260ff02b28685f581a82ca7ff8195
2018-01-25 16:26:38 -08:00
TreeHugger Robot
f30add84f8 Merge "Refactor VHAL" 2018-01-25 00:36:29 +00:00
Steve Paik
1ae977d6e8 Refactor VHAL
This CL contains the following modifications:
- Add INT64_VEC type
- Rename VehiclePropertyType:COMPLEX to MIXED
- Remove supportedAreas from VehiclePropConfig
- Allow an areaId to contain multiple zones/seats/windows
- Remove ROW_* zones
- Remove zone/areaId from subscribe() interface
- CLANG formatting

Bug: 72348165
Test:  Compiles
Change-Id: I274dc69b6532a06433a0409c7ca44d0a5bce65af
2018-01-23 14:52:18 -08:00
Anthony Mah
a9d8c0d0f1 interfaces: Automotive Vehicle HAL shared lib def
Revise the definitions for Vehicle HAL bp file.

Bug: b/67430788
Test: Buits and boots

Change-Id: I57ca7ed41de3fd58860b6a1f226c53dcdd6287bf
2018-01-19 13:20:09 -08:00
Aditi Nagaraj
8dcab8e6dd Adding VmsUtils for parsing Vms Vehicle Properties
Test: Tested unit test app on mojave.
Bug: 68704508
Change-Id: I4833e4940710752a2f7943323c5e7ff2489f1c07
2018-01-11 13:04:26 -08:00
Chih-Hung Hsieh
8c7f10bdc4 Use -Werror in hardware/interfaces/automotive/vehicle/2.0
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I439352bb0f876bac10393c08c9bdaa665709b147
2017-11-28 14:18:26 -08:00
TreeHugger Robot
5f05509dc1 Merge "Add HW_KEY_INPUT to DefaultVehicleHal" 2017-11-18 01:45:20 +00:00
Enrico Granata
624034fab3 Add HW_KEY_INPUT to DefaultVehicleHal
Having this property available allows one to simulate key events via Vhal Emulator for testing/debugging purposes

Test: manual
Exempt-From-Owner-Approval: CL against code owned by Automotive team
Change-Id: I1de84c616c6611b8562f9c4442195829869f224d
(cherry picked from commit cbc10191c3d56490a646a472635e8babc397cb44)
2017-11-17 23:32:03 +00:00
Enrico Granata
a77c20486a Give automotive team ownership of the default Vehicle HAL implementation
Test: read file
Change-Id: I32db85f45ebe38c128415f0fa3cb7ccca66d4a97
Exempt-From-Owner-Approval: smoreland@ suggested we take ownership of this subdirectory
2017-11-17 15:28:08 -08:00
Steve Paik
e980916bd7 Add EV parameters to VHAL
Add parameters:
  - INFO_FUEL_TYPE
  - INFO_EV_BATTERY_CAPACITY
  - INFO_EV_CONNECTOR_TYPE
  - ENGINE_ON
  - FUEL_LEVEL
  - FUEL_DOOR_OPEN
  - EV_BATTERY_LEVEL
  - EV_CHARGE_PORT_OPEN
  - EV_CHARGE_PORT_CONNECTED
  - EV_BATTERY_INSTANTANEOUS_CHARGE_RATE

Added enums:
  - EvConnectorType
  - FuelType

Bug: 63330964
Test: Embedded Kitchen Sink can access the params

Change-Id: Iaedbb02db91d354ebed98fbae4c1ba204098e152
2017-11-09 00:13:51 -08:00
TreeHugger Robot
6f53db667b Merge "Add 'vendor.' prefix to a vendor HAL service name" 2017-09-12 06:34:56 +00:00
Jaekyun Seok
81104ae5ef Add 'vendor.' prefix to a vendor HAL service name
To prevent property name collisions between properties of system and
vendor, 'vendor.' prefix must be added to a vendor HAL service name.
You can see the details in http://go/treble-sysprop-compatibility.

Test: succeeded building and tested on a walleye device
Bug: 36796459
Change-Id: I4e8fbee791ec917a8f627a1366f4d44ec7e6febc
2017-09-12 08:01:42 +09:00
Enrico Granata
ad2baebb3b Do not write initial empty values for the diagnostic properties.
There is a separate step that initializes them with meaningful values.

Change-Id: I2480a029773b62b0e77b8c52c73f2ee465caf17c
Fixes: b/65125128
Test: runtest -x packages/services/Car/tests/android_car_api_test/src/android/car/apitest/CarDiagnosticManagerTest.java
2017-09-11 15:06:40 -07:00
Pavel Maltsev
250139c8b0 Merge Vehicle HAL 2.1 iface to 2.0
Vehicle HAL is property based and all properties are considered
optional. It is quite a bit of pain to create new versions of VHAL only
to extend properties.

Bug: 64303350

Test: build and flash, verefied system works stable.
Change-Id: I8adb858f53a5d9d31f7444bf97ae09baf2fffafa
2017-08-24 21:59:18 -07:00
Tri Vo
22b2d68170 Build automotive hals with VNDK.
Bug: 37342627
Test: cd hardware/interfaces/automotive &&
BOARD_VNDK_VERSION=current mma -j64 -k
Change-Id: I89e9af8a5fded3a31eedb9942cfba8e8d9614f53
2017-07-12 16:25:27 -07:00
Tri Vo
fc87140da9 convert vehicle to .bp
Test: cd hardware/interfaces/automotive && mma -j64
Change-Id: I851c9b2ff956b0f6d9d7a6076d495aad9038a66a
2017-07-11 12:55:13 -07:00
Steven Moreland
c525408c60 Remove toString methods in Vehicle HAL.
These methods are already generated by HIDL, but this is
only now being realized.

Test: methods no longer conflict
Change-Id: I522630267beb7f87713a0a54c1ecb38077dc1b4e
2017-06-21 12:57:02 -07:00
Steve Paik
d841094820 Add support of generating fake events via emulator
Bug:  62358398
Test:  Python scripts can enable fake events
Change-Id: Id933ae59fc4d763572b88f58367a3aef0af52b6b
2017-06-06 10:24:53 -07:00
Alex Yakavenka
773bf5aa08 Compile manager-lib shared library
bug: 38424350
Test: Local build
Change-Id: Idd03b8bac365f17b7fc418016d2c250a199384fe
2017-05-26 17:41:01 +00:00
Scott Randolph
3446440623 Eliminate redundant #includes and a missing one
Minor cleanup that fell out of a debugging effort.
Test:  Build and run vehicle hal on gordon peak

Change-Id: I29bcb74f3eac96df303139b2717b06c8dfedb839
2017-05-11 17:43:14 -07:00
Ram Periathiruvadi
e17a009d5d Add DOOR_LOCK to default config.
One of the triggers for Bluetooth Auto connect is a door unlock signal.
Adding it to the list of default supported properties.

Bug: b/37674555
Test: Auto connect triggers on adb shell dumpsys activity service
com.android.car inject-event zoned-boolean 0x16200b02 1 false

Change-Id: Icfed9ea57239cd2397f3e71dcfaccd767a2e9739
2017-05-04 11:31:05 -07:00
Steven Moreland
356c2ced1d Vehicle: IWYU
Missing dependency that was being transitively included
from MQDescriptor.h.

Test: links
Bug: 37791060
Change-Id: I90ccb2edabab8c63429caa0884f6c5820c29fe11
2017-05-02 09:53:59 -07:00
TreeHugger Robot
1195320158 Merge "vehicle: respect result of registerAsService" 2017-04-27 02:59:01 +00:00
Steven Moreland
e50f2efab5 vehicle: respect result of registerAsService
Test: works with https://android-review.googlesource.com/c/358172/
Change-Id: I73bb43f0759f4e396ededf4d8ef7f13711c13276
2017-04-26 11:43:25 -07:00
Enrico Granata
01f5121a33 Don't set hidl_string's buffer to nullptr
Sending a null hidl_string from native code to Java is currently not
a supported operation and will cause a crash. As originally written,
shallowCopy would set a hidl_string to null as soon as a non-empty
stringValue was followed by an empty stringValue. Since freeze frames
come with a string value (the DTC) and live frames doesn't, this would
cause all diagnostics to crash while reading VehiclePropValue from parcel
immediately after dispatching a freeze frame. Fix by resetting empty strings
to a global non-null but zero length buffer.

Bug: 37435530
Test: diagnostic_injector.py
Change-Id: Ie79174dd7ab3d266f1e3addefa5ba9e2128ea9f8
2017-04-25 14:20:33 -07:00
Pavel Maltsev
a4e82724da Merge "Fix failing VTS test cases" into oc-dev am: d77a4a5585
am: 0dbe46536b

Change-Id: I55813abb627487337b17c7e90e734687812f0485
2017-04-24 22:52:27 +00:00
Pavel Maltsev
0e251c8805 Fix failing VTS test cases
Also, increase number of binder threads in VHAL for performance testing

Fix: b/37543801, b/36778517
Bug: b/36510399

Test: make vts BUILD_GOOGLE_VTS=true -j32 && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VtsHalAutomotiveVehicleV2_0Host -l INFO && adb shell /data/nativetest64/android.hardware.automotive.vehicle@2.0-manager-unit-tests/android.hardware.automotive.vehicle@2.0-manager-unit-tests
Change-Id: I850c6be328f1a07ae3fda898a18137c76afe3115
2017-04-21 09:49:16 -07:00
Pavel Maltsev
decc02b6f5 Merge "Use IBinder to identify callbacks in VHAL" into oc-dev am: 2e25e562fa
am: 84163bc36f

Change-Id: Ifa921d812d63f2833e015201e8a1d111383b10ef
2017-04-18 23:51:44 +00:00
TreeHugger Robot
2e25e562fa Merge "Use IBinder to identify callbacks in VHAL" into oc-dev 2017-04-18 23:23:10 +00:00
Pavel Maltsev
41a000da58 Use IBinder to identify callbacks in VHAL
Right now there's no way to distinguish multiple clients, thus we cannot
associate IVehicleCallback from subscribe and unsubscribe method. As a
temporary solution we will use pointer to IBinder from underlying proxy
object until HILD will have some API to do that.

Test: verified unit tests run, checked that subsequent 'subscribe' calls
do not create new client objects in VHAL

Bug: b/37254245
Change-Id: I029564b7b03e4821287c2110d0929a5c4cbce0ce
2017-04-18 14:20:11 -07:00
Pavel Maltsev
753f3b0d1e Merge "Adding a custom property to the default VHAL impl" into oc-dev am: 69c42429d1
am: 7bac03deb2

Change-Id: I1ece0ab7a50274e4957155e01d4db50b9b52e645
2017-04-17 21:23:51 +00:00