Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -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 |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.server.wm; |
| 18 | |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 19 | import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW; |
| 20 | import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW; |
| 21 | import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY; |
| 22 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL; |
| 23 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; |
| 24 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA; |
| 25 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY; |
| 26 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL; |
Jorim Jaggi | 9bafc71 | 2017-01-19 17:28:30 +0100 | [diff] [blame^] | 27 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 28 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL; |
| 29 | import static android.view.WindowManager.LayoutParams.TYPE_BOOT_PROGRESS; |
| 30 | import static android.view.WindowManager.LayoutParams.TYPE_DISPLAY_OVERLAY; |
| 31 | import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; |
| 32 | import static android.view.WindowManager.LayoutParams.TYPE_DRAG; |
| 33 | import static android.view.WindowManager.LayoutParams.TYPE_DREAM; |
| 34 | import static android.view.WindowManager.LayoutParams.TYPE_INPUT_CONSUMER; |
| 35 | import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; |
| 36 | import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; |
| 37 | import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG; |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 38 | import static android.view.WindowManager.LayoutParams.TYPE_MAGNIFICATION_OVERLAY; |
| 39 | import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; |
| 40 | import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; |
| 41 | import static android.view.WindowManager.LayoutParams.TYPE_PHONE; |
| 42 | import static android.view.WindowManager.LayoutParams.TYPE_POINTER; |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 43 | import static android.view.WindowManager.LayoutParams.TYPE_PRESENTATION; |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 44 | import static android.view.WindowManager.LayoutParams.TYPE_PRIORITY_PHONE; |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 45 | import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION; |
| 46 | import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG; |
| 47 | import static android.view.WindowManager.LayoutParams.TYPE_SCREENSHOT; |
| 48 | import static android.view.WindowManager.LayoutParams.TYPE_SEARCH_BAR; |
| 49 | import static android.view.WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY; |
| 50 | import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR; |
| 51 | import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL; |
| 52 | import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL; |
| 53 | import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; |
| 54 | import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG; |
| 55 | import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; |
| 56 | import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY; |
| 57 | import static android.view.WindowManager.LayoutParams.TYPE_TOAST; |
| 58 | import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION; |
| 59 | import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION_STARTING; |
| 60 | import static android.view.WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; |
| 61 | import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; |
Wale Ogunwale | cfca258 | 2016-10-19 09:53:25 -0700 | [diff] [blame] | 62 | import static org.mockito.Mockito.mock; |
| 63 | |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 64 | import android.annotation.Nullable; |
| 65 | import android.content.Context; |
| 66 | import android.content.res.CompatibilityInfo; |
| 67 | import android.content.res.Configuration; |
| 68 | import android.graphics.Rect; |
Andrii Kulian | 4ede3e0 | 2017-01-12 11:52:31 -0800 | [diff] [blame] | 69 | import android.hardware.display.DisplayManagerInternal; |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 70 | import android.os.Bundle; |
| 71 | import android.os.IBinder; |
| 72 | import android.os.RemoteException; |
| 73 | import android.util.Log; |
| 74 | import android.view.Display; |
| 75 | import android.view.IWindowManager; |
| 76 | import android.view.KeyEvent; |
| 77 | import android.view.WindowManager; |
Jorim Jaggi | 9bafc71 | 2017-01-19 17:28:30 +0100 | [diff] [blame^] | 78 | import android.view.WindowManagerGlobal; |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 79 | import android.view.WindowManagerPolicy; |
| 80 | import android.view.animation.Animation; |
Andrii Kulian | 4ede3e0 | 2017-01-12 11:52:31 -0800 | [diff] [blame] | 81 | import android.os.PowerManagerInternal; |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 82 | |
| 83 | import com.android.internal.policy.IKeyguardDismissCallback; |
| 84 | import com.android.internal.policy.IShortcutService; |
| 85 | import com.android.server.input.InputManagerService; |
Andrii Kulian | 4ede3e0 | 2017-01-12 11:52:31 -0800 | [diff] [blame] | 86 | import com.android.server.LocalServices; |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 87 | |
| 88 | import java.io.PrintWriter; |
| 89 | |
Wale Ogunwale | cfca258 | 2016-10-19 09:53:25 -0700 | [diff] [blame] | 90 | class TestWindowManagerPolicy implements WindowManagerPolicy { |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 91 | private static final String TAG = "TestWindowManagerPolicy"; |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 92 | |
Wale Ogunwale | 5136249 | 2016-09-08 17:49:17 -0700 | [diff] [blame] | 93 | private static WindowManagerService sWm = null; |
| 94 | |
Andrii Kulian | 4ede3e0 | 2017-01-12 11:52:31 -0800 | [diff] [blame] | 95 | int rotationToReport = 0; |
| 96 | |
Jorim Jaggi | 9bafc71 | 2017-01-19 17:28:30 +0100 | [diff] [blame^] | 97 | private Runnable mRunnableWhenAddingSplashScreen; |
| 98 | |
Wale Ogunwale | 5136249 | 2016-09-08 17:49:17 -0700 | [diff] [blame] | 99 | static synchronized WindowManagerService getWindowManagerService(Context context) { |
| 100 | if (sWm == null) { |
| 101 | // We only want to do this once for the test process as we don't want WM to try to |
| 102 | // register a bunch of local services again. |
Andrii Kulian | 4ede3e0 | 2017-01-12 11:52:31 -0800 | [diff] [blame] | 103 | if (LocalServices.getService(DisplayManagerInternal.class) == null) { |
| 104 | LocalServices.addService(DisplayManagerInternal.class, |
| 105 | mock(DisplayManagerInternal.class)); |
| 106 | } |
| 107 | if (LocalServices.getService(PowerManagerInternal.class) == null) { |
| 108 | LocalServices.addService(PowerManagerInternal.class, |
| 109 | mock(PowerManagerInternal.class)); |
| 110 | } |
Wale Ogunwale | cfca258 | 2016-10-19 09:53:25 -0700 | [diff] [blame] | 111 | sWm = WindowManagerService.main(context, mock(InputManagerService.class), true, false, |
| 112 | false, new TestWindowManagerPolicy()); |
Wale Ogunwale | 5136249 | 2016-09-08 17:49:17 -0700 | [diff] [blame] | 113 | } |
| 114 | return sWm; |
| 115 | } |
| 116 | |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 117 | @Override |
| 118 | public void registerShortcutKey(long shortcutCode, IShortcutService shortcutKeyReceiver) |
| 119 | throws RemoteException { |
| 120 | |
| 121 | } |
| 122 | |
| 123 | @Override |
| 124 | public void init(Context context, IWindowManager windowManager, |
| 125 | WindowManagerFuncs windowManagerFuncs) { |
| 126 | |
| 127 | } |
| 128 | |
| 129 | @Override |
| 130 | public boolean isDefaultOrientationForced() { |
| 131 | return false; |
| 132 | } |
| 133 | |
| 134 | @Override |
| 135 | public void setInitialDisplaySize(Display display, int width, int height, int density) { |
| 136 | |
| 137 | } |
| 138 | |
| 139 | @Override |
| 140 | public void setDisplayOverscan(Display display, int left, int top, int right, int bottom) { |
| 141 | |
| 142 | } |
| 143 | |
| 144 | @Override |
| 145 | public int checkAddPermission(WindowManager.LayoutParams attrs, int[] outAppOp) { |
| 146 | return 0; |
| 147 | } |
| 148 | |
| 149 | @Override |
| 150 | public boolean checkShowToOwnerOnly(WindowManager.LayoutParams attrs) { |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | @Override |
| 155 | public void adjustWindowParamsLw(WindowManager.LayoutParams attrs) { |
| 156 | |
| 157 | } |
| 158 | |
| 159 | @Override |
| 160 | public void adjustConfigurationLw(Configuration config, int keyboardPresence, |
| 161 | int navigationPresence) { |
| 162 | |
| 163 | } |
| 164 | |
| 165 | @Override |
| 166 | public int windowTypeToLayerLw(int type) { |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 167 | // TODO: figure-out a good way to keep this in-sync with PhoneWindowManager...sigh! |
| 168 | if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) { |
| 169 | return 2; |
| 170 | } |
| 171 | switch (type) { |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 172 | case TYPE_PRESENTATION: |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 173 | case TYPE_PRIVATE_PRESENTATION: |
| 174 | return 2; |
| 175 | case TYPE_WALLPAPER: |
| 176 | // wallpaper is at the bottom, though the window manager may move it. |
| 177 | return 2; |
| 178 | case TYPE_DOCK_DIVIDER: |
| 179 | return 2; |
| 180 | case TYPE_QS_DIALOG: |
| 181 | return 2; |
| 182 | case TYPE_PHONE: |
| 183 | return 3; |
| 184 | case TYPE_SEARCH_BAR: |
| 185 | case TYPE_VOICE_INTERACTION_STARTING: |
| 186 | return 4; |
| 187 | case TYPE_VOICE_INTERACTION: |
| 188 | // voice interaction layer is almost immediately above apps. |
| 189 | return 5; |
| 190 | case TYPE_INPUT_CONSUMER: |
| 191 | return 6; |
| 192 | case TYPE_SYSTEM_DIALOG: |
| 193 | return 7; |
| 194 | case TYPE_TOAST: |
| 195 | // toasts and the plugged-in battery thing |
| 196 | return 8; |
| 197 | case TYPE_PRIORITY_PHONE: |
| 198 | // SIM errors and unlock. Not sure if this really should be in a high layer. |
| 199 | return 9; |
| 200 | case TYPE_DREAM: |
| 201 | // used for Dreams (screensavers with TYPE_DREAM windows) |
| 202 | return 10; |
| 203 | case TYPE_SYSTEM_ALERT: |
| 204 | // like the ANR / app crashed dialogs |
| 205 | return 11; |
| 206 | case TYPE_INPUT_METHOD: |
| 207 | // on-screen keyboards and other such input method user interfaces go here. |
| 208 | return 12; |
| 209 | case TYPE_INPUT_METHOD_DIALOG: |
| 210 | // on-screen keyboards and other such input method user interfaces go here. |
| 211 | return 13; |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 212 | case TYPE_STATUS_BAR_SUB_PANEL: |
| 213 | return 15; |
| 214 | case TYPE_STATUS_BAR: |
| 215 | return 16; |
| 216 | case TYPE_STATUS_BAR_PANEL: |
| 217 | return 17; |
| 218 | case TYPE_KEYGUARD_DIALOG: |
| 219 | return 18; |
| 220 | case TYPE_VOLUME_OVERLAY: |
| 221 | // the on-screen volume indicator and controller shown when the user |
| 222 | // changes the device volume |
| 223 | return 19; |
| 224 | case TYPE_SYSTEM_OVERLAY: |
| 225 | // the on-screen volume indicator and controller shown when the user |
| 226 | // changes the device volume |
| 227 | return 20; |
| 228 | case TYPE_NAVIGATION_BAR: |
| 229 | // the navigation bar, if available, shows atop most things |
| 230 | return 21; |
| 231 | case TYPE_NAVIGATION_BAR_PANEL: |
| 232 | // some panels (e.g. search) need to show on top of the navigation bar |
| 233 | return 22; |
| 234 | case TYPE_SCREENSHOT: |
| 235 | // screenshot selection layer shouldn't go above system error, but it should cover |
| 236 | // navigation bars at the very least. |
| 237 | return 23; |
| 238 | case TYPE_SYSTEM_ERROR: |
| 239 | // system-level error dialogs |
| 240 | return 24; |
| 241 | case TYPE_MAGNIFICATION_OVERLAY: |
| 242 | // used to highlight the magnified portion of a display |
| 243 | return 25; |
| 244 | case TYPE_DISPLAY_OVERLAY: |
| 245 | // used to simulate secondary display devices |
| 246 | return 26; |
| 247 | case TYPE_DRAG: |
| 248 | // the drag layer: input for drag-and-drop is associated with this window, |
| 249 | // which sits above all other focusable windows |
| 250 | return 27; |
| 251 | case TYPE_ACCESSIBILITY_OVERLAY: |
| 252 | // overlay put by accessibility services to intercept user interaction |
| 253 | return 28; |
| 254 | case TYPE_SECURE_SYSTEM_OVERLAY: |
| 255 | return 29; |
| 256 | case TYPE_BOOT_PROGRESS: |
| 257 | return 30; |
| 258 | case TYPE_POINTER: |
| 259 | // the (mouse) pointer layer |
| 260 | return 31; |
| 261 | } |
| 262 | Log.e(TAG, "Unknown window type: " + type); |
| 263 | return 2; |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | @Override |
| 267 | public int subWindowTypeToLayerLw(int type) { |
Wale Ogunwale | adde52e | 2016-07-16 13:11:55 -0700 | [diff] [blame] | 268 | // TODO: figure-out a good way to keep this in-sync with PhoneWindowManager... |
| 269 | switch (type) { |
| 270 | case TYPE_APPLICATION_PANEL: |
| 271 | case TYPE_APPLICATION_ATTACHED_DIALOG: |
| 272 | return 1; |
| 273 | case TYPE_APPLICATION_MEDIA: |
| 274 | return -2; |
| 275 | case TYPE_APPLICATION_MEDIA_OVERLAY: |
| 276 | return -1; |
| 277 | case TYPE_APPLICATION_SUB_PANEL: |
| 278 | return 2; |
| 279 | case TYPE_APPLICATION_ABOVE_SUB_PANEL: |
| 280 | return 3; |
| 281 | } |
| 282 | Log.e(TAG, "Unknown sub-window type: " + type); |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 283 | return 0; |
| 284 | } |
| 285 | |
| 286 | @Override |
| 287 | public int getMaxWallpaperLayer() { |
| 288 | return 0; |
| 289 | } |
| 290 | |
| 291 | @Override |
Andrii Kulian | db8e106 | 2016-11-15 18:30:27 -0800 | [diff] [blame] | 292 | public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation, int uiMode, |
| 293 | int displayId) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 294 | return 0; |
| 295 | } |
| 296 | |
| 297 | @Override |
Andrii Kulian | db8e106 | 2016-11-15 18:30:27 -0800 | [diff] [blame] | 298 | public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation, int uiMode, |
| 299 | int displayId) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | @Override |
Andrii Kulian | db8e106 | 2016-11-15 18:30:27 -0800 | [diff] [blame] | 304 | public int getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation, int uiMode, |
| 305 | int displayId) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 306 | return 0; |
| 307 | } |
| 308 | |
| 309 | @Override |
Andrii Kulian | db8e106 | 2016-11-15 18:30:27 -0800 | [diff] [blame] | 310 | public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation, int uiMode, |
| 311 | int displayId) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 312 | return 0; |
| 313 | } |
| 314 | |
| 315 | @Override |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 316 | public boolean isKeyguardHostWindow(WindowManager.LayoutParams attrs) { |
| 317 | return false; |
| 318 | } |
| 319 | |
| 320 | @Override |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 321 | public boolean canBeHiddenByKeyguardLw(WindowState win) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 322 | return false; |
| 323 | } |
| 324 | |
Jorim Jaggi | 9bafc71 | 2017-01-19 17:28:30 +0100 | [diff] [blame^] | 325 | /** |
| 326 | * Sets a runnable to run when adding a splash screen which gets executed after the window has |
| 327 | * been added but before returning the surface. |
| 328 | */ |
| 329 | void setRunnableWhenAddingSplashScreen(Runnable r) { |
| 330 | mRunnableWhenAddingSplashScreen = r; |
| 331 | } |
| 332 | |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 333 | @Override |
Jorim Jaggi | ba41f4b | 2016-12-14 17:43:07 -0800 | [diff] [blame] | 334 | public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme, |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 335 | CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon, |
Andrii Kulian | fb1bf69 | 2017-01-17 11:17:34 -0800 | [diff] [blame] | 336 | int logo, int windowFlags, Configuration overrideConfig, int displayId) { |
Jorim Jaggi | 9bafc71 | 2017-01-19 17:28:30 +0100 | [diff] [blame^] | 337 | final com.android.server.wm.WindowState window; |
| 338 | final AppWindowToken atoken; |
| 339 | synchronized (sWm.mWindowMap) { |
| 340 | atoken = WindowTestsBase.sDisplayContent.getAppWindowToken(appToken); |
| 341 | window = WindowTestsBase.createWindow(null, TYPE_APPLICATION_STARTING, atoken, |
| 342 | "Starting window"); |
| 343 | atoken.startingWindow = window; |
| 344 | } |
| 345 | if (mRunnableWhenAddingSplashScreen != null) { |
| 346 | mRunnableWhenAddingSplashScreen.run(); |
| 347 | mRunnableWhenAddingSplashScreen = null; |
| 348 | } |
| 349 | return () -> { |
| 350 | synchronized (sWm.mWindowMap) { |
| 351 | atoken.removeChild(window); |
| 352 | atoken.startingWindow = null; |
| 353 | } |
| 354 | }; |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | @Override |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 358 | public int prepareAddWindowLw(WindowState win, |
| 359 | WindowManager.LayoutParams attrs) { |
| 360 | return 0; |
| 361 | } |
| 362 | |
| 363 | @Override |
| 364 | public void removeWindowLw(WindowState win) { |
| 365 | |
| 366 | } |
| 367 | |
| 368 | @Override |
| 369 | public int selectAnimationLw(WindowState win, int transit) { |
| 370 | return 0; |
| 371 | } |
| 372 | |
| 373 | @Override |
| 374 | public void selectRotationAnimationLw(int[] anim) { |
| 375 | |
| 376 | } |
| 377 | |
| 378 | @Override |
| 379 | public boolean validateRotationAnimationLw(int exitAnimId, int enterAnimId, |
| 380 | boolean forceDefault) { |
| 381 | return false; |
| 382 | } |
| 383 | |
| 384 | @Override |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 385 | public Animation createHiddenByKeyguardExit(boolean onWallpaper, |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 386 | boolean goingToNotificationShade) { |
| 387 | return null; |
| 388 | } |
| 389 | |
| 390 | @Override |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 391 | public Animation createKeyguardWallpaperExit(boolean goingToNotificationShade) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 392 | return null; |
| 393 | } |
| 394 | |
| 395 | @Override |
| 396 | public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) { |
| 397 | return 0; |
| 398 | } |
| 399 | |
| 400 | @Override |
| 401 | public int interceptMotionBeforeQueueingNonInteractive(long whenNanos, int policyFlags) { |
| 402 | return 0; |
| 403 | } |
| 404 | |
| 405 | @Override |
| 406 | public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, |
| 407 | int policyFlags) { |
| 408 | return 0; |
| 409 | } |
| 410 | |
| 411 | @Override |
| 412 | public KeyEvent dispatchUnhandledKey(WindowState win, KeyEvent event, |
| 413 | int policyFlags) { |
| 414 | return null; |
| 415 | } |
| 416 | |
| 417 | @Override |
| 418 | public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, |
| 419 | int displayRotation, int uiMode) { |
| 420 | |
| 421 | } |
| 422 | |
| 423 | @Override |
| 424 | public int getSystemDecorLayerLw() { |
| 425 | return 0; |
| 426 | } |
| 427 | |
| 428 | @Override |
| 429 | public void getContentRectLw(Rect r) { |
| 430 | |
| 431 | } |
| 432 | |
| 433 | @Override |
| 434 | public void layoutWindowLw(WindowState win, |
| 435 | WindowState attached) { |
| 436 | |
| 437 | } |
| 438 | |
| 439 | @Override |
| 440 | public boolean getInsetHintLw(WindowManager.LayoutParams attrs, Rect taskBounds, |
| 441 | int displayRotation, int displayWidth, int displayHeight, Rect outContentInsets, |
| 442 | Rect outStableInsets, Rect outOutsets) { |
| 443 | return false; |
| 444 | } |
| 445 | |
| 446 | @Override |
| 447 | public void finishLayoutLw() { |
| 448 | |
| 449 | } |
| 450 | |
| 451 | @Override |
| 452 | public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) { |
| 453 | |
| 454 | } |
| 455 | |
| 456 | @Override |
| 457 | public void applyPostLayoutPolicyLw(WindowState win, |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 458 | WindowManager.LayoutParams attrs, WindowState attached, WindowState imeTarget) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | @Override |
| 462 | public int finishPostLayoutPolicyLw() { |
| 463 | return 0; |
| 464 | } |
| 465 | |
| 466 | @Override |
| 467 | public boolean allowAppAnimationsLw() { |
| 468 | return false; |
| 469 | } |
| 470 | |
| 471 | @Override |
| 472 | public int focusChangedLw(WindowState lastFocus, |
| 473 | WindowState newFocus) { |
| 474 | return 0; |
| 475 | } |
| 476 | |
| 477 | @Override |
| 478 | public void startedWakingUp() { |
| 479 | |
| 480 | } |
| 481 | |
| 482 | @Override |
| 483 | public void finishedWakingUp() { |
| 484 | |
| 485 | } |
| 486 | |
| 487 | @Override |
| 488 | public void startedGoingToSleep(int why) { |
| 489 | |
| 490 | } |
| 491 | |
| 492 | @Override |
| 493 | public void finishedGoingToSleep(int why) { |
| 494 | |
| 495 | } |
| 496 | |
| 497 | @Override |
| 498 | public void screenTurningOn(ScreenOnListener screenOnListener) { |
| 499 | |
| 500 | } |
| 501 | |
| 502 | @Override |
| 503 | public void screenTurnedOn() { |
| 504 | |
| 505 | } |
| 506 | |
| 507 | @Override |
| 508 | public void screenTurnedOff() { |
| 509 | |
| 510 | } |
| 511 | |
| 512 | @Override |
| 513 | public boolean isScreenOn() { |
Jorim Jaggi | 9bafc71 | 2017-01-19 17:28:30 +0100 | [diff] [blame^] | 514 | return true; |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | @Override |
| 518 | public void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) { |
| 519 | |
| 520 | } |
| 521 | |
| 522 | @Override |
| 523 | public void notifyCameraLensCoverSwitchChanged(long whenNanos, boolean lensCovered) { |
| 524 | |
| 525 | } |
| 526 | |
| 527 | @Override |
| 528 | public void enableKeyguard(boolean enabled) { |
| 529 | |
| 530 | } |
| 531 | |
| 532 | @Override |
| 533 | public void exitKeyguardSecurely(OnKeyguardExitResult callback) { |
| 534 | |
| 535 | } |
| 536 | |
| 537 | @Override |
| 538 | public boolean isKeyguardLocked() { |
| 539 | return false; |
| 540 | } |
| 541 | |
| 542 | @Override |
| 543 | public boolean isKeyguardSecure(int userId) { |
| 544 | return false; |
| 545 | } |
| 546 | |
| 547 | @Override |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 548 | public boolean isKeyguardOccluded() { |
| 549 | return false; |
| 550 | } |
| 551 | |
| 552 | @Override |
| 553 | public boolean isKeyguardTrustedLw() { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 554 | return false; |
| 555 | } |
| 556 | |
| 557 | @Override |
| 558 | public boolean isKeyguardShowingAndNotOccluded() { |
| 559 | return false; |
| 560 | } |
| 561 | |
| 562 | @Override |
| 563 | public boolean inKeyguardRestrictedKeyInputMode() { |
| 564 | return false; |
| 565 | } |
| 566 | |
| 567 | @Override |
Jorim Jaggi | 241ae10 | 2016-11-02 21:57:33 -0700 | [diff] [blame] | 568 | public void dismissKeyguardLw(@Nullable IKeyguardDismissCallback callback) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | @Override |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 572 | public boolean isKeyguardDrawnLw() { |
| 573 | return false; |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | @Override |
Jorim Jaggi | 77e1043 | 2016-10-26 17:43:56 -0700 | [diff] [blame] | 577 | public boolean isShowingDreamLw() { |
| 578 | return false; |
| 579 | } |
| 580 | |
| 581 | @Override |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 582 | public void onKeyguardOccludedChangedLw(boolean occluded) { |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 583 | } |
| 584 | |
| 585 | @Override |
| 586 | public int rotationForOrientationLw(int orientation, |
| 587 | int lastRotation) { |
Andrii Kulian | 4ede3e0 | 2017-01-12 11:52:31 -0800 | [diff] [blame] | 588 | return rotationToReport; |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 589 | } |
| 590 | |
| 591 | @Override |
| 592 | public boolean rotationHasCompatibleMetricsLw(int orientation, |
| 593 | int rotation) { |
| 594 | return false; |
| 595 | } |
| 596 | |
| 597 | @Override |
| 598 | public void setRotationLw(int rotation) { |
| 599 | |
| 600 | } |
| 601 | |
| 602 | @Override |
| 603 | public void setSafeMode(boolean safeMode) { |
| 604 | |
| 605 | } |
| 606 | |
| 607 | @Override |
| 608 | public void systemReady() { |
| 609 | |
| 610 | } |
| 611 | |
| 612 | @Override |
| 613 | public void systemBooted() { |
| 614 | |
| 615 | } |
| 616 | |
| 617 | @Override |
| 618 | public void showBootMessage(CharSequence msg, boolean always) { |
| 619 | |
| 620 | } |
| 621 | |
| 622 | @Override |
| 623 | public void hideBootMessages() { |
| 624 | |
| 625 | } |
| 626 | |
| 627 | @Override |
| 628 | public void userActivity() { |
| 629 | |
| 630 | } |
| 631 | |
| 632 | @Override |
| 633 | public void enableScreenAfterBoot() { |
| 634 | |
| 635 | } |
| 636 | |
| 637 | @Override |
| 638 | public void setCurrentOrientationLw(int newOrientation) { |
| 639 | |
| 640 | } |
| 641 | |
| 642 | @Override |
| 643 | public boolean performHapticFeedbackLw(WindowState win, int effectId, |
| 644 | boolean always) { |
| 645 | return false; |
| 646 | } |
| 647 | |
| 648 | @Override |
| 649 | public void keepScreenOnStartedLw() { |
| 650 | |
| 651 | } |
| 652 | |
| 653 | @Override |
| 654 | public void keepScreenOnStoppedLw() { |
| 655 | |
| 656 | } |
| 657 | |
| 658 | @Override |
| 659 | public int getUserRotationMode() { |
| 660 | return 0; |
| 661 | } |
| 662 | |
| 663 | @Override |
| 664 | public void setUserRotationMode(int mode, |
| 665 | int rotation) { |
| 666 | |
| 667 | } |
| 668 | |
| 669 | @Override |
| 670 | public int adjustSystemUiVisibilityLw(int visibility) { |
| 671 | return 0; |
| 672 | } |
| 673 | |
| 674 | @Override |
| 675 | public boolean hasNavigationBar() { |
| 676 | return false; |
| 677 | } |
| 678 | |
| 679 | @Override |
| 680 | public void lockNow(Bundle options) { |
| 681 | |
| 682 | } |
| 683 | |
| 684 | @Override |
| 685 | public void setLastInputMethodWindowLw(WindowState ime, |
| 686 | WindowState target) { |
| 687 | |
| 688 | } |
| 689 | |
| 690 | @Override |
| 691 | public void showRecentApps(boolean fromHome) { |
| 692 | |
| 693 | } |
| 694 | |
| 695 | @Override |
| 696 | public void showGlobalActions() { |
| 697 | |
| 698 | } |
| 699 | |
| 700 | @Override |
| 701 | public int getInputMethodWindowVisibleHeightLw() { |
| 702 | return 0; |
| 703 | } |
| 704 | |
| 705 | @Override |
| 706 | public void setCurrentUserLw(int newUserId) { |
| 707 | |
| 708 | } |
| 709 | |
| 710 | @Override |
Evan Rosky | 1839645 | 2016-07-27 15:19:37 -0700 | [diff] [blame] | 711 | public void setSwitchingUser(boolean switching) { |
| 712 | |
| 713 | } |
| 714 | |
| 715 | @Override |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 716 | public void dump(String prefix, PrintWriter writer, String[] args) { |
| 717 | |
| 718 | } |
| 719 | |
| 720 | @Override |
| 721 | public boolean canMagnifyWindow(int windowType) { |
| 722 | return false; |
| 723 | } |
| 724 | |
| 725 | @Override |
| 726 | public boolean isTopLevelWindow(int windowType) { |
| 727 | return false; |
| 728 | } |
| 729 | |
| 730 | @Override |
| 731 | public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) { |
| 732 | |
| 733 | } |
| 734 | |
| 735 | @Override |
| 736 | public void getStableInsetsLw(int displayRotation, int displayWidth, int displayHeight, |
| 737 | Rect outInsets) { |
| 738 | |
| 739 | } |
| 740 | |
| 741 | @Override |
| 742 | public boolean isNavBarForcedShownLw(WindowState win) { |
| 743 | return false; |
| 744 | } |
| 745 | |
| 746 | @Override |
| 747 | public void getNonDecorInsetsLw(int displayRotation, int displayWidth, int displayHeight, |
| 748 | Rect outInsets) { |
| 749 | |
| 750 | } |
| 751 | |
| 752 | @Override |
| 753 | public boolean isDockSideAllowed(int dockSide) { |
| 754 | return false; |
| 755 | } |
| 756 | |
| 757 | @Override |
| 758 | public void onConfigurationChanged() { |
| 759 | |
| 760 | } |
| 761 | |
| 762 | @Override |
| 763 | public boolean shouldRotateSeamlessly(int oldRotation, int newRotation) { |
| 764 | return false; |
| 765 | } |
Brian Carlstrom | 7203d62 | 2016-09-21 01:00:36 -0700 | [diff] [blame] | 766 | |
| 767 | @Override |
| 768 | public void setTvPipVisibilityLw(boolean visible) { |
| 769 | |
| 770 | } |
| 771 | |
| 772 | @Override |
| 773 | public void setRecentsVisibilityLw(boolean visible) { |
| 774 | |
| 775 | } |
Wale Ogunwale | b699ce0 | 2016-07-18 12:05:30 -0700 | [diff] [blame] | 776 | } |