14 Commits

Author SHA1 Message Date
Vladislav Kaznacheev
33c5903e77 Hold a weak reference to PointerController when handling vsync
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-09-09 10:03:31 -07:00
Michael Wright
778e3b91ac DO NOT MERGE Remove Pointer Capture API
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-17 18:02:37 +01:00
Michael Wright
f9d9ce7705 DO NOT MERGE Rename PointerIcon and Pointer Capture APIs
This is a response to API council feedback.

Bug: 26830970
Change-Id: Ia2d284b5c1ab8365bedfdc37d129be4b8146036b
2016-05-17 18:02:32 +01:00
Jun Mukai
347e5d498f Introduce pointer capture API.
This depends on I4189eb4d93f50c2865b7a325727be5ceebcc71f8 of
frameworks/native.

Bug: 5452473
Change-Id: Ie21e521f3e5c581f976dc0feb5d84bfa48b046cd
2015-12-18 10:22:43 -08:00
Jun Mukai
d4eaef7f4c Make public pointer icon API with custom icons.
BUG: 25778347, 23804184
Change-Id: If138b97c750c912e9848412c27b65004899961eb
2015-12-14 19:45:10 -08:00
Jun Mukai
19a5601979 Introduce accessibility large pointer icons.
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-30 14:42:53 -08:00
Jun Mukai
808196f139 Introduce animated pointer icon for STYLE_WAIT.
Change-Id: I893f8276e09351db6187c553f349008794b95690
2015-11-17 17:36:08 -08:00
Jun Mukai
c0c0ac37ab Bring DisplayEventReceiver to PointerController.
Now the fading animation of pointers is handled at vsync.

Change-Id: I10fe27d9d7a0d46c4e6504ca487e80bb56e2fd98
2015-10-30 10:24:55 -07:00
Jun Mukai
5ec7420ecd Use invisible icon for POINTER_ICON_STYLE_NULL.
Change-Id: I10d35bdc4da4817d769eb164e6f15e4618670a05
2015-10-21 13:03:01 -07:00
Jun Mukai
1db5397d88 Allow changing mouse pointer icon for the current context.
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
2015-10-15 01:47:29 -07:00
Michael Wright
d6b473713f Move inputservice over to frameworks/native
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-11 10:47:36 -08:00
Michael Wright
453fa30ab2 Revert "Move inputservice over to frameworks/native"
This reverts commit 89e5c7ebb37fabc4368e87e17a502db62598bd61.
2014-02-10 15:08:26 -08:00
Michael Wright
89e5c7ebb3 Move inputservice over to frameworks/native
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
2014-02-10 14:10:27 -08:00
Amith Yamasani
9158825f9c Move some system services to separate directories
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
2013-12-19 15:25:37 -08:00