Merge "Add guidance for avoiding race in Sensors HAL 2.0" into qt-dev

This commit is contained in:
Brian Duddie 2019-06-18 23:44:20 +00:00 committed by Android (Google) Code Review
commit 5c654f3fc6
2 changed files with 6 additions and 1 deletions

View file

@ -546,6 +546,7 @@ d8e7717e8187dd7453d4142f8f331e7c325e7a6f9e8d44ac0d52b3be502bfe83 android.hardwar
08d439c463e4044fa78874037d8e8379aa3cabecde32f08a775897eea5a538af android.hardware.secure_element@1.1::ISecureElement
b53ac9d61c24efb16a2d63a861cef20680f6d57adb244a03b9778c675550628b android.hardware.secure_element@1.1::ISecureElementHalCallback
3702b1c52c0bb3427244618e9e7975c05228bf4ceb8720da7a93603a71cb0368 android.hardware.sensors@2.0::ISensors
c36670945ea09d92ae90a557147352ed9bd5223f957d347b367c2acb6f94870f android.hardware.sensors@2.0::ISensors # b/135216821
ae5faa38538a9f50eb71eb7f9b998271124d2c64b761cb11c4d820c7732b4ddc android.hardware.sensors@2.0::ISensorsCallback
3a98242a57d0820dacaca0f7db52bec433eae1f21c498763c6f1ece611c3967b android.hardware.sensors@2.0::types
ce4b98211959449361146d4b1e5554dc841ceb4d4577154d7b2fb6d1eb504f76 android.hardware.soundtrigger@2.2::ISoundTriggerHw

View file

@ -99,7 +99,11 @@ interface ISensors {
* Lock FMQ. When the HAL reads the data from the Wake Lock FMQ, the HAL
* decrements its current count of unprocessed WAKE_UP events and releases
* its wake_lock if the current count of unprocessed WAKE_UP events is
* zero.
* zero. It is important to note that the HAL must acquire the wake lock and
* update its internal state regarding the number of outstanding WAKE_UP
* events _before_ posting the event to the Wake Lock FMQ, in order to avoid
* a race condition that can lead to loss of wake lock synchronization with
* the framework.
*
* The framework must use the WakeLockQueueFlagBits::DATA_WRITTEN value to
* notify the HAL that data has been written to the Wake Lock FMQ and must