Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f29b764d authored by Peng Xu's avatar Peng Xu Committed by gitbuildkicker
Browse files

Prevent framework from stucking at communicating with HIDL HAL

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
(cherry picked from commit ab7884fc)
parent 17ebc823
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment