blob: 0a27e1a1da68c7f1a1bf2686c82367f9100b7031 [file] [log] [blame]
Jorim Jaggif96c90a2018-09-26 16:55:15 +02001/*
2 * Copyright (C) 2018 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
Tiger Huang0f5347e2020-03-06 17:09:41 +080019import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
Winson Chung8a168902020-03-12 22:39:22 -070020import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
Tiger Huang0f5347e2020-03-06 17:09:41 +080021import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
Tiger Huang57e2e1c2020-03-13 22:54:36 +080022import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
Tiger Huang332793b2019-10-29 23:21:27 +080023import static android.view.InsetsState.ITYPE_IME;
24import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
25import static android.view.InsetsState.ITYPE_STATUS_BAR;
Yunfan Chenb04dc002019-02-14 17:08:39 +090026import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL;
Tiger Huang57e2e1c2020-03-13 22:54:36 +080027import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
Tiger Huanga16634032020-02-05 17:10:03 +080028import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020029import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
Tiger Huanga16634032020-02-05 17:10:03 +080030
Jorim Jaggif96c90a2018-09-26 16:55:15 +020031import static org.junit.Assert.assertEquals;
Tiger Huanga70fd872020-04-15 05:25:16 +080032import static org.junit.Assert.assertFalse;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020033import static org.junit.Assert.assertNotNull;
Jorim Jaggib6030952018-10-23 18:31:52 +020034import static org.junit.Assert.assertNull;
Tiger Huanga70fd872020-04-15 05:25:16 +080035import static org.junit.Assert.assertTrue;
Tiger Huang53c8eb82020-03-31 18:22:05 +080036import static org.mockito.Mockito.atLeast;
37import static org.mockito.Mockito.clearInvocations;
38import static org.mockito.Mockito.spy;
39import static org.mockito.Mockito.verify;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020040
Jorim Jaggi9b4f4202020-01-28 17:05:06 +010041import android.graphics.Rect;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020042import android.platform.test.annotations.Presubmit;
Jorim Jaggib6030952018-10-23 18:31:52 +020043import android.view.InsetsSourceControl;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020044import android.view.InsetsState;
Jorim Jaggi28620472019-01-02 23:21:49 +010045import android.view.test.InsetsModeSession;
Jorim Jaggif96c90a2018-09-26 16:55:15 +020046
Tiger Huanga16634032020-02-05 17:10:03 +080047import androidx.test.filters.SmallTest;
48
Yunfan Chenb04dc002019-02-14 17:08:39 +090049import org.junit.AfterClass;
50import org.junit.BeforeClass;
Tadashi G. Takaokabf0d57b2018-11-19 16:09:58 +090051import org.junit.Test;
Jorim Jaggi28620472019-01-02 23:21:49 +010052import org.junit.runner.RunWith;
Tadashi G. Takaokabf0d57b2018-11-19 16:09:58 +090053
Jorim Jaggif96c90a2018-09-26 16:55:15 +020054@SmallTest
Jorim Jaggif96c90a2018-09-26 16:55:15 +020055@Presubmit
Jorim Jaggi28620472019-01-02 23:21:49 +010056@RunWith(WindowTestRunner.class)
Jorim Jaggif96c90a2018-09-26 16:55:15 +020057public class InsetsStateControllerTest extends WindowTestsBase {
Jorim Jaggi28620472019-01-02 23:21:49 +010058 private static InsetsModeSession sInsetsModeSession;
Yunfan Chenb04dc002019-02-14 17:08:39 +090059
60 @BeforeClass
61 public static void setUpOnce() {
Yunfan Chenb04dc002019-02-14 17:08:39 +090062 // To let the insets provider control the insets visibility, the insets mode has to be
63 // NEW_INSETS_MODE_FULL.
Jorim Jaggi28620472019-01-02 23:21:49 +010064 sInsetsModeSession = new InsetsModeSession(NEW_INSETS_MODE_FULL);
Yunfan Chenb04dc002019-02-14 17:08:39 +090065 }
66
67 @AfterClass
68 public static void tearDownOnce() {
Jorim Jaggi28620472019-01-02 23:21:49 +010069 sInsetsModeSession.close();
Yunfan Chenb04dc002019-02-14 17:08:39 +090070 }
Jorim Jaggif96c90a2018-09-26 16:55:15 +020071
72 @Test
73 public void testStripForDispatch_notOwn() {
Tiger Huang332793b2019-10-29 23:21:27 +080074 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
Jorim Jaggi28620472019-01-02 23:21:49 +010075 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Jorim Jaggi9b4f4202020-01-28 17:05:06 +010076 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
Tiger Huang332793b2019-10-29 23:21:27 +080077 statusBar.setControllableInsetProvider(getController().getSourceProvider(ITYPE_STATUS_BAR));
Tiger Huang0f5347e2020-03-06 17:09:41 +080078 assertNotNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_STATUS_BAR));
Jorim Jaggif96c90a2018-09-26 16:55:15 +020079 }
80
81 @Test
82 public void testStripForDispatch_own() {
Tiger Huang332793b2019-10-29 23:21:27 +080083 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
84 mDisplayContent.getInsetsStateController().getSourceProvider(ITYPE_STATUS_BAR)
Jorim Jaggi9b4f4202020-01-28 17:05:06 +010085 .setWindow(statusBar, null, null);
Tiger Huang332793b2019-10-29 23:21:27 +080086 statusBar.setControllableInsetProvider(getController().getSourceProvider(ITYPE_STATUS_BAR));
87 final InsetsState state = getController().getInsetsForDispatch(statusBar);
Jorim Jaggibfa95a72020-06-18 22:51:49 +020088 assertNull(state.peekSource(ITYPE_STATUS_BAR));
Jorim Jaggif96c90a2018-09-26 16:55:15 +020089 }
90
91 @Test
92 public void testStripForDispatch_navBar() {
Jorim Jaggi28620472019-01-02 23:21:49 +010093 final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar");
Tiger Huang332793b2019-10-29 23:21:27 +080094 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
Jorim Jaggi28620472019-01-02 23:21:49 +010095 final WindowState ime = createWindow(null, TYPE_APPLICATION, "ime");
Tiger Huanga16634032020-02-05 17:10:03 +080096
97 // IME cannot be the IME target.
98 ime.mAttrs.flags |= FLAG_NOT_FOCUSABLE;
99
Jorim Jaggi9b4f4202020-01-28 17:05:06 +0100100 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
101 getController().getSourceProvider(ITYPE_NAVIGATION_BAR).setWindow(navBar, null, null);
102 getController().getSourceProvider(ITYPE_IME).setWindow(ime, null, null);
Jorim Jaggi963c5c22020-04-01 22:53:42 +0200103 assertNull(getController().getInsetsForDispatch(navBar).peekSource(ITYPE_IME));
104 assertNull(getController().getInsetsForDispatch(navBar).peekSource(ITYPE_STATUS_BAR));
Jorim Jaggib6030952018-10-23 18:31:52 +0200105 }
106
107 @Test
Tiger Huang0f5347e2020-03-06 17:09:41 +0800108 public void testStripForDispatch_pip() {
109 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
110 final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar");
111 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
112
113 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
114 getController().getSourceProvider(ITYPE_NAVIGATION_BAR).setWindow(navBar, null, null);
115 app.setWindowingMode(WINDOWING_MODE_PINNED);
116
117 assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_STATUS_BAR));
118 assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_NAVIGATION_BAR));
119 }
120
121 @Test
122 public void testStripForDispatch_freeform() {
123 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
124 final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar");
125 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
126
127 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
128 getController().getSourceProvider(ITYPE_NAVIGATION_BAR).setWindow(navBar, null, null);
129 app.setWindowingMode(WINDOWING_MODE_FREEFORM);
130
131 assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_STATUS_BAR));
132 assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_NAVIGATION_BAR));
133 }
134
135 @Test
Winson Chung8a168902020-03-12 22:39:22 -0700136 public void testStripForDispatch_multiwindow_alwaysOnTop() {
137 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
138 final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar");
139 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
140
141 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
142 getController().getSourceProvider(ITYPE_NAVIGATION_BAR).setWindow(navBar, null, null);
143 app.setWindowingMode(WINDOWING_MODE_MULTI_WINDOW);
144 app.setAlwaysOnTop(true);
145
146 assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_STATUS_BAR));
147 assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_NAVIGATION_BAR));
148 }
149
150 @Test
Tiger Huangc0d837a2020-04-24 00:49:27 +0800151 public void testStripForDispatch_independentSources() {
152 getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
153
154 final WindowState app1 = createWindow(null, TYPE_APPLICATION, "app1");
155 app1.mBehindIme = true;
156
157 final WindowState app2 = createWindow(null, TYPE_APPLICATION, "app2");
158 app2.mBehindIme = false;
159
160 getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true);
161 assertFalse(getController().getInsetsForDispatch(app2).getSource(ITYPE_IME).isVisible());
162 assertTrue(getController().getInsetsForDispatch(app1).getSource(ITYPE_IME).isVisible());
163 }
164
165 @Test
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800166 public void testStripForDispatch_belowIme() {
Tiger Huanga70fd872020-04-15 05:25:16 +0800167 getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
168
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800169 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Tiger Huanga70fd872020-04-15 05:25:16 +0800170 app.mBehindIme = true;
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800171
Tiger Huanga70fd872020-04-15 05:25:16 +0800172 getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true);
173 assertTrue(getController().getInsetsForDispatch(app).getSource(ITYPE_IME).isVisible());
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800174 }
175
176 @Test
177 public void testStripForDispatch_aboveIme() {
Tiger Huanga70fd872020-04-15 05:25:16 +0800178 getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
179
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800180 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Tiger Huanga70fd872020-04-15 05:25:16 +0800181 app.mBehindIme = false;
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800182
Tiger Huanga70fd872020-04-15 05:25:16 +0800183 getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true);
184 assertFalse(getController().getInsetsForDispatch(app).getSource(ITYPE_IME).isVisible());
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800185 }
186
187 @Test
Tiger Huang53c8eb82020-03-31 18:22:05 +0800188 public void testStripForDispatch_imeOrderChanged() {
Tiger Huang9cfd6852020-06-21 20:53:56 +0800189 // This can be the IME z-order target while app cannot be the IME z-order target.
190 // This is also the only IME control target in this test, so IME won't be invisible caused
191 // by the control-target change.
192 mDisplayContent.mInputMethodInputTarget = createWindow(null, TYPE_APPLICATION, "base");
Tiger Huang53c8eb82020-03-31 18:22:05 +0800193
Tiger Huang9cfd6852020-06-21 20:53:56 +0800194 // Make IME and stay visible during the test.
195 mImeWindow.setHasSurface(true);
196 getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
197 getController().onImeControlTargetChanged(mDisplayContent.mInputMethodInputTarget);
198 final InsetsState requestedState = new InsetsState();
199 requestedState.getSource(ITYPE_IME).setVisible(true);
200 mDisplayContent.mInputMethodInputTarget.updateRequestedInsetsState(requestedState);
201 getController().onInsetsModified(mDisplayContent.mInputMethodInputTarget, requestedState);
Tiger Huang53c8eb82020-03-31 18:22:05 +0800202
203 // Send our spy window (app) into the system so that we can detect the invocation.
204 final WindowState win = createWindow(null, TYPE_APPLICATION, "app");
Tiger Huang9cfd6852020-06-21 20:53:56 +0800205 win.setHasSurface(true);
Tiger Huang53c8eb82020-03-31 18:22:05 +0800206 final WindowToken parent = win.mToken;
207 parent.removeChild(win);
208 final WindowState app = spy(win);
209 parent.addWindow(app);
210
211 // Adding FLAG_NOT_FOCUSABLE makes app above IME.
212 app.mAttrs.flags |= FLAG_NOT_FOCUSABLE;
213 mDisplayContent.computeImeTarget(true);
Tiger Huang53c8eb82020-03-31 18:22:05 +0800214 mDisplayContent.applySurfaceChangesTransaction();
215
Tiger Huanga70fd872020-04-15 05:25:16 +0800216 // app won't get visible IME insets while above IME even when IME is visible.
Tiger Huang9cfd6852020-06-21 20:53:56 +0800217 assertTrue(getController().getRawInsetsState().getSourceOrDefaultVisibility(ITYPE_IME));
Tiger Huanga70fd872020-04-15 05:25:16 +0800218 assertFalse(getController().getInsetsForDispatch(app).getSource(ITYPE_IME).isVisible());
Tiger Huang53c8eb82020-03-31 18:22:05 +0800219
220 // Reset invocation counter.
221 clearInvocations(app);
222
223 // Removing FLAG_NOT_FOCUSABLE makes app below IME.
224 app.mAttrs.flags &= ~FLAG_NOT_FOCUSABLE;
225 mDisplayContent.computeImeTarget(true);
Tiger Huang53c8eb82020-03-31 18:22:05 +0800226 mDisplayContent.applySurfaceChangesTransaction();
227
228 // Make sure app got notified.
229 verify(app, atLeast(1)).notifyInsetsChanged();
230
Tiger Huang9cfd6852020-06-21 20:53:56 +0800231 // app will get visible IME insets while below IME.
Tiger Huanga70fd872020-04-15 05:25:16 +0800232 assertTrue(getController().getInsetsForDispatch(app).getSource(ITYPE_IME).isVisible());
Tiger Huang53c8eb82020-03-31 18:22:05 +0800233 }
234
235 @Test
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800236 public void testStripForDispatch_childWindow_altFocusable() {
Tiger Huanga70fd872020-04-15 05:25:16 +0800237 getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800238
Tiger Huanga70fd872020-04-15 05:25:16 +0800239 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800240 final WindowState child = createWindow(app, TYPE_APPLICATION, "child");
241 child.mAttrs.flags |= FLAG_ALT_FOCUSABLE_IM;
242
Tiger Huanga70fd872020-04-15 05:25:16 +0800243 mDisplayContent.computeImeTarget(true);
244 mDisplayContent.setLayoutNeeded();
245 mDisplayContent.applySurfaceChangesTransaction();
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800246
Tiger Huanga70fd872020-04-15 05:25:16 +0800247 getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true);
248 assertTrue(getController().getInsetsForDispatch(app).getSource(ITYPE_IME).isVisible());
249 assertFalse(getController().getInsetsForDispatch(child).getSource(ITYPE_IME).isVisible());
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800250 }
251
252 @Test
253 public void testStripForDispatch_childWindow_splitScreen() {
Tiger Huanga70fd872020-04-15 05:25:16 +0800254 getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800255
Tiger Huanga70fd872020-04-15 05:25:16 +0800256 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800257 final WindowState child = createWindow(app, TYPE_APPLICATION, "child");
258 child.mAttrs.flags |= FLAG_NOT_FOCUSABLE;
259 child.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
260
Tiger Huanga70fd872020-04-15 05:25:16 +0800261 mDisplayContent.computeImeTarget(true);
262 mDisplayContent.setLayoutNeeded();
263 mDisplayContent.applySurfaceChangesTransaction();
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800264
Tiger Huanga70fd872020-04-15 05:25:16 +0800265 getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true);
266 assertTrue(getController().getInsetsForDispatch(app).getSource(ITYPE_IME).isVisible());
267 assertFalse(getController().getInsetsForDispatch(child).getSource(ITYPE_IME).isVisible());
Tiger Huang57e2e1c2020-03-13 22:54:36 +0800268 }
269
270 @Test
Jorim Jaggi9b4f4202020-01-28 17:05:06 +0100271 public void testImeForDispatch() {
272 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
273 final WindowState ime = createWindow(null, TYPE_APPLICATION, "ime");
Tiger Huanga16634032020-02-05 17:10:03 +0800274
275 // IME cannot be the IME target.
276 ime.mAttrs.flags |= FLAG_NOT_FOCUSABLE;
277
Jorim Jaggi9b4f4202020-01-28 17:05:06 +0100278 InsetsSourceProvider statusBarProvider =
279 getController().getSourceProvider(ITYPE_STATUS_BAR);
280 statusBarProvider.setWindow(statusBar, null, ((displayFrames, windowState, rect) ->
281 rect.set(0, 1, 2, 3)));
282 getController().getSourceProvider(ITYPE_IME).setWindow(ime, null, null);
283 statusBar.setControllableInsetProvider(statusBarProvider);
284
285 statusBarProvider.onPostLayout();
286
287 final InsetsState state = getController().getInsetsForDispatch(ime);
288 assertEquals(new Rect(0, 1, 2, 3), state.getSource(ITYPE_STATUS_BAR).getFrame());
289 }
290
291 @Test
Jorim Jaggib6030952018-10-23 18:31:52 +0200292 public void testBarControllingWinChanged() {
Jorim Jaggi28620472019-01-02 23:21:49 +0100293 final WindowState navBar = createWindow(null, TYPE_APPLICATION, "navBar");
Tiger Huang332793b2019-10-29 23:21:27 +0800294 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
Jorim Jaggi28620472019-01-02 23:21:49 +0100295 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Jorim Jaggi9b4f4202020-01-28 17:05:06 +0100296 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
297 getController().getSourceProvider(ITYPE_NAVIGATION_BAR).setWindow(navBar, null, null);
Jorim Jaggi956ca412019-01-07 14:49:14 +0100298 getController().onBarControlTargetChanged(app, null, app, null);
Jorim Jaggib6030952018-10-23 18:31:52 +0200299 InsetsSourceControl[] controls = getController().getControlsForDispatch(app);
300 assertEquals(2, controls.length);
301 }
302
303 @Test
304 public void testControlRevoked() {
Tiger Huang332793b2019-10-29 23:21:27 +0800305 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
Jorim Jaggi28620472019-01-02 23:21:49 +0100306 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Jorim Jaggi9b4f4202020-01-28 17:05:06 +0100307 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
Jorim Jaggi956ca412019-01-07 14:49:14 +0100308 getController().onBarControlTargetChanged(app, null, null, null);
Jorim Jaggib6030952018-10-23 18:31:52 +0200309 assertNotNull(getController().getControlsForDispatch(app));
Jorim Jaggi956ca412019-01-07 14:49:14 +0100310 getController().onBarControlTargetChanged(null, null, null, null);
Jorim Jaggib6030952018-10-23 18:31:52 +0200311 assertNull(getController().getControlsForDispatch(app));
312 }
313
314 @Test
315 public void testControlRevoked_animation() {
Tiger Huang332793b2019-10-29 23:21:27 +0800316 final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
Jorim Jaggi28620472019-01-02 23:21:49 +0100317 final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
Jorim Jaggi9b4f4202020-01-28 17:05:06 +0100318 getController().getSourceProvider(ITYPE_STATUS_BAR).setWindow(statusBar, null, null);
Jorim Jaggi956ca412019-01-07 14:49:14 +0100319 getController().onBarControlTargetChanged(app, null, null, null);
Jorim Jaggib6030952018-10-23 18:31:52 +0200320 assertNotNull(getController().getControlsForDispatch(app));
Tiger Huang332793b2019-10-29 23:21:27 +0800321 statusBar.cancelAnimation();
Jorim Jaggib6030952018-10-23 18:31:52 +0200322 assertNull(getController().getControlsForDispatch(app));
323 }
324
325 private InsetsStateController getController() {
326 return mDisplayContent.getInsetsStateController();
Jorim Jaggif96c90a2018-09-26 16:55:15 +0200327 }
328}