OSDN Git Service

Recover cleanly from power HAL service crashes
authorConnor O'Brien <connoro@google.com>
Tue, 28 Feb 2017 00:41:35 +0000 (16:41 -0800)
committerConnor O'Brien <connoro@google.com>
Wed, 29 Mar 2017 18:54:25 +0000 (11:54 -0700)
commit578eb7fee3a28ff9ca309e741b5a647637896ba1
tree99913c7de0b3f6a2320ae5b2574279ff0d8571d1
parent84d7e77aceb2979270823e2eac2eebf2e22a786e
Recover cleanly from power HAL service crashes

Currently if the binderized power HAL service crashes, services that
call the HAL will crash as well. To fix this:
- Before calling power HAL functions, check that the handle to the
  power HAL service is still valid, and reload using getService() if
  necessary.
- When a call to a power HAL function fails, log the failure and mark
  the handle as invalid.

Bug: 35728909
Test: adb shell kill -9 $(adb shell pidof android.hardware.power@1.0-service)
Change-Id: Id2dd1a6507b9f5044d928483cdb6b736c701f8ba
Signed-off-by: Connor O'Brien <connoro@google.com>
services/core/jni/com_android_server_am_BatteryStatsService.cpp
services/core/jni/com_android_server_power_PowerManagerService.cpp