Commit graph

436 commits

Author SHA1 Message Date
TreeHugger Robot
501169a9fb Merge "Minor clarificaton on USER_IDENTIFICATION_ASSOCIATION doc." into rvc-dev 2020-05-12 17:05:45 +00:00
TreeHugger Robot
9a3f5f02e9 Merge "Register VHAL to car watchdog" into rvc-dev 2020-05-08 17:58:15 +00:00
felipeal
00134a22c2 Minor clarificaton on USER_IDENTIFICATION_ASSOCIATION doc.
Test: none
Bug: 150409351
Change-Id: I4c8e11c118a503998736acb37259eb6aaea1c542
2020-05-08 09:48:29 -07:00
Eric Jeong
908101a9d9 Register VHAL to car watchdog
- For health checking, the car watchdog client attemps to get
PERF_VEHICLE_SPEED.
- If successful, it regards VHAL is healhty and responds to the car
watchdog daemon. Otherwise, VHAL will be killed by the daemon.

Bug: 154367059
Bug: 154262220
Test: dumpsys android.automotive.watchdog.ICarWatchdog/default and check
if vehicle hal is registered as a client

Change-Id: I2eb466550c56f25ba550ebbd35dc8fde9681ea59
2020-05-07 15:10:43 -07:00
felipeal
4dda37e0d0 Fixed USER_IDENTIFICATION_ASSOCIATION structs and documentation.
Bug: 150409351
Test: m
Test: atest UserHalServiceTest UserHalHelperTest

Change-Id: I121b47f1cc0889259210de96007c3c0f82985e8c
2020-05-06 12:34:47 -07:00
Kai Wang
89fe540104 Merge "Duplicate setting when generate fake data" into rvc-dev 2020-05-01 22:25:37 +00:00
Kai
bb780f4875 Revise documentation for tire pressure and max_defrost
Use the max/min in areaConfig to indicate the recommended tire
pressure.
Explain areaId for HVAC_MAX_DEFROST

Bug: 153906683
Test: make and flash
Change-Id: Ie71279dba4e87efdec75934dcac1c86e22fffaa3
2020-04-30 18:56:27 +00:00
TreeHugger Robot
d2115c9876 Merge "Moved emulated User HAL capabilities into a library." into rvc-dev 2020-04-27 19:23:12 +00:00
felipeal
9c998c0720 Moved emulated User HAL capabilities into a library.
So it can be used by other Vehicle HAL implementations.

Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --user-hal
Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --help
Test: m -j android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib

Bug: 150167241
Bug: 150409377

Merged-In: I2d0c5039c3b994dfe10d3b411f6d502bebe7cca0
Change-Id: I2d0c5039c3b994dfe10d3b411f6d502bebe7cca0
2020-04-24 16:11:19 -07:00
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
Kai
56e5567aaa Duplicate setting when generate fake data
If the statusCode is Ok, we generate the fake data twice which will
break the test.

Bug: 143234180
Test: atest VehicleHALTest
Change-Id: I7754649fb4202239f9eca63a12bc8dd5f2a3d916
2020-04-13 18:11:14 -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