By setting vendor_available, the following may become true:
* a prebuilt library from this release may be used at runtime by
in a later releasse (by vendor code compiled against this release).
so this library shouldn't depend on runtime state that may change
in the future.
* this library may be loaded twice into a single process (potentially
an old version and a newer version). The symbols will be isolated
using linker namespaces, but this may break assumptions about 1
library in 1 process (your singletons will run twice).
Background:
This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.
At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.
It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:
https://android-review.googlesource.com/368372
None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.
Bug: 36426473
Bug: 36079834
Test: m -j android.hardware.sensors@1.0-convert
Test: attempt to compile with BOARD_VNDK_VERSION := current
Change-Id: I0a4e8a658b5b33bd7a6668242f98a4f6cda2a94f
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h
Test: pass
Merged-In: Iff316b21bef556bb026378b7f89e97ded3febef4
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h
Test: pass
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
hidl_string no longer will provide an implicit cast to const char* as it
interfers with other expected behaviors of the class. It now emulated
std::string in requiring a call to .c_str() to get the same behavior.
Bug: 36532780
Test: Build the tree
Change-Id: I265590c7c18f425e44863df062a56b67519a932a
Bug: 36580454
Test: unlock watch with LLOB sensor and verify no SensorService crash
Change-Id: Ib1d086efd80e829bb844521fa39325f095b1c2c9
Signed-off-by: Ben Fennema <fennema@google.com>
This has been copy pasted and isn't actually required.
Test: all hals manually tested to work on internal marlin (which have them binderized).
Note: tv hals not tested (and they never have been). Filed b/36562029
Note: for thermal hal, could only run VTS/check logs for errors.
Test: lshal outputs proper stuff
Fixes: 31928447
Change-Id: Id1be584dc0fa2d70e9189b922335146bf6d1382d
Add gating condition before calling the hal function pointers for
set_mode and inject_sensor_data.
Bug: 36073404
Test: compiles
Change-Id: I9c194c1a286fb64304b4329f43c3de2a3d6ae939
* Less suceptible to lingering sensor activation before system
restarts.
* Covers injectSensorEvent and setOperationMode API
* More test cases to test various operation conditions.
Bug: 32022776
Bug: 33618936
Test: vts-tradefed run commandAndExit vts --module VtsHalSensorsV1_0Target
Change-Id: I75f585a373880e831f511784a856d322077c07c0
Log(FATAL) is creating lots of nuisance bugs.
Test: Sensor service continues to recover from a system server
restart and sensors are available.
No crash log is created.
Bug: 36094522
Bug: 36115683
Change-Id: Idc2d086709dc2132c98aab806aa44728fbdaa189
Sensor hidl service has two threads quota. One is used for sending
commands down to hardware, and the other for retrieving sensor events
from hardware. The second is usually blocked on poll().
When system server quits abnormaly, the poll thread may still be
blocked in HAL implementation and holding that thread. There won't be
enough available threads for framework sensor service to function
correctly when system service restarts, resulting in a deadlock at
enableSensor() or getService() until the hidl service is restarted.
This fix detects a second connection from framework sensor service
and kills the hidl service in case that happens. The system will restart
the hidl service with clean state and return system to normal operation.
Bug: 35727090
Bug: 35843387
Bug: 35702298
Bug: 35919167
Bug: 35848670
Bug: 35903635
Test: Restart device works in normal case.
Restart also works with the following scenario (reproducing error)
"adb root && adb shell dumpsys sensorservice restrict random &&
adb shell stop && adb shell start"
Change-Id: Ibffa87d93b2d24af2803be9281e7141d0a221e3e
This reverts commit 6909bfd8ee.
Updated sense null strings are now allowed in hidl as of Iada25da5407c3eccdd28704d993ffdee8b15c5fe.
Bug: 35421240
Change-Id: Ied1745ba7169b2e4bc0a20000503e47172538f08
Some HALs may provide null pointers in lieu of empty strings.
Avoid simple copies of these strings.
Bug: 35384551
Test: Verify affected device (Pixel-C) boots and auto-rotate works.
Change-Id: I37ab6e781d6dfdcc1667bcc0467690f7c2c9a557
i) Increase the number of default threads to 2.
ii) Handle the flush complete event correctly.
Bug: 35189074
Bug: 35067266
Test: Test that sensors work in both binderized and passthrough modes.
Ensure that camera photosphere works.
Change-Id: Ic8dadf03395b4e96092ae962cf790c93d65a1c8d
We need google shims on the vendor partition because they are providing
an implementation of a vendor defined interface. They were written by
google just as a courtesy/to make the transition easier. They're
basically a set for vendors to assemble their hal implementations
from.
Bug: 34135607
Test: marlin persist.hal.binderization on/off
Change-Id: I2e2af5af39264cf290259755bb9b2eb9827a21f5
Java intermediates are now created in the common rather than the device-
specific generated sources subdirectory.
Bug: 33842609
Test: make
Change-Id: I16af4cd19bf0b24baa0ad9ebfdb86b4d959c8672
HIDL implementation defaults to using a single thread for a service.
This blocks on sensorservice poll. A minimum of two threads are needed
to allow for any meaningful control.
Bug: 35067266
Test: Verify sensors stream in both passthrough and binderized modes.
Change-Id: I44ccdb6db253ca9eb9903b51e05c1893945e297e
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: builds; verify HAL still works
Bug: 33844934
Change-Id: Iefb6dfe80ec8f4ab389d2b6529f9f968365289b2
This change is done in AOSP hardware/libhardware and have to be manually
merged into hardware/interfaces after comments are moved to HIDL.
Test: comment change
Change-Id: I8dd5abd0c03eec7ef6bfef107b4b04404144627e
Added support for newly added HAL function for sensor event direct
report feature, replace dummy implementation with funtional ones for
the following:
* registerDirectChannel
* unregisterDirectChannel
* configDirectReport
Added a vts test case for direct report.
Added new offset definition to types.hal. This will not affect
existing client/calling code.
Bug: 30985702
Bug: 32022776
Test: vts pass
Change-Id: Ie5e3cddd7c37664e8c59d69cf70aaa1310fd3f58
Check maxCount parameter so that it will not allocate overly large
amount of memory if input parameter is bad.
Bug: 32953589
Test: build and pass vts
Change-Id: Ia19e0315ab1623b8b6580889c1e058a19e6c9670
* Parse profiling data for each test case.
* Merge the profiling data for each test case at the end of test
and upload the profiling info to web.
Bug:34226555
Test: run vts -m VibratorHidlProfilingTest
Change-Id: I9e13eada8e7db338a29c6943868d12e76844e2c4
* Swap GEOMAGNETIC_FIELD with MAGNETIC_FIELD for more accurate
definition.
* Remove redundunt prefixes in various enum definitions.
* Clarify that string type will be removed for well defined sensor
types. This avoid dependency on strings defined in sensors.h.
* Added SensorFlagShift enum.
* Remove unused flag parameter in batch.
* Remove legacy setDelay function.
* Change the type of sensor flag to bitfield<SensorFlagBits>, and
use uint32_t since only low 32 bits are used.
Test: all sensor works(in marlin), tested with sensorlogger.
Change-Id: I93a4d13c5d2e054857d1e400d15002aeb9a47368
Extend injectSensorData functionality to also take
SENSOR_TYPE_ADDITIONAL_INFO type for parameter download.
Defined new AINFO constants
AINFO_LOCAL_GEOMAGNETIC_FIELD
AINFO_LOCAL_GRAVITY
AINFO_DOCK_STATE
AINFO_HIGH_PERFORMANCE_MODE
AINFO_MAGNETIC_FIELD_CALIBRATION
Test: manual
Change-Id: I642fa1048ad600cc87c029ec18e73b3411631032
* replace all "should" description with more precise wording.
* replace "aidl" name in parameter to avoid confusion.
* reformat files and method description.
Test: m -j32
Change-Id: Id1129b816b3c364c76f0a24fabba1e1418dbd8db
the getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: make hidl_test; adb sync; adb shell;
data/native_test64/hidl_test64
Run VTS test from go/vtsrun on Sensors, Vr, Nfc
Verify NFC HAL works (turn NFC on and off in Settings)
In support of b/33844934
Change-Id: Ibcc140c3ce7930bff61cda2213c4c9ed4491a964
Added functions:
* registerDirectChannel
* unregisterDirectChannel
* configDirectReport
Added structs and enums related to direct report functionality.
Stub default implementation is also included.
Test: compiles and runs
Bug: 30985702
Change-Id: Ia542673e2b180e0aa62c1374cf8c1671bf2f5721
After framework shutdown, there may be stall events when sensors vts
target test starts. These events make vts flaky. This CL allows the
test to remove all those events to avoid test results being affected.
Test can run repeatedly > 20 times without failure with this patch.
Test: vts-tradefed run commandAndExit vts
--module SensorsHidlTargetTest
Bug: 33618936
Change-Id: I027e88b2b7425136543b15cf39afb203c315d8bf
Decide target_basepaths by device's bitness.
On 32-bit target, do not include */lib64.
Bug: 33930594
Test: vts-tradefed run commandAndExit vts -m VibratorHidlTest -l INFO
Change-Id: I340ded1d763dc194da461ecf183c6a2ff5f5ee6f
* Using update-makefiles.sh to add make rule for profiler in Android.bp
* Remove make rule for profiler in vts/Android.mk.
Bug:31930023
Test: mma
Change-Id: Iea834d8610501c2fce63f65742db31bafb85c0b8
Initial submission of Sensor VTS test, including the following
test cases:
* SensorListValid
* NormalAccelerometerStreamingOperation
* NormalGyroscopeStreamingOperation
* AccelerometerSamplingPeriodHotSwitchOperation
* AccelerometerBatchingOperation
One thing to note is that runtime has to be stopped to prevent
sensor service from stealing samples (which causes test failure).
Test: m vts -j32 &&
adb shell stop &&
vts-tradefed run commandAndExit vts \
--skip-all-system-status-check \
--primary-abi-only \
--skip-preconditions \
--module SensorsHidlTargetTest
vts-tradefed run commandAndExit vts \
--skip-all-system-status-check \
--primary-abi-only \
--skip-preconditions \
--module SensorsHidlTest
adb shell start
Test: # alternative, faster way to run target test only
m sensors_hidl_hal_test -j32 &&
TOUT=$T/out/target/product/${TARGET_PRODUCT}
TEST=data/nativetest/sensors_hidl_hal_test/sensors_hidl_hal_test
adb push ${TOUT}/${TEST} /${TEST} && \
adb shell ${TEST}
Change-Id: I3e26aa550f4cdec2cebb847f47d63ed33a527210
To allow genrules with more than one tool, rename the tool property to
tools and make it an array, replace $tool with $(location <label>),
and use $() for other variables for consistency.
Bug: 31948427
Test: compare build.ninja
Change-Id: I3d714f70a2af0dc60faeee10e09b6ed166601f1d