Commit graph

66 commits

Author SHA1 Message Date
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
TreeHugger Robot
69c42429d1 Merge "Adding a custom property to the default VHAL impl" into oc-dev 2017-04-17 20:57:38 +00:00
Pavel Maltsev
794fc4f9ff Adding a custom property to the default VHAL impl
This property is supposed to be used mostly from e2e tests (a simple
test-case is provided in separate CL)

Test: make -j && runtest -x packages/services/Car/tests/vehiclehal_test/

Bug: b/36510399
Change-Id: I09b24f22ab328eee1ef6add60901ed03bf046874
2017-04-17 10:39:27 -07:00
Andreas Huber
6fa374ad30 Changed the naming scheme for Treble java libraries (both static and dynamic)
android.hardware.foo@1.0-java => android.hardware.foo-V1.0-java

Bug: 37207894
Test: make
Change-Id: I177f4cfd42f635aaf096107af8309d1a82ed41c0
Merged-In: I8b91881dfaf507c0d852d56ebbb53ff0987e5a34
2017-04-13 15:23:46 -07:00
Steven Moreland
3b36a83a2e Update makefiles (2/2).
Test: pass
Change-Id: Ic7e6289c7b69785491708ce0acbb657f4c704229
2017-04-11 09:58:03 -07:00
Steven Moreland
4e7a307730 Fix transitive includes.
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h

Test: pass
Merged-In: Iff316b21bef556bb026378b7f89e97ded3febef4
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
2017-04-06 22:04:05 +00:00
Pavel Maltsev
33676528f8 Extract logic of storing values to separate class
Also rename DefaultVehicleHal to EmulatedVehicleHal and
extract emulator related code to VehicleEmulator class

Test: mm -j32 ; verified Car Service worked

Change-Id: I34361fdec6f94629cf7ef6c35ff56ef9ce78b855
2017-04-06 05:07:44 +00:00
Enrico Granata
5ecfdeacd9 Fix an issue where Vehicle HAL would crash when trying to update a continuous property without an initial floating-point value
Bug: 36858992
Test: build, flash and boot

(cherry picked from commit 945d0bbc86)

Merged-In: I9906abbf386cf75e838102299e3e97de3475db63
Change-Id: I19ef534fde190a3a1adaca377e8f09760c0ccf4e
2017-04-06 05:06:43 +00:00
Pavel Maltsev
8166677c4b Refactor default values in VHAL
Move default values closer to config declration to add properties
with less pain in future.

Test: mm -j32; verified if Car Service works

(cherry picked from commit 24ade17518)
Merged-In: I2f18837658149eb657f44d81e34eb8e6e497a25c
Change-Id: Ie4285581fa9d871b366b0ed2f08fa8073739a0a9
2017-04-06 05:01:49 +00:00
Pavel Maltsev
270aeae9f4 Remove dependency to libbinder in VHAL
Also, removed per property ACL as it was based on client UID

Test: mm -j ; verified Car Service works

Bug: b/36649684
Change-Id: I7625a013dda8e3ebce5b86a253a8c1befe267c11
(cherry picked from commit 72aebeb3ec)
2017-04-03 23:02:22 +00:00
Andreas Huber
40d3a9bd8c Convert all comments into "doxygen-ready" comments.
Bug: 36453077
Test: mma
Change-Id: I0b1f77dfae5d2258969e33d85ecf45401ffbdfaa
2017-03-29 08:53:58 -07:00
Steven Moreland
561b602a99 Update makefiles for hwtypes.h
Test: pass
Change-Id: I8e17eb8fec5d2f04c526476a866c8dd54ccb556c
2017-03-28 15:18:20 +00:00
Enrico Granata
15e12268ff Add logic for VHAL versions > 2.0 to forward property information to 2.0
Use this infrastructure to move OBD2_LIVE_FRAME support over to the Vehicle HAL 2.0 layer.

This is useful in DefaultVehicleHal 2.0 to let the Emulator layer send/receive information about properties defined by later VehicleHal versions.
Additionally, support the notion that a custom property thusly defined might have logic more intricate than simply a property Id and an area Id,
via a custom handler object that supports get() and set() operations. A default handler object simply falls back to a stored VehiclePropValue, but
more complex implementations are possible.

Test: manual testing in Python:
import vhal_consts_2_0 as c
from vhal_emulator import Vhal

v = Vhal(c.vhal_types_2_0)

v.getConfig(c.VEHICLE_PROPERTY_HVAC_TEMPERATURE_SET)
print v.rxMsg()

v.setProperty(c.VEHICLE_PROPERTY_HVAC_TEMPERATURE_SET, c.VEHICLE_ZONE_ROW_1_LEFT, 70)
print v.rxMsg()

v.getProperty(c.VEHICLE_PROPERTY_HVAC_TEMPERATURE_SET, c.VEHICLE_ZONE_ROW_1_LEFT)
print v.rxMsg()

v.getProperty(0x11e00d00, 0)
print v.rxMsg()

plus

runtest Obd2LiveFrame.java

Change-Id: I9c342e6e2c9ff581beacd238a42780ca10f96d9c
2017-03-21 15:11:16 -07:00
Steven Moreland
54cc198022 update-makefiles for transisitive dependencies
Test: pass
Bug: 36162559
Change-Id: I4f5fddaef9811f0da1d69fa26a5d34830a1a9634
2017-03-20 07:13:46 -07:00
Pavel Maltsev
7005f9f643 Fix typo CELCIUS -> CELSIUS in Vehicle HAL
Test: typo in comments only.
Change-Id: I1610beb9cb44b3b50e9a86fcff41d3421c6ad849
2017-03-15 10:49:28 -07:00
Pavel Maltsev
3fc25be745 Fix config map in default Vehicle HAL impl
Test: tested through VTS
Change-Id: Ibcf607d0ad5cc39291b0d8a159ca3ad849bea8ce
2017-03-14 12:15:46 -07:00
Pavel Maltsev
fb6617935a Fix HvacPowerOn vehicle property
Test: VTS test is now passing
Change-Id: I815645310822bf24c8ee3a37f00c9d78a1e9b666
2017-03-14 11:58:22 -07:00
Pavel Maltsev
8e92b749f4 Merge "Fix static properties to comply with VTS" 2017-03-10 01:18:49 +00:00
TreeHugger Robot
54b2e5e9c8 Merge "Treat warnings as errors in VHAL unit test" 2017-03-10 01:12:07 +00:00
Antonio Cortes Perez
2102b7e765 Merge "Placeholder for future implementation of VMS property in the default hal." 2017-03-08 23:26:01 +00:00
Pavel Maltsev
ff89b0ed42 Treat warnings as errors in VHAL unit test
Test: mm -j

Change-Id: Ic174d0550d621ef8508377db97db33f813c06ab1
Fix: b/34901911
2017-03-08 15:16:24 -08:00
Steven Moreland
ce9967834a Remove warning: vehicle RecurrentTimer_test.cpp
0xdeadbeef is exactly 32 bits, so it is interpretted as an unsigned
integer which was causing a warning. Since it's a test value, I changed
it to 0xdead which is interpretted as a signed integer.

Test: pass
Change-Id: Ibb75b23461700d77158e2337b8a472e87629ad61
2017-03-08 08:34:49 -08:00
Pavel Maltsev
4b0c5abe76 Fix static properties to comply with VTS
Test: VTS is passing

Bug: b/32021794
Change-Id: I0bc0cd98f27ec8b059df283a52fbe18d88962e35
2017-03-07 20:26:13 -08:00
Antonio Cortes
10ccd94f7f Placeholder for future implementation of VMS property in the default hal.
Test: build and flash Mojave board.
Bug: 35628104
Change-Id: I865d943b00b46ca1dd632ff3803702faec38f3f4
2017-03-07 10:51:54 -08:00
TreeHugger Robot
f410228abc Merge "Add continuous property infrastructure to VHAL" 2017-03-07 02:10:05 +00:00
TreeHugger Robot
5d6a91ccce Merge "Fix sensor event in vehicle HAL emulator" 2017-03-07 00:59:24 +00:00
Pavel Maltsev
8ab96e3874 Add continuous property infrastructure to VHAL
Implemented RecurrentTimer class that can be used in VHAL
implementations to trigger an event every X amount of time.
This make sense for continous properties.
Also added linkToDeath for VHAL listeners.

Test: unit tests added and ran

Change-Id: I4a2e0607ff6b15b3e7babbe3fbb9fff8d4e28838
2017-03-06 10:55:06 -08:00
Bryan Eyler
da0d1a1d01 Merge "Add a continuous property to default implementation." 2017-03-03 22:06:47 +00:00
Antonio Cortes Perez
bf827a9898 Merge "Post-O. Move VMS property to hal 2.1." 2017-03-03 15:11:24 +00:00
Antonio Cortes
dd1b9d395d Post-O. Move VMS property to hal 2.1.
Test: build and flash Mojave board with TARGET_USES_CAR_FUTURE_FEATURES=true.
Test: check that the property is displayed in the logs during startup.
Bug: 35628104

Change-Id: I8b5327ae255cd94ac78a0436aac06b32e3168c28
2017-03-02 15:59:51 -08:00
Pavel Maltsev
1ba0d5ee05 Fix sensor event in vehicle HAL emulator
Test: verified events are now gets propagated to CarSensorManager
(toggle day/night mode in Emulator UI)

Change-Id: Ifc4a755c5f6d31f41ab26ebc873c66c43d9e234a
Fix: b/35926101
2017-03-02 14:58:26 -08:00
Bryan Eyler
1c386b5899 Add default behavior for HVAC power
Add properties to HVAC_POWER_ON config string
Return NOT_AVAILABLE for properties in HVAC_POWER_ON config string when
power is off.

Change-Id: Icfa06aa169345e973d2e152aa6dbd8c14f3a5d17
2017-03-01 14:17:00 -08:00
TreeHugger Robot
bbcd49ad86 Merge "Add CarSensor properties to DefaultVehicleHal" 2017-02-28 20:53:47 +00:00
Steve Paik
746c89fa9b Add CarSensor properties to DefaultVehicleHal
Test:  Run python vhal_emulator_test
Change-Id: I1ebab23942397c5043840ea4ea1dc8e515f38c29
2017-02-28 10:38:36 -08:00
Steve Paik
62abcb399a Merge "Add pipe interface to DefaultVehicleHal" 2017-02-28 04:44:39 +00:00
Pavel Maltsev
15e9a8f967 Vehicle Hal 2.1: register with the default name
b/35811488

Test: verified Car Service connected to VHAL 2.1
Change-Id: I5d287b2dc71f62bba501ab872f9a14196d5dabb7
2017-02-27 17:49:37 -08:00
Steve Paik
a59644ac8e Add pipe interface to DefaultVehicleHal
- Create base communications interface
- Refactor socket calls to use SocketComm class

Test: Use python scripts and custom emulator to test communications

Change-Id: Ia401587223035e748991516a2285cc31cb71a9c9
2017-02-27 17:27:18 -08:00
Yifan Hong
4c13f2da75 Merge "Car HAL uses "default" service name" 2017-02-24 20:58:53 +00:00
TreeHugger Robot
dbd6d31f62 Merge "Move OBD2 support to Vehicle HAL 2.1." 2017-02-23 22:45:30 +00:00
Enrico Granata
7debe91a97 Move OBD2 support to Vehicle HAL 2.1.
For O-MR1.
Test: build
Bug: 34746908
Change-Id: I369e6531b8957d8e03154fdf5d732e8242a3c245
2017-02-23 13:06:41 -08:00
Chris Phoenix
018a4d47a8 Car HAL uses "default" service name
the getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934

Change-Id: I1fc92a29178befc1b2232cfcc4b13058d57cd798
2017-02-22 18:47:14 -08:00
Tri Vo
d94a7d2df9 Remove .vts spec files
Test: mmma hardware/interfaces
Change-Id: Idae97ce60a6368cfa685ae6b2d71b9ad163e8605
2017-02-22 12:53:52 -08:00
TreeHugger Robot
d86b0f1f76 Merge "Make vehicle HAL 2.1 proprietary module" 2017-02-22 00:22:04 +00:00
Pavel Maltsev
59f79d0985 Make vehicle HAL 2.1 proprietary module
Bug: b/34716856

Test: make -j ; manually verified Car Service is able to connect
Change-Id: I88cbc7426cf2c41a36d970c4238e5a36d0c1f926
2017-02-21 12:57:41 -08:00
Bryan Eyler
c7f5f76bfd Merge "Remove unused OFF/MIN/MAX constants from HAL." 2017-02-18 00:55:00 +00:00
Bryan Eyler
fd03d46680 Add a continuous property to default implementation.
Just a sample.  It's supposed to be ON_CHANGE as well, but that's a much
larger change.

Change-Id: Idd8c2a8346cb78efeae3d72bab5bd9d8f36cb5f2
2017-02-17 14:49:25 -08:00
Bryan Eyler
b7387b78b8 Remove unused OFF/MIN/MAX constants from HAL.
Change-Id: I8b2b0d94872fdfcb60d2791ee14be85cccd35129
2017-02-17 14:44:43 -08:00
Pavel Maltsev
d99798219b Regenerate make files for Vehicle HAL 2.1
Test: m -j32 ; manually verified Car Service is able to connect to HAL

Bug: b/34716856
Change-Id: I544fa67181ef1d5212c6476100728edaa9aa6c7e
2017-02-16 16:55:06 -08:00
Pavel Maltsev
c5344ac04c Initial submit of Vehicle HAL 2.1
Major changes / decisions:

- created empty IVehicle@2.1 interface to distinguish HAL impls
  from client's (Car Service) perspective;
- created default 2.1 implementation that currently delegates all
  calls to existing 2.0 implementation
- had to refactor a little bit 2.0 thus components could be esily
  imported in 2.1

TOOD:
- move OBD and VMS code to 2.1
- decouple "DefaultVehicleHal.cpp"
- rename "DefaultVehicleHal" to Emulator (let's call things by their names)

b/34716856

Test: todo

Change-Id: Ib23650ca1277f0dfb24e5c789d65a19dce8b1abc
2017-02-14 16:07:11 -08:00