Commit graph

11983 commits

Author SHA1 Message Date
Xusong Wang
96e68dc8e0 Add VTS tests for NNAPI compilation caching.
Add the following tests for compilation caching:
- validation tests
  - Test isCachingSupported
  - Test prepareModelFromCache with invalid numFd and invalid access mode
  - Test saveToCache with invalid numFd, invalid access mode,
    invalid file size, and invalid fd offset
- execution test
  - Save a mobilenet model to cache and then retrieve and run accuracy
    evaluation.
  - The same test but the file offsets for prepareModelFromCache is not at zero.
- security test
  - CompilationCachingSecurityTest.CorruptedSecuritySensitiveCache
    Randomly flip one bit of security-sensitive cache.
  - CompilationCachingSecurityTest.WrongLengthSecuritySensitiveCache
    Randomly append bytes to security-sensitive cache.
  - CompilationCachingSecurityTest.WrongToken
    Randomly flip one bit of cache token.

Bug: 119616526
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Change-Id: Iae9211cb28ce972b29572dfedd45d1ade4dfdaf5
Merged-In: Iae9211cb28ce972b29572dfedd45d1ade4dfdaf5
(cherry picked from commit 3405878e5e)
2019-02-08 10:17:17 -08:00
Slava Shklyaev
c9ff099c01 Add getSupportedExtensions to NNAPI IDevice
Bug: 118603011
Test: mma
Change-Id: I5bd1cf2dfd8c4700819d52a87931df2959ef6929
Merged-In: I5bd1cf2dfd8c4700819d52a87931df2959ef6929
(cherry picked from commit 6148d0f446)
2019-02-08 10:17:17 -08:00
Slava Shklyaev
bbcdc42abb Define NNAPI Extensions types
Machine Learning is a fast moving domain: new operations and data types
are introduced at a staggering speed. The Android API, on the other
hand, evolves on a yearly cycle. Many application developers, OEMs, and
SoC vendors would like to be able to define new operations at a faster
cycle.

In OC-MR1, NNAPI provided a simple mechanism to mitigate this problem:
two OEM data types and an OEM operation. The downside of this mechanism is that
it is simplistic: There’s no guarantee of consistency between vendors.

Examples of features that are required by the first parties' use cases
that we would like to be able to define outside of the normal Android
release cycle:
- New data types:
  - Sparse tensor (used by some speech generation models).
  - 16 bit int tensor (needed by OCR).
  - 16 bit float tensor.
- New operations:
  - 16 bit quantized LSTM (needed by OCR).
  - Basic primitives like sqrt and floor.
  - Logical operations.
  - Complex neural network layers.
  - Control flow.
- Enhancement to existing operations:
  - Concatenate supporting different scales/zeroPoints for arguments.
  - High-dimensional tensors.
  - Ordering of dimensions.

We are going to provide support for two types of extensions:
- NNAPI Platform extension. This is functionality that will become part of
  future releases of NNAPI. These extensions provide generic,
  non-vendor-specific functionality. Only the Android team can define new
  platform extensions. These extensions will be defined in the master
  branch of AOSP. Each extension comes with:
  - Documentation defining the extension,
  - A header file for the new constants,
  - A parameter validation library to be used by drivers, and
  - Validation tests akin to the CTS and VTS tests.
- Vendor extension. A vendor-specific extension is an alternative to OEM
  operation and data types. Its usage will be limited only to first party apps
  preinstalled on the /vendor or /odm partition.
  Each vendor will be identified by a specific value to
  prevent collisions between multiple IPs found on the same SoC. This
  effectively creates a vendor-specific namespace. These identifiers are
  assigned by Google.

This change only defines the new interface. The implementation follows
in changes Ie4e2530e4c81fabe4eb59b7a6ba4a3b4bb483bd1,
I02aa12f4a8444012ddf3b20c2bfbba6a21ce9ce9, and
Icf59ed04e602aa7a730eb1eb45e5f6b1204fafb3.

Bug: 118605927
Test: mma
Change-Id: Ia9b99015eec7a48bbf969cbe503862271f09adca
Merged-In: Ia9b99015eec7a48bbf969cbe503862271f09adca
(cherry picked from commit 9212018558)
2019-02-08 10:17:17 -08:00
Pengquan Meng
e0298925ce Merge "Fix doc on 1.4 IRadioIndication.cellInfoList1_4" 2019-02-07 18:01:24 +00:00
Treehugger Robot
f7b6c73725 Merge "Register Bluetooth Audio Hal v2 within Audio HAL" 2019-02-07 02:51:28 +00:00
Cheney Ni
4f6882ff4b Register Bluetooth Audio Hal v2 within Audio HAL
Register Bluetooth Audio Hal v2 by Audio HAL service so Bluetooth stack
can fetch the service interface as well.

Bug: 111519504
Test: manual

Change-Id: I3ac8c0472c58dd4d8a9b1ad8408313b80282cc85
2019-02-06 23:30:26 +00:00
Pengquan Meng
16ad3c25df Fix doc on 1.4 IRadioIndication.cellInfoList1_4
Bug: 123959296
Test: build
Change-Id: Ia12ad593ab33fbaec36b6ce95e1108550f8ff52c
2019-02-06 22:55:12 +00:00
Peiyong Lin
925f06e87b Merge "[ConfigStore] Slient log spam." 2019-02-06 22:04:11 +00:00
Steven Moreland
b35c23e70c Merge "Update makefiles." 2019-02-06 19:20:31 +00:00
Peiyong Lin
09dbd3df37 [ConfigStore] Slient log spam.
Previously ConfigStore keeps logging info of each function, this patch moves it
to verbose to avoid log spam.

BUG: 123312783
Test: Build, flash and boot. Verify with adb logcat
Change-Id: I8dce745122ca05d18cd899c536342521432f5325
2019-02-06 11:05:14 -08:00
Steven Moreland
06adbd75e5 Merge "Test ...libhwbinder-impl static." 2019-02-06 18:16:54 +00:00
Wei Wang
892624d06d Make atrace HAL optional
Bug: 111098596
Test: build
Change-Id: I2a18f004926e4488b87dd1d830490717908de963
2019-02-05 16:55:04 -08:00
Steven Moreland
941f105b60 Update makefiles.
Some of these are out of date.

Bug: N/A
Test: N/A
Change-Id: Ibf87fad9981d4e430a0bf797feadbb0bede232fc
2019-02-05 13:14:26 -08:00
Steven Moreland
532c05a3ec Test ...libhwbinder-impl static.
So that it can be included in tests.

Bug: 122456128
Test: libhwbinder_benchmark, hwbinderThroughputTest, libhwbinder_latency
Change-Id: I4c77c04252c7d6f0c2215ee052d747561db181e0
2019-02-01 15:13:32 -08:00
Pengquan Meng
7ac99ae365 Merge "Add 5G cellInfo & signal strength" 2019-02-01 21:09:46 +00:00
Treehugger Robot
b5db125860 Merge "Explicitly include log/log.h or android/log.h instead of cutils/log.h" 2019-02-01 19:12:35 +00:00
Sasha Smundak
769c053d7c Explicitly include log/log.h or android/log.h instead of cutils/log.h
Eliminates the warning.
Test: treehugger

Bug: 123758136
Change-Id: Ibe50261efc18d659a10129977342bc765a9ba9d5
2019-02-01 10:52:09 -08:00
vichang
97048ee337 Merge "Remove the dependency on ICU" 2019-02-01 16:57:43 +00:00
Pengquan Meng
e32a755ed2 Add 5G cellInfo & signal strength
Bug: 123532650
Test: build
Change-Id: I76bff3f6ff56ef76cb357c327b44d54757952e32
2019-01-31 14:11:37 -08:00
Tom Cherry
12e20e3f2a Merge "Move to new Fstab class" 2019-01-31 19:35:54 +00:00
Cheney Ni
47a8309706 Implementation of Bluetooth Audio HAL interface v2
This is the default implementation of Bluetooth Audio Hal v2, and 3
providers are defined.

* BluetoothAudioProvider is the default provider, which is a stub when
  no SessionType matched.
* A2dpSoftwareAudioProvider uses to replace the old A2DP legacy module
  and uses IPC via HIDL interface between Bluetooth stack and Audio HAL.
* HearingAidAudioProvider uses to replace the Hearing Aids module which
  uses UNIX socket as IPC and now there is HIDL based interface.

There is also a shared library named "libbluetooth_audio_session.so" to
provide the linkage directly between this HIDL and its HAL module,
bluetooth_audio. With this library, we can break the library dependency
and guarantee those symbols of libraries while compiling.

Bug: 111519504
Bug: 122503379
Test: boot and manual test

Change-Id: I54d86291482b7fb041a3ac3e171b68a4ed7bfa07
2019-01-31 18:16:54 +00:00
Treehugger Robot
5203e215e2 Merge "VTS for Bluetooth Audio HAL v2" 2019-01-31 18:16:35 +00:00
Victor Chang
58062e0d41 Remove the dependency on ICU
Static libxml2 no longer requires ICU4C. Remove
the depedency from the build file.

Bug: 121468463
Test: vts-tradefed run vts -m VtsHalAudioEffectV4_0Target
Test: vts-tradefed run vts -m VtsHalAudioV4_0Target
Merged-In: Ib843fb1071a634f25e27e5291b00d11852ac08a9
Change-Id: Ib843fb1071a634f25e27e5291b00d11852ac08a9
2019-01-31 14:05:15 +00:00
Cheney Ni
56d54f1655 VTS for Bluetooth Audio HAL v2
Initial VTS commit for the bluetooth.audio@2.0 HAL

Bug: 111519504
Test: VTS (VtsHalBluetoothAudioV2_0TargetTest) passed

Change-Id: Id607979724182de242c29747218f6b12880d6295
2019-01-30 17:18:32 -08:00
Nathan Harold
304c0ce012 Merge "Explicitly Document INT_MAX for Invalid Fields" 2019-01-30 22:45:06 +00:00
Tom Cherry
bf94481483 Move to new Fstab class
Test: treehugger
Change-Id: I0a3a58193c1482296bc5b60df3f9247e5f1366c3
2019-01-30 14:27:43 -08:00
Xusong Wang
4faf072e22 Add VTS test for dynamic output shape.
Test dynamic output shape with generated models when
- Dimensions of output operands are fully specified
- Dimensions of output operands are unspecified with sufficient buffer
- Dimensions of output operands are unspecified with insufficient buffer

Test: VTS on 1.2 sample driver
Change-Id: I4d26395ce443687ccbd47445b36e3356d70035cc
Merged-In: I4d26395ce443687ccbd47445b36e3356d70035cc
(cherry picked from commit 929fd21e06)
2019-01-30 11:18:24 -08:00
Slava Shklyaev
2739b2ef57 Shorten NNAPI enum range names
Test: mma
Change-Id: I5138589acc127336e8c0e72ca7d6b49532a4eeb9
Merged-In: I5138589acc127336e8c0e72ca7d6b49532a4eeb9
(cherry picked from commit 794703db84)
2019-01-30 10:49:49 -08:00
Miao Wang
d2668b5b9d Report "SKIPPED" for unsupported tests.
- Instead of reporting PASS for unsupported tests, use GTEST_SKIP to
  skip the tests at runtime.

Bug: 113356629
Test: mm
Test: VTS tests on HVX driver
Change-Id: I6a870b61809e58490e66dd4ea36ddeb64fc68a07
Merged-In: I6a870b61809e58490e66dd4ea36ddeb64fc68a07
(cherry picked from commit bb685a4a97)
2019-01-29 15:16:10 -08:00
Xusong Wang
fc67805f4a Implement NN HAL for compilation caching.
Add three methods
- IDevice::isCachingSupported
- IDevice::prepareModelFromCache
- IPreparedModel::saveToCache

Bug: 119616526
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: If28ffe0be48bcb9f4715293fc1201c8d2dbeb946
Merged-In: If28ffe0be48bcb9f4715293fc1201c8d2dbeb946
(cherry picked from commit 89dfafb42f)
2019-01-29 15:00:49 -08:00
Michael Butler
29471a8935 NNAPI Burst -- HAL VTS tests
FastMessageQueue is a Treble-compliant data structure that enables fast
communication between two processes. The FMQ object itself is an atomic
circular buffer that is optionally synchronized with a futex. However,
FMQ has no notion of ownership or lifetime across processes, so it must
be paired with higher-level constructs to manage the lifetime and
ownership.

The NNAPI is introducing the notion of an "Execution Burst" object (or
more simply a "Burst" object), which is similar to an
ANeuralNetworksExecution, but is intended to be reused across multiple
executions and has lower IPC overheads. It achieves this low IPC
overhead by replacing HIDL HwBinder calls with FMQ messages.
Specifically, it replaces IPreparedModel::executeSynchronously's call
from the client into the service with fmq_sync<FmqRequestDatum> (an FMQ
channel used to pass a serialized Request object) and it replaces
the return from the service into the client with
fmq_sync<FmqResultDatum> (an FMQ channel used to return serialized
result status and OutputShapes information).

Each channel is a unidirectional flow of information with exactly one
producer and exactly one consumer. The channels are created by the NN
runtime and passed to the service via
IPreparedModel::configureExecutionBurst.

This CL tests the Burst in both the execution path and validation path
in the Vendor Test Suite (VTS) in neuralnetworks/1.*/vts/functional/.

The VTS binary--VtsHalNeuralnetworksV1_2TargetTest--can be built and run
as any previous version could.

Bug: 119570067
Test: mma
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I3a36484eff9565c2d028c07c099804a0289f294a
Merged-In: I3a36484eff9565c2d028c07c099804a0289f294a
(cherry picked from commit 814d8372f3)
2019-01-29 18:34:34 +00:00
Nathan Harold
5109018dfa Explicitly Document INT_MAX for Invalid Fields
When fields are inapplicable, they should not
be set to a clearly out-of-range value to signal
to the framework that those fields are not used.
In some cases, there is an in-range invalid value
that has been defined by the standards. The docs
are inconsistent in calling out INT_MAX as the
value to be used when something is inapplicable
vs the case when a measurement is simply not
reported. In all cases, INT_MAX can be used to
denote an invalid value, and in cases where the
field/structure is inapplicable, it is the correct
value. This CL updates all the docstrings for
SignalStrength-related fields to clarify that
INT_MAX is the correct "invalid" value for cases
when fields are inapplicable.

Bug: 123088652
Test: compilation (docstring-only change); CTS
    naturally enforces this change on devices with
    newer HALs; backwards compatibility is preserved
    for existing HAL versions.

Change-Id: I5cfa917f504d15691ab3f2c298189bdd47794a42
2019-01-28 18:59:08 -08:00
Amit Mahajan
685fcc0098 Merge "Add a new parameter to emergencyDial()." 2019-01-28 23:33:54 +00:00
Ruchi Kandoi
078f8c0a14 Merge "Add android.hardware.secure_element@1.1" 2019-01-28 21:49:55 +00:00
Treehugger Robot
08540bfbbe Merge "power.stats: Use PowerStats HAL v1.0 in cuttlefish" 2019-01-28 21:03:26 +00:00
Amit Mahajan
cc07875537 Merge "Add Emergency Call testing mode" 2019-01-28 20:51:25 +00:00
Treehugger Robot
1cd12c820c Merge "Replace clang-format with symlink." 2019-01-28 20:16:54 +00:00
Sooraj Sasindran
bed7070e4d Merge "Fix the compatibility matrix with range" 2019-01-28 19:48:44 +00:00
Youming Ye
8327a56b3d Merge "Add functional folder for vts 1.4." 2019-01-28 19:19:19 +00:00
Amit Mahajan
bd400ae327 Merge "Add Emergency Uniform Resource Name (URN)" 2019-01-28 18:50:55 +00:00
Yifan Hong
40877b8c21 Merge "Build DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE." 2019-01-28 18:08:44 +00:00
Sooraj Sasindran
373a240386 Fix the compatibility matrix with range
Fix the compatibility matrix with range of versions

Bug: 122994344
Test: verified manually
Change-Id: Ic5ebb7261d2fe8f379d46ebcc0c47efe8dbd3c59
Merged-In: Ic5ebb7261d2fe8f379d46ebcc0c47efe8dbd3c59
2019-01-28 18:05:20 +00:00
Youming Ye
ae28042bff Add functional folder for vts 1.4.
New tests would be added in cpp files under functional folder. Add a new
folder since it doesn't exist for 1.4 yet.

Test: Compilation
Change-Id: Ieac30bbbc865b76a08d4bdd655f0d489bb7f77bd
Bug: 73784494
2019-01-25 14:27:57 -08:00
Yifan Hong
fee037aac8 Build DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE.
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE is installed on
/product/etc/vintf. It is considered as a replacement of
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE, so only one
of them may be defined. At build time, things like
SEPolicy versions etc. will be written to
/product/etc/vintf/compatibility_matrix.device.xml, just
like the /system one.

Also, split framework_compatibitity_matrix.xml to
system_compatibility_matrix.xml and product_compatibility_matrix.xml.
The latter two corresponds to matrices installed to respective
partitions only.

Test: build with DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE defined
Test: boot (sanity)
Bug: 120600021
Change-Id: I81f9a8f5028cbb88c45f44df04bccb8ccb483972
2019-01-25 13:58:34 -08:00
Benjamin Schwartz
6bb3b5f099 power.stats: Use PowerStats HAL v1.0 in cuttlefish
Bug: 122267057
Test: Build cf_x86_phone-userdebug
Change-Id: I91a1b9d4db8acd2c47753e3b36ea20effd99e09a
2019-01-25 08:48:36 -08:00
Xusong Wang
d22c5232f3 Test dynamic output shape in GeneratedTests.
Enable VTS unit test for dynamic output shape deduction.

Only test dynamic output shape for V1_2::IDevice with V1_2::Model.

Bug: 73506513
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: I4134e1ec54a15554eb8533134897279651b57da3
Merged-In: I4134e1ec54a15554eb8533134897279651b57da3
(cherry picked from commit a316581b21)
2019-01-24 19:11:36 -08:00
David Gross
55a3d328b7 Update neuralnetworks HAL to allow collecting execution duration.
Test: VtsHalNeuralnetworksV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.0::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_1TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.1::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all

Bug: 115390094

Change-Id: If67a5ffe39cfdd78498e01f26251734fdc8e66c7
Merged-In: If67a5ffe39cfdd78498e01f26251734fdc8e66c7
(cherry picked from commit e301349b05)
2019-01-24 16:07:03 -08:00
Xusong Wang
5d67a0bf05 Clean and reorder operation enums.
Four operation enums are removed:
- DETECTION_OUTPUT
- PRIOR_BOX
- SPARSE_TO_DENSE
- EMBEDDING_LOOKUP_SPARSE

Operation enums are reorder into alphabetic order.

Bug: 123253865
Bug: 122744669
Test: NeuralNetworksTest_static
Change-Id: Ie5d2bff6fac061bdca0a99e5b8c8ac05733fac4b
Merged-In: Ie5d2bff6fac061bdca0a99e5b8c8ac05733fac4b
(cherry picked from commit 28a33a9cb1)
2019-01-24 16:05:33 -08:00
Lev Proleev
2d98264026 mutateOperationOperandTypeSkip for new TRANSPOSE_CONV_2D variant
Bug: 119255406
Test: Vts NNAPI tests.
Change-Id: I63f7fc67cedcc2a9db8c359ff96be3c9403b9a20
Merged-In: I63f7fc67cedcc2a9db8c359ff96be3c9403b9a20
(cherry picked from commit 1509a2664c)
2019-01-24 16:05:08 -08:00
Xusong Wang
b50bc313d7 Add 1.2 NN HAL interface for dynamic output shape.
Let notify_1_2() notify output shapes.

Document unspecified dimensions and rank.

Bug: 73506513
Bug: 77234888
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: I01108913212d9f4aa47daf2f293ea19259925865
Merged-In: I01108913212d9f4aa47daf2f293ea19259925865
(cherry picked from commit 187c59715c)
2019-01-24 14:19:00 -08:00