summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2023-10-27 18:27:21 +0000
committer Winson Chung <winsonc@google.com> 2023-10-31 16:20:39 +0000
commit64d3acf7fd5e7b6572e4ce46cd8ed05f048b564d (patch)
tree4260cbcb7104c9210eff54f5a3845127de9b55cc /libs/androidfw/FileStream.cpp
parenta6cb68cf9d85c6479a52dc1b084ff17b7603fc28 (diff)
Key input consumers by token and not by name
- Currently input consumers are singletons keyed by static name, which is problematic because the per-user Launcher process registers and unregisters the input consumer when SysUI binds to the current user's TouchInteractionService. However, the ordering of service create and destroy when switching users is not guaranteed, so you can end up with user 2's service being created before user 1's service destroy is called. Currently this crashes because we expect singletons. - This change changes the tracking of input consumers to be by token (which is already passed by the caller), and uses the token for identifying the input consumer to destroy. In addition, it only enforces a singleton check for input consumers registered for the same user. And when fetching an input consumer by name, the last registered consumer with that name takes precedence and is returned. This allows multiple Launcher processes to register a consumer for the current user without preventing the closing Launcher service from removing its previously registered consumer. Fixes: 300973954 Test: Verify with multiple users that there's no race between registering and destroying the recents input consumer Change-Id: I64d2453c3671747b5799f26b628448fdf03bdb77
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions