summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RegionSamplingThread.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2019-02-04 14:27:29 -0800
committer Siarhei Vishniakou <svv@google.com> 2019-03-08 15:50:38 -0800
commit15b66d1475adfa0d31a9aac8c76b124f6f4dfeda (patch)
tree910035199ae7aae7369c5aa23ab21a7604fc22b2 /services/surfaceflinger/RegionSamplingThread.cpp
parent3d694145126c794a1d47f4d05164756307a79cf8 (diff)
Do not crash if InputClassifier HAL crashes
If InputClassifier HAL crashes for some reason, we don't have to crash the system. Instead, just check return type and move on. The InputClassifier stage is not critical to input dispatch, and the phone can remain perfectly functional without this stage. Log an error message instead. We are also assuming in InputClassifier that HAL is always present. There are 2 lines of defense here: 1) MotionClassifier always checks the returns from the HAL. If any of the returns are not OK, then MotionClassifier thread exits. This is safe to do always, but a downside of this is that logspam will occur if events are not able to be added to the queue (since the thread that is to be consuming them is no longer running). 2) Register HAL death recipient in InputClassifier. When the HAL death occurs, mMotionClassifier will be set to null, thus preventing further events from going into the queue. This will avoid the logspam from 1). Test: ps -A | grep -i input. Then interact with the phone. Then kill the HAL process, 'killall android.hardware.input.classifier@1.0-service-example'. Then make sure that phone remains functional. Bug: 117935272 Change-Id: I7e8f676d3baa0703198f0731273678c3575bdf60
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
0 files changed, 0 insertions, 0 deletions