Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 1 | /* |
| 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 |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 14 | * limitations under the License. |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | package com.android.server.wm; |
| 18 | |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 19 | import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; |
| 20 | import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; |
| 21 | import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 22 | import static android.os.Build.VERSION_CODES.P; |
| 23 | import static android.os.Build.VERSION_CODES.Q; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 24 | import static android.view.Display.DEFAULT_DISPLAY; |
Issei Suzuki | 43190bd | 2018-08-20 17:28:41 +0200 | [diff] [blame] | 25 | import static android.view.DisplayCutout.BOUNDS_POSITION_LEFT; |
| 26 | import static android.view.DisplayCutout.BOUNDS_POSITION_TOP; |
Adrian Roos | 2426421 | 2018-02-19 16:26:15 +0100 | [diff] [blame] | 27 | import static android.view.DisplayCutout.fromBoundingRect; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 28 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; |
| 29 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; |
| 30 | import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 31 | import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 32 | import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION; |
Brett Chabot | a26eda9 | 2018-07-23 13:08:30 -0700 | [diff] [blame] | 33 | |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 34 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.any; |
| 35 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.anyBoolean; |
Tadashi G. Takaoka | bf0d57b | 2018-11-19 16:09:58 +0900 | [diff] [blame] | 36 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing; |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 37 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.eq; |
| 38 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; |
| 39 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.never; |
| 40 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.same; |
Tadashi G. Takaoka | bf0d57b | 2018-11-19 16:09:58 +0900 | [diff] [blame] | 41 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy; |
| 42 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.times; |
| 43 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 44 | import static com.android.server.wm.WindowContainer.POSITION_TOP; |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 45 | import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL; |
chaviw | ebcbc34 | 2018-02-07 13:19:00 -0800 | [diff] [blame] | 46 | |
Adrian Roos | 5251b1d | 2018-03-23 18:57:43 +0100 | [diff] [blame] | 47 | import static org.hamcrest.Matchers.is; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 48 | import static org.junit.Assert.assertEquals; |
Andrii Kulian | f0379de | 2018-03-14 16:24:07 -0700 | [diff] [blame] | 49 | import static org.junit.Assert.assertFalse; |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 50 | import static org.junit.Assert.assertNotNull; |
lumark | ff0ab69 | 2018-11-05 20:32:30 +0800 | [diff] [blame] | 51 | import static org.junit.Assert.assertNull; |
Adrian Roos | 5251b1d | 2018-03-23 18:57:43 +0100 | [diff] [blame] | 52 | import static org.junit.Assert.assertThat; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 53 | import static org.junit.Assert.assertTrue; |
Tarandeep Singh | a6f3561 | 2019-01-11 19:50:46 -0800 | [diff] [blame] | 54 | import static org.mockito.ArgumentMatchers.eq; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 55 | |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 56 | import android.annotation.SuppressLint; |
Tarandeep Singh | a6f3561 | 2019-01-11 19:50:46 -0800 | [diff] [blame] | 57 | import android.app.WindowConfiguration; |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 58 | import android.content.res.Configuration; |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 59 | import android.graphics.Rect; |
Susi Kharraz-Post | 9893b8c | 2019-02-12 14:21:29 -0500 | [diff] [blame] | 60 | import android.metrics.LogMaker; |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 61 | import android.os.SystemClock; |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 62 | import android.platform.test.annotations.Presubmit; |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 63 | import android.util.DisplayMetrics; |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 64 | import android.view.DisplayCutout; |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 65 | import android.view.Gravity; |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 66 | import android.view.MotionEvent; |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 67 | import android.view.Surface; |
Tarandeep Singh | a6f3561 | 2019-01-11 19:50:46 -0800 | [diff] [blame] | 68 | import android.view.ViewRootImpl; |
| 69 | import android.view.test.InsetsModeSession; |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 70 | |
Brett Chabot | a26eda9 | 2018-07-23 13:08:30 -0700 | [diff] [blame] | 71 | import androidx.test.filters.FlakyTest; |
| 72 | import androidx.test.filters.SmallTest; |
Brett Chabot | a26eda9 | 2018-07-23 13:08:30 -0700 | [diff] [blame] | 73 | |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 74 | import com.android.dx.mockito.inline.extended.ExtendedMockito; |
Susi Kharraz-Post | 9893b8c | 2019-02-12 14:21:29 -0500 | [diff] [blame] | 75 | import com.android.internal.logging.MetricsLogger; |
| 76 | import com.android.internal.logging.nano.MetricsProto; |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 77 | import com.android.server.wm.utils.WmDisplayCutout; |
| 78 | |
Brett Chabot | a26eda9 | 2018-07-23 13:08:30 -0700 | [diff] [blame] | 79 | import org.junit.Test; |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 80 | import org.mockito.ArgumentCaptor; |
Susi Kharraz-Post | 9893b8c | 2019-02-12 14:21:29 -0500 | [diff] [blame] | 81 | import org.mockito.Mockito; |
Brett Chabot | a26eda9 | 2018-07-23 13:08:30 -0700 | [diff] [blame] | 82 | |
Adrian Roos | 0f9368c | 2018-04-08 10:59:08 -0700 | [diff] [blame] | 83 | import java.util.ArrayList; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 84 | import java.util.Arrays; |
Adrian Roos | 0f9368c | 2018-04-08 10:59:08 -0700 | [diff] [blame] | 85 | import java.util.Collections; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 86 | import java.util.LinkedList; |
| 87 | import java.util.List; |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 88 | |
| 89 | /** |
| 90 | * Tests for the {@link DisplayContent} class. |
| 91 | * |
| 92 | * Build/Install/Run: |
Yunfan Chen | 6dd9a62 | 2019-02-18 15:12:33 +0900 | [diff] [blame] | 93 | * atest WmTests:DisplayContentTests |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 94 | */ |
| 95 | @SmallTest |
| 96 | @Presubmit |
Wale Ogunwale | 44fbdf5 | 2016-11-16 10:18:45 -0800 | [diff] [blame] | 97 | public class DisplayContentTests extends WindowTestsBase { |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 98 | |
| 99 | @Test |
Yunfan Chen | 6dd9a62 | 2019-02-18 15:12:33 +0900 | [diff] [blame] | 100 | @FlakyTest(detail = "Promote to presubmit when shown to be stable.") |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 101 | public void testForAllWindows() { |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 102 | final WindowState exitingAppWindow = createWindow(null, TYPE_BASE_APPLICATION, |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 103 | mDisplayContent, "exiting app"); |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 104 | final AppWindowToken exitingAppToken = exitingAppWindow.mAppToken; |
Yunfan Chen | 6dd9a62 | 2019-02-18 15:12:33 +0900 | [diff] [blame] | 105 | // Wait until everything in animation handler get executed to prevent the exiting window |
| 106 | // from being removed during WindowSurfacePlacer Traversal. |
| 107 | waitUntilHandlersIdle(); |
| 108 | |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 109 | exitingAppToken.mIsExiting = true; |
Bryce Lee | 6d41026 | 2017-02-28 15:30:17 -0800 | [diff] [blame] | 110 | exitingAppToken.getTask().mStack.mExitingAppTokens.add(exitingAppToken); |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 111 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 112 | assertForAllWindowsOrder(Arrays.asList( |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 113 | mWallpaperWindow, |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 114 | exitingAppWindow, |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 115 | mChildAppWindowBelow, |
| 116 | mAppWindow, |
| 117 | mChildAppWindowAbove, |
| 118 | mDockedDividerWindow, |
| 119 | mStatusBarWindow, |
| 120 | mNavBarWindow, |
| 121 | mImeWindow, |
| 122 | mImeDialogWindow)); |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 126 | public void testForAllWindows_WithAppImeTarget() { |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 127 | final WindowState imeAppTarget = |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 128 | createWindow(null, TYPE_BASE_APPLICATION, mDisplayContent, "imeAppTarget"); |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 129 | |
lumark | ff0ab69 | 2018-11-05 20:32:30 +0800 | [diff] [blame] | 130 | mDisplayContent.mInputMethodTarget = imeAppTarget; |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 131 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 132 | assertForAllWindowsOrder(Arrays.asList( |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 133 | mWallpaperWindow, |
| 134 | mChildAppWindowBelow, |
| 135 | mAppWindow, |
| 136 | mChildAppWindowAbove, |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 137 | imeAppTarget, |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 138 | mImeWindow, |
| 139 | mImeDialogWindow, |
| 140 | mDockedDividerWindow, |
| 141 | mStatusBarWindow, |
| 142 | mNavBarWindow)); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 143 | } |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 144 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 145 | @Test |
lumark | ff0ab69 | 2018-11-05 20:32:30 +0800 | [diff] [blame] | 146 | public void testForAllWindows_WithChildWindowImeTarget() throws Exception { |
| 147 | mDisplayContent.mInputMethodTarget = mChildAppWindowAbove; |
Wale Ogunwale | 3c1170d | 2016-12-02 14:44:52 -0800 | [diff] [blame] | 148 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 149 | assertForAllWindowsOrder(Arrays.asList( |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 150 | mWallpaperWindow, |
| 151 | mChildAppWindowBelow, |
| 152 | mAppWindow, |
| 153 | mChildAppWindowAbove, |
| 154 | mImeWindow, |
| 155 | mImeDialogWindow, |
| 156 | mDockedDividerWindow, |
| 157 | mStatusBarWindow, |
| 158 | mNavBarWindow)); |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 159 | } |
Wale Ogunwale | 5d7e7f1 | 2016-12-12 14:47:05 -0800 | [diff] [blame] | 160 | |
| 161 | @Test |
lumark | ff0ab69 | 2018-11-05 20:32:30 +0800 | [diff] [blame] | 162 | public void testForAllWindows_WithStatusBarImeTarget() throws Exception { |
| 163 | mDisplayContent.mInputMethodTarget = mStatusBarWindow; |
Wale Ogunwale | 6ce0fb8 | 2016-12-13 14:24:00 -0800 | [diff] [blame] | 164 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 165 | assertForAllWindowsOrder(Arrays.asList( |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 166 | mWallpaperWindow, |
| 167 | mChildAppWindowBelow, |
| 168 | mAppWindow, |
| 169 | mChildAppWindowAbove, |
| 170 | mDockedDividerWindow, |
| 171 | mStatusBarWindow, |
| 172 | mImeWindow, |
| 173 | mImeDialogWindow, |
| 174 | mNavBarWindow)); |
Wale Ogunwale | 6ce0fb8 | 2016-12-13 14:24:00 -0800 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 178 | public void testForAllWindows_WithInBetweenWindowToken() { |
Wale Ogunwale | 5d7e7f1 | 2016-12-12 14:47:05 -0800 | [diff] [blame] | 179 | // This window is set-up to be z-ordered between some windows that go in the same token like |
| 180 | // the nav bar and status bar. |
| 181 | final WindowState voiceInteractionWindow = createWindow(null, TYPE_VOICE_INTERACTION, |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 182 | mDisplayContent, "voiceInteractionWindow"); |
Wale Ogunwale | 5d7e7f1 | 2016-12-12 14:47:05 -0800 | [diff] [blame] | 183 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 184 | assertForAllWindowsOrder(Arrays.asList( |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 185 | mWallpaperWindow, |
| 186 | mChildAppWindowBelow, |
| 187 | mAppWindow, |
| 188 | mChildAppWindowAbove, |
| 189 | mDockedDividerWindow, |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 190 | voiceInteractionWindow, |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 191 | mStatusBarWindow, |
| 192 | mNavBarWindow, |
| 193 | mImeWindow, |
| 194 | mImeDialogWindow)); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 195 | } |
Wale Ogunwale | 5d7e7f1 | 2016-12-12 14:47:05 -0800 | [diff] [blame] | 196 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 197 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 198 | public void testComputeImeTarget() { |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 199 | // Verify that an app window can be an ime target. |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 200 | final WindowState appWin = createWindow(null, TYPE_APPLICATION, mDisplayContent, "appWin"); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 201 | appWin.setHasSurface(true); |
| 202 | assertTrue(appWin.canBeImeTarget()); |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 203 | WindowState imeTarget = mDisplayContent.computeImeTarget(false /* updateImeTarget */); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 204 | assertEquals(appWin, imeTarget); |
chaviw | ebcbc34 | 2018-02-07 13:19:00 -0800 | [diff] [blame] | 205 | appWin.mHidden = false; |
Wale Ogunwale | 5d7e7f1 | 2016-12-12 14:47:05 -0800 | [diff] [blame] | 206 | |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 207 | // Verify that an child window can be an ime target. |
| 208 | final WindowState childWin = createWindow(appWin, |
| 209 | TYPE_APPLICATION_ATTACHED_DIALOG, "childWin"); |
| 210 | childWin.setHasSurface(true); |
| 211 | assertTrue(childWin.canBeImeTarget()); |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 212 | imeTarget = mDisplayContent.computeImeTarget(false /* updateImeTarget */); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 213 | assertEquals(childWin, imeTarget); |
Wale Ogunwale | 5d7e7f1 | 2016-12-12 14:47:05 -0800 | [diff] [blame] | 214 | } |
Andrii Kulian | 6cc1a1d | 2016-12-27 23:52:59 -0800 | [diff] [blame] | 215 | |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 216 | /** |
| 217 | * This tests stack movement between displays and proper stack's, task's and app token's display |
| 218 | * container references updates. |
| 219 | */ |
Andrii Kulian | 6cc1a1d | 2016-12-27 23:52:59 -0800 | [diff] [blame] | 220 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 221 | public void testMoveStackBetweenDisplays() { |
Andrii Kulian | 367ff7f | 2017-01-25 19:45:34 -0800 | [diff] [blame] | 222 | // Create a second display. |
| 223 | final DisplayContent dc = createNewDisplay(); |
Andrii Kulian | 6cc1a1d | 2016-12-27 23:52:59 -0800 | [diff] [blame] | 224 | |
| 225 | // Add stack with activity. |
| 226 | final TaskStack stack = createTaskStackOnDisplay(dc); |
| 227 | assertEquals(dc.getDisplayId(), stack.getDisplayContent().getDisplayId()); |
| 228 | assertEquals(dc, stack.getParent().getParent()); |
| 229 | assertEquals(dc, stack.getDisplayContent()); |
| 230 | |
| 231 | final Task task = createTaskInStack(stack, 0 /* userId */); |
chaviw | 97d2820 | 2018-02-27 16:23:53 -0800 | [diff] [blame] | 232 | final WindowTestUtils.TestAppWindowToken token = WindowTestUtils.createTestAppWindowToken( |
| 233 | dc); |
Andrii Kulian | 6cc1a1d | 2016-12-27 23:52:59 -0800 | [diff] [blame] | 234 | task.addChild(token, 0); |
| 235 | assertEquals(dc, task.getDisplayContent()); |
| 236 | assertEquals(dc, token.getDisplayContent()); |
| 237 | |
| 238 | // Move stack to first display. |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 239 | mDisplayContent.moveStackToDisplay(stack, true /* onTop */); |
| 240 | assertEquals(mDisplayContent.getDisplayId(), stack.getDisplayContent().getDisplayId()); |
| 241 | assertEquals(mDisplayContent, stack.getParent().getParent()); |
| 242 | assertEquals(mDisplayContent, stack.getDisplayContent()); |
| 243 | assertEquals(mDisplayContent, task.getDisplayContent()); |
| 244 | assertEquals(mDisplayContent, token.getDisplayContent()); |
Andrii Kulian | 6cc1a1d | 2016-12-27 23:52:59 -0800 | [diff] [blame] | 245 | } |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 246 | |
| 247 | /** |
| 248 | * This tests override configuration updates for display content. |
| 249 | */ |
| 250 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 251 | public void testDisplayOverrideConfigUpdate() { |
Evan Rosky | dfe3da7 | 2018-10-26 17:21:06 -0700 | [diff] [blame] | 252 | final Configuration currentOverrideConfig = |
| 253 | mDisplayContent.getRequestedOverrideConfiguration(); |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 254 | |
| 255 | // Create new, slightly changed override configuration and apply it to the display. |
| 256 | final Configuration newOverrideConfig = new Configuration(currentOverrideConfig); |
| 257 | newOverrideConfig.densityDpi += 120; |
| 258 | newOverrideConfig.fontScale += 0.3; |
| 259 | |
Evan Rosky | e747c3e | 2018-10-30 20:06:41 -0700 | [diff] [blame] | 260 | mWm.setNewDisplayOverrideConfiguration(newOverrideConfig, mDisplayContent); |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 261 | |
| 262 | // Check that override config is applied. |
Evan Rosky | dfe3da7 | 2018-10-26 17:21:06 -0700 | [diff] [blame] | 263 | assertEquals(newOverrideConfig, mDisplayContent.getRequestedOverrideConfiguration()); |
Andrii Kulian | 367ff7f | 2017-01-25 19:45:34 -0800 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | /** |
| 267 | * This tests global configuration updates when default display config is updated. |
| 268 | */ |
| 269 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 270 | public void testDefaultDisplayOverrideConfigUpdate() { |
Evan Rosky | e747c3e | 2018-10-30 20:06:41 -0700 | [diff] [blame] | 271 | DisplayContent defaultDisplay = mWm.mRoot.getDisplayContent(DEFAULT_DISPLAY); |
| 272 | final Configuration currentConfig = defaultDisplay.getConfiguration(); |
Andrii Kulian | 367ff7f | 2017-01-25 19:45:34 -0800 | [diff] [blame] | 273 | |
| 274 | // Create new, slightly changed override configuration and apply it to the display. |
Andrii Kulian | a95bfff | 2017-03-30 19:00:41 -0700 | [diff] [blame] | 275 | final Configuration newOverrideConfig = new Configuration(currentConfig); |
Andrii Kulian | 367ff7f | 2017-01-25 19:45:34 -0800 | [diff] [blame] | 276 | newOverrideConfig.densityDpi += 120; |
| 277 | newOverrideConfig.fontScale += 0.3; |
| 278 | |
Evan Rosky | e747c3e | 2018-10-30 20:06:41 -0700 | [diff] [blame] | 279 | mWm.setNewDisplayOverrideConfiguration(newOverrideConfig, defaultDisplay); |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 280 | |
| 281 | // Check that global configuration is updated, as we've updated default display's config. |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 282 | Configuration globalConfig = mWm.mRoot.getConfiguration(); |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 283 | assertEquals(newOverrideConfig.densityDpi, globalConfig.densityDpi); |
| 284 | assertEquals(newOverrideConfig.fontScale, globalConfig.fontScale, 0.1 /* delta */); |
Andrii Kulian | 367ff7f | 2017-01-25 19:45:34 -0800 | [diff] [blame] | 285 | |
| 286 | // Return back to original values. |
Evan Rosky | e747c3e | 2018-10-30 20:06:41 -0700 | [diff] [blame] | 287 | mWm.setNewDisplayOverrideConfiguration(currentConfig, defaultDisplay); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 288 | globalConfig = mWm.mRoot.getConfiguration(); |
Andrii Kulian | a95bfff | 2017-03-30 19:00:41 -0700 | [diff] [blame] | 289 | assertEquals(currentConfig.densityDpi, globalConfig.densityDpi); |
| 290 | assertEquals(currentConfig.fontScale, globalConfig.fontScale, 0.1 /* delta */); |
Andrii Kulian | d68501e | 2017-01-10 22:57:27 -0800 | [diff] [blame] | 291 | } |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 292 | |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 293 | /** |
| 294 | * Tests tapping on a stack in different display results in window gaining focus. |
| 295 | */ |
| 296 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 297 | public void testInputEventBringsCorrectDisplayInFocus() { |
| 298 | DisplayContent dc0 = mWm.getDefaultDisplayContentLocked(); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 299 | // Create a second display |
| 300 | final DisplayContent dc1 = createNewDisplay(); |
| 301 | |
| 302 | // Add stack with activity. |
| 303 | final TaskStack stack0 = createTaskStackOnDisplay(dc0); |
| 304 | final Task task0 = createTaskInStack(stack0, 0 /* userId */); |
| 305 | final WindowTestUtils.TestAppWindowToken token = |
chaviw | 97d2820 | 2018-02-27 16:23:53 -0800 | [diff] [blame] | 306 | WindowTestUtils.createTestAppWindowToken(dc0); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 307 | task0.addChild(token, 0); |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 308 | dc0.configureDisplayPolicy(); |
| 309 | assertNotNull(dc0.mTapDetector); |
| 310 | |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 311 | final TaskStack stack1 = createTaskStackOnDisplay(dc1); |
| 312 | final Task task1 = createTaskInStack(stack1, 0 /* userId */); |
| 313 | final WindowTestUtils.TestAppWindowToken token1 = |
chaviw | 97d2820 | 2018-02-27 16:23:53 -0800 | [diff] [blame] | 314 | WindowTestUtils.createTestAppWindowToken(dc0); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 315 | task1.addChild(token1, 0); |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 316 | dc1.configureDisplayPolicy(); |
| 317 | assertNotNull(dc1.mTapDetector); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 318 | |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 319 | // tap on primary display. |
| 320 | tapOnDisplay(dc0); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 321 | // Check focus is on primary display. |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 322 | assertEquals(mWm.mRoot.getTopFocusedDisplayContent().mCurrentFocus, |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 323 | dc0.findFocusedWindow()); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 324 | |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 325 | // Tap on secondary display. |
| 326 | tapOnDisplay(dc1); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 327 | // Check focus is on secondary. |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 328 | assertEquals(mWm.mRoot.getTopFocusedDisplayContent().mCurrentFocus, |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 329 | dc1.findFocusedWindow()); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 330 | } |
| 331 | |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 332 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 333 | public void testFocusedWindowMultipleDisplays() { |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 334 | doTestFocusedWindowMultipleDisplays(false /* perDisplayFocusEnabled */, Q); |
| 335 | } |
| 336 | |
| 337 | @Test |
| 338 | public void testFocusedWindowMultipleDisplaysPerDisplayFocusEnabled() { |
| 339 | doTestFocusedWindowMultipleDisplays(true /* perDisplayFocusEnabled */, Q); |
| 340 | } |
| 341 | |
| 342 | @Test |
| 343 | public void testFocusedWindowMultipleDisplaysPerDisplayFocusEnabledLegacyApp() { |
| 344 | doTestFocusedWindowMultipleDisplays(true /* perDisplayFocusEnabled */, P); |
| 345 | } |
| 346 | |
| 347 | private void doTestFocusedWindowMultipleDisplays(boolean perDisplayFocusEnabled, |
| 348 | int targetSdk) { |
| 349 | mWm.mPerDisplayFocusEnabled = perDisplayFocusEnabled; |
| 350 | |
Andrii Kulian | 0214ed9 | 2017-05-16 13:44:05 -0700 | [diff] [blame] | 351 | // Create a focusable window and check that focus is calculated correctly |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 352 | final WindowState window1 = |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 353 | createWindow(null, TYPE_BASE_APPLICATION, mDisplayContent, "window1"); |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 354 | window1.mAppToken.mTargetSdk = targetSdk; |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 355 | updateFocusedWindow(); |
| 356 | assertTrue(window1.isFocused()); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 357 | assertEquals(window1, mWm.mRoot.getTopFocusedDisplayContent().mCurrentFocus); |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 358 | |
| 359 | // Check that a new display doesn't affect focus |
| 360 | final DisplayContent dc = createNewDisplay(); |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 361 | updateFocusedWindow(); |
| 362 | assertTrue(window1.isFocused()); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 363 | assertEquals(window1, mWm.mRoot.getTopFocusedDisplayContent().mCurrentFocus); |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 364 | |
| 365 | // Add a window to the second display, and it should be focused |
| 366 | final WindowState window2 = createWindow(null, TYPE_BASE_APPLICATION, dc, "window2"); |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 367 | window2.mAppToken.mTargetSdk = targetSdk; |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 368 | updateFocusedWindow(); |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 369 | assertTrue(window2.isFocused()); |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 370 | assertEquals(perDisplayFocusEnabled && targetSdk >= Q, window1.isFocused()); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 371 | assertEquals(window2, mWm.mRoot.getTopFocusedDisplayContent().mCurrentFocus); |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 372 | |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 373 | // Move the first window to top including parents, and make sure focus is updated |
David Stevens | 4693956 | 2017-03-24 13:04:00 -0700 | [diff] [blame] | 374 | window1.getParent().positionChildAt(POSITION_TOP, window1, true); |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 375 | updateFocusedWindow(); |
| 376 | assertTrue(window1.isFocused()); |
Tiger Huang | 51c5a1d | 2018-12-11 20:24:51 +0800 | [diff] [blame] | 377 | assertEquals(perDisplayFocusEnabled && targetSdk >= Q, window2.isFocused()); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 378 | assertEquals(window1, mWm.mRoot.getTopFocusedDisplayContent().mCurrentFocus); |
Adrian Roos | 4163d62 | 2018-05-22 16:56:35 +0200 | [diff] [blame] | 379 | } |
| 380 | |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 381 | /** |
| 382 | * This tests setting the maximum ui width on a display. |
| 383 | */ |
| 384 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 385 | public void testMaxUiWidth() { |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 386 | // Prevent base display metrics for test from being updated to the value of real display. |
| 387 | final DisplayContent displayContent = createDisplayNoUpdateDisplayInfo(); |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 388 | final int baseWidth = 1440; |
| 389 | final int baseHeight = 2560; |
| 390 | final int baseDensity = 300; |
| 391 | |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 392 | displayContent.updateBaseDisplayMetrics(baseWidth, baseHeight, baseDensity); |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 393 | |
| 394 | final int maxWidth = 300; |
| 395 | final int resultingHeight = (maxWidth * baseHeight) / baseWidth; |
| 396 | final int resultingDensity = (maxWidth * baseDensity) / baseWidth; |
| 397 | |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 398 | displayContent.setMaxUiWidth(maxWidth); |
| 399 | verifySizes(displayContent, maxWidth, resultingHeight, resultingDensity); |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 400 | |
| 401 | // Assert setting values again does not change; |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 402 | displayContent.updateBaseDisplayMetrics(baseWidth, baseHeight, baseDensity); |
| 403 | verifySizes(displayContent, maxWidth, resultingHeight, resultingDensity); |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 404 | |
| 405 | final int smallerWidth = 200; |
| 406 | final int smallerHeight = 400; |
| 407 | final int smallerDensity = 100; |
| 408 | |
| 409 | // Specify smaller dimension, verify that it is honored |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 410 | displayContent.updateBaseDisplayMetrics(smallerWidth, smallerHeight, smallerDensity); |
| 411 | verifySizes(displayContent, smallerWidth, smallerHeight, smallerDensity); |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 412 | |
| 413 | // Verify that setting the max width to a greater value than the base width has no effect |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 414 | displayContent.setMaxUiWidth(maxWidth); |
| 415 | verifySizes(displayContent, smallerWidth, smallerHeight, smallerDensity); |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 416 | } |
| 417 | |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 418 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 419 | public void testDisplayCutout_rot0() { |
| 420 | synchronized (mWm.getWindowManagerLock()) { |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 421 | final DisplayContent dc = createNewDisplay(); |
| 422 | dc.mInitialDisplayWidth = 200; |
| 423 | dc.mInitialDisplayHeight = 400; |
Adrian Roos | 2426421 | 2018-02-19 16:26:15 +0100 | [diff] [blame] | 424 | Rect r = new Rect(80, 0, 120, 10); |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 425 | final DisplayCutout cutout = new WmDisplayCutout( |
Issei Suzuki | 43190bd | 2018-08-20 17:28:41 +0200 | [diff] [blame] | 426 | fromBoundingRect(r.left, r.top, r.right, r.bottom, BOUNDS_POSITION_TOP), null) |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 427 | .computeSafeInsets(200, 400).getDisplayCutout(); |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 428 | |
| 429 | dc.mInitialDisplayCutout = cutout; |
| 430 | dc.setRotation(Surface.ROTATION_0); |
| 431 | dc.computeScreenConfiguration(new Configuration()); // recomputes dc.mDisplayInfo. |
| 432 | |
| 433 | assertEquals(cutout, dc.getDisplayInfo().displayCutout); |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 438 | public void testDisplayCutout_rot90() { |
| 439 | synchronized (mWm.getWindowManagerLock()) { |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 440 | // Prevent mInitialDisplayCutout from being updated from real display (e.g. null |
| 441 | // if the device has no cutout). |
| 442 | final DisplayContent dc = createDisplayNoUpdateDisplayInfo(); |
| 443 | // Rotation may use real display info to compute bound, so here also uses the |
| 444 | // same width and height. |
| 445 | final int displayWidth = dc.mInitialDisplayWidth; |
| 446 | final int displayHeight = dc.mInitialDisplayHeight; |
| 447 | final int cutoutWidth = 40; |
| 448 | final int cutoutHeight = 10; |
| 449 | final int left = (displayWidth - cutoutWidth) / 2; |
| 450 | final int top = 0; |
| 451 | final int right = (displayWidth + cutoutWidth) / 2; |
| 452 | final int bottom = cutoutHeight; |
| 453 | |
| 454 | final Rect r1 = new Rect(left, top, right, bottom); |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 455 | final DisplayCutout cutout = new WmDisplayCutout( |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 456 | fromBoundingRect(r1.left, r1.top, r1.right, r1.bottom, BOUNDS_POSITION_TOP), |
| 457 | null) |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 458 | .computeSafeInsets(displayWidth, displayHeight).getDisplayCutout(); |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 459 | |
| 460 | dc.mInitialDisplayCutout = cutout; |
| 461 | dc.setRotation(Surface.ROTATION_90); |
| 462 | dc.computeScreenConfiguration(new Configuration()); // recomputes dc.mDisplayInfo. |
| 463 | |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 464 | // ----o---------- ------------- |
| 465 | // | | | | | |
| 466 | // | ------o | o--- |
| 467 | // | | | | |
| 468 | // | | -> | | |
| 469 | // | | ---o |
| 470 | // | | | |
| 471 | // | | ------------- |
| 472 | final Rect r = new Rect(top, left, bottom, right); |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 473 | assertEquals(new WmDisplayCutout( |
Issei Suzuki | 43190bd | 2018-08-20 17:28:41 +0200 | [diff] [blame] | 474 | fromBoundingRect(r.left, r.top, r.right, r.bottom, BOUNDS_POSITION_LEFT), null) |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 475 | .computeSafeInsets(displayHeight, displayWidth) |
| 476 | .getDisplayCutout(), dc.getDisplayInfo().displayCutout); |
Adrian Roos | 1cf58505 | 2018-01-03 18:43:27 +0100 | [diff] [blame] | 477 | } |
| 478 | } |
| 479 | |
| 480 | @Test |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 481 | public void testLayoutSeq_assignedDuringLayout() { |
| 482 | synchronized (mWm.getWindowManagerLock()) { |
Adrian Roos | 5251b1d | 2018-03-23 18:57:43 +0100 | [diff] [blame] | 483 | |
| 484 | final DisplayContent dc = createNewDisplay(); |
| 485 | final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, dc, "w"); |
| 486 | |
| 487 | dc.setLayoutNeeded(); |
| 488 | dc.performLayout(true /* initial */, false /* updateImeWindows */); |
| 489 | |
| 490 | assertThat(win.mLayoutSeq, is(dc.mLayoutSeq)); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | @Test |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 495 | @SuppressLint("InlinedApi") |
| 496 | public void testOrientationDefinedByKeyguard() { |
| 497 | final DisplayContent dc = createNewDisplay(); |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 498 | |
| 499 | // When display content is created its configuration is not yet initialized, which could |
| 500 | // cause unnecessary configuration propagation, so initialize it here. |
| 501 | final Configuration config = new Configuration(); |
| 502 | dc.computeScreenConfiguration(config); |
| 503 | dc.onRequestedOverrideConfigurationChanged(config); |
| 504 | |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 505 | // Create a window that requests landscape orientation. It will define device orientation |
| 506 | // by default. |
| 507 | final WindowState window = createWindow(null /* parent */, TYPE_BASE_APPLICATION, dc, "w"); |
| 508 | window.mAppToken.setOrientation(SCREEN_ORIENTATION_LANDSCAPE); |
| 509 | |
| 510 | final WindowState keyguard = createWindow(null, TYPE_STATUS_BAR, dc, "keyguard"); |
| 511 | keyguard.mHasSurface = true; |
| 512 | keyguard.mAttrs.screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED; |
| 513 | |
| 514 | assertEquals("Screen orientation must be defined by the app window by default", |
| 515 | SCREEN_ORIENTATION_LANDSCAPE, dc.getOrientation()); |
| 516 | |
| 517 | keyguard.mAttrs.screenOrientation = SCREEN_ORIENTATION_PORTRAIT; |
| 518 | assertEquals("Visible keyguard must influence device orientation", |
| 519 | SCREEN_ORIENTATION_PORTRAIT, dc.getOrientation()); |
| 520 | |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 521 | mWm.setKeyguardGoingAway(true); |
Andrii Kulian | 92c9a94 | 2017-10-10 00:41:41 -0700 | [diff] [blame] | 522 | assertEquals("Keyguard that is going away must not influence device orientation", |
| 523 | SCREEN_ORIENTATION_LANDSCAPE, dc.getOrientation()); |
| 524 | } |
| 525 | |
Andrii Kulian | f0379de | 2018-03-14 16:24:07 -0700 | [diff] [blame] | 526 | @Test |
| 527 | public void testDisableDisplayInfoOverrideFromWindowManager() { |
| 528 | final DisplayContent dc = createNewDisplay(); |
| 529 | |
| 530 | assertTrue(dc.mShouldOverrideDisplayConfiguration); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 531 | mWm.dontOverrideDisplayInfo(dc.getDisplayId()); |
Andrii Kulian | f0379de | 2018-03-14 16:24:07 -0700 | [diff] [blame] | 532 | |
| 533 | assertFalse(dc.mShouldOverrideDisplayConfiguration); |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 534 | verify(mWm.mDisplayManagerInternal, times(1)) |
Andrii Kulian | f0379de | 2018-03-14 16:24:07 -0700 | [diff] [blame] | 535 | .setDisplayInfoOverrideFromWindowManager(dc.getDisplayId(), null); |
| 536 | } |
| 537 | |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 538 | @Test |
Riddle Hsu | 85bd04b | 2018-11-17 00:34:36 +0800 | [diff] [blame] | 539 | public void testClearLastFocusWhenReparentingFocusedWindow() { |
| 540 | final DisplayContent defaultDisplay = mWm.getDefaultDisplayContentLocked(); |
| 541 | final WindowState window = createWindow(null /* parent */, TYPE_BASE_APPLICATION, |
| 542 | defaultDisplay, "window"); |
| 543 | defaultDisplay.mLastFocus = window; |
| 544 | mDisplayContent.mCurrentFocus = window; |
| 545 | mDisplayContent.reParentWindowToken(window.mToken); |
| 546 | |
| 547 | assertNull(defaultDisplay.mLastFocus); |
| 548 | } |
| 549 | |
| 550 | @Test |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 551 | public void testGetPreferredOptionsPanelGravityFromDifferentDisplays() { |
| 552 | final DisplayContent portraitDisplay = createNewDisplay(); |
| 553 | portraitDisplay.mInitialDisplayHeight = 2000; |
| 554 | portraitDisplay.mInitialDisplayWidth = 1000; |
| 555 | |
| 556 | portraitDisplay.setRotation(Surface.ROTATION_0); |
| 557 | assertFalse(isOptionsPanelAtRight(portraitDisplay.getDisplayId())); |
| 558 | portraitDisplay.setRotation(Surface.ROTATION_90); |
| 559 | assertTrue(isOptionsPanelAtRight(portraitDisplay.getDisplayId())); |
| 560 | |
| 561 | final DisplayContent landscapeDisplay = createNewDisplay(); |
| 562 | landscapeDisplay.mInitialDisplayHeight = 1000; |
| 563 | landscapeDisplay.mInitialDisplayWidth = 2000; |
| 564 | |
| 565 | landscapeDisplay.setRotation(Surface.ROTATION_0); |
| 566 | assertTrue(isOptionsPanelAtRight(landscapeDisplay.getDisplayId())); |
| 567 | landscapeDisplay.setRotation(Surface.ROTATION_90); |
| 568 | assertFalse(isOptionsPanelAtRight(landscapeDisplay.getDisplayId())); |
| 569 | } |
| 570 | |
lumark | ff0ab69 | 2018-11-05 20:32:30 +0800 | [diff] [blame] | 571 | @Test |
| 572 | public void testInputMethodTargetUpdateWhenSwitchingOnDisplays() { |
| 573 | final DisplayContent newDisplay = createNewDisplay(); |
| 574 | |
| 575 | final WindowState appWin = createWindow(null, TYPE_APPLICATION, mDisplayContent, "appWin"); |
| 576 | final WindowState appWin1 = createWindow(null, TYPE_APPLICATION, newDisplay, "appWin1"); |
| 577 | appWin.setHasSurface(true); |
| 578 | appWin1.setHasSurface(true); |
| 579 | |
| 580 | // Set current input method window on default display, make sure the input method target |
| 581 | // is appWin & null on the other display. |
| 582 | mDisplayContent.setInputMethodWindowLocked(mImeWindow); |
| 583 | newDisplay.setInputMethodWindowLocked(null); |
| 584 | assertTrue("appWin should be IME target window", |
| 585 | appWin.equals(mDisplayContent.mInputMethodTarget)); |
| 586 | assertNull("newDisplay Ime target: ", newDisplay.mInputMethodTarget); |
| 587 | |
| 588 | // Switch input method window on new display & make sure the input method target also |
| 589 | // switched as expected. |
| 590 | newDisplay.setInputMethodWindowLocked(mImeWindow); |
| 591 | mDisplayContent.setInputMethodWindowLocked(null); |
| 592 | assertTrue("appWin1 should be IME target window", |
| 593 | appWin1.equals(newDisplay.mInputMethodTarget)); |
| 594 | assertNull("default display Ime target: ", mDisplayContent.mInputMethodTarget); |
| 595 | } |
| 596 | |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 597 | @Test |
| 598 | public void testOnDescendantOrientationRequestChanged() { |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 599 | final DisplayContent dc = createNewDisplay(); |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 600 | mWm.mAtmService.mRootActivityContainer = mock(RootActivityContainer.class); |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 601 | final int newOrientation = dc.getLastOrientation() == SCREEN_ORIENTATION_LANDSCAPE |
| 602 | ? SCREEN_ORIENTATION_PORTRAIT |
| 603 | : SCREEN_ORIENTATION_LANDSCAPE; |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 604 | |
| 605 | final WindowState window = createWindow(null /* parent */, TYPE_BASE_APPLICATION, dc, "w"); |
| 606 | window.getTask().mTaskRecord = mock(TaskRecord.class, ExtendedMockito.RETURNS_DEEP_STUBS); |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 607 | window.mAppToken.setOrientation(newOrientation); |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 608 | |
| 609 | ActivityRecord activityRecord = mock(ActivityRecord.class); |
| 610 | |
| 611 | assertTrue("Display should rotate to handle orientation request by default.", |
| 612 | dc.onDescendantOrientationChanged(window.mToken.token, activityRecord)); |
| 613 | |
| 614 | final ArgumentCaptor<Configuration> captor = ArgumentCaptor.forClass(Configuration.class); |
| 615 | verify(mWm.mAtmService).updateDisplayOverrideConfigurationLocked(captor.capture(), |
| 616 | same(activityRecord), anyBoolean(), eq(dc.getDisplayId())); |
| 617 | final Configuration newDisplayConfig = captor.getValue(); |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 618 | assertEquals(Configuration.ORIENTATION_PORTRAIT, newDisplayConfig.orientation); |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 619 | } |
| 620 | |
| 621 | @Test |
| 622 | public void testOnDescendantOrientationRequestChanged_FrozenToUserRotation() { |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 623 | final DisplayContent dc = createNewDisplay(); |
Garfield Tan | 7fbca05 | 2019-02-19 10:45:35 -0800 | [diff] [blame^] | 624 | dc.getDisplayRotation().setFixedToUserRotation( |
| 625 | DisplayRotation.FIXED_TO_USER_ROTATION_ENABLED); |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 626 | mWm.mAtmService.mRootActivityContainer = mock(RootActivityContainer.class); |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 627 | final int newOrientation = dc.getLastOrientation() == SCREEN_ORIENTATION_LANDSCAPE |
| 628 | ? SCREEN_ORIENTATION_PORTRAIT |
| 629 | : SCREEN_ORIENTATION_LANDSCAPE; |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 630 | |
| 631 | final WindowState window = createWindow(null /* parent */, TYPE_BASE_APPLICATION, dc, "w"); |
| 632 | window.getTask().mTaskRecord = mock(TaskRecord.class, ExtendedMockito.RETURNS_DEEP_STUBS); |
Garfield Tan | 49dae10 | 2019-02-04 09:51:59 -0800 | [diff] [blame] | 633 | window.mAppToken.setOrientation(newOrientation); |
Garfield Tan | 90b0428 | 2018-12-11 14:04:42 -0800 | [diff] [blame] | 634 | |
| 635 | ActivityRecord activityRecord = mock(ActivityRecord.class); |
| 636 | |
| 637 | assertFalse("Display shouldn't rotate to handle orientation request if fixed to" |
| 638 | + " user rotation.", |
| 639 | dc.onDescendantOrientationChanged(window.mToken.token, activityRecord)); |
| 640 | verify(mWm.mAtmService, never()).updateDisplayOverrideConfigurationLocked(any(), |
| 641 | eq(activityRecord), anyBoolean(), eq(dc.getDisplayId())); |
| 642 | } |
| 643 | |
Tarandeep Singh | a6f3561 | 2019-01-11 19:50:46 -0800 | [diff] [blame] | 644 | @Test |
| 645 | public void testComputeImeParent_app() throws Exception { |
| 646 | try (final InsetsModeSession session = |
| 647 | new InsetsModeSession(ViewRootImpl.NEW_INSETS_MODE_IME)) { |
| 648 | final DisplayContent dc = createNewDisplay(); |
| 649 | dc.mInputMethodTarget = createWindow(null, TYPE_BASE_APPLICATION, "app"); |
| 650 | assertEquals(dc.mInputMethodTarget.mAppToken.getSurfaceControl(), |
| 651 | dc.computeImeParent()); |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | @Test |
| 656 | public void testComputeImeParent_app_notFullscreen() throws Exception { |
| 657 | try (final InsetsModeSession session = |
| 658 | new InsetsModeSession(ViewRootImpl.NEW_INSETS_MODE_IME)) { |
| 659 | final DisplayContent dc = createNewDisplay(); |
| 660 | dc.mInputMethodTarget = createWindow(null, TYPE_STATUS_BAR, "app"); |
| 661 | dc.mInputMethodTarget.setWindowingMode( |
| 662 | WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY); |
| 663 | assertEquals(dc.getWindowingLayer(), dc.computeImeParent()); |
| 664 | } |
| 665 | } |
| 666 | |
| 667 | @Test |
| 668 | public void testComputeImeParent_noApp() throws Exception { |
| 669 | try (final InsetsModeSession session = |
| 670 | new InsetsModeSession(ViewRootImpl.NEW_INSETS_MODE_IME)) { |
| 671 | final DisplayContent dc = createNewDisplay(); |
| 672 | dc.mInputMethodTarget = createWindow(null, TYPE_STATUS_BAR, "statusBar"); |
| 673 | assertEquals(dc.getWindowingLayer(), dc.computeImeParent()); |
| 674 | } |
| 675 | } |
| 676 | |
Susi Kharraz-Post | 9893b8c | 2019-02-12 14:21:29 -0500 | [diff] [blame] | 677 | @Test |
| 678 | public void testOrientationChangeLogging() { |
| 679 | MetricsLogger mockLogger = mock(MetricsLogger.class); |
| 680 | Configuration oldConfig = new Configuration(); |
| 681 | oldConfig.orientation = Configuration.ORIENTATION_LANDSCAPE; |
| 682 | |
| 683 | Configuration newConfig = new Configuration(); |
| 684 | newConfig.orientation = Configuration.ORIENTATION_PORTRAIT; |
| 685 | final DisplayContent displayContent = spy(createNewDisplay()); |
| 686 | Mockito.doReturn(mockLogger).when(displayContent).getMetricsLogger(); |
| 687 | Mockito.doReturn(oldConfig).doReturn(newConfig).when(displayContent).getConfiguration(); |
| 688 | |
| 689 | displayContent.onConfigurationChanged(newConfig); |
| 690 | |
| 691 | ArgumentCaptor<LogMaker> logMakerCaptor = ArgumentCaptor.forClass(LogMaker.class); |
| 692 | verify(mockLogger).write(logMakerCaptor.capture()); |
| 693 | assertThat(logMakerCaptor.getValue().getCategory(), |
| 694 | is(MetricsProto.MetricsEvent.ACTION_PHONE_ORIENTATION_CHANGED)); |
| 695 | assertThat(logMakerCaptor.getValue().getSubtype(), |
| 696 | is(Configuration.ORIENTATION_PORTRAIT)); |
| 697 | } |
| 698 | |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 699 | private boolean isOptionsPanelAtRight(int displayId) { |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 700 | return (mWm.getPreferredOptionsPanelGravity(displayId) & Gravity.RIGHT) == Gravity.RIGHT; |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 701 | } |
| 702 | |
Bryce Lee | 27cec32 | 2017-03-21 09:41:37 -0700 | [diff] [blame] | 703 | private static void verifySizes(DisplayContent displayContent, int expectedBaseWidth, |
| 704 | int expectedBaseHeight, int expectedBaseDensity) { |
| 705 | assertEquals(displayContent.mBaseDisplayWidth, expectedBaseWidth); |
| 706 | assertEquals(displayContent.mBaseDisplayHeight, expectedBaseHeight); |
| 707 | assertEquals(displayContent.mBaseDisplayDensity, expectedBaseDensity); |
| 708 | } |
| 709 | |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 710 | private void updateFocusedWindow() { |
Tadashi G. Takaoka | b6e148c | 2018-11-03 02:59:06 -0700 | [diff] [blame] | 711 | synchronized (mWm.mGlobalLock) { |
| 712 | mWm.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, false); |
Tiger Huang | 1e5b10a | 2018-07-30 20:19:51 +0800 | [diff] [blame] | 713 | } |
| 714 | } |
| 715 | |
Riddle Hsu | 654a6f9 | 2018-07-13 22:59:36 +0800 | [diff] [blame] | 716 | /** |
| 717 | * Create DisplayContent that does not update display base/initial values from device to keep |
| 718 | * the values set by test. |
| 719 | */ |
| 720 | private DisplayContent createDisplayNoUpdateDisplayInfo() { |
| 721 | final DisplayContent displayContent = spy(createNewDisplay()); |
| 722 | doNothing().when(displayContent).updateDisplayInfo(); |
| 723 | return displayContent; |
| 724 | } |
| 725 | |
Adrian Roos | 0f9368c | 2018-04-08 10:59:08 -0700 | [diff] [blame] | 726 | private void assertForAllWindowsOrder(List<WindowState> expectedWindowsBottomToTop) { |
| 727 | final LinkedList<WindowState> actualWindows = new LinkedList<>(); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 728 | |
| 729 | // Test forward traversal. |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 730 | mDisplayContent.forAllWindows(actualWindows::addLast, false /* traverseTopToBottom */); |
Adrian Roos | 0f9368c | 2018-04-08 10:59:08 -0700 | [diff] [blame] | 731 | assertThat("bottomToTop", actualWindows, is(expectedWindowsBottomToTop)); |
| 732 | |
| 733 | actualWindows.clear(); |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 734 | |
| 735 | // Test backward traversal. |
Wale Ogunwale | 11cc516 | 2017-04-25 20:29:13 -0700 | [diff] [blame] | 736 | mDisplayContent.forAllWindows(actualWindows::addLast, true /* traverseTopToBottom */); |
Adrian Roos | 0f9368c | 2018-04-08 10:59:08 -0700 | [diff] [blame] | 737 | assertThat("topToBottom", actualWindows, is(reverseList(expectedWindowsBottomToTop))); |
| 738 | } |
| 739 | |
| 740 | private static List<WindowState> reverseList(List<WindowState> list) { |
| 741 | final ArrayList<WindowState> result = new ArrayList<>(list); |
| 742 | Collections.reverse(result); |
| 743 | return result; |
Wale Ogunwale | 3424795 | 2017-02-19 11:57:53 -0800 | [diff] [blame] | 744 | } |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 745 | |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 746 | private void tapOnDisplay(final DisplayContent dc) { |
| 747 | final DisplayMetrics dm = dc.getDisplayMetrics(); |
| 748 | final float x = dm.widthPixels / 2; |
| 749 | final float y = dm.heightPixels / 2; |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 750 | final long downTime = SystemClock.uptimeMillis(); |
| 751 | final long eventTime = SystemClock.uptimeMillis() + 100; |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 752 | // sending ACTION_DOWN |
| 753 | final MotionEvent downEvent = MotionEvent.obtain( |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 754 | downTime, |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 755 | downTime, |
| 756 | MotionEvent.ACTION_DOWN, |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 757 | x, |
| 758 | y, |
Arthur Hung | be5ce21 | 2018-09-13 18:41:56 +0800 | [diff] [blame] | 759 | 0 /*metaState*/); |
| 760 | downEvent.setDisplayId(dc.getDisplayId()); |
| 761 | dc.mTapDetector.onPointerEvent(downEvent); |
| 762 | |
| 763 | // sending ACTION_UP |
| 764 | final MotionEvent upEvent = MotionEvent.obtain( |
| 765 | downTime, |
| 766 | eventTime, |
| 767 | MotionEvent.ACTION_UP, |
| 768 | x, |
| 769 | y, |
| 770 | 0 /*metaState*/); |
| 771 | upEvent.setDisplayId(dc.getDisplayId()); |
| 772 | dc.mTapDetector.onPointerEvent(upEvent); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 773 | } |
Wale Ogunwale | b783fd8 | 2016-11-04 09:51:54 -0700 | [diff] [blame] | 774 | } |