Commit graph

81 commits

Author SHA1 Message Date
Steven Moreland
eb8e1a7dc5 vehicle: respect result of registerAsService
(cherry picked from commit e50f2efab5)

Test: works with https://android-review.googlesource.com/c/358172/
Change-Id: I73bb43f0759f4e396ededf4d8ef7f13711c13276
2017-04-28 04:22:39 +00:00
TreeHugger Robot
441c1cb7d7 Merge changes from topic 'o-usage64-2' into oc-dev
* changes:
  automotive: Adjust tests for libui gralloc flags change
  camera: Adjust for libui gralloc flags change
2017-04-25 04:12:31 +00:00
Chris Forbes
f90642b8f8 automotive: Adjust tests for libui gralloc flags change
Change-Id: Ia88d8fc664196eae7153ccfb755ea9c3d135fd0c
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube
2017-04-21 18:33:41 +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
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
Chia-I Wu
79d13ff0f5 graphics: revise gralloc interfaces
Revise IAllocator and IMapper to reduce IPC and to support gralloc0
devices.

Specifically, IAllocator is trimmed down to have essentially only

    allocate(BufferDescriptor descriptor, uint32_t count)
        generates (Error error,
                   uint32_t stride,
                   vec<handle> buffers);

The ability to allocate buffers with shared backing store is
removed.  ProducerUsage and ConsumerUsage are moved to the
graphics.common package and are merged and renamed to BufferUsage.
BufferUsage's bits follow gralloc0.

IMapper gains

    typedef vec<uint32_t> BufferDescriptor;
    createDescriptor(BufferDescriptorInfo descriptorInfo)
          generates (Error error,
                     BufferDescriptor descriptor);

where BufferDescriptor is an implementation-defined blob.  lockFlex
is replaced by lockYCbCr.  All getters are removed.

Reference counting with retain/release is replaced by
importBuffer/freeBuffer.

Most if not all gralloc1 features are not used by the runtime yet.
There is also not too much test written for them.  As such, they
tend to behave differently between implementations and cannot be
used reliably.

Bug: 36481301
Test: builds and boots on Pixel
Change-Id: I1d31105120517ea2c128c7a19297acf3bfd312bb
2017-04-10 11:15:54 -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
Scott Randolph
f059ae420d Merge "Use explicit .c_str() for hidl_string" into oc-dev 2017-04-06 18:01:48 +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
Scott Randolph
8997880087 Use explicit .c_str() for hidl_string
hidl_string no longer will provide an implicit cast to const char* as it
interfers with other expected behaviors of the class.  It now emulated
std::string in requiring a call to .c_str() to get the same behavior.

Bug:  36532780
Test:  Build the tree
Change-Id: I265590c7c18f425e44863df062a56b67519a932a
2017-04-04 10:53:26 -07: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
Scott Randolph
6c0855895a Add VTS tests for EVS HAL
Note:  This change list was developed as ag/2031642 on master, but
cherry picks are broken at the moment, so reapplying directly to oc-dev.
The change in master will be abandoned in favor of the auto-merger.

Test:  Run them against the default (mock) driver on bat_land
Change-Id: I7ae523eb6a18ce6a1d0dcd8494f335ffa77f34f1
2017-03-31 16:26:16 -07:00
Scott Randolph
de9880eece Simplify EVS HAL and move to "agressive opens"
This adapts the API implementation to allow a duplicate "open" operation
to automatically close any previous connections to the device.  This
works around a binder level issue that can cause destructors triggered
by remote clients to be delivered out of order to the server.

This was originally change ag/1969959 on master, but has been
recreated on oc-dev (cherry-picking was broken at the time).
The original master change will be abandoned in favor of this getting
merged down from oc-dev.

Test:  Run Vts test (added in following change)
Change-Id: I7b417998e59a4d592fbb91811c4101f39097c5dd
2017-03-30 14:04:12 -07: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
Steven Moreland
25197e9240 EvsCamera: %zd -> %zu for size_t print
%zd doesn't throw a warning, but %zu is technically correct.

Change-Id: I3762d01cc424ecf84e73c21afe5a5a3d295fe782
2017-03-10 21:05:09 -08: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
Steven Moreland
6ac7efc85e EvsCamera: %lu -> %zd for size_t print
lu causes a warning when size_t isn't 64-bit

Test: pass
Change-Id: If8f5c45273713e67478226db66ce73bd64f4e063
2017-03-08 22:18:47 -08:00
Steven Moreland
48c52249e4 hidl_default to all targets.
find hardware/interfaces -type f -not -path "*/.git/*" \
-exec sed -i -e '/cc_[A-Za-z_]\+/ { N; s/$/\n    defaults:
\["hidl_defaults"\],/ }' {} \;
./hardware/interfaces/update-makefiles.sh

Test: pass
Bug: 35840847
Change-Id: If10c464d2f000b85c8d698fe11a4f3fc4cfad282
2017-03-08 19:31:53 -08: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
TreeHugger Robot
b5bec3d243 Merge "Remove warning: vehicle RecurrentTimer_test.cpp" 2017-03-08 18:29:03 +00: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
TreeHugger Robot
20bb6cc808 Merge "Move EVS HAL under automotive folder" 2017-03-08 01:17:38 +00: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
Scott Randolph
8342279a79 Move EVS HAL under automotive folder
Test:  Build locally
Change-Id: I76aa7eb52497169d0edcb6d756e0a7ca31bb0b46
2017-03-06 15:59:50 -08: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