commit | 22c330ce3b5ae4763f5dee9821662e743bb02e6a | [log] [tgz] |
---|---|---|
author | Andy Chen <achen73@ford.com> | Mon Aug 29 20:07:10 2022 -0400 |
committer | Prabir Pradhan <prabirmsp@google.com> | Tue Sep 06 19:29:54 2022 +0000 |
tree | fc9cc15fb33ad06c010798604be277f4f3054b40 | |
parent | cb05b913b656e3d16a6ea362afa7e1e403297847 [diff] [blame] |
Avoid UI freezing when reading battery capacity/status Reading battery capacity and status could fail and end up with timeout after 5s for some input devices, for example: 8BitDo SN30 Pro+ gamepad. Before reading those items, it would be better to release `mLock` so that other threads could run. Bug: 244088945 Test: Manually verified no UI freezing when calling `inputDevice.batteryState.capacity` or `inputDevice.batteryState.status` Change-Id: Ibb6b8c999b7fd4fe7fbcc57264a1fe6ad74903dc Merged-In: Ibb6b8c999b7fd4fe7fbcc57264a1fe6ad74903dc
diff --git a/services/inputflinger/reader/controller/PeripheralController.cpp b/services/inputflinger/reader/controller/PeripheralController.cpp index a693496..8065f57 100644 --- a/services/inputflinger/reader/controller/PeripheralController.cpp +++ b/services/inputflinger/reader/controller/PeripheralController.cpp
@@ -524,4 +524,8 @@ return light->getLightPlayerId(); } +int32_t PeripheralController::getEventHubId() const { + return getDeviceContext().getEventHubId(); +} + } // namespace android