From 2af9dacc3af8478139b63f7906e79f4f4d208d2c Mon Sep 17 00:00:00 2001 From: Ashutosh Joshi Date: Fri, 10 Mar 2017 12:53:31 -0800 Subject: [PATCH] Do not crash fatally when recovering from system server restart. 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 --- sensors/1.0/default/Sensors.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sensors/1.0/default/Sensors.cpp b/sensors/1.0/default/Sensors.cpp index 37e2b81d9b..24573109c2 100644 --- a/sensors/1.0/default/Sensors.cpp +++ b/sensors/1.0/default/Sensors.cpp @@ -165,8 +165,9 @@ Return Sensors::poll(int32_t maxCount, poll_cb _hidl_cb) { if(!lock.owns_lock()){ // cannot get the lock, hidl service will go into deadlock if it is not restarted. // This is guaranteed to not trigger in passthrough mode. - LOG(FATAL) << + LOG(ERROR) << "ISensors::poll() re-entry. I do not know what to do except killing myself."; + ::exit(-1); } if (maxCount <= 0) {