73 Commits

Author SHA1 Message Date
Dianne Hackborn
c652de8141 Implement display overscan support.
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
2013-02-19 12:08:58 -08:00
Mathias Agopian
3866f0d581 split Surface in two classes: SurfaceControl and Surface
SurfaceControl is the window manager side; it can
control the attributes of a surface but cannot push buffers
to it. Surface on the other hand is the application (producer)
side and is used to push buffers to the surface.

Change-Id: Ib6754c968924e87e8dd02a2073c7a447f729f4dd
2013-02-14 12:19:11 -08:00
Craig Mautner
0bf6ec9e37 Clean up warnings.
Change-Id: I1dfe21e5f64364c90565b594e28074cabe7daa64
2012-12-18 10:03:21 -08:00
Jeff Brown
384e6fe84d am 1edc6111: am 61e21940: am 7fcb5dc5: Merge "Pin electron beam surface to natural orientation." into jb-mr1.1-dev
* commit '1edc61119d145b05f0b5e1323a2fc0fa6a29d4bc':
  Pin electron beam surface to natural orientation.
2012-12-05 12:28:25 -08:00
Jeff Brown
7f3994ec2a Pin electron beam surface to natural orientation.
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-12-04 14:40:23 -08:00
Irfan Sheriff
4d14f6bb81 am 61b00239: am 0cec3de3: am b4d5a9e7: Merge "WFD: Fallback to PIN mode if PBC is not supported" into jb-mr1.1-dev
* commit '61b00239dda1d0c5e7c34e88ad9f56817543d0b8':
  WFD: Fallback to PIN mode if PBC is not supported
2012-11-29 14:32:33 -08:00
Irfan Sheriff
6681be2787 WFD: Fallback to PIN mode if PBC is not supported
Bug: 7627641
Change-Id: Ibba6114f907c67f1cb60c460d5b65479f2d1b148
2012-11-28 15:54:06 -08:00
Jesse Hall
9a2609f76e Merge "Handle hotplug events as described instead of rescanning" 2012-11-15 09:33:40 -08:00
Jesse Hall
e244db42da Handle hotplug events as described instead of rescanning
Hotplug events say which display they're for and whether the display
was connected or disconnected. Before, this info was ignored, and the
event just triggered a rescan of all displays. If a display was
disconnected and then reconnected quickly, the rescan would treat this
as a no-op or a device property change and wouldn't turn the display
on.

Now the display manager attempts to update its state with the change
the event describes. So a quick disconnect/connect cycle will cause
the display to be turned on since the display manager will have
updated its internal state to reflect the disconnect event, and will
treat the connect event as a new display rather than a device property
change.

Bug: 7491120
Change-Id: If16268fbd0708683f6401ea72fbee9fb2c3c8d19
2012-11-14 22:55:09 -08:00
Jeff Brown
74da109102 Support Wifi display devices that rename themselves.
Some Wifi display devices like to rename themselves after a
connection completes (or at other times).  Make sure to update
the name of the display when we detect that it changed in
our scan results.

This problem is somewhat complicated by the fact that we remember
the display name persistently, so we need to update our list
of remembered displays too.

Improve the state machine to avoid redundant attempts to
disconnect or cancel connection.

Bug: 7478895
Change-Id: I35a9e2c6a8deadbe892dacd5e3b4a5a2b12d6cf0
2012-11-07 18:43:32 -08:00
Jeff Brown
92130f6407 Add MediaRouter API to get presentation display.
This new API makes it possible for an application to ask on
which Display it should show a Presentation based on the currently
selected media route.

Also added a new API on DisplayManager to query displays that
support a certain category of uses.

Improved the documentation of the Presentation class to explain
how to choose an appropriate Display for presentation.

Bug: 7409073
Change-Id: Iab451215e570ae55f3718fc228303143c800fe51
2012-10-25 20:31:21 -07:00
Jeff Brown
f0681b34df Secure windows, secure surface views and secure displays.
Add new API to determine whether a display is secure.
Add new API to make a SurfaceView secure.
Clarify documentation.

Bug: 7368436
Change-Id: I7068c34c910e43b4bc72e43fa0dded59a25f0fe2
2012-10-23 20:37:40 -07:00
Jamie Gennis
7bbf8163fb Set the secureness when creating displays
This change makes use of the new 'secure' argument to the
ISurfaceComposer::createDisplay method.  In this change both the overlay and
wifi displays are hard-coded to be non-secure displays.

Bug: 7368436
Change-Id: Ib65312f2adab5104d8deefbfc32af9dc106a9129
2012-10-19 18:34:35 -07:00
Jeff Brown
6669250034 Fix deadlock.
The display manager must never call into the activity manager with
its lock held.  Make it clear that the adapters are constructed
while holding the syncroot lock.

Bug: 7377631
Change-Id: I1557313cbb31dcad9b5a46919a88a5a1c1af3e9b
2012-10-18 17:37:39 -07:00
Jeff Brown
27f1d674bf Add special mirroring modes for demonstration purposes.
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-17 18:41:31 -07:00
Jeff Brown
a7f9c966bc Add a notification icon when connected to wireless display.
Bug: 7350174
Change-Id: I18481e2a1445b0aa3340e5d9b02511394521e50e
2012-10-17 15:50:06 -07:00
Jeff Brown
8ec0943a79 Blank all displays including Wifi Display when screen is off.
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-16 16:19:23 -07:00
Jeff Brown
ee4f029ff4 Update wifi display device name when renamed.
Bug: 7340725
Change-Id: Ia3835a37fa3800371920f863b82f992efe764664
2012-10-15 15:31:59 -07:00
Jeff Brown
2444ae7e2b Ensure MediaRouter correctly handles renamed Wifi displays.
Fix a couple of bugs that cause MediaRouter to disconnect from
the current Wifi display whenever it is renamed.

Added an extra check in WifiDisplayAdapter for identity renames.
The Settings app already handles this case but it's good to have
the service check for it as well so we don't store unnecessary
aliases.

Bug: 7310777
Change-Id: I8fddd32ca59f9b798ee31b467b81457508c345f8
2012-10-11 14:30:21 -07:00
Jeff Brown
9e316a1a2a Blank or unblank all displays as need.
Ensures that both the internal display and HDMI are blanked
or unblanked in tandem.

Bug: 7309812
Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
2012-10-08 19:23:15 -07:00
Jeff Brown
031e9d2e21 Merge changes I0ed9ba00,Ia8c6d7fe into jb-mr1-dev
* changes:
  Fix bug removing all windows that belong to a display.
  Add some missing debug output.
2012-10-02 17:08:07 -07:00
Jeff Brown
bcbe9cf475 Merge "Add new Display API for secure video capabilities." into jb-mr1-dev 2012-10-02 16:39:08 -07:00
Jeff Brown
77aebfdbae Add new Display API for secure video capabilities.
Added a new API to determine whether the display supports
protected buffers so that an application can choose a different
content stream or change how it decodes the content so
that it will be viewable on the display.

At present, wifi display does not fully support protected
buffers although this may be enhanced in the future.

Bug: 6986623
Change-Id: If53a53d72b0ec92753cc4b29f99fcb131e00449b
2012-10-02 16:25:10 -07:00
Jeff Brown
c2726643e7 Add some missing debug output.
Bug: 7257579
Change-Id: Ia8c6d7fefe6d4c4e6c37f20722c7ffce4bcfcbae
2012-10-02 16:25:10 -07:00
Craig Mautner
d5523dc7b7 Call Surface.destroy when Display is removed.
Prevents leaked Surfaces.

Bug: 7272421.
Change-Id: I6c87eb11bb0bedcf8de451b04477c70c248f905d
2012-10-02 15:28:09 -07:00
Irfan Sheriff
56925d65fd Always update peer list in display controller
Display controller should always stay in sync with peer list to avoid
showing incorrect available status on peers which would
cause connectivity issues.

Bug: 7268307
Change-Id: If04644339c1ee3f567939e4441dd6f6a45e4179a
2012-10-01 23:01:57 -07:00
Craig Mautner
65d11b3eef Only inform DisplayManager of visible content.
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-10-01 13:59:52 -07:00
Jeff Brown
bc33545746 Allow applications to connect to known wifi displays.
Bug: 7177920
Change-Id: I9d8406e1016988e2cd267dfa52d78a829f1b385e
2012-09-26 18:34:47 -07:00
Jeff Brown
d49359631b Handle user switched for settings changes.
Move OVERLAY_DISPLAY_DEVICES to Global.

Bug: 7127417
Change-Id: I632648ac5b01408512f59424f3bb55162431bea4
2012-09-25 15:26:51 -07:00
Irfan Sheriff
916b2b5a93 Merge "Increase WFD connect time out to 60s" into jb-mr1-dev 2012-09-23 17:32:07 -07:00
Irfan Sheriff
2c2ca5cb7c Increase WFD connect time out to 60s
The worst case WPS timeout for GO negotiation is two minutes.
Until, we better handle cancelling/disconnecting and re-syncing the
WFD framework with the wifi direct framework/supplicant, increase
the time out to 60s to help with dogfood

Bug: 7217600
Change-Id: I1ba0d9963b957454e2c6f47bfdf05176dea07be7
2012-09-23 17:30:19 -07:00
Jeff Brown
e87bf03076 Support HDMI hotplug.
Bug: 7206678
Change-Id: Ia5212b16658a5f5a2ccf8528eca7bebd45ca857a
2012-09-21 15:34:32 -07:00
Irfan Sheriff
957fadc500 Merge "Use min group owner intent for concurrency" into jb-mr1-dev 2012-09-20 18:05:22 -07:00
Irfan Sheriff
99766cf40e Use min group owner intent for concurrency
Our device only supports STA & GC concurrency

Change-Id: I4f16c959a6f4e7ad5610dcae67be830d741f162c
2012-09-20 17:18:20 -07:00
Jeff Brown
bbd28a293f Provide a debugging option to force enable wifi display.
Bug: 7179627
Change-Id: I84c7605a1cee5ed723341eebdcec4a824e7e4d38
2012-09-20 16:47:15 -07:00
Jeff Brown
c2b9ea6241 Make wifi display state changes more robust.
Bug: 7178216
Change-Id: Icceaeb61730b0b4916cdda44459f4c69553e303c
2012-09-19 23:15:26 -07:00
Jeff Brown
89d5546d7f Add support for remembering Wifi display devices.
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-19 22:04:44 -07:00
Irfan Sheriff
24ed276913 Merge "WFD fixes" into jb-mr1-dev 2012-09-18 12:22:06 -07:00
Irfan Sheriff
e0c28d5f13 WFD fixes
- Specificy max GO intent for WFD
- Increase GO idle time out to 20s and use it for GO and client
- Fix connection broadcast

Change-Id: Ia0e28bc9eb3e23d2830a6c814c5a537ca0bcd5db
2012-09-18 12:20:37 -07:00
Dave Burke
049dd8e6a3 Merge "Revert "Specify max go intent for wifi display"" into jb-mr1-dev 2012-09-17 18:58:11 -07:00
Dave Burke
ee261a5a6c Revert "Specify max go intent for wifi display"
This reverts commit 7ab7260697de617aced0b0ba594304a42e5395bd

Change-Id: I5b322f41729695465b164e1dfe6d4b1902cd8117
2012-09-17 18:56:19 -07:00
Irfan Sheriff
218e2f199b Merge "Specify max go intent for wifi display" into jb-mr1-dev 2012-09-17 17:37:48 -07:00
Irfan Sheriff
7ab7260697 Specify max go intent for wifi display
For p2p and sta single channel concurrency, we need the device
to be a GO

Change-Id: I8c3f180b8fc450238e24dace478f03cdf4e370a7
2012-09-17 17:34:03 -07:00
Jeff Brown
c9bd4ca005 Swap remote submix initialization order.
Need to turn the submix on before connecting and off
after disconnecting.

Change-Id: I53389c3b61e6d663855accd0461eed42a67d9d2b
2012-09-17 12:24:43 -07:00
Jeff Brown
5380a064c3 Eat copy pasta.
Change-Id: I74cbad279c15f1999cc68d732fc04d6c448b5c39
2012-09-13 19:24:57 -07:00
Jeff Brown
cdfc56a387 Merge "Add preliminary API for reporting display capabilities." into jb-mr1-dev 2012-09-13 15:34:51 -07:00
Jeff Brown
c5df37c285 Add preliminary API for reporting display capabilities.
Change-Id: Ie18dce5b5d130f9a7cdfca08cddbf9b099312277
2012-09-13 11:45:07 -07:00
Jeff Brown
88469e56c8 Enable remote submix for wifi display.
Change-Id: Ib6cad4ecfed91abf835555a1089a206ee9b0763c
2012-09-12 16:03:11 -07:00
Jeff Brown
f8f0eddd07 Improve reporting of wifi connection state.
We should only report that the wifi display is connected
after the RTSP connection has been fully established.

Change-Id: Ifc6bc5d5cebd42d551026885b31cbc74b7ece2b1
2012-09-11 17:05:11 -07:00
Jeff Brown
59c53c6224 Don't auto-discover peers until scan requested.
Change-Id: I4ad08873567a5ac86e9bd46abd2375b183e2e95b
2012-09-11 12:21:55 -07:00