87 Commits

Author SHA1 Message Date
Chong Zhang
e38af818b1 wifi-display: add a global setting to force WPS config method
Bug: 9371882
Change-Id: I7417535f12fa5b75be471974250cfd13e45f87b2
2013-08-30 10:40:35 -07:00
Chong Zhang
72193e1f32 wifi-display: disable WFD IE when Wifi display is turned off
Change-Id: Ibd7e3a59f7988975b4ac6c7efdba2b545097a2bd
2013-08-29 15:42:58 -07:00
Chong Zhang
1f3ecaae63 wifi-display: add certification options
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-23 16:02:09 -07:00
Jeff Brown
f15ef4b02c Remove setRemoteSubmixOn method.
The submix will be controlled automatically from now on based on
whether there is an active audio recorder.

Bug: 10265163
Change-Id: I90a8592136c6507680e70f054243df70cc82efad
2013-08-16 20:21:09 -07:00
Jesse Hall
6a6bc216d1 Use new ISurfaceComposer::destroyDisplay method
Bug: 10191053
Change-Id: I3ecc6880db4a4c77c6db4e8b50faa9b4021d17c6
2013-08-08 15:44:15 -07:00
Jeff Brown
ef981a40aa Fix propagation of display overscan information.
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-07 14:33:50 -07:00
Jeff Brown
33041bd903 Add debug message to help diagnose a presentation bug.
Bug: 10154780
Change-Id: I0e711a6316cb231ec48fc31d87b8cbd5d857c2f8
2013-08-02 21:11:14 -07:00
Jeff Brown
7d00affce6 Support public virtual displays.
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-08-02 21:11:07 -07:00
Jeff Brown
040f44d0eb Add support for secure overlay displays for development.
Change-Id: I426115ec5a3fbda52a481097731abc8b3d9013a4
2013-08-02 19:44:19 -07:00
Jeff Brown
a506a6ec94 Add an API to allow for creating private virtual displays.
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-06-18 15:32:41 -07:00
Chong Zhang
ab87a63997 MediaRouter: grey out wifi displays that's in use
bug 9229799

Change-Id: I9f5fd2107f60c492d42c74e575e6483838a51267
2013-06-13 20:17:39 -07:00
Chong Zhang
21f603996e wifi-display: set display to unavailable if p2p device is unavailable
Bug 9229799

Change-Id: I680015943f40cded45645dfa0eae42bbce5ce9a3
2013-06-06 15:49:16 -07:00
Dianne Hackborn
8d044e8bc2 Start combining threads in system process.
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-05-02 17:42:40 -07:00
Jeff Brown
f110a3701b Sent hint to Wifi driver when enabling WFD.
Bug: 8521148
Change-Id: I53b4cf7a3714b28f9df457e559abe92711c02cef
2013-04-17 20:25:36 -07:00
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