Commit graph

375 commits

Author SHA1 Message Date
TreeHugger Robot
a772a420b0 Merge "Add support to USER_IDENTIFICATION_ASSOCIATION_PROPERTY." into rvc-dev 2020-04-24 00:23:34 +00:00
TreeHugger Robot
bb0349f722 Merge "Minor corrections on USER_SWITCH documentation." into rvc-dev 2020-04-23 23:26:20 +00:00
Felipe Leme
0fd963cad8 Minor corrections on USER_SWITCH documentation.
Also removed the hash check on Vehicle HAL files, as they're still being
worked on.

Test: m
Bug: 15249991

Change-Id: I214ebc9b5bbd71e5db1a1332296ceb4e426c50cf
2020-04-23 14:28:30 -07:00
Calvin Huang
96ea2ce5e7 Merge "Add manifest to vintf fragments" into rvc-dev 2020-04-23 20:24:30 +00:00
felipeal
67664dfacc Add support to USER_IDENTIFICATION_ASSOCIATION_PROPERTY.
Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --set 299896587 i 1 i 1 i 2
Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --get 299896587

Bug: 150409351

Change-Id: I5f05c1689abdeeffd1abcd0e85fd01b584501a2e
2020-04-23 12:54:09 -07:00
Jordan Jozwiak
93f22c85c7 Merge "Add config for tire pressure display units" into rvc-dev 2020-04-23 19:19:54 +00:00
Jordan Jozwiak
7faa170ff1 Add config for tire pressure display units
Bug: 154751939
Test: aae app vhal apply google
// verify property included in dump
adb -s c3139966 shell dumpsys activity service com.android.car get-carpropertyconfig | grep TIRE_PRESSURE_DISPLAY_UNITS -A5

Change-Id: Id7a3ad7351db5a4f03ab3a29fa06e9c82321a44e
2020-04-22 14:38:52 -07:00
Calvin Huang
a653616f18 Add manifest to vintf fragments
Bug: 153734354
Test: Manual
Change-Id: I5f29cdacced0bdc0bf5a74f92ecda916f10bea06
2020-04-21 14:44:10 -07:00
Calvin Huang
a7f44eb83c Add manifest for IVehicle
Bug: 153734354
Test: Manual
Change-Id: I7e6a65e3fb49bb04108d0fd243df0b7447a93b1e
2020-04-16 16:02:17 -07:00
Hayden Gomes
6eaedbae7c Merge "Adding android_filesystem_config.h import" into rvc-dev 2020-04-10 16:19:37 +00:00
Hayden Gomes
8261cac9e8 Adding android_filesystem_config.h import
Addressing outstanding todo in VehicleHalManager

Bug: 148098383
Test: m vts and atest android.hardware.automotive.vehicle@2.0-manager-unit-tests
Change-Id: I9a222077d0de91f8c7353c80d8a1aeff53cffa61
2020-04-09 17:17:31 -07:00
Hao Chen
37cd4646ac Move virtualization-specific proto definition to /device/google/trout
Test: build
Bug: 148816426
Change-Id: I5ea4a078d2733d0b5fc370211389ebc0488898ef
2020-04-09 18:20:15 +00:00
TreeHugger Robot
03a34b7964 Merge "Add filegroup for trout project to use VehicleHalProto definition" into rvc-dev 2020-04-07 20:05:47 +00:00
Calvin Huang
d5608a2d5a Override VHAL property init value with json
Bug: 150978133
Test: Manual
Change-Id: Iaa45adad3712ca3cc325d52433048b3208109402
2020-04-06 22:07:02 -07:00
Hao Chen
efc31de2b6 Add filegroup for trout project to use VehicleHalProto definition
Other virtualization specific definitions and build rules will be moved
to /device/google/trout in the following patches. Keep them for now so
that we will not break the build.

Test: build
Bug: 148816426
Change-Id: I8a579346b55aa812db3dd30a34050c9515f7a68d
2020-04-06 16:27:15 -07:00
felipeal
eb5c657bc7 Implemented SWITCH_USER in the emulated User HAL.
Examples:

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --user-hal
No InitialUserInfo response
No SwitchUser response

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --set 299896584 a 1 i 666 i 3 i 1 s "D\\'OH!"
Set property {.timestamp = 63698971001637, .areaId = 1, .prop = 299896584, .status = AVAILABLE, .value = {.int32Values = [3]{666, 3, 1}, .floatValues = [0]{}, .int64Values = [0]{}, .bytes = [0]{}, .stringValue = "D'OH!"}}

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --user-hal
No InitialUserInfo response
SwitchUser response: {.timestamp = 63698971001637, .areaId = 1, .prop = 299896584, .status = AVAILABLE, .value = {.int32Values = [3]{666, 3, 1}, .floatValues = [0]{}, .int64Values = [0]{}, .bytes = [0]{}, .stringValue = "D'OH!"}}

Test: see commands above
Bug: 150409110

Change-Id: Id5b92774fccebbc39ed8d3f553df3f5aa30fc656
2020-03-23 09:43:34 -07:00
Kai Wang
e5a22f2fa1 Merge "Add timestamp for continuously property." into rvc-dev 2020-03-18 17:47:04 +00:00
Kai
47a9378d4d Add timestamp for continuously property.
Bug: 148960132
Test: 1. apply google vhal to device
      2. atest CtsCarTestCases:CarPropertyManagerTest

Change-Id: Ib6690b5e242287958017c87632f56a546d418674
2020-03-17 22:46:06 +00:00
Huihong Luo
034c9bc96e Don't send brightness to car service inside Emulator
This fixes this cts test: android.cts.statsd.atom.UidAtomTests#testScreenBrightness

Bug: 139959479
Test: atest android.cts.statsd.atom.UidAtomTests#testScreenBrightness
Change-Id: I66f858ce7686a90cd395f4e646133e8ea4604be4
Merged-In: I66f858ce7686a90cd395f4e646133e8ea4604be4
(cherry picked from commit 1322465c48d0c3dfa5953573b80a89460b8e7e95)
(cherry picked from commit 5d463fdaaa)
2020-03-11 19:34:00 -07:00
Hao Chen
25cf3b5b9c Bugfix: add "override" explicitly to make the compiler happy
Test: build

Bug: 148877226
Change-Id: I90806ee2c2302ce9cc5dc8f82754aa807c2ec7ef
2020-03-09 12:53:23 -07:00
Hao Chen
f724a227b0 Merge nested namesapces
fix the nits in ag/10318156

Bug: 150791171

Test: build
Change-Id: I44609f8c7cbeffcb02cb9f2e2f56f3a829de17f6
Merged-In: I44609f8c7cbeffcb02cb9f2e2f56f3a829de17f6
2020-03-04 22:20:03 +00:00
Hao Chen
a6d6fa3d9d Split client and server impl
Some of the code in VHAL client implementation contains Android-specific
code, and some of the server operations only works in the native case.
So we split them up so that the AGL VHAL server can selectivly pick the
parts it needs.

It won't change the logic of native VHAL.

Bug: 148877226
Bug: 150791171

Test: Build

Change-Id: Ie142b19a5c435a0b4252ffd297504bde69eb44b0
(cherry picked from commit 7e9e37fa0a)
Merged-In: Ie142b19a5c435a0b4252ffd297504bde69eb44b0
2020-03-04 22:19:56 +00:00
Hao Chen
2f2b3bbef6 Split vehicle client and server interface header
Since vehicle client may contains some Android-specific types/headers
that may not exist on AGL, we split the header into "client" and "server".
It won't change the logic of Android codes.

Bug: 148877226
Bug: 150791171
Test: build

Change-Id: I550034b071ca6a7ca322fb26b61d76ed4a7307ee
(cherry picked from commit 8dfac92fee)
Merged-In: I550034b071ca6a7ca322fb26b61d76ed4a7307ee
2020-03-04 22:19:48 +00:00
Hao Chen
d599096596 Add headers and macros for building VHAL server for AGL
It won't change the logic of Android codes.

Bug: 148877226
Bug: 150791171

Test: Android build won't break

Change-Id: I07006a4a3e20900a2fa90b84167d114f9ac45cfe
(cherry picked from commit 080963546a)
Merged-In: I07006a4a3e20900a2fa90b84167d114f9ac45cfe
2020-03-04 22:18:03 +00:00
Kai Wang
653916fb29 Merge "Add property for multiple ev port locations" 2020-02-21 20:52:03 +00:00
Kai
d0bc0bc57b Add property for multiple ev port locations
Some cars have multiple ev ports.

Bug: 117599455
Test: google VHAL and kitchenSink app
Change-Id: I630b60f773867d1e3a85786403ee28852d497f7e
2020-02-20 10:31:30 -08:00
Danny Epstein
71e543a61f Add rotary interface to VHAL.
Adds a new property for rotary knobs that can spin indefinitely.

Test: Changed Hawk VHAL to use new property for volume
Change-Id: I74eb664e243b5796f7bccb2debd9c440bf430f7d
2020-02-20 10:15:59 -08:00
Jim Kaye
afb6d8fdf4 Clean up descriptions of power states
Clarify the descriptions of VehicleApPowerStateReq and
VehicleApPowerStateReport.

Fixes: 128841180
Test: None. Documentation only.
Change-Id: Icbe86e2e6a761e37adf2689596eb81bb68295fa7
2020-02-14 13:24:35 -08:00
Felipe Leme
f2d4327c83 Merge "Changed value of "no user id" to -10000 (same as UserHandle.USER_NULL)." 2020-02-13 04:17:33 +00:00
Felipe Leme
7778389b1a Fixed User HAL dump.
It was not validating the input before storing the response form lshal, which
would crash it later.

Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --set 299896583 a 2
Bug: 146207078

Change-Id: I49a38041e2881224c61e3c645db7c9103d024040
2020-02-12 12:04:10 -08:00
Felipe Leme
31a6216561 Changed value of "no user id" to -10000 (same as UserHandle.USER_NULL).
Test: no, thanks
Bug: 146207078

Change-Id: I8bdab48caa8cff98ac8795e6aa20a2b295363fda
2020-02-12 11:29:39 -08:00
Enrico Granata
52d6e032af Move the virtualized vehicle hal code into the trout tree
AAOS virtualization work is happening under the trout tree, and
we should be building reference HAL implementations for the
virtualized deployment under that tree

Bug: 148816426
Test: build
Change-Id: I90fd2bc4191f8076475e034c7feb07b2664e63c8
2020-02-10 17:42:53 -08:00
Felipe Leme
2acb9a7e0d Added VehicleHal.dump()
This (optional) function allows the HAL implementation customize lshal debug;
for example, it could:
  - augment dump() by dumping its own state
  - disable dump()
  - dump specific state based on arguments
  - run custom commands based on arguments

This CL also implements this method in the emulated vehicle HAL, where it adds
options to dump the user-related state.

Bug: 146207078

Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --user-hal
Test: atest android.hardware.automotive.vehicle@2.0-manager-unit-tests \
          android.hardware.automotive.vehicle@2.0-default-impl-unit-tests

Change-Id: If04e8222a31448f170ab2b54552051196b6ab958
2020-02-07 16:03:09 -08:00
Felipe Leme
003fe685c2 Implemented INITIAL_USER_INFO.
This property is called by Android when it starts, and it's expecting a
property change indicating what the initial user should be.

During normal circumstances, the emulator will reply right away, passing a
response if InitialUserInfoResponseAction::DEFAULT (so Android could use its
own logic to decide which user to boot).

But during development / testing, the behavior can be changed using lshal dump,
so the following scenarios can be tested:
- property timeout
- HAL response using a different request id
- user switch
- user creation

Bug: 146207078
Test: manual tests with lshal and a modified CarServiceHelper
Test: atest android.hardware.automotive.vehicle@2.0-manager-unit-tests \
      android.hardware.automotive.vehicle@2.0-default-impl-unit-tests

Change-Id: Ia5be62c8b19a168c0c6da5307169fc14bf3069c9
2020-02-07 09:35:14 -08:00
TreeHugger Robot
a01dc25fc1 Merge "Implemented IVehicle::debug() on default Vehicle HAL implementation." 2020-02-06 02:44:10 +00:00
Felipe Leme
6542f01ef2 Fixed typo (vehcile -> vehicle).
Test: rgrep -i vehcile . || echo NOT_FOUND
Bug: 146207078

Change-Id: I3ab9ffe25b6bf58a4ff18a70e94bf910b5302e72
2020-02-05 15:58:31 -08:00
Felipe Leme
75a27f8b37 Implemented IVehicle::debug() on default Vehicle HAL implementation.
This function allows developer to drive (no pun intend) the VHAL behaviour
using lshal, which is useful when implementing new CarService functionalities
that depend on VHAL properties.

Examples:

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --help
Usage:

[no args]: dumps (id and value) all supported properties
--help: shows this help
--list: lists the ids of all supported properties
--get <PROP1> [PROP2] [PROPN]: dumps the value of specific properties
--set <PROP> <i|s> <VALUE>: sets the value of property PROP, using an arbitrary number
  of key/value parameters (i for int32, s for string)

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default | head -2
dumping 87 properties
1: {.timestamp = 0, .areaId = 0, .prop = 299896583, .status = AVAILABLE,
.value = {.int32Values = [3]{42, 1, 10}, .floatValues = [0]{}, .int64Values = [0]{},
.bytes = [0]{}, .stringValue = ""}}

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default \
  --set 299896583 s Numbers i 4 i 8 i 15 i 16 i 23 i 42
Set property {.timestamp = 0, .areaId = 0, .prop = 299896583, .status = AVAILABLE,
.value = {.int32Values = [6]{4, 8, 15, 16, 23, 42}, .floatValues = [0]{},
.int64Values = [0]{}, .bytes = [0]{}, .stringValue = "Numbers"}}

$ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default \
  --get 299896583

{.timestamp = 102372810363603, .areaId = 0, .prop = 299896583, .status = AVAILABLE,
.value = {.int32Values = [6]{4, 8, 15, 16, 23, 42}, .floatValues = [0]{},
.int64Values = [0]{}, .bytes = [0]{}, .stringValue = "Numbers"}}

Bug: 146207078
Test: see examples above
Test: atest android.hardware.automotive.vehicle@2.0-manager-unit-tests \
      android.hardware.automotive.vehicle@2.0-default-impl-unit-tests

Change-Id: I2a9bd6f39f2938653a404cab43bdae9e45476529
2020-02-05 15:22:50 -08:00
TreeHugger Robot
b1674a0147 Merge "Added more properties associated with user management:" 2020-02-05 05:56:39 +00:00
Felipe Leme
8edc5b8326 Added more properties associated with user management:
- CREATE_USER: called after an Android user is created.
- REMOVE_USER: called after an Android user is removed.
- USER_IDENTIFICATION_ASSOCIATION: associates an Android user with
  vehicle artifacts like a key FOB.

This CL only defines the new types, they're not implemented or used yet.

Test: m -j android.hardware.automotive.vehicle@2.0-service
Bug: 146207078

Change-Id: Idb399df55567402edb1b954b1c4b25f69e810a81
2020-02-04 19:01:40 -08:00
Enrico Granata
c44909ded8 Centralize creation and error handling for VsockServerInfo
Provide helper functions that create VsockServerInfo objects
from either the command line or the property storage, and
have them return optional instead of relying on default values.

Also, avoid atoi() since it has the potential for undefined behavior.

Test: build
Change-Id: I0aab6b7d84e5084580e25217ac5ba4f5a1db6e2a
2020-02-03 14:01:37 -08:00
felipeal
c5afe480bd Added new properties on Vehicle HAL to support user management.
These initial properties are:

- INITIAL_USER_INFO: gets information about the initial user, it will
  replace the android.car.systemuser.bootuseroverrideid system property
  approach.
- SWITCH_USER_REQUEST: used to communicate a user switch request from
  Android to HAL, or vice versa.

This CL only defines the new types, they're not implemented or used yet.

Test: m -j android.hardware.automotive.vehicle@2.0-service
Bug: 146207078

Change-Id: I25055f8adc90aaebaf3a3faa9a9b73c284440624
2020-01-31 09:24:15 -08:00
Hao Chen
5a97c389e9 Apply Grpc Client to current VHal Implementation
Test: tested on Cuttlefish VM

 - Use virtualization HAL implementation, device/google/cuttlefish/shared/auto/device.mk, PRODUCT_PACKAGES:
      remove android.hardware.automotive.vehicle@2.0-service
      add:
        android.hardware.automotive.vehicle@2.0-virtualization-service
        android.hardware.automotive.vehicle@2.0-virtualization-grpc-server

 - configure the server CID and port, add the following device/google/cuttlefish/shared/config/init.vendor.rc:
        setprop ro.vendor.vehiclehal.server.cid 3
        setprop ro.vendor.vehiclehal.server.port 9210
 - Build and Launch cuttlefish VM
        m && acloud create --boot-timeout 3600 -vv --local-instance --local-image
 - VHAL should work as normal, see tests in ag/9693857

Bug: b/141493212

Change-Id: I97df02dd26b89f60d3d87b2c32c4f4f8919b1294
2020-01-23 13:34:34 -08:00
Hao Chen
46df8f5909 Grpc Vehicle Connectors
Test: Build; test with ag/9869095

Bug: b/141493212

Change-Id: Ia4c0b0b5b358b1c67aae43d8c64f781b83725329
2020-01-23 13:14:29 -08:00
Tyler Trephan
8081fb6eba Merge "Updated PERF_STEERING_ANGLE to support rear steering." 2020-01-18 00:17:06 +00:00
Tyler Trephan
e57c109d3e Adding INFO_EXTERIOR_DIMENSIONS car property.
Fix: 146020990
Test: Tested on device.
Change-Id: I003cbb05de0a91efb8e393860fc64ba508515b26
2020-01-17 11:31:09 -08:00
Tyler Trephan
cb8d72c707 Updated PERF_STEERING_ANGLE to support rear steering.
Change-Id: I2d8d8eff076ab2b76476a8b4edc18d213df71d45
Fix: 146022250
Test: Tested on device.
2020-01-14 16:12:55 -08:00
Hao Chen
0885f9b10a Set Timestamp By the Server when the client called 'set'
Test: Build; unit tests `atest packages/services/Car/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarPropertyTest.java`

Bug: b/141493212

Change-Id: I6686a15d6e9fa483d9b361acfe88001b7497b937
2019-12-20 10:48:45 -08:00
Hao Chen
de6835be3e Simplify Connector class APIs and hierachy
Test: Build; unit tests `atest
 packages/services/Car/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarPropertyTest.java`

Bug: b/141493212

Change-Id: I6c561d517646760dfff63cb6c6b50c3c5994098a
2019-12-20 10:48:15 -08:00
Hao Chen
5f82b989bb Merge changes from topic "proto_package_name"
* changes:
  A more generalized package name for VHal proto IDLs
  Protobuf message converter should be a public utility library
2019-12-19 21:30:40 +00:00
Hao Chen
5deac06ad9 A more generalized package name for VHal proto IDLs
Test: build; test (and submit) with ag/9868729

Change-Id: Iacdf518d8c90485430a009e341dd1fd705b7ee83
2019-12-06 16:01:28 -08:00