Lines Matching defs:display

17 package android.hardware.display;
25 import android.hardware.display.DisplayManager;
26 import android.hardware.display.VirtualDisplay;
109 * Ensures that an application can create a private virtual display and show
115 assertNotNull("virtual display must not be null", virtualDisplay);
117 Display display = virtualDisplay.getDisplay();
119 assertDisplayRegistered(display, Display.FLAG_PRIVATE);
121 // Show a private presentation on the display.
123 display, BLUEISH,
128 assertDisplayUnregistered(display);
132 * Ensures that an application can create a private presentation virtual display and show
139 assertNotNull("virtual display must not be null", virtualDisplay);
141 Display display = virtualDisplay.getDisplay();
143 assertDisplayRegistered(display, Display.FLAG_PRIVATE | Display.FLAG_PRESENTATION);
145 // Show a private presentation on the display.
147 display, BLUEISH,
152 assertDisplayUnregistered(display);
156 * Ensures that an application can create a public virtual display and show
168 assertNotNull("virtual display must not be null", virtualDisplay);
170 Display display = virtualDisplay.getDisplay();
172 assertDisplayRegistered(display, Display.FLAG_PRESENTATION);
175 // Show a window on the default display. It should be mirrored to the
176 // virtual display automatically.
182 // Mirroring case with secure window (but display is not secure).
183 // Show a window on the default display. It should be replaced with black on
184 // the virtual display.
185 assertDisplayCanShowPresentation("mirrored secure window on non-secure display",
191 // Show a normal presentation on the display.
193 display, BLUEISH,
196 // Presentation case with secure window (but display is not secure).
197 // Show a normal presentation on the display. It should be replaced with black.
198 assertDisplayCanShowPresentation("secure presentation window on non-secure display",
199 display, Color.BLACK,
205 assertDisplayUnregistered(display);
209 * Ensures that an application can create a secure public virtual display and show
222 assertNotNull("virtual display must not be null", virtualDisplay);
224 Display display = virtualDisplay.getDisplay();
226 assertDisplayRegistered(display, Display.FLAG_PRESENTATION | Display.FLAG_SECURE);
228 // Mirroring case with secure window (and display is secure).
229 // Show a window on the default display. It should be mirrored to the
230 // virtual display automatically.
232 assertDisplayCanShowPresentation("mirrored secure window on secure display",
237 // Presentation case with secure window (and display is secure).
238 // Show a normal presentation on the display.
239 assertDisplayCanShowPresentation("secure presentation window on secure display",
240 display, BLUEISH,
246 assertDisplayUnregistered(display);
249 private void assertDisplayRegistered(Display display, int flags) {
250 assertNotNull("display object must not be null", display);
251 assertTrue("display must be valid", display.isValid());
252 assertTrue("display id must be unique",
253 display.getDisplayId() != Display.DEFAULT_DISPLAY);
254 assertEquals("display must have correct flags", flags, display.getFlags());
255 assertEquals("display name must match supplied name", NAME, display.getName());
257 display.getSize(size);
258 assertEquals("display width must match supplied width", WIDTH, size.x);
259 assertEquals("display height must match supplied height", HEIGHT, size.y);
260 assertEquals("display rotation must be 0",
261 Surface.ROTATION_0, display.getRotation());
262 assertNotNull("display must be registered",
266 assertNotNull("display must be registered as a presentation display",
270 assertNull("display must not be registered as a presentation display",
276 private void assertDisplayUnregistered(Display display) {
277 assertNull("display must no longer be registered after being removed",
279 assertFalse("display must no longer be valid", display.isValid());
282 private void assertDisplayCanShowPresentation(String message, final Display display,
285 assertTrue(message + ": display should not show content before window is shown",
294 presentation[0] = new TestPresentation(getContext(), display,
301 assertTrue(message + ": display should show content after window is shown",
348 public TestPresentation(Context context, Display display,
350 super(context, display);
411 Log.d(TAG, "New image available from virtual display.");
476 // We use this threshold in case the display is being letterboxed when