blob: 4742a73b17a89947ad6639e51888845edd0f0215 [file] [log] [blame]
Santos Cordonee8931e2017-04-05 10:31:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package com.android.server.display;
18
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010019import static com.android.server.display.VirtualDisplayAdapter.UNIQUE_ID_PREFIX;
20
Kevin DuBoisbf76b11b2018-09-04 09:14:15 -070021import static org.junit.Assert.assertEquals;
22import static org.junit.Assert.assertNotNull;
23import static org.junit.Assert.assertTrue;
24import static org.junit.Assert.fail;
25import static org.mockito.Mockito.mock;
26import static org.mockito.Mockito.verify;
27import static org.mockito.Mockito.when;
28
Santos Cordonee8931e2017-04-05 10:31:15 -070029import android.content.Context;
Dan Gittik122df862018-03-28 16:59:22 +010030import android.hardware.display.BrightnessConfiguration;
31import android.hardware.display.Curve;
Santos Cordonee8931e2017-04-05 10:31:15 -070032import android.hardware.display.DisplayManager;
33import android.hardware.display.DisplayViewport;
Kevin DuBoisbf76b11b2018-09-04 09:14:15 -070034import android.hardware.display.DisplayedContentSample;
35import android.hardware.display.DisplayedContentSamplingAttributes;
Santos Cordonee8931e2017-04-05 10:31:15 -070036import android.hardware.display.IVirtualDisplayCallback;
37import android.hardware.input.InputManagerInternal;
38import android.os.Handler;
39import android.os.IBinder;
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010040import android.view.Display;
41import android.view.DisplayInfo;
Santos Cordonee8931e2017-04-05 10:31:15 -070042import android.view.SurfaceControl;
Santos Cordonee8931e2017-04-05 10:31:15 -070043
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010044import androidx.test.InstrumentationRegistry;
45import androidx.test.filters.SmallTest;
Kevin DuBoisbf76b11b2018-09-04 09:14:15 -070046import androidx.test.runner.AndroidJUnit4;
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010047
Santos Cordonee8931e2017-04-05 10:31:15 -070048import com.android.server.LocalServices;
Santos Cordonc22c5632017-06-21 16:03:49 -070049import com.android.server.SystemService;
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -040050import com.android.server.display.DisplayDeviceInfo;
Santos Cordonee8931e2017-04-05 10:31:15 -070051import com.android.server.display.DisplayManagerService.SyncRoot;
Santos Cordonc22c5632017-06-21 16:03:49 -070052import com.android.server.lights.LightsManager;
Adrian Roose99bc052017-11-20 17:55:31 +010053import com.android.server.wm.WindowManagerInternal;
Santos Cordonee8931e2017-04-05 10:31:15 -070054
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010055import org.junit.Before;
56import org.junit.Test;
57import org.junit.runner.RunWith;
Santos Cordonee8931e2017-04-05 10:31:15 -070058import org.mockito.ArgumentCaptor;
59import org.mockito.Mock;
60import org.mockito.MockitoAnnotations;
61
62import java.util.List;
Kevin DuBoisbf76b11b2018-09-04 09:14:15 -070063import java.util.stream.LongStream;
Santos Cordonee8931e2017-04-05 10:31:15 -070064
65@SmallTest
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010066@RunWith(AndroidJUnit4.class)
67public class DisplayManagerServiceTest {
Santos Cordonc22c5632017-06-21 16:03:49 -070068 private static final int MSG_REGISTER_DEFAULT_DISPLAY_ADAPTERS = 1;
69 private static final long SHORT_DEFAULT_DISPLAY_TIMEOUT_MILLIS = 10;
70
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +010071 private Context mContext;
72
Santos Cordonc22c5632017-06-21 16:03:49 -070073 private final DisplayManagerService.Injector mShortMockedInjector =
74 new DisplayManagerService.Injector() {
75 @Override
76 VirtualDisplayAdapter getVirtualDisplayAdapter(SyncRoot syncRoot,
77 Context context, Handler handler, DisplayAdapter.Listener listener) {
78 return mMockVirtualDisplayAdapter;
79 }
80
81 @Override
82 long getDefaultDisplayDelayTimeout() {
83 return SHORT_DEFAULT_DISPLAY_TIMEOUT_MILLIS;
84 }
85 };
86 private final DisplayManagerService.Injector mBasicInjector =
87 new DisplayManagerService.Injector() {
88 @Override
89 VirtualDisplayAdapter getVirtualDisplayAdapter(SyncRoot syncRoot,
90 Context context, Handler handler,
91 DisplayAdapter.Listener displayAdapterListener) {
92 return new VirtualDisplayAdapter(syncRoot, context, handler,
93 displayAdapterListener,
94 (String name, boolean secure) -> mMockDisplayToken);
95 }
96 };
97
Santos Cordonee8931e2017-04-05 10:31:15 -070098 @Mock InputManagerInternal mMockInputManagerInternal;
99 @Mock IVirtualDisplayCallback.Stub mMockAppToken;
100 @Mock WindowManagerInternal mMockWindowManagerInternal;
Santos Cordonc22c5632017-06-21 16:03:49 -0700101 @Mock LightsManager mMockLightsManager;
Santos Cordonee8931e2017-04-05 10:31:15 -0700102 @Mock VirtualDisplayAdapter mMockVirtualDisplayAdapter;
103 @Mock IBinder mMockDisplayToken;
104
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100105 @Before
106 public void setUp() throws Exception {
Santos Cordonee8931e2017-04-05 10:31:15 -0700107 MockitoAnnotations.initMocks(this);
Santos Cordonee8931e2017-04-05 10:31:15 -0700108
109 LocalServices.removeServiceForTest(InputManagerInternal.class);
110 LocalServices.addService(InputManagerInternal.class, mMockInputManagerInternal);
111 LocalServices.removeServiceForTest(WindowManagerInternal.class);
112 LocalServices.addService(WindowManagerInternal.class, mMockWindowManagerInternal);
Santos Cordonc22c5632017-06-21 16:03:49 -0700113 LocalServices.removeServiceForTest(LightsManager.class);
114 LocalServices.addService(LightsManager.class, mMockLightsManager);
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100115
116 mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
Santos Cordonee8931e2017-04-05 10:31:15 -0700117 }
118
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100119 @Test
120 public void testCreateVirtualDisplay_sentToInputManager() {
Santos Cordonc22c5632017-06-21 16:03:49 -0700121 DisplayManagerService displayManager =
122 new DisplayManagerService(mContext, mBasicInjector);
123 registerDefaultDisplays(displayManager);
124 displayManager.systemReady(false /* safeMode */, true /* onlyCore */);
125 displayManager.windowManagerAndInputReady();
126
Santos Cordonee8931e2017-04-05 10:31:15 -0700127 // This is effectively the DisplayManager service published to ServiceManager.
Santos Cordonc22c5632017-06-21 16:03:49 -0700128 DisplayManagerService.BinderService bs = displayManager.new BinderService();
Santos Cordonee8931e2017-04-05 10:31:15 -0700129
130 String uniqueId = "uniqueId --- Test";
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100131 String uniqueIdPrefix = UNIQUE_ID_PREFIX + mContext.getPackageName() + ":";
Santos Cordonee8931e2017-04-05 10:31:15 -0700132 int width = 600;
133 int height = 800;
134 int dpi = 320;
135 int flags = DisplayManager.VIRTUAL_DISPLAY_FLAG_SUPPORTS_TOUCH;
136
137 when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
138 int displayId = bs.createVirtualDisplay(mMockAppToken /* callback */,
139 null /* projection */, "com.android.frameworks.servicestests",
140 "Test Virtual Display", width, height, dpi, null /* surface */, flags /* flags */,
141 uniqueId);
142
Robert Carrae606b42018-02-15 15:36:23 -0800143 displayManager.performTraversalInternal(mock(SurfaceControl.Transaction.class));
Santos Cordonee8931e2017-04-05 10:31:15 -0700144
145 // flush the handler
Santos Cordonc22c5632017-06-21 16:03:49 -0700146 displayManager.getDisplayHandler().runWithScissors(() -> {}, 0 /* now */);
Santos Cordonee8931e2017-04-05 10:31:15 -0700147
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100148 ArgumentCaptor<List<DisplayViewport>> viewportCaptor = ArgumentCaptor.forClass(List.class);
149 verify(mMockInputManagerInternal).setDisplayViewports(viewportCaptor.capture());
150 List<DisplayViewport> viewports = viewportCaptor.getValue();
Santos Cordonee8931e2017-04-05 10:31:15 -0700151
Arthur Hung41e81e72018-10-31 18:04:56 +0800152 // Expect to receive 2 viewports: internal, and virtual
153 assertEquals(2, viewports.size());
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100154
155 DisplayViewport virtualViewport = null;
156 DisplayViewport internalViewport = null;
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100157 for (int i = 0; i < viewports.size(); i++) {
158 DisplayViewport v = viewports.get(i);
159 switch (v.type) {
160 case DisplayViewport.VIEWPORT_INTERNAL: {
161 internalViewport = v;
162 break;
163 }
164 case DisplayViewport.VIEWPORT_EXTERNAL: {
Arthur Hung41e81e72018-10-31 18:04:56 +0800165 fail("EXTERNAL viewport should not exist.");
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100166 break;
167 }
168 case DisplayViewport.VIEWPORT_VIRTUAL: {
169 virtualViewport = v;
170 break;
171 }
172 }
173 }
Arthur Hung41e81e72018-10-31 18:04:56 +0800174 // INTERNAL viewport gets created upon access.
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100175 assertNotNull(internalViewport);
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100176 assertNotNull(virtualViewport);
177
Arthur Hung41e81e72018-10-31 18:04:56 +0800178 // INTERNAL
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100179 assertTrue(internalViewport.valid);
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100180
181 // VIRTUAL
182 assertEquals(height, virtualViewport.deviceHeight);
183 assertEquals(width, virtualViewport.deviceWidth);
184 assertEquals(uniqueIdPrefix + uniqueId, virtualViewport.uniqueId);
185 assertEquals(displayId, virtualViewport.displayId);
Santos Cordonee8931e2017-04-05 10:31:15 -0700186 }
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400187
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100188 @Test
189 public void testPhysicalViewports() {
190 DisplayManagerService displayManager =
191 new DisplayManagerService(mContext, mBasicInjector);
192 registerDefaultDisplays(displayManager);
193 displayManager.systemReady(false /* safeMode */, true /* onlyCore */);
194 displayManager.windowManagerAndInputReady();
195
196 // This is effectively the DisplayManager service published to ServiceManager.
197 DisplayManagerService.BinderService bs = displayManager.new BinderService();
198
199 when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
200
201 final int displayIds[] = bs.getDisplayIds();
202 assertEquals(1, displayIds.length);
203 final int displayId = displayIds[0];
204 DisplayInfo info = bs.getDisplayInfo(displayId);
205 assertEquals(info.type, Display.TYPE_BUILT_IN);
206
207 displayManager.performTraversalInternal(mock(SurfaceControl.Transaction.class));
208
209 // flush the handler
210 displayManager.getDisplayHandler().runWithScissors(() -> {}, 0 /* now */);
211
212 ArgumentCaptor<List<DisplayViewport>> viewportCaptor = ArgumentCaptor.forClass(List.class);
213 verify(mMockInputManagerInternal).setDisplayViewports(viewportCaptor.capture());
214 List<DisplayViewport> viewports = viewportCaptor.getValue();
215
Arthur Hung41e81e72018-10-31 18:04:56 +0800216 // Expect to receive actual viewports: 1 internal
217 assertEquals(1, viewports.size());
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100218
Arthur Hung41e81e72018-10-31 18:04:56 +0800219 DisplayViewport internalViewport = viewports.get(0);
220
221 // INTERNAL is the only one actual display.
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100222 assertNotNull(internalViewport);
Arthur Hung41e81e72018-10-31 18:04:56 +0800223 assertEquals(DisplayViewport.VIEWPORT_INTERNAL, internalViewport.type);
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100224 assertTrue(internalViewport.valid);
225 assertEquals(displayId, internalViewport.displayId);
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100226 }
227
228 @Test
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400229 public void testCreateVirtualDisplayRotatesWithContent() throws Exception {
Santos Cordonc22c5632017-06-21 16:03:49 -0700230 DisplayManagerService displayManager =
231 new DisplayManagerService(mContext, mBasicInjector);
232 registerDefaultDisplays(displayManager);
233
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400234 // This is effectively the DisplayManager service published to ServiceManager.
Santos Cordonc22c5632017-06-21 16:03:49 -0700235 DisplayManagerService.BinderService bs = displayManager.new BinderService();
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400236
237 String uniqueId = "uniqueId --- Rotates With Content Test";
238 int width = 600;
239 int height = 800;
240 int dpi = 320;
241 int flags = DisplayManager.VIRTUAL_DISPLAY_FLAG_ROTATES_WITH_CONTENT;
242
243 when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
244 int displayId = bs.createVirtualDisplay(mMockAppToken /* callback */,
245 null /* projection */, "com.android.frameworks.servicestests",
246 "Test Virtual Display", width, height, dpi, null /* surface */, flags /* flags */,
247 uniqueId);
248
Robert Carrae606b42018-02-15 15:36:23 -0800249 displayManager.performTraversalInternal(mock(SurfaceControl.Transaction.class));
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400250
251 // flush the handler
Santos Cordonc22c5632017-06-21 16:03:49 -0700252 displayManager.getDisplayHandler().runWithScissors(() -> {}, 0 /* now */);
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400253
Santos Cordonc22c5632017-06-21 16:03:49 -0700254 DisplayDeviceInfo ddi = displayManager.getDisplayDeviceInfoInternal(displayId);
Alex Sakhartchouk879d24f2017-06-20 22:01:19 -0400255 assertNotNull(ddi);
256 assertTrue((ddi.flags & DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT) != 0);
257 }
Santos Cordonc22c5632017-06-21 16:03:49 -0700258
259 /**
260 * Tests that the virtual display is created along-side the default display.
261 */
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100262 @Test
Santos Cordonc22c5632017-06-21 16:03:49 -0700263 public void testStartVirtualDisplayWithDefaultDisplay_Succeeds() throws Exception {
264 DisplayManagerService displayManager =
265 new DisplayManagerService(mContext, mShortMockedInjector);
266 registerDefaultDisplays(displayManager);
267 displayManager.onBootPhase(SystemService.PHASE_WAIT_FOR_DEFAULT_DISPLAY);
268 }
269
270 /**
271 * Tests that we get a Runtime exception when we cannot initialize the default display.
272 */
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100273 @Test
Santos Cordonc22c5632017-06-21 16:03:49 -0700274 public void testStartVirtualDisplayWithDefDisplay_NoDefaultDisplay() throws Exception {
275 DisplayManagerService displayManager =
276 new DisplayManagerService(mContext, mShortMockedInjector);
277 Handler handler = displayManager.getDisplayHandler();
278 handler.runWithScissors(() -> {}, 0 /* now */);
279
280 try {
281 displayManager.onBootPhase(SystemService.PHASE_WAIT_FOR_DEFAULT_DISPLAY);
282 } catch (RuntimeException e) {
283 return;
284 }
285 fail("Expected DisplayManager to throw RuntimeException when it cannot initialize the"
286 + " default display");
287 }
288
289 /**
290 * Tests that we get a Runtime exception when we cannot initialize the virtual display.
291 */
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100292 @Test
Santos Cordonc22c5632017-06-21 16:03:49 -0700293 public void testStartVirtualDisplayWithDefDisplay_NoVirtualDisplayAdapter() throws Exception {
294 DisplayManagerService displayManager = new DisplayManagerService(mContext,
295 new DisplayManagerService.Injector() {
296 @Override
297 VirtualDisplayAdapter getVirtualDisplayAdapter(SyncRoot syncRoot,
298 Context context, Handler handler, DisplayAdapter.Listener listener) {
299 return null; // return null for the adapter. This should cause a failure.
300 }
301
302 @Override
303 long getDefaultDisplayDelayTimeout() {
304 return SHORT_DEFAULT_DISPLAY_TIMEOUT_MILLIS;
305 }
306 });
307 try {
308 displayManager.onBootPhase(SystemService.PHASE_WAIT_FOR_DEFAULT_DISPLAY);
309 } catch (RuntimeException e) {
310 return;
311 }
312 fail("Expected DisplayManager to throw RuntimeException when it cannot initialize the"
313 + " virtual display adapter");
314 }
315
Dan Gittik122df862018-03-28 16:59:22 +0100316 /**
317 * Tests that an exception is raised for too dark a brightness configuration.
318 */
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100319 @Test
Dan Gittik122df862018-03-28 16:59:22 +0100320 public void testTooDarkBrightnessConfigurationThrowException() {
321 DisplayManagerService displayManager =
322 new DisplayManagerService(mContext, mShortMockedInjector);
323 Curve minimumBrightnessCurve = displayManager.getMinimumBrightnessCurveInternal();
324 float[] lux = minimumBrightnessCurve.getX();
325 float[] minimumNits = minimumBrightnessCurve.getY();
326 float[] nits = new float[minimumNits.length];
327 // For every control point, assert that making it slightly lower than the minimum throws an
328 // exception.
329 for (int i = 0; i < nits.length; i++) {
330 for (int j = 0; j < nits.length; j++) {
331 nits[j] = minimumNits[j];
332 if (j == i) {
333 nits[j] -= 0.1f;
334 }
335 if (nits[j] < 0) {
336 nits[j] = 0;
337 }
338 }
339 BrightnessConfiguration config =
340 new BrightnessConfiguration.Builder(lux, nits).build();
341 Exception thrown = null;
342 try {
343 displayManager.validateBrightnessConfiguration(config);
344 } catch (IllegalArgumentException e) {
345 thrown = e;
346 }
347 assertNotNull("Building too dark a brightness configuration must throw an exception");
348 }
349 }
350
351 /**
352 * Tests that no exception is raised for not too dark a brightness configuration.
353 */
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100354 @Test
Dan Gittik122df862018-03-28 16:59:22 +0100355 public void testBrightEnoughBrightnessConfigurationDoesNotThrowException() {
356 DisplayManagerService displayManager =
357 new DisplayManagerService(mContext, mShortMockedInjector);
358 Curve minimumBrightnessCurve = displayManager.getMinimumBrightnessCurveInternal();
359 float[] lux = minimumBrightnessCurve.getX();
360 float[] nits = minimumBrightnessCurve.getY();
361 BrightnessConfiguration config = new BrightnessConfiguration.Builder(lux, nits).build();
362 displayManager.validateBrightnessConfiguration(config);
363 }
364
365 /**
366 * Tests that null brightness configurations are alright.
367 */
Siarhei Vishniakou2eb0f8f2018-07-06 23:30:12 +0100368 @Test
Dan Gittik122df862018-03-28 16:59:22 +0100369 public void testNullBrightnessConfiguration() {
370 DisplayManagerService displayManager =
371 new DisplayManagerService(mContext, mShortMockedInjector);
372 displayManager.validateBrightnessConfiguration(null);
373 }
374
Kevin DuBoisbf76b11b2018-09-04 09:14:15 -0700375 /**
376 * Tests that collection of display color sampling results are sensible.
377 */
378 @Test
379 public void testDisplayedContentSampling() {
380 DisplayManagerService displayManager =
381 new DisplayManagerService(mContext, mShortMockedInjector);
382 registerDefaultDisplays(displayManager);
383
384 DisplayDeviceInfo ddi = displayManager.getDisplayDeviceInfoInternal(0);
385 assertNotNull(ddi);
386
387 DisplayedContentSamplingAttributes attr =
388 displayManager.getDisplayedContentSamplingAttributesInternal(0);
389 if (attr == null) return; //sampling not supported on device, skip remainder of test.
390
391 boolean enabled = displayManager.setDisplayedContentSamplingEnabledInternal(0, true, 0, 0);
Kevin DuBois205a6802019-01-07 17:04:46 -0800392 assertTrue(enabled);
Kevin DuBoisbf76b11b2018-09-04 09:14:15 -0700393
394 displayManager.setDisplayedContentSamplingEnabledInternal(0, false, 0, 0);
395 DisplayedContentSample sample = displayManager.getDisplayedContentSampleInternal(0, 0, 0);
396 assertNotNull(sample);
397
398 long numPixels = ddi.width * ddi.height * sample.getNumFrames();
399 long[] samples = sample.getSampleComponent(DisplayedContentSample.ColorComponent.CHANNEL0);
400 assertTrue(samples.length == 0 || LongStream.of(samples).sum() == numPixels);
401
402 samples = sample.getSampleComponent(DisplayedContentSample.ColorComponent.CHANNEL1);
403 assertTrue(samples.length == 0 || LongStream.of(samples).sum() == numPixels);
404
405 samples = sample.getSampleComponent(DisplayedContentSample.ColorComponent.CHANNEL2);
406 assertTrue(samples.length == 0 || LongStream.of(samples).sum() == numPixels);
407
408 samples = sample.getSampleComponent(DisplayedContentSample.ColorComponent.CHANNEL3);
409 assertTrue(samples.length == 0 || LongStream.of(samples).sum() == numPixels);
410 }
411
Santos Cordonc22c5632017-06-21 16:03:49 -0700412 private void registerDefaultDisplays(DisplayManagerService displayManager) {
413 Handler handler = displayManager.getDisplayHandler();
414 // Would prefer to call displayManager.onStart() directly here but it performs binderService
415 // registration which triggers security exceptions when running from a test.
416 handler.sendEmptyMessage(MSG_REGISTER_DEFAULT_DISPLAY_ADAPTERS);
417 // flush the handler
418 handler.runWithScissors(() -> {}, 0 /* now */);
419 }
Santos Cordonee8931e2017-04-05 10:31:15 -0700420}