summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/display/DisplayManagerService.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-12-09DO NOT MERGE: Remove obsolete "headless" supportMike Lockwood
Change-Id: I829fe48e6ebcb819e260646bb19ac6ddfcf07f83
2013-11-21Stop wifi display discovery when no longer needed.Jeff Brown
Keep track of how many clients are requesting scans and scan continuously until all of them are gone then explicitly terminate the scan instead of letting it time out as before. Suspend wifi display scans while connecting or connected to a remote display. This is handled by both the display manager and media router since neither has complete information about what is happening. Much of this code will no longer be needed once wifi display support is integrated directly into the media router service. Ensure that we don't attempt to scan or connect to wifi displays while the wifi display feature is off. Infer when a connection attempt fails and unselect the wifi display route automatically so it doesn't appear to be connecting forever. Fix issues around correctly canceling and retrying connection attempts. Often we would cancel but not retry. Improved connection reliability somewhat. It seems that discovery must already be in progress in order for a connection attempt to succeed. Ensure QuickSettings uses exactly the same logic as the MediaRouteButton to determine when the remote display tile should be made visible. Bug: 11717053 Change-Id: I18afc977b0e8c26204b8c96adaa79f05225f7b6e
2013-11-15Disallow applications from initiating cast screen.Jeff Brown
Only allow the system ui and settings to connect to a remote display. To do this, we essentially hide the remote displays from applications by using the ROUTE_TYPE_REMOTE_DISPLAY then add permission checks around the operations that connect to them. As a bonus, this may actually save power on devices since applications that use MediaRouter will not longer be performing discover on remote display routes at all. Bug: 11257292 Change-Id: I9ea8c568df4df5a0f0cf3d0f11b39c87e2110795
2013-08-23wifi-display: add certification optionsChong Zhang
When certification mode is enabled: - Pass wfd session info to wifi display settings - Allow sink to connect to source - Add interface in display manager for pausing/resuming session - Add interface in WifiP2pManager for setting lc, oc and starting autonomous GO Note that we're compliant regardless of certification mode, but some confusing options (eg. allowing incoming connection from sink) we want to hide when not being tested. Bug: 9371882 Change-Id: Icc7dcae4e046453796cfa03f5f197055fabf234b
2013-08-08Use new ISurfaceComposer::destroyDisplay methodJesse Hall
Bug: 10191053 Change-Id: I3ecc6880db4a4c77c6db4e8b50faa9b4021d17c6
2013-08-07Fix propagation of display overscan information.Jeff Brown
Fix several problems in the way that the overscan was plumbed in which could result in information not being delivered to applications. There was also a violation of certain invariants regarding the immutability of returned DisplayInfo objects. Bug: 10213771 Change-Id: I21184a14305e44278b5e81353bf95d511e8517fb
2013-08-02Add debug message to help diagnose a presentation bug.Jeff Brown
Bug: 10154780 Change-Id: I0e711a6316cb231ec48fc31d87b8cbd5d857c2f8
2013-08-02Support public virtual displays.Jeff Brown
Refactor the new private virtual display API to also support creating public virtual displays with various characteristics. This feature requires special permissions and is only intended for use by the system. Change-Id: I44dd19f37cf76ea6d6e313afe42f4a412bd96663
2013-06-18Add an API to allow for creating private virtual displays.Jeff Brown
This change enables applications to create a private virtual display that renders its content to a surface of its own creation. The display is private in the sense that only the application that owns the display is allowed to place windows upon it. Mirroring and blanking is also disabled for these displays. Bug: 9192512 Change-Id: I852ea07f0c7df1d244e354e3daca3a6960285ca0
2013-05-02Start combining threads in system process.Dianne Hackborn
This introduces four generic thread that services can use in the system process: - Background: part of the framework for all processes, for work that is purely background (no timing constraint). - UI: for time-critical display of UI. - Foreground: normal foreground work. - IO: performing IO operations. I went through and moved services into these threads in the places I felt relatively comfortable about understanding what they are doing. There are still a bunch more we need to look at -- lots of networking stuff left, 3 or so different native daemon connectors which I didn't know how much would block, audio stuff, etc. Also updated Watchdog to be aware of and check these new threads, with a new API for other threads to also participate in this checking. Change-Id: Ie2f11061cebde5f018d7383b3a910fbbd11d5e11
2013-02-19Implement display overscan support.Dianne Hackborn
The window manager now keeps track of the overscan of each display, with an API to set it. The overscan impacts how it positions windows in the display. There is a new set of APIs for windows to say they would like to go into the overscan region. There is a call into the window manager to set the overscan region for a display, and it now has a concept of display settings that it stores presistently. Also added a new "wm" command, moving the window manager specific commands from the "am" command to there and adding a new now to set the overscan region. Change-Id: Id2c8092db64fd0a982274fedac7658d82f30f9ff
2012-12-18Clean up warnings.Craig Mautner
Change-Id: I1dfe21e5f64364c90565b594e28074cabe7daa64
2012-12-04Pin electron beam surface to natural orientation.Jeff Brown
If a rotation occurred while the electron beam surface was showing, the surface may have appeared in the wrong orientation. We fix this problem by adjusting the transformation matrix of the electron beam surface according to the display orientation whenever a display transaction occurs. The rotation itself is allowed to proceed but it is not visible to the user. We must let this happen so that the lock screen is correctly oriented when the screen is turned back on. Note that the electron beam surface serves two purposes. First, it is used to play the screen off animation. When the animation is finished, the surface remains visible but is solid black. Then we turn the screen off. Second, when we turn the screen back on we leave the electron beam surface showing until the window manager is ready to show the new content. This prevents the user from seeing a flash of the old content while the screen is being turned on. When everything is ready, we dismiss the electron beam. It's important for the electron beam to remain visible for the entire duration from just before the screen is turned off until after the screen is turned on and is ready to be seen. This is why we cannot fix the bug by deferring rotation or otherwise getting in the way of the window manager doing what it needs to do to get the screen ready when the screen is turned on again. Bug: 7479740 Change-Id: I2fcf35114ad9b2e00fdfc67793be6df62c8dc4c3
2012-10-17Add special mirroring modes for demonstration purposes.Jeff Brown
Assume rotation of HDMI display is portait. $ adb shell setprop persist.demo.hdmirotation portrait Don't lock rotation while HDMI is plugged in. $ adb shell setprop persist.demo.hdmirotationlock false Hide secondary displays from apps but continue mirroring to them. $ adb shell setprop persist.demo.singledisplay true Bug: 7326281 Change-Id: I8f9a3b0bc19821a3a01043b0f516806dac82ce53
2012-10-16Blank all displays including Wifi Display when screen is off.Jeff Brown
Calling blank() on Surface Flinger to turn the screen off is not enough to ensure that the content is blanked to all virtual displays. What's more, the black surface left in place by the ElectronBeam may not completely hide the content (particularly if the display orientation changes). To fix this for real, we'll want to move the display power management code from the power manager into the display manager but we don't have time for that. As a work around, force all displays to show an empty layer stack with no surfaces on it while blanked. Bug: 7311959 Change-Id: I870c985f9e76f3f2322e5d83cdbbed9ed15b9f10
2012-10-08Blank or unblank all displays as need.Jeff Brown
Ensures that both the internal display and HDMI are blanked or unblanked in tandem. Bug: 7309812 Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
2012-10-01Only inform DisplayManager of visible content.Craig Mautner
WindowManager was notifying DisplayManager of content if any window existed on a display. Now the window must be visible and we must not be showing a Dream or the Keyguard. Bug: 7214060. Change-Id: I9ce4a49aabfbac22ff1e39a837199ce35b9f7503
2012-09-26Allow applications to connect to known wifi displays.Jeff Brown
Bug: 7177920 Change-Id: I9d8406e1016988e2cd267dfa52d78a829f1b385e
2012-09-21Support HDMI hotplug.Jeff Brown
Bug: 7206678 Change-Id: Ia5212b16658a5f5a2ccf8528eca7bebd45ca857a
2012-09-20Provide a debugging option to force enable wifi display.Jeff Brown
Bug: 7179627 Change-Id: I84c7605a1cee5ed723341eebdcec4a824e7e4d38
2012-09-19Add support for remembering Wifi display devices.Jeff Brown
Add a setting to globally disable Wifi display. Fixed a bug where the wifi display broadcast receiver was running on the wrong thread. Removed the wifi-display QuickSettings dialog, all functionality has been moved to Settings. Bug: 7178216 Bug: 7192799 Change-Id: I9796baac8245d664cf28fa147b9ed978d81d8ab9
2012-09-09Disable wifi display API when the adapter is not registered.Jeff Brown
Bug: 7132341 Change-Id: I46d859082077afd2c8adc829ad285977dff80d07
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-09-08Add new wifi display discovery API.Jeff Brown
The API is quite simple. There are a few extra functions on DisplayManager to scan, connect and disconnect from wifi displays and get status, and a single protected broadcast sent when the status changes. Change-Id: Ic91dbab5ee818e790b27fa32e1a1e93788793be0
2012-09-07Make mirroring automatic based on Windows on display.Craig Mautner
Tell the display manager whenever a given logical display contains interesting windows. If so, then the display manager arranges to show that content on a physical display, otherwise it ignores the logical display and makes its associated primary physical display mirror the default display. Assign DisplayContents when Displays are added, remove them when Displays are removed, and update the DisplayInfo when Displays change. Change-Id: I36e08ec538055acabe1e24cdd12c40de4e47a158
2012-09-07Add support for Wifi display.Jeff Brown
Change-Id: I99693786cf9d07d07d3400046c55eb4933730b80
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-29Add initial multi-display support.Jeff Brown
Split the DisplayManager into two parts. One part is bound to a Context and takes care of Display compatibility and caching Display objects on behalf of the Context. The other part is global and takes care of communicating with the DisplayManagerService, handling callbacks, and caching DisplayInfo objects on behalf of the process. Implemented support for enumerating Displays and getting callbacks when displays are added, removed or changed. Elaborated the roles of DisplayManagerService, DisplayAdapter, and DisplayDevice. We now support having multiple display adapters registered, each of which can register multiple display devices and configure them dynamically. Added an OverlayDisplayAdapter which is used to simulate secondary displays by means of overlay windows. Different configurations of overlays can be selected using a new setting in the Developer Settings panel. The overlays can be repositioned and resized by the user for convenience. At the moment, all displays are mirrors of display 0 and no display transformations are applied. This will be improved in future patches. Refactored the way that the window manager creates its threads. The OverlayDisplayAdapter needs to be able to use hardware acceleration so it must share the same UI thread as the Keyguard and window manager policy. We now handle this explicitly as part of starting up the system server. This puts us in a better position to consider how we might want to share (or not share) Loopers among components. Overlay displays are disabled when in safe mode or in only-core mode to reduce the number of dependencies started in these modes. Change-Id: Ic2a661d5448dde01b095ab150697cb6791d69bb5
2012-08-27Add plumbing for new surface flinger display API.Jeff Brown
Cleaned up the implementation of Surface and SurfaceSession to use more consistent naming and structure. Added JNI for all of the new surface flinger display API calls. Enforced the requirement that all Surfaces created by the window manager be named. Updated the display manager service to use the new methods. Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
2012-08-19Improve display manager debugging.Jeff Brown
Change-Id: Iae794fe99a7cf9809f64eafb216091126a2f7e39
2012-08-19Stub out display manager service implementation.Jeff Brown
Reverting to the previous stub as the display adapter registration and the logical to physical mapping is not at all what we are going to need moving forward. Fixed up the service initialization order so that the display manager service has a context from the start. Change-Id: I717f2f1099c7a77180ef207c371ec8329258850a
2012-08-02Add features to DisplayManager.Craig Mautner
Added Surface.setDisplayId(). Added callbacks to DisplayManagerService. Change-Id: Idd3f85f8ca1f1208962f1196efd6a3ab51c8c259
2012-08-02Refactor DisplayManagerService to be functional.Craig Mautner
Change-Id: Ieac1eca172be5dc5db45302d3afa26188acd4d6d
2012-08-01Start moving away from DisplayMetrics.DENSITY_DEVICE.Dianne Hackborn
This puts in most of the infrastructure needed to allow us to switch between different densities at run time. The main remaining uses of the global are to initialize the Bitmap object (not sure what to do about that since it doesn't have anything passed in the constructor to get this information from), and being able to load drawables if we need a different density than what was preloaded by zygote. Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
2012-07-25Add display manager skeleton.Jeff Brown
The purpose of this change is to remove direct reliance on SurfaceFlinger for describing the size and characteristics of displays. This patch also starts to make a distinction between logical displays and physical display devices. Currently, the window manager owns the concept of a logical display whereas the new display manager owns the concept of a physical display device. Change-Id: I7e0761f83f033be6c06fd1041280c21500bcabc0