summaryrefslogtreecommitdiff
path: root/libs/androidfw/ZipFileRO.cpp
diff options
context:
space:
mode:
author Antonio Kantek <kanant@google.com> 2024-04-22 17:10:27 +0000
committer Antonio Kantek <kanant@google.com> 2024-04-23 16:44:59 -0700
commit0180fe9074ea48aa0c0bc212e7e62aa72d224f77 (patch)
treeaf6d50002f5a1c4f3a8ed2f470e625244fe23d11 /libs/androidfw/ZipFileRO.cpp
parent5ed41c223295ee22c4217af837f4fc7ccc434d13 (diff)
(2nd try) Bind an input device via descriptor
These changes solve a problem for systems that have multiple displays as well as 2 or more input devices with the exact same name. (e.g. 2 Xbox Series X controllers will report the exact same device name). Currently the default behavior for overall Android is that input device inputs go towards the last screen that the user touched. On systems where a single computer is used for displaying content to multiple people, this can be a problem. A user may be trying to play a game with a controller on screen 1, while a second user tries to browse the internet on screen 2. If the user on screen 2 touches the screen, it'll keep sending the controller input events to screen 2 instead of the game on screen 1. To fix this, the system can use a function to bind controllers to a display. The system can just find an input device by device name and make sure all inputs from that controller go to the correct display. That ensures that no matter what, the controller inputs go to the desired game on screen 1. Now consider a single system with 2 screens and 2 different users trying to play controller games. User A will want their controller inputs to go to screen 1 and User B will want their controller inputs to go to screen 2. This is possible with the current functionality. That is, unless the controllers have the exact same device name. In that case the controllers can only be locked to one screen or another. Device names are not unique. However, descriptors are unique per device. This would allow the system to uniquely identify each input device and bind them to the correct screen. Descriptors also cover certain scenarios. Such as a keyboard with a track pad built into it. It'll be 2 different input devices with 2 different device names but the same descriptor. The original CL [1], was reverted due to the fact that renaming `addUniqueIdAssociation` testApi caused conflict when testing on `next` targets. This CL reverts [2] (the revert CL). [1] Original CL: I5c65b61652e5f4946d63d8ab7309093e49e65083 [2] Revert CL: Idd30621950c1e5499efca71daf3e80b20c4097a6 Test: Built and run on hardware (adapted to run on Android 12L) Test: Passed all tests under atest InputManagerServiceTests with lunch sdk_phone_x86_64-eng Test: atest FrameworksServicesTests InputTests InputManagerServiceTests Test: atest libsurfaceflinger_unittest Bug: 324075859 Signed-off-by: Michael Crimando <mcriman1@ford.com> Change-Id: Ic05feb08a667acb317d14efe7786cb103895e84f
Diffstat (limited to 'libs/androidfw/ZipFileRO.cpp')
0 files changed, 0 insertions, 0 deletions