Commit Graph

5 Commits

Author SHA1 Message Date
Michael Wright
6853fe6d78 Move PointerController enums to enum classes.
Bug: 160010896
Test: atest PointerController_test, compile
Change-Id: I6c7bfc91023ce6cd2dc8f82b0d72731f871ad3ea
Merged-In: I6c7bfc91023ce6cd2dc8f82b0d72731f871ad3ea
2020-07-07 10:43:01 -07:00
Michael Wright
a0bc6b1d09 Move PointerController from sp to shared_ptr
Bug: 160010896
Test: atest PointerController_test, manual usage
Change-Id: I4e665d00c56b44c9c1a4ea8cb27ffd10ade3315b
Merged-In: I4e665d00c56b44c9c1a4ea8cb27ffd10ade3315b
2020-07-07 10:11:58 -07:00
Prabir Pradhan
ca7d72347e PointerController: Add guards to ensure display is valid
This change makes it so that PointerController does not ask its Policy
to load any resources for any displays until a DisplayViewport is set,
and verifies this with unit tests.

Bug: 145699789
Bug: 146385350
Test: atest libinputservice_test
Change-Id: I2e48e7ac4700e6f9fdf939a7bd0e6639b051ade6
Merged-In: I2e48e7ac4700e6f9fdf939a7bd0e6639b051ade6
2020-05-28 14:03:22 -07:00
Garfield Tan
e9c6151756 Stop loading animation for addtional cursor type.
In the test below it only expects MockSprite#setIcon() being called
once, but with animation it may be called multiple times.

Bug: 144947344
Test: atest PoitnerControllerTest#updatePointerIcon
Change-Id: I5c4908fb8301cae144fd637c831f2012a35862e3
Merged-In: I5c4908fb8301cae144fd637c831f2012a35862e3
2020-05-28 14:03:21 -07:00
Garfield Tan
c15eb91b04 Add cursor type and hotspot to surface metadata.
Also bootstrap unit tests for PointerController. Need to mark 3
functions of SpriteController virtual so their behaviors can be
overridden.

Bug: 130822623
Test: SurfaceFlinger can get cursor type and hotspot.
Change-Id: I739cd03214364144bb4e22a166ecc7abfd3492fe
Merged-In: I739cd03214364144bb4e22a166ecc7abfd3492fe
2020-05-28 14:03:21 -07:00