VirtualDisplaypublic final class VirtualDisplay extends Object Represents a virtual display. The content of a virtual display is rendered to a
{@link android.view.Surface} that you must provide to {@link DisplayManager#createVirtualDisplay
createVirtualDisplay()}.
Because a virtual display renders to a surface provided by the application, it will be
released automatically when the process terminates and all remaining windows on it will
be forcibly removed. However, you should also explicitly call {@link #release} when
you're done with it.
|
Fields Summary |
---|
private final DisplayManagerGlobal | mGlobal | private final android.view.Display | mDisplay | private IVirtualDisplayCallback | mToken | private android.view.Surface | mSurface |
Methods Summary |
---|
public android.view.Display | getDisplay()Gets the virtual display.
return mDisplay;
| public android.view.Surface | getSurface()Gets the surface that backs the virtual display.
return mSurface;
| public void | release()Releases the virtual display and destroys its underlying surface.
All remaining windows on the virtual display will be forcibly removed
as part of releasing the virtual display.
if (mToken != null) {
mGlobal.releaseVirtualDisplay(mToken);
mToken = null;
}
| public void | resize(int width, int height, int densityDpi)Asks the virtual display to resize.
This is really just a convenience to allow applications using
virtual displays to adapt to changing conditions without having
to tear down and recreate the display.
mGlobal.resizeVirtualDisplay(mToken, width, height, densityDpi);
| public void | setSurface(android.view.Surface surface)Sets the surface that backs the virtual display.
Detaching the surface that backs a virtual display has a similar effect to
turning off the screen.
It is still the caller's responsibility to destroy the surface after it has
been detached.
if (mSurface != surface) {
mGlobal.setVirtualDisplaySurface(mToken, surface);
mSurface = surface;
}
| public java.lang.String | toString()
return "VirtualDisplay{display=" + mDisplay + ", token=" + mToken
+ ", surface=" + mSurface + "}";
|
|