blob: dd4b3440de81f2bd0090db16b2a37fecd63085fa [file] [log] [blame]
Wale Ogunwale44fbdf52016-11-16 10:18:45 -08001/*
2 * Copyright (C) 2016 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.wm;
18
Jorim Jaggi829b9cd2017-01-23 16:20:53 +010019import android.app.ActivityManager.TaskDescription;
Jorim Jaggi9bafc712017-01-19 17:28:30 +010020import android.app.ActivityManagerInternal;
Wale Ogunwalec5cc3012017-01-13 13:26:16 -080021import android.content.res.Configuration;
22import android.graphics.Rect;
23import android.os.Binder;
24import android.view.IApplicationToken;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080025import org.junit.Assert;
26import org.junit.Before;
Jorim Jaggi9bafc712017-01-19 17:28:30 +010027import org.mockito.Mock;
28import org.mockito.Mockito;
29import org.mockito.MockitoAnnotations;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080030
Wale Ogunwale1666e312016-12-16 11:27:18 -080031import android.app.ActivityManager.TaskSnapshot;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080032import android.content.Context;
33import android.os.IBinder;
34import android.support.test.InstrumentationRegistry;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080035import android.view.IWindow;
36import android.view.WindowManager;
37
38import static android.app.ActivityManager.StackId.FIRST_DYNAMIC_STACK_ID;
39import static android.app.AppOpsManager.OP_NONE;
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -080040import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
Wale Ogunwalec5cc3012017-01-13 13:26:16 -080041import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080042import static android.content.res.Configuration.EMPTY;
43import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
44import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
Wale Ogunwale3c1170d2016-12-02 14:44:52 -080045import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
46import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
47import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
48import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
49import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
50import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
51import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
52import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
53import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -080054import static com.android.server.wm.WindowContainer.POSITION_TOP;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080055import static org.mockito.Mockito.mock;
56
Jorim Jaggi9bafc712017-01-19 17:28:30 +010057import com.android.server.AttributeCache;
58import com.android.server.LocalServices;
59
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080060/**
61 * Common base class for window manager unit test classes.
62 */
Wale Ogunwale26c0dfe2016-12-14 14:42:30 -080063class WindowTestsBase {
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080064 static WindowManagerService sWm = null;
Jorim Jaggi9bafc712017-01-19 17:28:30 +010065 static TestWindowManagerPolicy sPolicy = null;
66 private final static IWindow sIWindow = new TestIWindow();
67 private final static Session sMockSession = mock(Session.class);
Wale Ogunwalec5cc3012017-01-13 13:26:16 -080068 static int sNextStackId = FIRST_DYNAMIC_STACK_ID;
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080069 private static int sNextTaskId = 0;
70
Wale Ogunwale3c1170d2016-12-02 14:44:52 -080071 private static boolean sOneTimeSetupDone = false;
Wale Ogunwale26c0dfe2016-12-14 14:42:30 -080072 static DisplayContent sDisplayContent;
73 static WindowLayersController sLayersController;
74 static WindowState sWallpaperWindow;
75 static WindowState sImeWindow;
76 static WindowState sImeDialogWindow;
77 static WindowState sStatusBarWindow;
78 static WindowState sDockedDividerWindow;
79 static WindowState sNavBarWindow;
80 static WindowState sAppWindow;
81 static WindowState sChildAppWindowAbove;
82 static WindowState sChildAppWindowBelow;
Jorim Jaggi9bafc712017-01-19 17:28:30 +010083 static @Mock ActivityManagerInternal sMockAm;
Wale Ogunwale3c1170d2016-12-02 14:44:52 -080084
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080085 @Before
86 public void setUp() throws Exception {
Wale Ogunwale3c1170d2016-12-02 14:44:52 -080087 if (sOneTimeSetupDone) {
Jorim Jaggi9bafc712017-01-19 17:28:30 +010088 Mockito.reset(sMockAm);
Wale Ogunwale3c1170d2016-12-02 14:44:52 -080089 return;
90 }
91 sOneTimeSetupDone = true;
Jorim Jaggi9bafc712017-01-19 17:28:30 +010092 MockitoAnnotations.initMocks(this);
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080093 final Context context = InstrumentationRegistry.getTargetContext();
Jorim Jaggi9bafc712017-01-19 17:28:30 +010094 LocalServices.addService(ActivityManagerInternal.class, sMockAm);
95 AttributeCache.init(context);
Wale Ogunwale44fbdf52016-11-16 10:18:45 -080096 sWm = TestWindowManagerPolicy.getWindowManagerService(context);
Jorim Jaggi9bafc712017-01-19 17:28:30 +010097 sPolicy = (TestWindowManagerPolicy) sWm.mPolicy;
Wale Ogunwale3c1170d2016-12-02 14:44:52 -080098 sLayersController = new WindowLayersController(sWm);
Wale Ogunwale1666e312016-12-16 11:27:18 -080099 sDisplayContent = sWm.mRoot.getDisplayContent(context.getDisplay().getDisplayId());
100 if (sDisplayContent != null) {
101 sDisplayContent.removeImmediately();
102 }
Wale Ogunwale3c1170d2016-12-02 14:44:52 -0800103 sDisplayContent = new DisplayContent(context.getDisplay(), sWm, sLayersController,
104 new WallpaperController(sWm));
Andrii Kuliand2765632016-12-12 22:26:34 -0800105 sWm.mRoot.addChild(sDisplayContent, 0);
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100106 sWm.mDisplayEnabled = true;
107 sWm.mDisplayReady = true;
Wale Ogunwale3c1170d2016-12-02 14:44:52 -0800108
109 // Set-up some common windows.
110 sWallpaperWindow = createWindow(null, TYPE_WALLPAPER, sDisplayContent, "wallpaperWindow");
111 sImeWindow = createWindow(null, TYPE_INPUT_METHOD, sDisplayContent, "sImeWindow");
112 sImeDialogWindow =
113 createWindow(null, TYPE_INPUT_METHOD_DIALOG, sDisplayContent, "sImeDialogWindow");
114 sStatusBarWindow = createWindow(null, TYPE_STATUS_BAR, sDisplayContent, "sStatusBarWindow");
115 sNavBarWindow =
Wale Ogunwale6ce0fb82016-12-13 14:24:00 -0800116 createWindow(null, TYPE_NAVIGATION_BAR, sDisplayContent, "sNavBarWindow");
Wale Ogunwale3c1170d2016-12-02 14:44:52 -0800117 sDockedDividerWindow =
Wale Ogunwale6ce0fb82016-12-13 14:24:00 -0800118 createWindow(null, TYPE_DOCK_DIVIDER, sDisplayContent, "sDockedDividerWindow");
Wale Ogunwale3c1170d2016-12-02 14:44:52 -0800119 sAppWindow = createWindow(null, TYPE_BASE_APPLICATION, sDisplayContent, "sAppWindow");
120 sChildAppWindowAbove = createWindow(sAppWindow,
121 TYPE_APPLICATION_ATTACHED_DIALOG, sAppWindow.mToken, "sChildAppWindowAbove");
122 sChildAppWindowBelow = createWindow(sAppWindow,
123 TYPE_APPLICATION_MEDIA_OVERLAY, sAppWindow.mToken, "sChildAppWindowBelow");
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800124 }
125
126 /** Asserts that the first entry is greater than the second entry. */
127 void assertGreaterThan(int first, int second) throws Exception {
128 Assert.assertTrue("Excepted " + first + " to be greater than " + second, first > second);
129 }
130
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100131 /**
132 * Waits until the main handler for WM has processed all messages.
133 */
134 void waitUntilHandlerIdle() {
135 sWm.mH.runWithScissors(() -> { }, 0);
136 }
137
138 private static WindowToken createWindowToken(DisplayContent dc, int type) {
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800139 if (type < FIRST_APPLICATION_WINDOW || type > LAST_APPLICATION_WINDOW) {
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800140 return new TestWindowToken(type, dc);
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800141 }
142
Andrii Kuliand2765632016-12-12 22:26:34 -0800143 final TaskStack stack = createTaskStackOnDisplay(dc);
144 final Task task = createTaskInStack(stack, 0 /* userId */);
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800145 final TestAppWindowToken token = new TestAppWindowToken(dc);
Wale Ogunwale72919d22016-12-08 18:58:50 -0800146 task.addChild(token, 0);
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800147 return token;
148 }
149
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100150 static WindowState createWindow(WindowState parent, int type, String name) {
Wale Ogunwale805d9ec2016-12-07 12:22:08 -0800151 return (parent == null)
152 ? createWindow(parent, type, sDisplayContent, name)
153 : createWindow(parent, type, parent.mToken, name);
154 }
155
Jorim Jaggi02886a82016-12-06 09:10:06 -0800156 WindowState createAppWindow(Task task, int type, String name) {
157 final AppWindowToken token = new TestAppWindowToken(sDisplayContent);
158 task.addChild(token, 0);
159 return createWindow(null, type, token, name);
160 }
161
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100162 static WindowState createWindow(WindowState parent, int type, DisplayContent dc, String name) {
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800163 final WindowToken token = createWindowToken(dc, type);
164 return createWindow(parent, type, token, name);
165 }
166
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100167 static WindowState createWindow(WindowState parent, int type, WindowToken token, String name) {
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800168 final WindowManager.LayoutParams attrs = new WindowManager.LayoutParams(type);
169 attrs.setTitle(name);
170
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100171 final WindowState w = new WindowState(sWm, sMockSession, sIWindow, token, parent, OP_NONE,
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800172 0, attrs, 0, 0);
173 // TODO: Probably better to make this call in the WindowState ctor to avoid errors with
174 // adding it to the token...
175 token.addWindow(w);
176 return w;
177 }
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800178
Andrii Kuliand2765632016-12-12 22:26:34 -0800179 /** Creates a {@link TaskStack} and adds it to the specified {@link DisplayContent}. */
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100180 static TaskStack createTaskStackOnDisplay(DisplayContent dc) {
Wale Ogunwale1666e312016-12-16 11:27:18 -0800181 return createStackControllerOnDisplay(dc).mContainer;
182 }
183
184 static StackWindowController createStackControllerOnDisplay(DisplayContent dc) {
185 final int stackId = ++sNextStackId;
186 return new StackWindowController(stackId, null, dc.getDisplayId(),
187 true /* onTop */, new Rect(), sWm);
Andrii Kuliand2765632016-12-12 22:26:34 -0800188 }
189
190 /**Creates a {@link Task} and adds it to the specified {@link TaskStack}. */
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100191 static Task createTaskInStack(TaskStack stack, int userId) {
Andrii Kuliand2765632016-12-12 22:26:34 -0800192 final Task newTask = new Task(sNextTaskId++, stack, userId, sWm, null, EMPTY, false, 0,
Winson Chungd3395382016-12-13 11:49:09 -0800193 false, false, new TaskDescription(), null);
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800194 stack.addTask(newTask, POSITION_TOP);
Andrii Kuliand2765632016-12-12 22:26:34 -0800195 return newTask;
196 }
197
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800198 /* Used so we can gain access to some protected members of the {@link WindowToken} class */
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100199 static class TestWindowToken extends WindowToken {
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800200
201 TestWindowToken(int type, DisplayContent dc) {
202 this(type, dc, false /* persistOnEmpty */);
203 }
204
205 TestWindowToken(int type, DisplayContent dc, boolean persistOnEmpty) {
206 super(sWm, mock(IBinder.class), type, persistOnEmpty, dc);
207 }
208
209 int getWindowsCount() {
210 return mChildren.size();
211 }
212
213 boolean hasWindow(WindowState w) {
214 return mChildren.contains(w);
215 }
216 }
217
Andrii Kulian4ede3e02017-01-12 11:52:31 -0800218 /** Used so we can gain access to some protected members of the {@link AppWindowToken} class. */
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100219 static class TestAppWindowToken extends AppWindowToken {
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800220
221 TestAppWindowToken(DisplayContent dc) {
222 super(sWm, null, false, dc);
223 }
224
Winson Chung30480042017-01-26 10:55:34 -0800225 TestAppWindowToken(WindowManagerService service, IApplicationToken token,
226 boolean voiceInteraction, DisplayContent dc, long inputDispatchingTimeoutNanos,
227 boolean fullscreen, boolean showForAllUsers, int targetSdk, int orientation,
228 int rotationAnimationHint, int configChanges, boolean launchTaskBehind,
229 boolean alwaysFocusable, AppWindowContainerController controller) {
230 super(service, token, voiceInteraction, dc, inputDispatchingTimeoutNanos, fullscreen,
231 showForAllUsers, targetSdk, orientation, rotationAnimationHint, configChanges,
232 launchTaskBehind, alwaysFocusable, controller);
233 }
234
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800235 int getWindowsCount() {
236 return mChildren.size();
237 }
238
239 boolean hasWindow(WindowState w) {
240 return mChildren.contains(w);
241 }
242
243 WindowState getFirstChild() {
244 return mChildren.getFirst();
245 }
246
247 WindowState getLastChild() {
248 return mChildren.getLast();
249 }
Winson Chung30480042017-01-26 10:55:34 -0800250
251 int positionInParent() {
252 return getParent().mChildren.indexOf(this);
253 }
Wale Ogunwale3d0bfd92016-12-05 11:38:02 -0800254 }
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800255
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800256 /* Used so we can gain access to some protected members of the {@link Task} class */
257 class TestTask extends Task {
258
259 boolean mShouldDeferRemoval = false;
Andrii Kulian7cd7c2d2017-01-18 12:14:37 -0800260 boolean mOnDisplayChangedCalled = false;
Wale Ogunwale1666e312016-12-16 11:27:18 -0800261 private boolean mUseLocalIsAnimating = false;
262 private boolean mIsAnimating = false;
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800263
264 TestTask(int taskId, TaskStack stack, int userId, WindowManagerService service, Rect bounds,
265 Configuration overrideConfig, boolean isOnTopLauncher, int resizeMode,
Winson Chungd3395382016-12-13 11:49:09 -0800266 boolean supportsPictureInPicture, boolean homeTask,
267 TaskWindowContainerController controller) {
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800268 super(taskId, stack, userId, service, bounds, overrideConfig, isOnTopLauncher,
Winson Chungd3395382016-12-13 11:49:09 -0800269 resizeMode, supportsPictureInPicture, homeTask, new TaskDescription(),
270 controller);
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800271 }
272
273 boolean shouldDeferRemoval() {
274 return mShouldDeferRemoval;
275 }
276
277 int positionInParent() {
278 return getParent().mChildren.indexOf(this);
279 }
Andrii Kulian7cd7c2d2017-01-18 12:14:37 -0800280
281 @Override
282 void onDisplayChanged(DisplayContent dc) {
283 super.onDisplayChanged(dc);
284 mOnDisplayChangedCalled = true;
285 }
Wale Ogunwale1666e312016-12-16 11:27:18 -0800286
287 @Override
288 boolean isAnimating() {
289 return mUseLocalIsAnimating ? mIsAnimating : super.isAnimating();
290 }
291
292 void setLocalIsAnimating(boolean isAnimating) {
293 mUseLocalIsAnimating = true;
294 mIsAnimating = isAnimating;
295 }
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800296 }
297
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800298 /**
299 * Used so we can gain access to some protected members of {@link TaskWindowContainerController}
300 * class.
301 */
302 class TestTaskWindowContainerController extends TaskWindowContainerController {
303
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800304 TestTaskWindowContainerController() {
Wale Ogunwale1666e312016-12-16 11:27:18 -0800305 this(createStackControllerOnDisplay(sDisplayContent));
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800306 }
307
Wale Ogunwale1666e312016-12-16 11:27:18 -0800308 TestTaskWindowContainerController(StackWindowController stackController) {
309 super(sNextTaskId++, new TaskWindowContainerListener() {
310 @Override
311 public void onSnapshotChanged(TaskSnapshot snapshot) {
312
313 }
314
315 @Override
316 public void requestResize(Rect bounds, int resizeMode) {
317
318 }
319 }, stackController, 0 /* userId */, null /* bounds */,
Winson Chungd3395382016-12-13 11:49:09 -0800320 EMPTY /* overrideConfig*/, RESIZE_MODE_UNRESIZEABLE,
321 false /* supportsPictureInPicture */, false /* homeTask*/,
Jorim Jaggi829b9cd2017-01-23 16:20:53 +0100322 false /* isOnTopLauncher */, true /* toTop*/, true /* showForAllUsers */,
Wale Ogunwale1666e312016-12-16 11:27:18 -0800323 new TaskDescription(), sWm);
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800324 }
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800325
326 @Override
327 TestTask createTask(int taskId, TaskStack stack, int userId, Rect bounds,
Winson Chungd3395382016-12-13 11:49:09 -0800328 Configuration overrideConfig, int resizeMode, boolean supportsPictureInPicture,
329 boolean homeTask, boolean isOnTopLauncher, TaskDescription taskDescription) {
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800330 return new TestTask(taskId, stack, userId, mService, bounds, overrideConfig,
Winson Chungd3395382016-12-13 11:49:09 -0800331 isOnTopLauncher, resizeMode, supportsPictureInPicture, homeTask, this);
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800332 }
333 }
334
335 class TestAppWindowContainerController extends AppWindowContainerController {
336
337 final IApplicationToken mToken;
338
339 TestAppWindowContainerController(TestTaskWindowContainerController taskController) {
340 this(taskController, new TestIApplicationToken());
341 }
342
343 TestAppWindowContainerController(TestTaskWindowContainerController taskController,
344 IApplicationToken token) {
345 super(taskController, token, null /* listener */, 0 /* index */,
346 SCREEN_ORIENTATION_UNSPECIFIED, true /* fullscreen */,
347 true /* showForAllUsers */, 0 /* configChanges */, false /* voiceInteraction */,
348 false /* launchTaskBehind */, false /* alwaysFocusable */,
349 0 /* targetSdkVersion */, 0 /* rotationAnimationHint */,
350 0 /* inputDispatchingTimeoutNanos */, sWm);
351 mToken = token;
352 }
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100353
Winson Chung30480042017-01-26 10:55:34 -0800354 @Override
355 AppWindowToken createAppWindow(WindowManagerService service, IApplicationToken token,
356 boolean voiceInteraction, DisplayContent dc, long inputDispatchingTimeoutNanos,
357 boolean fullscreen, boolean showForAllUsers, int targetSdk, int orientation,
358 int rotationAnimationHint, int configChanges, boolean launchTaskBehind,
359 boolean alwaysFocusable, AppWindowContainerController controller) {
360 return new TestAppWindowToken(service, token, voiceInteraction, dc,
361 inputDispatchingTimeoutNanos, fullscreen, showForAllUsers, targetSdk,
362 orientation,
363 rotationAnimationHint, configChanges, launchTaskBehind, alwaysFocusable,
364 controller);
365 }
366
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100367 AppWindowToken getAppWindowToken() {
368 return (AppWindowToken) sDisplayContent.getWindowToken(mToken.asBinder());
369 }
Wale Ogunwalec5cc3012017-01-13 13:26:16 -0800370 }
371
372 class TestIApplicationToken implements IApplicationToken {
373
374 private final Binder mBinder = new Binder();
375 @Override
376 public IBinder asBinder() {
377 return mBinder;
378 }
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800379 }
Andrii Kulian4ede3e02017-01-12 11:52:31 -0800380
381 /** Used to track resize reports. */
382 class TestWindowState extends WindowState {
383 boolean resizeReported;
384
385 TestWindowState(WindowManager.LayoutParams attrs, WindowToken token) {
Jorim Jaggi9bafc712017-01-19 17:28:30 +0100386 super(sWm, sMockSession, sIWindow, token, null, OP_NONE, 0, attrs, 0, 0);
Andrii Kulian4ede3e02017-01-12 11:52:31 -0800387 }
388
389 @Override
390 void reportResized() {
391 super.reportResized();
392 resizeReported = true;
393 }
394
395 @Override
396 public boolean isGoneForLayoutLw() {
397 return false;
398 }
399
400 @Override
401 void updateResizingWindowIfNeeded() {
402 // Used in AppWindowTokenTests#testLandscapeSeascapeRotationRelayout to deceive
403 // the system that it can actually update the window.
404 boolean hadSurface = mHasSurface;
405 mHasSurface = true;
406
407 super.updateResizingWindowIfNeeded();
408
409 mHasSurface = hadSurface;
410 }
411 }
Wale Ogunwale44fbdf52016-11-16 10:18:45 -0800412}