summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/input/InputManagerService.java
AgeCommit message (Collapse)Author
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
2013-11-07Add media router service and integrate with remote displays.Jeff Brown
This change adds a new media router service whose purpose is to track global state information associated with media routes. This service publishes routes to the media router instance in application processes and handles requested state changes such as selecting or unselecting global routes. The service also binds to remote display provider services which can offer new remote display routes to the system. Includes a test application for manually verifying certain aspects of the operation of the media router service. The remote display provider interface is essentially a stripped down media route provider interface as defined in the support library media router implementation. For now, it is designed to be used only by first parties to publish remote display routes to the system so it is not exposed as public API in the SDK. In the future, the remote display provider interface will most likely be deprecated and replaced with a more featureful media route provider interface for third party integration, similar to what is in the support library today. Further patch sets integrate these new capabilities into the System UI and Settings for connecting remote displays. Bug: 11257292 Change-Id: I31109f23f17b474d17534d0f5f4503e388b081c2
2013-09-10Propagate input ANR reason to activity manager log.Jeff Brown
Make it a little easier to diagnose input dispatch timeouts by providing the detailed reason as the ANR annotation in the log. Bug: 10689184 Change-Id: Ie18fd9ad066b0673d1f57c030e027ad0085f4650
2013-07-16Refactoring of the print sub-system and API clean up.Svetoslav Ganov
1. Now a user state has ins own spooler since the spooler app is running per user. The user state registers an observer for the state of the spooler to get information needed to orchestrate unbinding from print serivces that have no work and eventually unbinding from the spooler when all no service has any work. 2. Abstracted a remote print service from the perspective of the system in a class that is transparently managing binding and unbinding to the remote instance. 3. Abstracted the remote print spooler to transparently manage binding and unbinding to the remote instance when there is work and when there is no work, respectively. 4. Cleaned up the print document adapter (ex-PrintAdapter) APIs to enable implementing the all callbacks on a thread of choice. If the document is really small, using the main thread makes sense. Now if an app that does not need the UI state to layout the printed content, it can schedule all the work for allocating resources, laying out, writing, and releasing resources on a dedicated thread. 5. Added info class for the printed document that is now propagated the the print services. A print service gets an instance of a new document class that encapsulates the document info and a method to access the document's data. 6. Added APIs for describing the type of a document to the new document info class. This allows a print service to do smarts based on the doc type. For now we have only photo and document types. 7. Renamed the systemReady method for system services that implement it with different semantics to systemRunning. Such methods assume the the service can run third-party code which is not the same as systemReady. 8. Cleaned up the print job configuration activity. 9. Sigh... code clean up here and there. Factoring out classes to improve readability. Change-Id: I637ba28412793166cbf519273fdf022241159a92
2012-09-30Switch from uevent model to /dev/input/event.Craig Mautner
Headsets are now detected from calls coming in from the input switch subsystem if a config.xml value is set to true. Bug: 6548391. Change-Id: I79259d2742e157b106a746474f32ffd1c171ddf3
2012-09-27Bundle correlated switch changes atomically.Jeff Brown
This is a prerequisite for headset jack detection on Manta. Bug: 6548391 Change-Id: I549a194344511c0cee578b00f6a9ab5fdbdfb99c
2012-09-25Handle user switched for settings changes.Jeff Brown
Move OVERLAY_DISPLAY_DEVICES to Global. Bug: 7127417 Change-Id: I632648ac5b01408512f59424f3bb55162431bea4
2012-09-24Fix issue #7214090: Need to be able to post notifications to all usersDianne Hackborn
Also fix a bunch of system services that should be doing this. And while doing that, found I needed to fix PendingIntent to evaluate USER_CURRENT at the point of sending, not creation. Note that this may end up with us having some notification shown to non-primary users that lead to settings UI that should only be for the primary user (such as the vpn notification). I'm not sure what to do about this, maybe we need a different UI to come up there or something, but showing the actual notification for those users at least seems less broken than not telling them at all. Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
2012-09-20Disentangle input manager service startup.Jeff Brown
We will be adding additional callbacks for other components. This change makes it clearer how the input manager is started and where the callbacks are initialized. Bug: 6548391 Change-Id: I4b2a61482126a12b7cf11fafe513f846c76c11e5
2012-09-10Make input system aware of multiple displays.Jeff Brown
The input system needs to know about the window that has focus, even if it is on a secondary display. So now we send it the list of all windows and indicate which display they are on. We filter the list of windows as necessary when delivering touch events. To keep things simple, monitor input channels and input filters are not supported except on the main display. We also do not pass the display id to applications; it is only used inside the input system for now. Properly scale touch coordinates based on the viewport. This will be needed to ensure that touch works on external display as well as when the internal display is being used to simulate a different resolution. Change-Id: I1815579a52fcc852c519b5391fc7ab8767c2dc59
2012-09-08Make display manager tell input system about viewports.Jeff Brown
The window manager is no longer responsible for telling the input system about the display viewport. Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1
2012-08-31More improvements to the display manager.Jeff Brown
Added more complete support for logical displays with support for mirroring, rotation and scaling. Improved the overlay display adapter's touch interactions. A big change here is that the display manager no longer relies on a single-threaded model to maintain its synchronization invariants. Unfortunately we had to change this so as to play nice with the fact that the window manager wants to own the surface flinger transaction around display and surface manipulations. As a result, the display manager has to be able to update displays from the context of any thread. It would be nice to make this process more cooperative. There are already several components competing to perform surface flinger transactions including the window manager, display manager, electron beam, overlay display window, and mouse pointer. They are not manipulating the same surfaces but they can collide with one another when they make global changes to the displays. Change-Id: I04f448594241f2004f6f3d1a81ccd12c566bf296
2012-08-25Make it easier to create asynchronous Handlers.Jeff Brown
There are potentially very many Handlers owned by services that should not be blocked by barriers introduced by UI traversals occurring on the same thread (if that ever happens). Add some convenience constructors to make it easy to switch these Handlers over to being async. Bug: 7057752 Change-Id: I64d9bffe81e7c52ada4cfad4e89d4340153f4688
2012-08-20Plumb the switch code into Dalvik.Jeff Brown
Bug: 6548391 Change-Id: If0e918669ba27ca0e6561930d4abc427c34de42d
2012-07-16Fix merge error, put in tmp workaround for input manager.Matthew Xie
Fix merge error, missing enableNoAutoConnect api. Remove bluetoothF from inputManageF.systemReady call as tmp workaround. Recover shutdownRadios(MAX_RADIO_WAIT_TIME) call in ShutdownThread Change-Id: Ice2b5c54267755bdbf56c742feabbb8709b92570
2012-07-16Removing a workaround for incorrect window position on window move.Svetoslav Ganov
1. The window manager was not notifying a window when the latter has been moved. This was causing incorrect coordinates of the nodes reported to accessibility services. To workaround that we have carried the correct window location when making a call from the accessibility layer into a window. Now the window manager notifies the window when it is moved and the workaround is no longer needed. This change takes it out. 2. The left and right in the attach info were not updated properly after a report that the window has moved. 3. The accessibility manager service was calling directly methods on the window manager service without going through the interface of the latter. This leads to unnecessary coupling and in the long rung increases system complexity and reduces maintability. bug:6623031 Change-Id: Iacb734b1bf337a47fad02c827ece45bb2f53a79d
2012-05-30Fix comparison of device source bits.Jeff Brown
Bug: 6576743 Change-Id: I6952b052e2ab9e62ddd46ab76f4df37ecc656757
2012-05-21Disable debug logs.Jeff Brown
Change-Id: Icc7d389789885185f2ca9b609bad6096fe290106
2012-05-20Add support for switching between multiple keyboard layouts.Jeff Brown
Also show a notification when an external keyboard is connected and does not have a keyboard layout selected yet. Bug: 6405203 Change-Id: Id0ac6d83b3b381f8a236b2244a04c9acb203db3c
2012-05-17Add support for grouping keyboard layouts by collection.Jeff Brown
Bug: 6405203 Change-Id: Id818b27ec09928150795d594a96df186a6e39168
2012-05-11Rename kcm attribute to keyboardLayout.Jeff Brown
Bug: 6478076 Change-Id: I7fc0d8eb36d03a628d070f8fd6ea1e1464b1a163
2012-05-02Separate the internal and external display rotations.Jeff Brown
When attached to an HDMI touch screen, the input system needs to know the size and rotation of the external display independent of the internal display. The size was already being reported separately but not the rotation. The inconsistency can cause problems if the internal display's natural rotation is portrait but the external display's natural rotation is landscape. Change-Id: Id344f04c1ba032625f6265766be66f9ddaa2cc0b
2012-05-01Improve handling of built-in keyboard.Jeff Brown
The window manager policy made some incorrect assumptions about the meaning of the Configuration.keyboard field. We need to be more careful about distinguishing between built-in and external keyboards. Most of this change is to move the determination of the parts of the Configuration related to input devices into the WindowManagerService leveraging new features of the InputManagerService to good effect. Then we plumb through the flag that indicates whether a device is internal or external so that we can be more particular about how the lid switch effects changes to the Configuration. Bug: 6424373 Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
2012-04-30Add support for using the lid switch to turn off the screen.Jeff Brown
Added a config option to allow the lid switch to turn off the screen. This is a closer match to what a lid switch should be doing. Removed an old feature to bypass keyguard when keyboard is visible because the way it was plumbed in made bad assumptions about the meaning of the lid switch. Also, the last product we shipped that had a physical keyboard turned this config option off. So away it goes. We can bring it back someday if we really want it. It's questionable how useful the feature is anyhow, since it only works when the keyguard is unsecure and when the lid switch is unlikely to be jostled in the user's pocket. Fixed a bug where we would tell the power manager that the keyboard was visible even if the lid switch did not control the keyboard. This used to cause the power manager to try to set the keyboard brightness, which doesn't work. Bug: 6377115 Bug: 6406726 Change-Id: Ic84b71d09563d51c92cd1cf132fa8bdee6509103
2012-04-20Get alias for Bluetooth devices.Jeff Brown
Bluetooth devices can be renamed by the user. Make the input system aware of the user-specified name and transparently pass it down to applications. This enables the keyboard layout picker Settings UI to use device names that are consistent with what the user set in the Bluetooth UI. Bug: 6363157 Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
2012-04-17Support loading keyboard layout overlays from resources.Jeff Brown
Added the concept of a keyboard layout overlay, which is a key character map file that has "type OVERLAY". Added support for loading keyboard layout overlays from resources dynamically. The layouts are reloaded whenever they are changed in the Settings application or an application is installed. This is somewhat more aggressive than necessary so we might want to optimize it later. Before system-ready, the input system uses just the generic keyboard layouts that are included on the device system image. After system-ready, it considers the user's selected keyboard layout overlay and attempts to load it as necessary. We need to wait until system-ready before doing this because we need to be in a state where it is safe to start applications or access their resources. Bug: 6110399 Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
2012-04-17Add persistence for selected keyboard layout.Jeff Brown
Bug: 6110399 Change-Id: I99544bf05e9755385bee478b5f047ccec2e5cae3
2012-04-13Add support for input devices that have vibrators.Jeff Brown
Added a getVibrator() method to InputDevice which returns a Vibrator associated with that input device. Its uses the same API as the system vibrator which makes it easy for applications to be modified to use one or the other. Bug: 6334179 Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
2012-04-12Notify applications when input devices change.Jeff Brown
This change allows the InputManager to keep track of what input devices are registered with the system and when they change. It needs to do this so that it can properly clear its cache of input device properties (especially the key map!) when changes occur. Added new API so that applications can register listeners for input device changes. Fixed a minor bug in EventHub where it didn't handle EPOLLHUP properly so it would spam the log about unsupposed epoll events until inotify noticed that the device was gone and removed it. Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
2012-04-10Request key maps from input manager service.Jeff Brown
Instead of each application loading the KeyCharacterMap from the file system, get them from the input manager service as part of the InputDevice object. Refactored InputManager to be a proper singleton instead of having a bunch of static methods. InputManager now maintains a cache of all InputDevice objects that it has loaded. Currently we never invalidate the cache which can cause InputDevice to return stale motion ranges if the device is reconfigured. This will be fixed in a future change. Added a fake InputDevice with ID -1 to represent the virtual keyboard. Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
2012-04-05Move some APIs from window manager to input manager.Jeff Brown
Simplified input injection API down to just one call. Removed all input state reading API. It was only used by the window manager policy and required a permission that applications could not obtain. READ_INPUT_STATE is now unused and deprecated. Change-Id: I41278141586ddee9468cae0fb59ff0dced6cbc00
2012-04-05Refactor input system into its own service.Jeff Brown
Extracted the input system from the window manager service into a new input manager service. This will make it easier to offer new input-related features to applications. Cleaned up the input manager service JNI layer somewhat to get rid of all of the unnecessary checks for whether the input manager had been initialized. Simplified the callback layer as well. Change-Id: I3175d01307aed1420780d3c093d2694b41edf66e