Commit graph

24842 commits

Author SHA1 Message Date
Sarah Chin
4a5f4e5ab2 Merge "Create getSystemSelectionChannel API" 2020-12-01 20:08:10 +00:00
Treehugger Robot
1f551d879a Merge "Convert mask types from uint32_t to enum type" 2020-12-01 17:06:51 +00:00
Sarah Chin
f69abcf78e Create getSystemSelectionChannel API
Test: atest TelephonyManagerTest
Test: atest VtsHalRadioV1_6TargetTest
Bug: 152813408
Change-Id: I6f3f70b7ff1b876ec98086431ed5c557875fca85
Merged-In: I6f3f70b7ff1b876ec98086431ed5c557875fca85
2020-11-30 14:40:01 -08:00
Janis Danisevskis
375f7d743d KeyMint 1.0: Fix tag type of USER_SECURE_ID.
Test: None
Bug: 174445211
Change-Id: Ic8f346c58db875ee9fe4131f87de8c1bc5e9ec18
2020-11-30 00:29:22 -08:00
Treehugger Robot
321618f711 Merge "vibrator: vts: correct the checking flag when testing on() interfaces" 2020-11-30 05:49:55 +00:00
Michael Butler
4cdcadf70c Merge "Invalidate NN interface objects on cache mismatch" 2020-11-24 19:32:27 +00:00
Michael Butler
376005883c Invalidate NN interface objects on cache mismatch
Currently, if an IDevice object is a DEAD_OBJECT, the runtime attempts
to re-retrieve the handle to the rebooted IDevice service. If an update
occurs after the IDevice was originally created, the rebooted IDevice
object may have different metadata and behavior. This is problematic
because the original metadata is cached in the runtime. Further, an
application might have made decisions based on that metadata and
behavior. (Note that a driver service that is functionally the same but
has a different underlying implementation such as having more optimized
code will have different `getVersionString` metadata.) Instead, this CL
invalidates the IDevice object on cache mismatch, and always returns an
error if it is used.

Bug: 173081926
Test: mma
Change-Id: I805987361c627c32d45e1b7c7aed230376fc66ad
Merged-In: I805987361c627c32d45e1b7c7aed230376fc66ad
(cherry picked from commit 5a74c0fb0f)
2020-11-24 10:42:45 -08:00
Shawn Willden
66b1cfaac0 Update to support keymaster's configurable version.
Test: VtsHalIdentityTargetTest
Bug: b/173577355
Change-Id: Ia7c1a46edec12047c51ed4888788386dcfe11ca9
2020-11-23 23:11:52 -07:00
Mikhail Naganov
12776a1b3d Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I07e96ae99724f38fe0b40194f4feab7ff68418e7
Merged-In: I07e96ae99724f38fe0b40194f4feab7ff68418e7
2020-11-24 03:44:08 +00:00
Steven Moreland
c86759a16b Merge changes from topic "hidl-clear-buf"
* changes:
  HIDL HALs mark sensitive data
  HIDL: IFoo mark @SensitiveData
2020-11-23 21:31:47 +00:00
Treehugger Robot
8d93e3a8d3 Merge changes from topic "nullzero-hal-v7"
* changes:
  Remove PREUPLOAD.cfg from audio HAL example
  audio: Implement VTS tests for V7.0
  audio: Add example HAL implementation
  audio: Reformat README as Markdown
  audio: HAL V7 tweaks
2020-11-23 19:25:49 +00:00
Treehugger Robot
389e9aa728 Merge "Bluetooth HAL: fix ISO handling for H4 protocol" 2020-11-23 18:49:47 +00:00
Jakub Pawlowski
db779b41a3 Bluetooth HAL: fix ISO handling for H4 protocol
Bug: 150670922
Test: run H4ProtocolTest.TestReads
Change-Id: Ib051550da1c99a3b682d149cd6c88cce294dbc9c
2020-11-23 17:43:09 +01:00
Fenglin Wu
15b01dc53b vibrator: vts: correct the checking flag when testing on() interfaces
Check CAP_ON_CALLBACK flag when testing vibrator onWithCallback() and
OnCallbackNotSupported() functions.

Bug: 172485963
Change-Id: Ie5c926ec943f191d1e5309ac85e7c8e1540fb824
2020-11-23 10:37:45 +08:00
Treehugger Robot
6be52d5b34 Merge "HAL changes for ThermalMitigation API." 2020-11-21 02:02:39 +00:00
Mikhail Naganov
94ab03a3a2 Remove PREUPLOAD.cfg from audio HAL example
As suggested by the comment on ag/12691153

Bug: 142480271
Test: N/A
Change-Id: Ic9e2b986d3f9734dd884a2c88ca86d251147126b
Merged-In: Ic9e2b986d3f9734dd884a2c88ca86d251147126b
2020-11-21 01:16:10 +00:00
Mikhail Naganov
d72a7c27ab audio: Implement VTS tests for V7.0
The major change in V7.0 is use of enum values defined
in the Audio Policy Configuration XSD schema. This allows
decoupling types used at the HIDL layer from system/audio.h.
Added a header audio_policy_configuration_V7_0-enums.h
with utility functions analogous to ones from system/audio.h
but defined for the types generated from XSD schema.

Since the code of VTS tests is shared between versions,
ensured that the VTS tests for the previous HAL versions
didn't regress.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
      atest VtsHalAudioEffectV6_0TargetTest
      atest VtsHalAudioV7_0TargetTest
      atest VtsHalAudioEffectV7_0TargetTest
Change-Id: Ia7c2d49a02783725080c8fed6a25853e91bba487
Merged-In: Ia7c2d49a02783725080c8fed6a25853e91bba487
2020-11-21 01:15:53 +00:00
Mikhail Naganov
baf57fb136 audio: Add example HAL implementation
This is partial implementation of the example V7.0 audio HAL
which passes VTS tests. Note that the 'core' part
of the HAL (IDevice/IStream) isn't implemented yet.
It passes VTS because it doesn't provide any devices
(modules) and the audio HAL isn't the 'default' instance.

Bug: 142480271
Test: atest VtsHalAudioV7_0TargetTest
      atest VtsHalAudioEffectV7_0TargetTest
Change-Id: Ie3dd62c5db1cdb5534df4dd7f326c4c8776bf3c4
Merged-In: Ie3dd62c5db1cdb5534df4dd7f326c4c8776bf3c4
2020-11-21 01:15:39 +00:00
Mikhail Naganov
1074c22fe1 audio: Reformat README as Markdown
Rename README -> README.md, reformat it as Markdown.
Provide missing descriptions for some directories.

Bug: 142480271
Test: N/A
Change-Id: Ic6f60a21def4bf210a7e1446454d709f68a13422
Merged-In: Ic6f60a21def4bf210a7e1446454d709f68a13422
2020-11-21 01:15:19 +00:00
Mikhail Naganov
355dd0630c audio: HAL V7 tweaks
- rename AudioBasicConfig -> AudioConfigBase to better
  match a similar structure in audio.h;

- define AudioProfile structure for defining an I/O profile;

- use AudioProfile to replace IStream.getSupported* methods
  with a single IStream.getSupportedProfiles method;

- define AudioDevice type for convenience and clarity;

- move enums definition for AudioInputFlags and AudioOutputFlags
  into XSD. This allows parsing APM config w/o depending on
  the framework code.

Bug: 142480271
Test: m
Change-Id: I1951b2de383751fe53b96954dfd02cdd1ab6cc8f
Merged-In: I1951b2de383751fe53b96954dfd02cdd1ab6cc8f
2020-11-21 01:15:03 +00:00
Treehugger Robot
4b0d04d39a Merge "identity: Change Identitial Credential to pass in subject by attestation params instead of making another function in attestation_utils." 2020-11-21 01:05:29 +00:00
Jack Nudelman
5cd9414268 HAL changes for ThermalMitigation API.
go/telephony-thermal-mitigation

Bug: 158872959
Test: make, vts

Change-Id: I914993a6e80305732564e0507ca6a74b1c296439
Merged-In: I914993a6e80305732564e0507ca6a74b1c296439
2020-11-21 00:49:48 +00:00
Daniel Bright
78293592cc Merge "Added pdu session id to setupDataCall" 2020-11-20 22:54:24 +00:00
Steven Moreland
28f2549765 HIDL HALs mark sensitive data
For extra precautious transaction clearing.

Bug: 171501998
Test: hidl_test + inspecting output
Change-Id: I813dc3dd6c85ad0e86c6b8c116b7a207517dd12e
2020-11-20 21:16:16 +00:00
Daniel Bright
3c72fbafce Added pdu session id to setupDataCall
The pdu session id needs to be passed to setup data call on handover

(clean cherry-pick)

Test: Tested that handover still worked with logs.  IWlan -> Cell + Cell -> IWlan
Bug: 161572859
Merged-In: I0e11c8997674cdaad4bb82491d818ca85ee197d1
Change-Id: I0e11c8997674cdaad4bb82491d818ca85ee197d1
2020-11-20 12:22:08 -08:00
Treehugger Robot
c563bfc08e Merge "Audio: Rearrange types in V7" 2020-11-20 19:39:55 +00:00
Daniel Bright
39c8747585 Merge "Added global retry support" 2020-11-20 18:48:35 +00:00
Selene Huang
06614b3e15 identity: Change Identitial Credential to pass in subject by
attestation params instead of making another function in attestation_utils.

Test: atest VtsHalIdentityTargetTest
Test: atest android.security.identity.cts
Change-Id: I67f5f584875a1baefc5a3d1a1fc46d605febbf33
2020-11-20 08:41:34 -08:00
Slava Shklyaev
49817a0e0f Replace nn::NativeHandle with nn::SharedHandle
Bug: 160669116
Test: mma
Change-Id: I73b2b93aab6cbf37d3c145e15ee9ae45228954f1
Merged-In: I73b2b93aab6cbf37d3c145e15ee9ae45228954f1
(cherry picked from commit d4290b8bf8)
2020-11-20 13:55:05 +00:00
Mikhail Naganov
fda20429b4 Audio: Rearrange types in V7
Update channel mask and SR lists to conform to XSD.
Added a script for converting existing APM XML files.

Bug: 142480271
Test: m
Change-Id: I986b9bccdade5fa850b06b033143388715a656af
Merged-In: I986b9bccdade5fa850b06b033143388715a656af
2020-11-20 01:41:38 +00:00
Grzegorz Kołodziejczyk
d7f04f9f06 Copy audioConfig according to config discriminator
Audio configuration as safe union is guarded to not violate its discriminator
usage. Only one member can be set.

Change-Id: I98a94d81ea5bacca2407286746432b972aac4488
2020-11-19 22:51:42 +00:00
Grzegorz Kołodziejczyk
7fa9659923 Check if no queue is set in negative config cases
Data queue pointer should be checked if it's nullptr if codec
configuration is invalid. This covers more code in case of invalid pcm
configuration.

Tag: #stability
Test: vts-tradefed run vts -m VtsHalBluetoothAudioV2_1TargetTest
Sponsor: jpawlowski@
Bug: 173353147
Change-Id: Ib78f1615e7a15603dc6d73188edf1df7eab12b8b
2020-11-19 22:51:35 +00:00
Grzegorz Kołodziejczyk
e01b0f7c5a Reset data queue pointer in negative config cases
Data queue should be set to nullptr if pcm configuration is invalid.
Otherwise previously set queue would be cosidered during check.

Tag: #stability
Test: vts-tradefed run vts -m VtsHalBluetoothAudioV2_1TargetTest
Sponsor: jpawlowski@
Fixes: 173353147
Bug: 173353147
Change-Id: I10ee061e1c75f73410a9d0a0b1eaace0e536addd
2020-11-19 22:51:29 +00:00
Steven Moreland
312bf0e65e HIDL: IFoo mark @SensitiveData
Marking this annotation for use in hidl_test, so that we make sure to
exercise it.

Bug: 171501998
Test: hidl_test
Change-Id: Ia40e5fdf26804773c1450d181723cc7b97bf6a81
2020-11-19 22:27:27 +00:00
Treehugger Robot
d47c62b62a Merge "identity: Fix attestation and documentation problems." 2020-11-19 15:52:21 +00:00
Marin Shalamanov
f344363e64 Merge "Clarify the ComposerClient comment for CONFIG_GROUP" 2020-11-19 13:27:53 +00:00
Marin Shalamanov
37c5495c52 Clarify the ComposerClient comment for CONFIG_GROUP
Clarify that configs with the same group should differ only
by refresh rate.

Test: n/a
Merged-In: I2b09689825fc9564665324ff18eb1907765b9016
Change-Id: I2b09689825fc9564665324ff18eb1907765b9016
2020-11-19 10:49:53 +00:00
Jack Yu
78843c1e4f Added global retry support
The retry timer suggested by the network will persist
accross network requests. Also changed the retry timer
to a 64-bit value to be consistent with types used in
Android time APIs.

(clean cherry-pick)

Test: FrameworksTelephonytests
Fix: 159672248
Merged-In: I763afdf34378512c60c0838830cb84875b1c66f0
Change-Id: I763afdf34378512c60c0838830cb84875b1c66f0
2020-11-18 21:32:22 -08:00
Karthik Bharadwaj
d3e3b877ac Merge "Strip hinge angle sensor when running a 2.1 HAL as 2.0" 2020-11-17 19:28:36 +00:00
David Zeuthen
34abaaefcb identity: Fix attestation and documentation problems.
- The docs said that IdentityCredential.createEphemeralKey() returned
  data encoded PKCS#8 which is wrong. It's supposed to be in DER format
  which is also what the VTS tests and credstore expects.

- Clarify that createEphemeralKeyPair(), setReaderEphemeralPublicKey(),
  and createAuthChallenge() are all optional.

- Avoid passing an invalid profile ID in the IdentityCredentialTests.
  verifyOneProfileAndEntryPass test.

- Update requirements for which tags must be present in the attestation
  for CredentialKey as well as the requirements on expiration date and
  the issuer name.  Update default implementation to satisfy these
  requirements. Update VTS tests to carefully verify these requrements
  are met.

- Clarify requirements for X.509 cert for AuthenticationKey. Add VTS
  test to verify.

- Mandate that TAG_IDENTITY_CREDENTIAL_KEY must not be set for test
  credentials. Add VTS test to verify this.

- Make default implementation pretend to be implemented in a trusted
  environment and streamline VTS tests to not special-case for the
  default implementation.

- Switch to using the attestation extension parser from the KM 4.1
  support library instead of the one from system/keymaster. The latter
  one did not support the latest attestation extension and thus would
  fail for pretty much anything that wasn't the default HAL impl.

- Fix a couple of bugs in keymaster::V4_1::parse_attestation_record():
  - Report root_of_trust.security_level
  - Add support for Tag::IDENTITY_CREDENTIAL_KEY

- Fix how EMacKey is calculated.

- Add test vectors to verify how EMacKey and DeviceMac is calculated.

Test: atest VtsHalIdentityTargetTest
Test: atest android.security.identity.cts
Bug: 171745570
Change-Id: I2f8bd772de078556733f769cec2021918d1d7de6
2020-11-17 13:44:00 -05:00
Treehugger Robot
0ab081bfa6 Merge "Implement keymint V1 aidl interfaces, service module, and vts tests." 2020-11-17 16:13:50 +00:00
Junyu Lai
628db71ca0 Merge "Refactor 1.0 TetheroffloadControl VTS" 2020-11-17 09:40:05 +00:00
Selene Huang
31ab404a5e Implement keymint V1 aidl interfaces, service module, and vts tests.
Bug: b/160968242
Test: atest VtsHalKeyMintV1_0TargetTest

Change-Id: I5f9d642f96e262dd567d88f4d582e621d168dceb
2020-11-17 01:11:42 -08:00
Michael Butler
4b276a767b Implement NNAPI canonical interfaces
This CL implements the canonical IDevice, IPreparedModel, and IBuffer
interfaces for the 1.0, 1.1, 1.2, and 1.3 NN HIDL HAL interfaces.
Further, it introduces "Resilient" adapter interfaces to automatically
retrieve a handle to a recovered interface object after it has died and
rebooted.

This CL also updates the conversion code from returning nn::Result to
nn::GeneralResult, which includes a ErrorStatus code in the case of an
error.

Finally, this CL introduces a new static library
neuralnetworks_utils_hal_service which consists of a single function
::android::nn::hal::getDevices which can be used by the NNAPI runtime to
retrieve the HIDL services without knowing the underlying HIDL types.

Bug: 160668438
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Iec6ae739df196b4034ffb35ea76781fd541ffec3
Merged-In: Iec6ae739df196b4034ffb35ea76781fd541ffec3
(cherry picked from commit 3670c385c4)
2020-11-16 14:29:55 -08:00
karthik bharadwaj
c8fd7b31e0 Strip hinge angle sensor when running a 2.1 HAL as 2.0
VTS ensures that  2.0 HALs don't expose the hinge angle sensor,
but the 2.1 HALs must run 2.0 VTS tests. This CL ensures that
we don't expose the hinge angle sensor on the 2.0 HAL, to avoid
failing those VTS tests.

Bug: 173135479
Test: run vts -a x86 -m VtsHalSensorsV2_0TargetTest
Change-Id: I944bfb0b01be0831e45cfd3d6ed7dab6770d1b80
2020-11-16 05:21:25 +00:00
Treehugger Robot
f19e282226 Merge "supplicant(vts): Skip p2p tests on non-p2p devices as intended" 2020-11-14 06:14:29 +00:00
Treehugger Robot
cecee13161 Merge "Camera: Expect physical results in the last partial notification" 2020-11-13 20:45:34 +00:00
Karthik Bharadwaj
98e36a4ca8 Merge "Fix VTS SensorsHidl Test Failures" 2020-11-13 06:47:17 +00:00
Karthik Bharadwaj
534d9358af Fix VTS SensorsHidl Test Failures
This CL fixes test failures by:
- Remove the deprecated 'Device Temperature' sensor from
the sensor list
- Ignoring the deprecated 'Device Temperature' sensor type
for tests
- Only accessing shared memory buffer if the shared memory
type is supported
- Return a default z-axis data value for the accel sensor type.
- Update the batch() functions argument to take an int64 timestamp
to adhere to the interface

Bug: 171940270
Test: run vts -a x86 -m VtsHalSensorsV2_0TargetTest
Change-Id: I88fe8746030f42edd620f9891aa44bc228a73426
2020-11-13 00:19:24 +00:00
Jerry Wong
a0e13d6060 supplicant(vts): Skip p2p tests on non-p2p devices as intended
The logic to skip the p2p tests on non-p2p devices appear to have
inadventently flipped since d6436731.

Bug: 173134041
Test: atest VtsHalWifiSupplicantV1_1TargetTest
Change-Id: I7945950e8483241e47e308a2c5ad97571d74a769
2020-11-12 15:01:24 -08:00