summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2023-11-21 01:53:34 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2023-11-30 02:08:07 +0000
commitff45ea84b7560390c3648086f0798d21ee23d64c (patch)
tree9871124269c94804e61dd5a12635e84872b3e1e5 /libs/androidfw/FileStream.cpp
parent0e51c4b2ef84013342dc19f4b898e5d6a48ac5a6 (diff)
Sync InputDeviceSensorManager device state with InputManagerGlobal
Previously, InputDeviceSensorManager created its own thread for two purposes: 1. To receive input devices changed callbacks, and 2. To notify events for listeners that were registered without a handler on which they should be notified. The fact that the sensor manager was getting devices changed callbacks on a separate thread meant that the callbacks would race with app callbaks, so it was possible for apps to be notified of devices changing before the manager was. In that case, an app that queries a newly added device's sensors will not get the sensor even if it exists, because the sensor manager doesn't know about the device yet. To fix this, we no longer receive device changes on the sensor thread. Instead, we notify the sensor manager of device changes directly from the binder thread to keep it in sync with InputManagerGlobal. The sensor thread will now be lazy-initialized only for case 2., where a listener is added with a null handler. Bug: 290254916 Test: atest InputDeviceSensorManagerTest Change-Id: I6877a353e8cddd85f0aed5f4aa51e0e16fc364e7
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions