summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.h
AgeCommit message (Collapse)Author
2021-02-18Introduce DynamicDisplayInfoMarin Shalamanov
In this CL we introduce SurfaceContorl.getDynamicDisplayInfo which replaces the current seprate calls for supported and active display mode, supproted and active color modes and HDR capabilities. This way display capabilities can be queried atomically. Additionally this CL pipes an DisplayMode IDs from SurfaceFlinger and updates LocalDislayAdapter to use IDs instead of array indices. Test: presubmit Bug: 159590486 Bug: 175678215 Change-Id: I169e3055d07905e2330e11f158b61ffd366f97e6
2020-08-19Switch to callback animationLiam Harrington
Modified current animation logic to use callbacks from the controllers to further clean and modularize code. Test: Pixel 3XL device, atest PointerController_test, compile Change-Id: I1073bd78687cca491663c0349751dab4b30aa8e2
2020-08-06Refactor of PointerControllerLiam Harrington
Abstracted logic that applies to all pointer types into general PointerController class and moved implementation of logic specific to the mouse cursor and touch spots to MouseCursorController and TouchSpotController, respectively. Test: Pixel 3XL device, atest PointerController_test, compile Change-Id: Ia5825c37ca75951cc8bcd7d5102c986bd957e69f
2020-07-07Move PointerController enums to enum classes.Michael Wright
Bug: 160010896 Test: atest PointerController_test, compile Change-Id: I6c7bfc91023ce6cd2dc8f82b0d72731f871ad3ea Merged-In: I6c7bfc91023ce6cd2dc8f82b0d72731f871ad3ea
2020-07-07Move PointerController from sp to shared_ptrMichael Wright
Bug: 160010896 Test: atest PointerController_test, manual usage Change-Id: I4e665d00c56b44c9c1a4ea8cb27ffd10ade3315b Merged-In: I4e665d00c56b44c9c1a4ea8cb27ffd10ade3315b
2020-05-28Move setDisplayViewport to InputReader.Garfield Tan
InputReader is responsible to associate device and display so it makes sense to allow it set display viewport for pointer controller. Bug: 146385350 Test: Cursor can be associated with external freeform displays as expected. Change-Id: I00d664dd180f1e693b1900582feea8f7ff02f93c Merged-In: I00d664dd180f1e693b1900582feea8f7ff02f93c
2019-02-13Support showTouches on multi-display (2/2)Arthur Hung
Currently the PointerController would be associated with the top most freeform or external display if enable desktop mode. But for presenting spots when enable showTouches from develop options, they should be shown on the corresponding display where user touched. Also changed Vector to std::vector. Test: atest inputflinger_tests Test: Use device support multi-display and touch screen (like mojave). Enable showTaps from develop options and check if show tap spots. Bug: 120815589 Change-Id: I0854fa97813aabf005dccb8ec6fbda10106126e9
2019-01-17Load correct resources for pointer icon on external screenAndrii Kulian
When mouse pointer changes displays, it should also reload the icon from new resources. Otherwise, if the densities of the previous and new displays are different, the size of the pointer sprite will look too small or too large. - Add getDisplayContext to get the corresponding Context by displayId. - Cache system pointer icons per display, clear if display removed. - Fix icon moved to default when not resetting out of task bound. Bug: 113559891 Test: Enable mouse pointer on default display, move to other screen Change-Id: Ic42d0ec32d9c979281e13c83b9e8b57134fd4f0d
2019-01-09Support mouse pointer on external displays (2/2)Arthur Hung
Limit mouse boundary to one display viewport. Currently if desktop mode is enable, selects the topmost freeform display, or find first external display if there is no freeform display. Return the default display if desktop mode is not enable. - Add getPointerDisplayId to find the preferred display. - Limit update viewports from InputReader. - obtainPointerController would also find the associated display id. - Reload cursor resources if resolution or display changed. Bug: 113559891 Test: atest inputfliger_tests Test: ActivityView test app Change-Id: Iffd01e27f5010ccfb0481a028658b7290ca6316d
2018-12-17Revert "Support mouse pointer on external displays (2/3)"Andrii Kulian
This reverts commit 84cdf9cc3b849679e6b4f6d3ccb66270f0abad2f. Reason for revert: b/120864177 Test: Presubmit Bug: b/120864177 Change-Id: Ia65e704169527b54cf1d1d470445f96a65fa0294
2018-12-10Support mouse pointer on external displays (2/3)Andrii Kulian
Limit mouse boundary to one display viewport. Currently if desktop mode is enable, selects the topmost freeform display, or find first external display if there is no freeform display. Return the default display if desktop mode is not enable. - Add getPointerDisplayId to find the preferred display. - Limit update viewports from InputReader. Also implements updatePointerDisplay to find and associate with the specified display viewport. - Reload cursor resources if resolution or display changed. Bug: 113559891 Test: atest inputfliger_tests Test: ActivityView test app Change-Id: Ief3410a517be457dfe6f1180342bb1dc88833635
2018-11-19InputFlinger Split: Use libinputreader in InputManagerServicePrabir Pradhan
This changes native InputManagerService to use the new backend library for inputflinger: libinputreader. Bug: 119264687 Test: manual: Build, run, and test input (touch, mouse) Change-Id: I619492d5492cd8444d7c2cc7af9717c19c938256
2018-07-11Refactor String8 to std::string callsSiarhei Vishniakou
DisplayViewport::uniqueId is now std::string, so change the calls appropriately. Do some additional cleanups and conversions. This almost completely removes the dependency on String8. Test: build only Bug: 111108021 Change-Id: Ibbb6ca59e9061954d4a5fb930ef03d42cb0230db
2016-09-09Hold a weak reference to PointerController when handling vsyncVladislav Kaznacheev
Currently PointerController starts listening to display events immediately (in its constructor) and never explicitly removes the callback. The reference dangling from the looper prevents the PointerController instance from being deleted when all the clients have released their references. As a result, when USB or BT mouse is disconnected, the mouse stays frozen on screen and only goes away after a 15 sec inactivity timeout. This change introduces an intermediary LooperCallback which holds only a weak reference to PointerController. The pointer now disappears immediately upon mouse disconnect. Bug: 30824220 Change-Id: I5f7208dbfa381b3e21f248cc0da402f307faa184
2016-05-17DO NOT MERGE Remove Pointer Capture APIMichael Wright
The underlying implementation needs to be completely rethought. If a process crashed while you were in pointer capture mode, you were pretty much stuck in it. If the mouse happened to move outside of your bounds right before you called the API, you'd never actually get an event (whatever it was hovering over would). There's no easy way for the system to tell you when you enter or exit this mode because it doesn't actually track who the current request is from. These are all solvable, but not in the N time frame. Maybe next time. Bug: 26830970 Change-Id: I03efd63c499b86dc278491ca3284566c1965581f
2016-05-17DO NOT MERGE Rename PointerIcon and Pointer Capture APIsMichael Wright
This is a response to API council feedback. Bug: 26830970 Change-Id: Ia2d284b5c1ab8365bedfdc37d129be4b8146036b
2015-12-18Introduce pointer capture API.Jun Mukai
This depends on I4189eb4d93f50c2865b7a325727be5ceebcc71f8 of frameworks/native. Bug: 5452473 Change-Id: Ie21e521f3e5c581f976dc0feb5d84bfa48b046cd
2015-12-14Make public pointer icon API with custom icons.Jun Mukai
BUG: 25778347, 23804184 Change-Id: If138b97c750c912e9848412c27b65004899961eb
2015-11-30Introduce accessibility large pointer icons.Jun Mukai
This patch does the following things: - add new graphic assets of large icons for accessibility needs (imported from ChromeOS data) - add the logic to choose the set of normal icons or accessibility icons - make InputManagerService to observe the settings change, so that it can reload the new resources This patch misses non-1x graphic though, because ChromeOS doesn't have such data. Bug: 25778857 Change-Id: Ia5f95d47f50b3f6eea555c3af8069bc6bae0b400
2015-11-17Introduce animated pointer icon for STYLE_WAIT.Jun Mukai
Change-Id: I893f8276e09351db6187c553f349008794b95690
2015-10-30Bring DisplayEventReceiver to PointerController.Jun Mukai
Now the fading animation of pointers is handled at vsync. Change-Id: I10fe27d9d7a0d46c4e6504ca487e80bb56e2fd98
2015-10-21Use invisible icon for POINTER_ICON_STYLE_NULL.Jun Mukai
Change-Id: I10d35bdc4da4817d769eb164e6f15e4618670a05
2015-10-15Allow changing mouse pointer icon for the current context.Jun Mukai
Right now, it only supports I-beam on EditText, but further rules will come in the future. The png files for the icons are from chromium. Bug: 24180385 Change-Id: I8de4ec8a5412b4830c08aa232c5083841c5c751c
2014-02-11Move inputservice over to frameworks/nativeMichael Wright
Remove all of the pieces except the PointerController and SpriteController over to frameworks/native in preparation for inputflinger. Those two need to stay in frameworks/base for now because they depend on Skia currently. In the long run they should be merged into either the InputManager or the WindowManager rather than as a part of the inputservice / inputflinger. Try 2. Change-Id: I84259356d3eb8efc5aefb9d6b311b5fc590ea3ed
2014-02-10Revert "Move inputservice over to frameworks/native"Michael Wright
This reverts commit 89e5c7ebb37fabc4368e87e17a502db62598bd61.
2014-02-10Move inputservice over to frameworks/nativeMichael Wright
Remove all of the pieces except the PointerController and SpriteController over to frameworks/native in preparation for inputflinger. Those two need to stay in frameworks/base for now because they depend on Skia currently. In the long run they should be merged into either the InputManager or the WindowManager rather than as a part of the inputservice / inputflinger. Change-Id: Iebef71f3030fb3d26a5f338eb66d75bb37c17734
2013-12-19Move some system services to separate directoriesAmith Yamasani
Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85