Commit graph

27860 commits

Author SHA1 Message Date
Bill Yi
89e61b7f9d Merge RQ2A.210405.006 to aosp-master - DO NOT MERGE
Merged-In: Ib56dbbc032236ffe012f36dfb83040b06847f455
Merged-In: Ia036416d8c0c90400586f9573c3be66b2ff8ea03
Change-Id: I09f542101304af38614d9d3715c25480bbef6c96
2021-04-13 19:29:20 -07:00
Michael Butler
6594b5f1b4 Merge changes from topic "nnapi-aidl-memory"
* changes:
  Update NN utility code and VTS tests with new Memory type
  Improve the structure of NNAPI AIDL Memory
2021-04-13 16:29:33 +00:00
Treehugger Robot
d997c72959 Merge "vts: Correct the TagType when verify_attestation_record" 2021-04-13 13:06:58 +00:00
ChengYou Ho
c9945ab2b4 Change WeaverConfig data types to int
also prefix return error codes

Bug: 179432365
Change-Id: I435fb261b1162e9b2f56c434f2defccc1505c842
2021-04-12 21:51:38 +00:00
Treehugger Robot
cab97a7d3e Merge "Check that KeyMint provides IRemotelyProvisionedComponent" 2021-04-12 16:55:03 +00:00
David Drysdale
4dc010739d Check that KeyMint provides IRemotelyProvisionedComponent
Move helper utilities across into KeyMintAidlTestBase to allow re-use.

Test: VtsHalRemotelyProvisionedComponentTargetTest, VtsAidlKeyMintTargetTest
Change-Id: Ib9e55a7d72fd197016ae1a1f073dadedafa09c25
2021-04-12 14:48:31 +01:00
Przemyslaw Szczepaniak
f61f789f86 Merge "Set correct API level for NNAPI AIDL service discovery." 2021-04-12 12:55:12 +00:00
Max Bires
303991b322 Merge "Transitioning identity to external_libcppbor" 2021-04-09 17:13:33 +00:00
Max Bires
a3c7f4c998 Transitioning identity to external_libcppbor
This change removes hardware/interfaces/identity's dependency on its own
libcppbor copy. The copy can not be fully removed until various vendor
dependencies are cleaned up.

Superficial changes are made to the VTS tests to match the slightly
altered namespace on some of the functions.

This migration is a prerequisite for getting the
IRemotelyProvisionedComponent functionality into system/keymaster.
Without migrating to the same library, the build system runs into issues
since there are "two" libcppbor libraries with conflicting namespaces
otherwise.

Bug: 182445123
Test: atest VtsHalIdentityTargetTest
Change-Id: I854ffa31c4adb5a3d1df06539fe66075ccc4625d
2021-04-09 08:57:01 -07:00
Przemysław Szczepaniak
3cc27f5c62 Set correct API level for NNAPI AIDL service discovery.
Use __ANDROID_API_FUTURE__ until the S version is finalized.

Bug: 183657864
Test: Build & flashed CF, run TFLite benchmark util
Change-Id: I1352aa33866487f955136c6fb8e4d0d279225f13
2021-04-09 11:30:28 +01:00
Daniel Norman
d215599f10 Merge "Allows injection for the default HINGE_ANGLE sensor." 2021-04-08 16:34:55 +00:00
Treehugger Robot
5bb7be3f8e Merge "Setting libcppcose to host supported." 2021-04-08 05:03:45 +00:00
Benjamin Schwartz
43374307a3 Merge "power/stats: Split channel name validation test" 2021-04-08 04:08:26 +00:00
Tommy Chiu
f00d8f1c0a vts: Correct the TagType when verify_attestation_record
TAG_BOOT_PATCHLEVEL and TAG_VENDOR_PATCHLEVEL should be interger type.

Fixed: 184796337
Test: VtsAidlKeyMintTargetTest not abort
Change-Id: Iccd6ac93910d44c0a02b798210909c404a98d8ab
2021-04-08 11:12:32 +08:00
Treehugger Robot
471017034f Merge "power/stats: Get scopedAStatus description in vts test" 2021-04-08 00:13:25 +00:00
Daniel Norman
56645759d3 Allows injection for the default HINGE_ANGLE sensor.
This will allow cuttlefish to inject HINGE_ANGLE sensor data, to
simulate a hinge sensor on the virtual device.

Bug: 181157794
Test: Inject HINGE_ANGLE sensor data.
      Observe events with `dumpsys sensorservice`.
Change-Id: Ie267bcfdbc98ed017a673b9e38ceccbf75090dd1
2021-04-07 16:51:23 -07:00
Max Bires
bcde7a7f66 Setting libcppcose to host supported.
This change adds the host supported flag to the libcppcose and removes
some unnecessary dependencies from the blueprint file.

Test: libcppcose builds
Change-Id: I45bca44267a50d0d401fc1964f96363e558317ff
2021-04-07 16:28:05 -07:00
Benjamin Schwartz
1f6d550027 power/stats: Split channel name validation test
Bug: 184722506
Test: atest VtsHalPowerStatsTargetTest
Change-Id: I4354c2c750073fcf1f950d84ec7d910fc04e8684
2021-04-07 16:03:37 -07:00
Benjamin Schwartz
e2404435a6 power/stats: Get scopedAStatus description in vts test
Bug: 184722506
Test: atest VtsHalPowerStatsTargetTest
Change-Id: I9e1a4f1965e901888963db74f68263d6a74b8204
2021-04-07 15:13:01 -07:00
Janis Danisevskis
71eb2258bf Merge "Security: Add @SensitiveData annotation." 2021-04-07 21:35:26 +00:00
Michael Butler
f03ebd93b9 Update NN utility code and VTS tests with new Memory type
This CL fixes the compiler errors that arose of changing the Memory
representation of the NN AIDL HAL, and updates the conversion and
utility code to work with the new Memory type.

This change also makes libaidlcommonsupport available to apex modules at
min sdk level 29.

Bug: 183118727
Test: mma
Test: VtsHalNeuralnetworksTargetTest
Change-Id: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6
Merged-In: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6
(cherry picked from commit b0fcb3927d)
2021-04-07 12:54:45 -07:00
Michael Butler
dd53d04d8c Improve the structure of NNAPI AIDL Memory
Prior to this change, the NN AIDL HAL created a Memory struct analogous
to hidl_memory, consisting of a name, size, and native handle. However,
this Memory struct is not very structured, and requires both the client
and server to agree on how the data should be interpreted.

This CL tightens the structure of the Memory representation by
introducing Ashmem and MappableFile structs to android.hardware.common
in order to hold specific file descriptors representing memory regions.
Further, this CL redefines android.hardwre.neuralnetworks's Memory
object as a union of the Ashmem, MappableFile, and (existing)
HardwareBuffer memory types.

This change also adds "com.android.neuralnetworks" to the graphics
AIDL HAL's apex_available build rule.

Bug: 183118727
Test: mma
Change-Id: I32322df676b83597c9e95f13662c322a6a80accc
Merged-In: I32322df676b83597c9e95f13662c322a6a80accc
(cherry picked from commit 1158c80ff6)
2021-04-07 12:54:18 -07:00
Michael Butler
d1626e1a4a Merge "Change NNAPI time from steady_clock to boot_clock -- hal" 2021-04-07 15:58:45 +00:00
Janis Danisevskis
1b45e0c5c1 Merge "KeyMaster 4.0: Add missing tags to support library." 2021-04-07 02:33:23 +00:00
Michael Butler
382d513dff Change NNAPI time from steady_clock to boot_clock -- hal
Previously, the NNAPI used std::chrono::steady_clock to represent and
measure timings. However, steady_clock does not count while the system
is suspended. Instead, boot_clock is monotonic like steady_clock but
does include the time when the system is suspended.

This change also indicates that services may convert from
std::chrono::steady_clock::time_point to
android::base::boot_clock::time_point in the HIDL 1.3 NN HAL.

Bug: 183118340
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Test: VtsHalNeuralnetworksTargetTest
Test: presubmit
Change-Id: I5a7d039a31d9ce98602a301387ec99635f279f42
Merged-In: I5a7d039a31d9ce98602a301387ec99635f279f42
(cherry picked from commit b8cf54cf5a)
2021-04-06 15:00:49 -07:00
Janis Danisevskis
9d363652af KeyMaster 4.0: Add missing tags to support library.
keymaster_tags.h was missing the tags
ATTESTATION_ID_SERIAL/IMEI/MEID.

Test: N/A
Bug: 183412538
Change-Id: I7216971a30fa1f42f152035bf79959f21bdbc09b
2021-04-06 12:54:57 -07:00
Janis Danisevskis
3829840d36 Security: Add @SensitiveData annotation.
Bug: 174857732
Test: N/A
Change-Id: Id1aeaf9b0da79b8c4d5e91f30942a31a26f7b1d4
2021-04-06 09:50:19 -07:00
Treehugger Robot
0ff57e62a8 Merge "Adds new error code which is required by keystore to handle strongbox hal related functionality. Test: N/A Bug: b/184306647" 2021-04-06 15:59:30 +00:00
Michael Butler
7a9d6092cd Create NN AIDL Burst adapter
Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: I2947faeb3820faa963e4df1eaf7aefec57b66c79
Merged-In: I2947faeb3820faa963e4df1eaf7aefec57b66c79
(cherry picked from commit 504f44926c)
2021-04-02 22:03:12 -07:00
Michael Butler
8414a6ebf9 Add additional parameters for NN Burst -- HAL
Adds deadline and loopTimeoutDuration to nn::IBurst::execute.

This CL additionally adds a test case for
IPreparedModel::configureExecutionBurst and adds the suffix "_H" to
the header guards that were missing "_H".

Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
Merged-In: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
(cherry picked from commit bbbdb0d5f1)
2021-04-02 22:02:38 -07:00
Michael Butler
388bcebc8f Add missing validation for NN canonical types
Bug: 177669661
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca
Merged-In: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca
(cherry picked from commit 08ee3f9287)
2021-04-02 22:02:02 -07:00
Chirag Pathak
cfb9792b4c Adds new error code which is required by keystore to handle strongbox hal related functionality.
Test: N/A
Bug: b/184306647

Change-Id: Ifbf7b931e58420f17e16f297205018248d39f476
2021-04-02 20:17:27 +00:00
Xusong Wang
3633d07092 Rename BufferRole.frequency -> probability -- HAL.
"Frenquency" often refers to the number of occurrences over a period of
time, while "probability" refers to the number of occurrences of one
event over the number of occurrences of all events. "Probability" is a
better name for this field.

Fixes: 183117895
Test: VtsHalNeuralnetworksTargetTest
Test: NNT_static
Change-Id: Ic86f73b8be2aed567ae4ca17bdb3a57c658fb349
Merged-In: Ic86f73b8be2aed567ae4ca17bdb3a57c658fb349
(cherry picked from commit 46bf892f46)
2021-04-02 10:26:29 -07:00
Myles Watson
21927e2ddd Merge "VtsBluetooth: Use ASSERT_* to end the test ASAP" 2021-04-02 16:36:16 +00:00
Treehugger Robot
1a9bbebbca Merge "Allow SecureClock tests to pass on devices w/out SecureClock" 2021-04-02 14:51:49 +00:00
Shawn Willden
d7f1c1d638 Merge "Allow KeyMint tests to pass on devices w/out KeyMint" 2021-04-02 14:44:42 +00:00
Shawn Willden
b21b4a3663 Merge "Correct error code in attest_key docs." 2021-04-02 14:44:16 +00:00
Benjamin Schwartz
3bad122962 power/stats: Index the state residency data providers
Data providers that provided data for multiple entities were being added
to the data structure as nullptr due to move semantics. Now they will
only be added once (ensuring no more nullptr entries) and an index will
map each power entity id to its corresponding data provider.

Bug: 184290936
Test: Presubmit
Change-Id: I858269beb36ba5f87bb14a228079f3abd6c2332f
2021-04-01 18:26:38 -07:00
Shawn Willden
14fdd67a30 Allow SecureClock tests to pass on devices w/out SecureClock
Bug: 182289099
Test: VtsAidlSecureClockTargetTest
Change-Id: I830fe2879cd3328adf950060afb7e9eb18e558b7
2021-04-01 17:06:06 -06:00
Shawn Willden
7e71f1e5c5 Allow KeyMint tests to pass on devices w/out KeyMint
Bug: 181987225
Test: VtsAidlKeyMintTargetTest
Change-Id: I243fee463611ec2bf1f3661c46d3431280e187aa
2021-04-01 16:44:22 -06:00
Steven Moreland
7af6d0fecc light: downgrade hardware open error
If a certain type of light isn't available, we want to indicate this,
but it isn't an error.

Bug: N/A (was asked to do this for some fixit)
Test: N/A
Change-Id: I69038964db22425a7e9b2c722ddd4f38bf5bea2e
2021-04-01 20:50:51 +00:00
Shawn Willden
7bbf6298f2 Correct error code in attest_key docs.
Also adds a test to verify that implementations return the expected
error code.

Test: VtsAidlKeyMintTargetTest
Change-Id: Ic8e9953a2572eb0cc8fefc363934eaf9b432b5a4
2021-04-01 12:57:21 -06:00
Myles Watson
244ad3663f VtsBluetooth: Use ASSERT_* to end the test ASAP
Bug: 181133988
Change-Id: I19807685e0330196a4309e5c3d1183f37911bdd5
Test: atest VtsHalBluetoothV1_0TargetTest
Tag: #test-stability
2021-04-01 11:05:09 -07:00
Shawn Willden
49e5b5eacc Merge "Fix documentation of EARLY_BOOT_ONLY tag in KeyMint" 2021-04-01 14:36:07 +00:00
David Drysdale
0c77e4d25a Merge changes I390aa702,I9084343c
* changes:
  Use a heuristic to correlate devices
  Fix DeviceInfo encoding and checks
2021-04-01 05:43:28 +00:00
Treehugger Robot
6f219a694c Merge "audio: Use get_audio_port_v7 in the default wrapper" 2021-03-31 20:15:53 +00:00
Michael Butler
6aab5a161e Merge "Add std::this_thread::yield to Burst NN polling loop" 2021-03-31 18:40:54 +00:00
Mikhail Naganov
cb766d2517 audio: Use get_audio_port_v7 in the default wrapper
get_audio_port_v7 interface method was added in aosp/1518624
but wasn't used in the default wrapper due to the refactoring
ongoing at that time. Fixing this omission.

Bug: 160352965
Test: atest VtsHalAudioV7_0TargetTest
Change-Id: I1e3594f30fe8fa319d0b5b4244531c9142870503
Merged-In: I1e3594f30fe8fa319d0b5b4244531c9142870503
2021-03-31 18:24:11 +00:00
David Drysdale
4d3c298c66 Use a heuristic to correlate devices
Every KeyMint device should have a corresponding
IRemotelyProvisionedComponent instance, but the converse is not true.

So given an IRPC instance under test, look for a corresponding KeyMint
device by comparing suffixes, but just skip the test if not found.

Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I390aa7025eb77f75a3280e8d85dc453b784c23ee
2021-03-31 18:27:36 +01:00
David Drysdale
f6fc5a6336 Fix DeviceInfo encoding and checks
- Make the default implementation include the DeviceInfo as a map, not
   a bstr-holding-a-map, to match the spec.
 - Check the signature of the signed MAC even in test mode.
 - Include the DeviceInfo in the data that the signature covers.

Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I9084343c1273c16a9cbd5a1156e7057a1c54a860
2021-03-31 18:08:59 +01:00