diff options
author | Yifan Hong <elsk@google.com> | 2017-11-02 18:43:06 -0700 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2017-11-06 15:33:36 -0800 |
commit | cf9a8b2e97acb40361f9df186cfb7bd38b2809d6 (patch) | |
tree | c71f4ebf487100bdae4a2546b2ee48cb5a628f5d /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 4c10ba499d60f88d24be147beee8ea321a07b34c (diff) |
BatteryService: Clean up init logic.
* Use getService instead of getTransport, because
getService checks VINTF already. Init has fewer #
of hwbinder calls and simpler logic.
* init() calls registerCallback() to HAL synchronously. Now that
there is a way to check for equality of interfaces in Java,
registerCallback can be called in HealthServiceWrapper.init()
earlier, and registerCallback in service notification can
be avoided when the service pre-exists.
* Instead of making hwbinder calls in a lock in hwbinder threads
(service notification callback), post to a background HandlerThread.
As a consequence, no lock is needed because ordering is ensured.
(Making hwbinder calls in a lock can lead to deadlocks if an
implementation calls back to system server and tries to acquire the
same lock.)
Test: boot 20 times
Test: BatteryServiceTest
Change-Id: Id27b789da78f0df9f867cba75d15203a4fb74e04
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions