The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 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 android.view; |
| 18 | |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 19 | import static android.content.pm.ActivityInfo.COLOR_MODE_DEFAULT; |
Vishnu Nair | 1d0fa07 | 2018-01-04 07:53:00 -0800 | [diff] [blame] | 20 | import static android.view.WindowLayoutParamsProto.ALPHA; |
| 21 | import static android.view.WindowLayoutParamsProto.BUTTON_BRIGHTNESS; |
| 22 | import static android.view.WindowLayoutParamsProto.COLOR_MODE; |
| 23 | import static android.view.WindowLayoutParamsProto.FLAGS; |
Vishnu Nair | 1d0fa07 | 2018-01-04 07:53:00 -0800 | [diff] [blame] | 24 | import static android.view.WindowLayoutParamsProto.FORMAT; |
| 25 | import static android.view.WindowLayoutParamsProto.GRAVITY; |
| 26 | import static android.view.WindowLayoutParamsProto.HAS_SYSTEM_UI_LISTENERS; |
| 27 | import static android.view.WindowLayoutParamsProto.HEIGHT; |
| 28 | import static android.view.WindowLayoutParamsProto.HORIZONTAL_MARGIN; |
| 29 | import static android.view.WindowLayoutParamsProto.INPUT_FEATURE_FLAGS; |
| 30 | import static android.view.WindowLayoutParamsProto.NEEDS_MENU_KEY; |
| 31 | import static android.view.WindowLayoutParamsProto.PREFERRED_REFRESH_RATE; |
| 32 | import static android.view.WindowLayoutParamsProto.PRIVATE_FLAGS; |
| 33 | import static android.view.WindowLayoutParamsProto.ROTATION_ANIMATION; |
| 34 | import static android.view.WindowLayoutParamsProto.SCREEN_BRIGHTNESS; |
| 35 | import static android.view.WindowLayoutParamsProto.SOFT_INPUT_MODE; |
| 36 | import static android.view.WindowLayoutParamsProto.SUBTREE_SYSTEM_UI_VISIBILITY_FLAGS; |
| 37 | import static android.view.WindowLayoutParamsProto.SYSTEM_UI_VISIBILITY_FLAGS; |
| 38 | import static android.view.WindowLayoutParamsProto.TYPE; |
| 39 | import static android.view.WindowLayoutParamsProto.USER_ACTIVITY_TIMEOUT; |
| 40 | import static android.view.WindowLayoutParamsProto.VERTICAL_MARGIN; |
| 41 | import static android.view.WindowLayoutParamsProto.WIDTH; |
| 42 | import static android.view.WindowLayoutParamsProto.WINDOW_ANIMATIONS; |
| 43 | import static android.view.WindowLayoutParamsProto.X; |
| 44 | import static android.view.WindowLayoutParamsProto.Y; |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 45 | |
Jorim Jaggi | f12ec0f | 2017-08-23 16:14:10 +0200 | [diff] [blame] | 46 | import android.Manifest.permission; |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 47 | import android.annotation.IntDef; |
Siva Velusamy | 0d857b9 | 2015-04-22 10:23:56 -0700 | [diff] [blame] | 48 | import android.annotation.NonNull; |
Albert Chaulk | 2ccb0b7 | 2017-06-20 14:39:29 -0400 | [diff] [blame] | 49 | import android.annotation.RequiresPermission; |
Bryce Lee | 53b9fbd | 2015-02-06 12:06:34 -0800 | [diff] [blame] | 50 | import android.annotation.SystemApi; |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 51 | import android.annotation.SystemService; |
Robert Carr | b48380a | 2017-04-04 14:56:37 -0700 | [diff] [blame] | 52 | import android.annotation.TestApi; |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 53 | import android.annotation.UnsupportedAppUsage; |
Jorim Jaggi | 241ae10 | 2016-11-02 21:57:33 -0700 | [diff] [blame] | 54 | import android.app.KeyguardManager; |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 55 | import android.app.Presentation; |
| 56 | import android.content.Context; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | import android.content.pm.ActivityInfo; |
| 58 | import android.graphics.PixelFormat; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 59 | import android.graphics.Rect; |
Albert Chaulk | 2ccb0b7 | 2017-06-20 14:39:29 -0400 | [diff] [blame] | 60 | import android.graphics.Region; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 61 | import android.os.IBinder; |
| 62 | import android.os.Parcel; |
| 63 | import android.os.Parcelable; |
| 64 | import android.text.TextUtils; |
| 65 | import android.util.Log; |
Steven Timotius | af03df6 | 2017-07-18 16:56:43 -0700 | [diff] [blame] | 66 | import android.util.proto.ProtoOutputStream; |
Phil Weaver | 8583ae8 | 2018-02-13 11:01:24 -0800 | [diff] [blame] | 67 | import android.view.accessibility.AccessibilityNodeInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 69 | import java.lang.annotation.Retention; |
| 70 | import java.lang.annotation.RetentionPolicy; |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 71 | import java.util.List; |
Wale Ogunwale | 1f240c9 | 2016-02-22 18:04:58 -0800 | [diff] [blame] | 72 | import java.util.Objects; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * The interface that apps use to talk to the window manager. |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 76 | * </p><p> |
| 77 | * Each window manager instance is bound to a particular {@link Display}. |
| 78 | * To obtain a {@link WindowManager} for a different display, use |
| 79 | * {@link Context#createDisplayContext} to obtain a {@link Context} for that |
| 80 | * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> |
| 81 | * to get the WindowManager. |
| 82 | * </p><p> |
| 83 | * The simplest way to show a window on another display is to create a |
| 84 | * {@link Presentation}. The presentation will automatically obtain a |
| 85 | * {@link WindowManager} and {@link Context} for that display. |
| 86 | * </p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | */ |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 88 | @SystemService(Context.WINDOW_SERVICE) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | public interface WindowManager extends ViewManager { |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 90 | |
| 91 | /** @hide */ |
| 92 | int DOCKED_INVALID = -1; |
| 93 | /** @hide */ |
| 94 | int DOCKED_LEFT = 1; |
| 95 | /** @hide */ |
| 96 | int DOCKED_TOP = 2; |
| 97 | /** @hide */ |
| 98 | int DOCKED_RIGHT = 3; |
| 99 | /** @hide */ |
| 100 | int DOCKED_BOTTOM = 4; |
| 101 | |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 102 | /** @hide */ |
Winson Chung | a89ffed | 2018-01-25 17:46:11 +0000 | [diff] [blame] | 103 | String INPUT_CONSUMER_PIP = "pip_input_consumer"; |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 104 | /** @hide */ |
Winson Chung | a89ffed | 2018-01-25 17:46:11 +0000 | [diff] [blame] | 105 | String INPUT_CONSUMER_NAVIGATION = "nav_input_consumer"; |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 106 | /** @hide */ |
Winson Chung | a89ffed | 2018-01-25 17:46:11 +0000 | [diff] [blame] | 107 | String INPUT_CONSUMER_WALLPAPER = "wallpaper_input_consumer"; |
| 108 | /** @hide */ |
| 109 | String INPUT_CONSUMER_RECENTS_ANIMATION = "recents_animation_input_consumer"; |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 110 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | /** |
Jorim Jaggi | f84e2f6 | 2018-01-16 14:17:59 +0100 | [diff] [blame] | 112 | * Not set up for a transition. |
| 113 | * @hide |
| 114 | */ |
| 115 | int TRANSIT_UNSET = -1; |
| 116 | |
| 117 | /** |
| 118 | * No animation for transition. |
| 119 | * @hide |
| 120 | */ |
| 121 | int TRANSIT_NONE = 0; |
| 122 | |
| 123 | /** |
| 124 | * A window in a new activity is being opened on top of an existing one in the same task. |
| 125 | * @hide |
| 126 | */ |
| 127 | int TRANSIT_ACTIVITY_OPEN = 6; |
| 128 | |
| 129 | /** |
| 130 | * The window in the top-most activity is being closed to reveal the previous activity in the |
| 131 | * same task. |
| 132 | * @hide |
| 133 | */ |
| 134 | int TRANSIT_ACTIVITY_CLOSE = 7; |
| 135 | |
| 136 | /** |
| 137 | * A window in a new task is being opened on top of an existing one in another activity's task. |
| 138 | * @hide |
| 139 | */ |
| 140 | int TRANSIT_TASK_OPEN = 8; |
| 141 | |
| 142 | /** |
| 143 | * A window in the top-most activity is being closed to reveal the previous activity in a |
| 144 | * different task. |
| 145 | * @hide |
| 146 | */ |
| 147 | int TRANSIT_TASK_CLOSE = 9; |
| 148 | |
| 149 | /** |
| 150 | * A window in an existing task is being displayed on top of an existing one in another |
| 151 | * activity's task. |
| 152 | * @hide |
| 153 | */ |
| 154 | int TRANSIT_TASK_TO_FRONT = 10; |
| 155 | |
| 156 | /** |
| 157 | * A window in an existing task is being put below all other tasks. |
| 158 | * @hide |
| 159 | */ |
| 160 | int TRANSIT_TASK_TO_BACK = 11; |
| 161 | |
| 162 | /** |
| 163 | * A window in a new activity that doesn't have a wallpaper is being opened on top of one that |
| 164 | * does, effectively closing the wallpaper. |
| 165 | * @hide |
| 166 | */ |
| 167 | int TRANSIT_WALLPAPER_CLOSE = 12; |
| 168 | |
| 169 | /** |
| 170 | * A window in a new activity that does have a wallpaper is being opened on one that didn't, |
| 171 | * effectively opening the wallpaper. |
| 172 | * @hide |
| 173 | */ |
| 174 | int TRANSIT_WALLPAPER_OPEN = 13; |
| 175 | |
| 176 | /** |
| 177 | * A window in a new activity is being opened on top of an existing one, and both are on top |
| 178 | * of the wallpaper. |
| 179 | * @hide |
| 180 | */ |
| 181 | int TRANSIT_WALLPAPER_INTRA_OPEN = 14; |
| 182 | |
| 183 | /** |
| 184 | * The window in the top-most activity is being closed to reveal the previous activity, and |
| 185 | * both are on top of the wallpaper. |
| 186 | * @hide |
| 187 | */ |
| 188 | int TRANSIT_WALLPAPER_INTRA_CLOSE = 15; |
| 189 | |
| 190 | /** |
| 191 | * A window in a new task is being opened behind an existing one in another activity's task. |
| 192 | * The new window will show briefly and then be gone. |
| 193 | * @hide |
| 194 | */ |
| 195 | int TRANSIT_TASK_OPEN_BEHIND = 16; |
| 196 | |
| 197 | /** |
| 198 | * A window in a task is being animated in-place. |
| 199 | * @hide |
| 200 | */ |
| 201 | int TRANSIT_TASK_IN_PLACE = 17; |
| 202 | |
| 203 | /** |
| 204 | * An activity is being relaunched (e.g. due to configuration change). |
| 205 | * @hide |
| 206 | */ |
| 207 | int TRANSIT_ACTIVITY_RELAUNCH = 18; |
| 208 | |
| 209 | /** |
| 210 | * A task is being docked from recents. |
| 211 | * @hide |
| 212 | */ |
| 213 | int TRANSIT_DOCK_TASK_FROM_RECENTS = 19; |
| 214 | |
| 215 | /** |
| 216 | * Keyguard is going away. |
| 217 | * @hide |
| 218 | */ |
| 219 | int TRANSIT_KEYGUARD_GOING_AWAY = 20; |
| 220 | |
| 221 | /** |
| 222 | * Keyguard is going away with showing an activity behind that requests wallpaper. |
| 223 | * @hide |
| 224 | */ |
| 225 | int TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER = 21; |
| 226 | |
| 227 | /** |
| 228 | * Keyguard is being occluded. |
| 229 | * @hide |
| 230 | */ |
| 231 | int TRANSIT_KEYGUARD_OCCLUDE = 22; |
| 232 | |
| 233 | /** |
| 234 | * Keyguard is being unoccluded. |
| 235 | * @hide |
| 236 | */ |
| 237 | int TRANSIT_KEYGUARD_UNOCCLUDE = 23; |
| 238 | |
| 239 | /** |
Jorim Jaggi | 98a9d20 | 2018-03-26 16:17:07 +0200 | [diff] [blame] | 240 | * A translucent activity is being opened. |
| 241 | * @hide |
| 242 | */ |
| 243 | int TRANSIT_TRANSLUCENT_ACTIVITY_OPEN = 24; |
| 244 | |
| 245 | /** |
| 246 | * A translucent activity is being closed. |
| 247 | * @hide |
| 248 | */ |
| 249 | int TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE = 25; |
| 250 | |
| 251 | /** |
Adrian Roos | 9357721 | 2018-04-10 14:12:10 -0700 | [diff] [blame] | 252 | * A crashing activity is being closed. |
| 253 | * @hide |
| 254 | */ |
| 255 | int TRANSIT_CRASHING_ACTIVITY_CLOSE = 26; |
| 256 | |
| 257 | /** |
Evan Rosky | 2289ba1 | 2018-11-19 18:28:18 -0800 | [diff] [blame] | 258 | * A task is changing windowing modes |
| 259 | * @hide |
| 260 | */ |
| 261 | int TRANSIT_TASK_CHANGE_WINDOWING_MODE = 27; |
| 262 | |
| 263 | /** |
Issei Suzuki | cac2a50 | 2019-04-16 16:52:50 +0200 | [diff] [blame] | 264 | * A display which can only contain one task is being shown because the first activity is |
| 265 | * started or it's being turned on. |
| 266 | * @hide |
| 267 | */ |
| 268 | int TRANSIT_SHOW_SINGLE_TASK_DISPLAY = 28; |
| 269 | |
| 270 | /** |
Jorim Jaggi | f84e2f6 | 2018-01-16 14:17:59 +0100 | [diff] [blame] | 271 | * @hide |
| 272 | */ |
| 273 | @IntDef(prefix = { "TRANSIT_" }, value = { |
| 274 | TRANSIT_UNSET, |
| 275 | TRANSIT_NONE, |
| 276 | TRANSIT_ACTIVITY_OPEN, |
| 277 | TRANSIT_ACTIVITY_CLOSE, |
| 278 | TRANSIT_TASK_OPEN, |
| 279 | TRANSIT_TASK_CLOSE, |
| 280 | TRANSIT_TASK_TO_FRONT, |
| 281 | TRANSIT_TASK_TO_BACK, |
| 282 | TRANSIT_WALLPAPER_CLOSE, |
| 283 | TRANSIT_WALLPAPER_OPEN, |
| 284 | TRANSIT_WALLPAPER_INTRA_OPEN, |
| 285 | TRANSIT_WALLPAPER_INTRA_CLOSE, |
| 286 | TRANSIT_TASK_OPEN_BEHIND, |
| 287 | TRANSIT_TASK_IN_PLACE, |
| 288 | TRANSIT_ACTIVITY_RELAUNCH, |
| 289 | TRANSIT_DOCK_TASK_FROM_RECENTS, |
| 290 | TRANSIT_KEYGUARD_GOING_AWAY, |
| 291 | TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER, |
| 292 | TRANSIT_KEYGUARD_OCCLUDE, |
Jorim Jaggi | 98a9d20 | 2018-03-26 16:17:07 +0200 | [diff] [blame] | 293 | TRANSIT_KEYGUARD_UNOCCLUDE, |
| 294 | TRANSIT_TRANSLUCENT_ACTIVITY_OPEN, |
Jorim Jaggi | 9c52ebb | 2018-06-01 14:45:24 +0200 | [diff] [blame] | 295 | TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE, |
Evan Rosky | 2289ba1 | 2018-11-19 18:28:18 -0800 | [diff] [blame] | 296 | TRANSIT_CRASHING_ACTIVITY_CLOSE, |
Issei Suzuki | cac2a50 | 2019-04-16 16:52:50 +0200 | [diff] [blame] | 297 | TRANSIT_TASK_CHANGE_WINDOWING_MODE, |
| 298 | TRANSIT_SHOW_SINGLE_TASK_DISPLAY |
Jorim Jaggi | f84e2f6 | 2018-01-16 14:17:59 +0100 | [diff] [blame] | 299 | }) |
| 300 | @Retention(RetentionPolicy.SOURCE) |
| 301 | @interface TransitionType {} |
| 302 | |
| 303 | /** |
| 304 | * Transition flag: Keyguard is going away, but keeping the notification shade open |
| 305 | * @hide |
| 306 | */ |
| 307 | int TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE = 0x1; |
| 308 | |
| 309 | /** |
| 310 | * Transition flag: Keyguard is going away, but doesn't want an animation for it |
| 311 | * @hide |
| 312 | */ |
| 313 | int TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION = 0x2; |
| 314 | |
| 315 | /** |
| 316 | * Transition flag: Keyguard is going away while it was showing the system wallpaper. |
| 317 | * @hide |
| 318 | */ |
| 319 | int TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER = 0x4; |
| 320 | |
| 321 | /** |
Issei Suzuki | 5609ccb | 2019-06-13 15:04:08 +0200 | [diff] [blame] | 322 | * Transition flag: Keyguard is going away with subtle animation. |
| 323 | * @hide |
| 324 | */ |
| 325 | int TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION = 0x8; |
| 326 | |
| 327 | /** |
Jorim Jaggi | f84e2f6 | 2018-01-16 14:17:59 +0100 | [diff] [blame] | 328 | * @hide |
| 329 | */ |
| 330 | @IntDef(flag = true, prefix = { "TRANSIT_FLAG_" }, value = { |
| 331 | TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE, |
| 332 | TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION, |
| 333 | TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER, |
| 334 | }) |
| 335 | @Retention(RetentionPolicy.SOURCE) |
| 336 | @interface TransitionFlags {} |
| 337 | |
| 338 | /** |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 339 | * Remove content mode: Indicates remove content mode is currently not defined. |
| 340 | * @hide |
| 341 | */ |
| 342 | int REMOVE_CONTENT_MODE_UNDEFINED = 0; |
| 343 | |
| 344 | /** |
| 345 | * Remove content mode: Indicates that when display is removed, all its activities will be moved |
| 346 | * to the primary display and the topmost activity should become focused. |
| 347 | * @hide |
| 348 | */ |
| 349 | int REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY = 1; |
| 350 | |
| 351 | /** |
| 352 | * Remove content mode: Indicates that when display is removed, all its stacks and tasks will be |
| 353 | * removed, all activities will be destroyed according to the usual lifecycle. |
| 354 | * @hide |
| 355 | */ |
| 356 | int REMOVE_CONTENT_MODE_DESTROY = 2; |
| 357 | |
| 358 | /** |
| 359 | * @hide |
| 360 | */ |
| 361 | @IntDef(prefix = { "REMOVE_CONTENT_MODE_" }, value = { |
| 362 | REMOVE_CONTENT_MODE_UNDEFINED, |
| 363 | REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY, |
| 364 | REMOVE_CONTENT_MODE_DESTROY, |
| 365 | }) |
| 366 | @interface RemoveContentMode {} |
| 367 | |
| 368 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 369 | * Exception that is thrown when trying to add view whose |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 370 | * {@link LayoutParams} {@link LayoutParams#token} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 371 | * is invalid. |
| 372 | */ |
| 373 | public static class BadTokenException extends RuntimeException { |
| 374 | public BadTokenException() { |
| 375 | } |
| 376 | |
| 377 | public BadTokenException(String name) { |
| 378 | super(name); |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /** |
Craig Mautner | 6018aee | 2012-10-23 14:27:49 -0700 | [diff] [blame] | 383 | * Exception that is thrown when calling {@link #addView} to a secondary display that cannot |
| 384 | * be found. See {@link android.app.Presentation} for more information on secondary displays. |
| 385 | */ |
| 386 | public static class InvalidDisplayException extends RuntimeException { |
| 387 | public InvalidDisplayException() { |
| 388 | } |
| 389 | |
| 390 | public InvalidDisplayException(String name) { |
| 391 | super(name); |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | /** |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 396 | * Returns the {@link Display} upon which this {@link WindowManager} instance |
| 397 | * will create new windows. |
| 398 | * <p> |
| 399 | * Despite the name of this method, the display that is returned is not |
| 400 | * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}). |
| 401 | * The returned display could instead be a secondary display that this |
| 402 | * window manager instance is managing. Think of it as the display that |
| 403 | * this {@link WindowManager} instance uses by default. |
| 404 | * </p><p> |
| 405 | * To create windows on a different display, you need to obtain a |
| 406 | * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager} |
| 407 | * class documentation for more information.) |
| 408 | * </p> |
| 409 | * |
| 410 | * @return The display that this window manager is managing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 411 | */ |
| 412 | public Display getDefaultDisplay(); |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 413 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 414 | /** |
| 415 | * Special variation of {@link #removeView} that immediately invokes |
| 416 | * the given view hierarchy's {@link View#onDetachedFromWindow() |
| 417 | * View.onDetachedFromWindow()} methods before returning. This is not |
| 418 | * for normal applications; using it correctly requires great care. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 419 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 420 | * @param view The view to be removed. |
| 421 | */ |
| 422 | public void removeViewImmediate(View view); |
Jeff Brown | d32460c | 2012-07-20 16:15:36 -0700 | [diff] [blame] | 423 | |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 424 | /** |
| 425 | * Used to asynchronously request Keyboard Shortcuts from the focused window. |
| 426 | * |
| 427 | * @hide |
| 428 | */ |
| 429 | public interface KeyboardShortcutsReceiver { |
| 430 | /** |
| 431 | * Callback used when the focused window keyboard shortcuts are ready to be displayed. |
| 432 | * |
| 433 | * @param result The keyboard shortcuts to be displayed. |
| 434 | */ |
| 435 | void onKeyboardShortcutsReceived(List<KeyboardShortcutGroup> result); |
| 436 | } |
| 437 | |
| 438 | /** |
Muyuan Li | 6ca619f | 2016-03-08 13:30:42 -0800 | [diff] [blame] | 439 | * Message for taking fullscreen screenshot |
| 440 | * @hide |
| 441 | */ |
| 442 | final int TAKE_SCREENSHOT_FULLSCREEN = 1; |
| 443 | |
| 444 | /** |
| 445 | * Message for taking screenshot of selected region. |
| 446 | * @hide |
| 447 | */ |
| 448 | final int TAKE_SCREENSHOT_SELECTED_REGION = 2; |
| 449 | |
| 450 | /** |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 451 | * @hide |
| 452 | */ |
| 453 | public static final String PARCEL_KEY_SHORTCUTS_ARRAY = "shortcuts_array"; |
| 454 | |
| 455 | /** |
| 456 | * Request for keyboard shortcuts to be retrieved asynchronously. |
| 457 | * |
| 458 | * @param receiver The callback to be triggered when the result is ready. |
| 459 | * |
| 460 | * @hide |
| 461 | */ |
Clara Bayarri | fcd7e80 | 2016-03-10 12:58:18 +0000 | [diff] [blame] | 462 | public void requestAppKeyboardShortcuts(final KeyboardShortcutsReceiver receiver, int deviceId); |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 463 | |
Albert Chaulk | 2ccb0b7 | 2017-06-20 14:39:29 -0400 | [diff] [blame] | 464 | /** |
| 465 | * Return the touch region for the current IME window, or an empty region if there is none. |
| 466 | * |
| 467 | * @return The region of the IME that is accepting touch inputs, or null if there is no IME, no |
| 468 | * region or there was an error. |
| 469 | * |
| 470 | * @hide |
| 471 | */ |
| 472 | @SystemApi |
| 473 | @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) |
| 474 | public Region getCurrentImeTouchRegion(); |
| 475 | |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 476 | /** |
| 477 | * Sets that the display should show its content when non-secure keyguard is shown. |
| 478 | * |
| 479 | * @param displayId Display ID. |
| 480 | * @param shouldShow Indicates that the display should show its content when non-secure keyguard |
| 481 | * is shown. |
| 482 | * @see KeyguardManager#isDeviceSecure() |
| 483 | * @see KeyguardManager#isDeviceLocked() |
| 484 | * @hide |
| 485 | */ |
| 486 | @TestApi |
| 487 | default void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow) { |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * Sets that the display should show system decors. |
| 492 | * <p> |
| 493 | * System decors include status bar, navigation bar, launcher. |
| 494 | * </p> |
| 495 | * |
| 496 | * @param displayId The id of the display. |
| 497 | * @param shouldShow Indicates that the display should show system decors. |
Andrii Kulian | dd98961 | 2019-02-21 12:13:28 -0800 | [diff] [blame] | 498 | * @see #shouldShowSystemDecors(int) |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 499 | * @hide |
| 500 | */ |
| 501 | @TestApi |
| 502 | default void setShouldShowSystemDecors(int displayId, boolean shouldShow) { |
| 503 | } |
| 504 | |
| 505 | /** |
Andrii Kulian | dd98961 | 2019-02-21 12:13:28 -0800 | [diff] [blame] | 506 | * Checks if the display supports showing system decors. |
| 507 | * <p> |
| 508 | * System decors include status bar, navigation bar, launcher. |
| 509 | * </p> |
| 510 | * |
| 511 | * @param displayId The id of the display. |
| 512 | * @see #setShouldShowSystemDecors(int, boolean) |
| 513 | * @hide |
| 514 | */ |
| 515 | @TestApi |
| 516 | default boolean shouldShowSystemDecors(int displayId) { |
| 517 | return false; |
| 518 | } |
| 519 | |
| 520 | /** |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 521 | * Sets that the display should show IME. |
| 522 | * |
| 523 | * @param displayId Display ID. |
| 524 | * @param shouldShow Indicates that the display should show IME. |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 525 | * @hide |
| 526 | */ |
| 527 | @TestApi |
| 528 | default void setShouldShowIme(int displayId, boolean shouldShow) { |
| 529 | } |
| 530 | |
lumark | 9a72d22 | 2019-03-30 18:31:45 +0800 | [diff] [blame] | 531 | /** |
| 532 | * Indicates that the display should show IME. |
| 533 | * |
| 534 | * @param displayId The id of the display. |
| 535 | * @return {@code true} if the display should show IME when an input field becomes |
| 536 | * focused on it. |
| 537 | * @hide |
| 538 | */ |
| 539 | @TestApi |
| 540 | default boolean shouldShowIme(int displayId) { |
| 541 | return false; |
| 542 | } |
| 543 | |
Filip Gruszczynski | 1a4dfe5 | 2015-11-15 10:58:57 -0800 | [diff] [blame] | 544 | public static class LayoutParams extends ViewGroup.LayoutParams implements Parcelable { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 545 | /** |
| 546 | * X position for this window. With the default gravity it is ignored. |
Fabrice Di Meglio | 9e3b002 | 2011-06-06 16:30:29 -0700 | [diff] [blame] | 547 | * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or |
| 548 | * {@link Gravity#END} it provides an offset from the given edge. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 549 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 550 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | public int x; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 552 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | /** |
| 554 | * Y position for this window. With the default gravity it is ignored. |
| 555 | * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides |
| 556 | * an offset from the given edge. |
| 557 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 558 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 559 | public int y; |
| 560 | |
| 561 | /** |
| 562 | * Indicates how much of the extra space will be allocated horizontally |
| 563 | * to the view associated with these LayoutParams. Specify 0 if the view |
| 564 | * should not be stretched. Otherwise the extra pixels will be pro-rated |
| 565 | * among all views whose weight is greater than 0. |
| 566 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 567 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 568 | public float horizontalWeight; |
| 569 | |
| 570 | /** |
| 571 | * Indicates how much of the extra space will be allocated vertically |
| 572 | * to the view associated with these LayoutParams. Specify 0 if the view |
| 573 | * should not be stretched. Otherwise the extra pixels will be pro-rated |
| 574 | * among all views whose weight is greater than 0. |
| 575 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 576 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 577 | public float verticalWeight; |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 578 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 579 | /** |
| 580 | * The general type of window. There are three main classes of |
| 581 | * window types: |
| 582 | * <ul> |
| 583 | * <li> <strong>Application windows</strong> (ranging from |
| 584 | * {@link #FIRST_APPLICATION_WINDOW} to |
| 585 | * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application |
| 586 | * windows. For these types of windows, the {@link #token} must be |
| 587 | * set to the token of the activity they are a part of (this will |
| 588 | * normally be done for you if {@link #token} is null). |
| 589 | * <li> <strong>Sub-windows</strong> (ranging from |
| 590 | * {@link #FIRST_SUB_WINDOW} to |
| 591 | * {@link #LAST_SUB_WINDOW}) are associated with another top-level |
| 592 | * window. For these types of windows, the {@link #token} must be |
| 593 | * the token of the window it is attached to. |
| 594 | * <li> <strong>System windows</strong> (ranging from |
| 595 | * {@link #FIRST_SYSTEM_WINDOW} to |
| 596 | * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for |
| 597 | * use by the system for specific purposes. They should not normally |
| 598 | * be used by applications, and a special permission is required |
| 599 | * to use them. |
| 600 | * </ul> |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 601 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 602 | * @see #TYPE_BASE_APPLICATION |
| 603 | * @see #TYPE_APPLICATION |
| 604 | * @see #TYPE_APPLICATION_STARTING |
Chong Zhang | fea963e | 2016-08-15 17:14:16 -0700 | [diff] [blame] | 605 | * @see #TYPE_DRAWN_APPLICATION |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 606 | * @see #TYPE_APPLICATION_PANEL |
| 607 | * @see #TYPE_APPLICATION_MEDIA |
| 608 | * @see #TYPE_APPLICATION_SUB_PANEL |
| 609 | * @see #TYPE_APPLICATION_ATTACHED_DIALOG |
| 610 | * @see #TYPE_STATUS_BAR |
| 611 | * @see #TYPE_SEARCH_BAR |
| 612 | * @see #TYPE_PHONE |
| 613 | * @see #TYPE_SYSTEM_ALERT |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 614 | * @see #TYPE_TOAST |
| 615 | * @see #TYPE_SYSTEM_OVERLAY |
| 616 | * @see #TYPE_PRIORITY_PHONE |
| 617 | * @see #TYPE_STATUS_BAR_PANEL |
| 618 | * @see #TYPE_SYSTEM_DIALOG |
| 619 | * @see #TYPE_KEYGUARD_DIALOG |
| 620 | * @see #TYPE_SYSTEM_ERROR |
| 621 | * @see #TYPE_INPUT_METHOD |
| 622 | * @see #TYPE_INPUT_METHOD_DIALOG |
| 623 | */ |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 624 | @ViewDebug.ExportedProperty(mapping = { |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 625 | @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 626 | to = "BASE_APPLICATION"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 627 | @ViewDebug.IntToString(from = TYPE_APPLICATION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 628 | to = "APPLICATION"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 629 | @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 630 | to = "APPLICATION_STARTING"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 631 | @ViewDebug.IntToString(from = TYPE_DRAWN_APPLICATION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 632 | to = "DRAWN_APPLICATION"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 633 | @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 634 | to = "APPLICATION_PANEL"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 635 | @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 636 | to = "APPLICATION_MEDIA"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 637 | @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 638 | to = "APPLICATION_SUB_PANEL"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 639 | @ViewDebug.IntToString(from = TYPE_APPLICATION_ABOVE_SUB_PANEL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 640 | to = "APPLICATION_ABOVE_SUB_PANEL"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 641 | @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 642 | to = "APPLICATION_ATTACHED_DIALOG"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 643 | @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 644 | to = "APPLICATION_MEDIA_OVERLAY"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 645 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 646 | to = "STATUS_BAR"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 647 | @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 648 | to = "SEARCH_BAR"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 649 | @ViewDebug.IntToString(from = TYPE_PHONE, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 650 | to = "PHONE"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 651 | @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 652 | to = "SYSTEM_ALERT"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 653 | @ViewDebug.IntToString(from = TYPE_TOAST, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 654 | to = "TOAST"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 655 | @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 656 | to = "SYSTEM_OVERLAY"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 657 | @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 658 | to = "PRIORITY_PHONE"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 659 | @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 660 | to = "SYSTEM_DIALOG"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 661 | @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 662 | to = "KEYGUARD_DIALOG"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 663 | @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 664 | to = "SYSTEM_ERROR"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 665 | @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 666 | to = "INPUT_METHOD"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 667 | @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 668 | to = "INPUT_METHOD_DIALOG"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 669 | @ViewDebug.IntToString(from = TYPE_WALLPAPER, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 670 | to = "WALLPAPER"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 671 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 672 | to = "STATUS_BAR_PANEL"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 673 | @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 674 | to = "SECURE_SYSTEM_OVERLAY"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 675 | @ViewDebug.IntToString(from = TYPE_DRAG, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 676 | to = "DRAG"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 677 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 678 | to = "STATUS_BAR_SUB_PANEL"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 679 | @ViewDebug.IntToString(from = TYPE_POINTER, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 680 | to = "POINTER"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 681 | @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 682 | to = "NAVIGATION_BAR"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 683 | @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 684 | to = "VOLUME_OVERLAY"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 685 | @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 686 | to = "BOOT_PROGRESS"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 687 | @ViewDebug.IntToString(from = TYPE_INPUT_CONSUMER, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 688 | to = "INPUT_CONSUMER"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 689 | @ViewDebug.IntToString(from = TYPE_DREAM, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 690 | to = "DREAM"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 691 | @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 692 | to = "NAVIGATION_BAR_PANEL"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 693 | @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 694 | to = "DISPLAY_OVERLAY"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 695 | @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 696 | to = "MAGNIFICATION_OVERLAY"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 697 | @ViewDebug.IntToString(from = TYPE_PRESENTATION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 698 | to = "PRESENTATION"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 699 | @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 700 | to = "PRIVATE_PRESENTATION"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 701 | @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 702 | to = "VOICE_INTERACTION"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 703 | @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION_STARTING, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 704 | to = "VOICE_INTERACTION_STARTING"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 705 | @ViewDebug.IntToString(from = TYPE_DOCK_DIVIDER, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 706 | to = "DOCK_DIVIDER"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 707 | @ViewDebug.IntToString(from = TYPE_QS_DIALOG, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 708 | to = "QS_DIALOG"), |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 709 | @ViewDebug.IntToString(from = TYPE_SCREENSHOT, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 710 | to = "SCREENSHOT"), |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 711 | @ViewDebug.IntToString(from = TYPE_APPLICATION_OVERLAY, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 712 | to = "APPLICATION_OVERLAY") |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 713 | }) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 714 | public int type; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 715 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 716 | /** |
| 717 | * Start of window types that represent normal application windows. |
| 718 | */ |
| 719 | public static final int FIRST_APPLICATION_WINDOW = 1; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 720 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | /** |
| 722 | * Window type: an application window that serves as the "base" window |
| 723 | * of the overall application; all other application windows will |
| 724 | * appear on top of it. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 725 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 726 | */ |
| 727 | public static final int TYPE_BASE_APPLICATION = 1; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 728 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 729 | /** |
| 730 | * Window type: a normal application window. The {@link #token} must be |
| 731 | * an Activity token identifying who the window belongs to. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 732 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 733 | */ |
| 734 | public static final int TYPE_APPLICATION = 2; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 735 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 736 | /** |
| 737 | * Window type: special application window that is displayed while the |
| 738 | * application is starting. Not for use by applications themselves; |
| 739 | * this is used by the system to display something until the |
| 740 | * application can show its own windows. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 741 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 742 | */ |
| 743 | public static final int TYPE_APPLICATION_STARTING = 3; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 744 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 745 | /** |
Chong Zhang | fea963e | 2016-08-15 17:14:16 -0700 | [diff] [blame] | 746 | * Window type: a variation on TYPE_APPLICATION that ensures the window |
| 747 | * manager will wait for this window to be drawn before the app is shown. |
| 748 | * In multiuser systems shows only on the owning user's window. |
| 749 | */ |
| 750 | public static final int TYPE_DRAWN_APPLICATION = 4; |
| 751 | |
| 752 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 753 | * End of types of application windows. |
| 754 | */ |
| 755 | public static final int LAST_APPLICATION_WINDOW = 99; |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 756 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 757 | /** |
| 758 | * Start of types of sub-windows. The {@link #token} of these windows |
| 759 | * must be set to the window they are attached to. These types of |
| 760 | * windows are kept next to their attached window in Z-order, and their |
| 761 | * coordinate space is relative to their attached window. |
| 762 | */ |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 763 | public static final int FIRST_SUB_WINDOW = 1000; |
| 764 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 765 | /** |
| 766 | * Window type: a panel on top of an application window. These windows |
| 767 | * appear on top of their attached window. |
| 768 | */ |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 769 | public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW; |
| 770 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 771 | /** |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 772 | * Window type: window for showing media (such as video). These windows |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 773 | * are displayed behind their attached window. |
| 774 | */ |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 775 | public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1; |
| 776 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 777 | /** |
| 778 | * Window type: a sub-panel on top of an application window. These |
| 779 | * windows are displayed on top their attached window and any |
| 780 | * {@link #TYPE_APPLICATION_PANEL} panels. |
| 781 | */ |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 782 | public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 783 | |
| 784 | /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout |
| 785 | * of the window happens as that of a top-level window, <em>not</em> |
| 786 | * as a child of its container. |
| 787 | */ |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 788 | public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3; |
| 789 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 790 | /** |
Dianne Hackborn | c4d5d02 | 2009-05-21 17:32:42 -0700 | [diff] [blame] | 791 | * Window type: window for showing overlays on top of media windows. |
| 792 | * These windows are displayed between TYPE_APPLICATION_MEDIA and the |
| 793 | * application window. They should be translucent to be useful. This |
| 794 | * is a big ugly hack so: |
| 795 | * @hide |
| 796 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 797 | @UnsupportedAppUsage |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 798 | public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW + 4; |
| 799 | |
| 800 | /** |
| 801 | * Window type: a above sub-panel on top of an application window and it's |
| 802 | * sub-panel windows. These windows are displayed on top of their attached window |
| 803 | * and any {@link #TYPE_APPLICATION_SUB_PANEL} panels. |
Wale Ogunwale | 3540f93 | 2015-06-02 11:07:07 -0700 | [diff] [blame] | 804 | * @hide |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 805 | */ |
| 806 | public static final int TYPE_APPLICATION_ABOVE_SUB_PANEL = FIRST_SUB_WINDOW + 5; |
| 807 | |
Dianne Hackborn | c4d5d02 | 2009-05-21 17:32:42 -0700 | [diff] [blame] | 808 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 809 | * End of types of sub-windows. |
| 810 | */ |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 811 | public static final int LAST_SUB_WINDOW = 1999; |
| 812 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 813 | /** |
| 814 | * Start of system-specific window types. These are not normally |
| 815 | * created by applications. |
| 816 | */ |
| 817 | public static final int FIRST_SYSTEM_WINDOW = 2000; |
Wale Ogunwale | 0a4dc22 | 2015-04-14 12:58:42 -0700 | [diff] [blame] | 818 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 819 | /** |
| 820 | * Window type: the status bar. There can be only one status bar |
| 821 | * window; it is placed at the top of the screen, and all other |
| 822 | * windows are shifted down so they are below it. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 823 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 824 | */ |
| 825 | public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 826 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 827 | /** |
| 828 | * Window type: the search bar. There can be only one search bar |
| 829 | * window; it is placed at the top of the screen. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 830 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 831 | */ |
| 832 | public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 833 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 834 | /** |
| 835 | * Window type: phone. These are non-application windows providing |
| 836 | * user interaction with the phone (in particular incoming calls). |
| 837 | * These windows are normally placed above all applications, but behind |
| 838 | * the status bar. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 839 | * In multiuser systems shows on all users' windows. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 840 | * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 841 | */ |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 842 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 843 | public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 844 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 845 | /** |
| 846 | * Window type: system window, such as low power alert. These windows |
| 847 | * are always on top of application windows. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 848 | * In multiuser systems shows only on the owning user's window. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 849 | * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 850 | */ |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 851 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 852 | public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3; |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 853 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 854 | /** |
| 855 | * Window type: keyguard window. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 856 | * In multiuser systems shows on all users' windows. |
Jorim Jaggi | e411fdf | 2014-07-28 23:00:44 +0200 | [diff] [blame] | 857 | * @removed |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 858 | */ |
| 859 | public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4; |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 860 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 861 | /** |
| 862 | * Window type: transient notifications. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 863 | * In multiuser systems shows only on the owning user's window. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 864 | * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 865 | */ |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 866 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 867 | public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 868 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 869 | /** |
| 870 | * Window type: system overlay windows, which need to be displayed |
| 871 | * on top of everything else. These windows must not take input |
| 872 | * focus, or they will interfere with the keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 873 | * In multiuser systems shows only on the owning user's window. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 874 | * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 875 | */ |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 876 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 877 | public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 878 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 879 | /** |
| 880 | * Window type: priority phone UI, which needs to be displayed even if |
| 881 | * the keyguard is active. These windows must not take input |
| 882 | * focus, or they will interfere with the keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 883 | * In multiuser systems shows on all users' windows. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 884 | * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 885 | */ |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 886 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 887 | public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 888 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 889 | /** |
| 890 | * Window type: panel that slides out from the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 891 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 892 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 893 | public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 894 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 895 | /** |
| 896 | * Window type: dialogs that the keyguard shows |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 897 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 898 | */ |
| 899 | public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 900 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 901 | /** |
| 902 | * Window type: internal system error windows, appear on top of |
| 903 | * everything they can. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 904 | * In multiuser systems shows only on the owning user's window. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 905 | * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 906 | */ |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 907 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 908 | public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 909 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 910 | /** |
| 911 | * Window type: internal input methods windows, which appear above |
| 912 | * the normal UI. Application windows may be resized or panned to keep |
| 913 | * the input focus visible while this window is displayed. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 914 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 915 | */ |
| 916 | public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11; |
| 917 | |
| 918 | /** |
| 919 | * Window type: internal input methods dialog windows, which appear above |
| 920 | * the current input method window. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 921 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 922 | */ |
| 923 | public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12; |
| 924 | |
| 925 | /** |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 926 | * Window type: wallpaper window, placed behind any window that wants |
| 927 | * to sit on top of the wallpaper. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 928 | * In multiuser systems shows only on the owning user's window. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 929 | */ |
| 930 | public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13; |
| 931 | |
| 932 | /** |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 933 | * Window type: panel that slides out from over the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 934 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | badc47e | 2009-11-08 17:37:07 -0800 | [diff] [blame] | 935 | */ |
| 936 | public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14; |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 937 | |
| 938 | /** |
| 939 | * Window type: secure system overlay windows, which need to be displayed |
| 940 | * on top of everything else. These windows must not take input |
| 941 | * focus, or they will interfere with the keyguard. |
| 942 | * |
| 943 | * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the |
| 944 | * system itself is allowed to create these overlays. Applications cannot |
| 945 | * obtain permission to create secure system overlays. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 946 | * |
| 947 | * In multiuser systems shows only on the owning user's window. |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 948 | * @hide |
| 949 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 950 | @UnsupportedAppUsage |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 951 | public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15; |
| 952 | |
Dianne Hackborn | badc47e | 2009-11-08 17:37:07 -0800 | [diff] [blame] | 953 | /** |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 954 | * Window type: the drag-and-drop pseudowindow. There is only one |
| 955 | * drag layer (at most), and it is placed on top of all other windows. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 956 | * In multiuser systems shows only on the owning user's window. |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 957 | * @hide |
| 958 | */ |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 959 | public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16; |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 960 | |
| 961 | /** |
Robert Carr | 8360a78 | 2017-11-22 12:47:58 -0800 | [diff] [blame] | 962 | * Window type: panel that slides out from over the status bar |
| 963 | * In multiuser systems shows on all users' windows. These windows |
| 964 | * are displayed on top of the stauts bar and any {@link #TYPE_STATUS_BAR_PANEL} |
| 965 | * windows. |
Joe Onorato | a89e903 | 2010-11-24 11:13:44 -0800 | [diff] [blame] | 966 | * @hide |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 967 | */ |
| 968 | public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17; |
| 969 | |
Jeff Brown | 83c0968 | 2010-12-23 17:50:18 -0800 | [diff] [blame] | 970 | /** |
| 971 | * Window type: (mouse) pointer |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 972 | * In multiuser systems shows on all users' windows. |
Jeff Brown | 83c0968 | 2010-12-23 17:50:18 -0800 | [diff] [blame] | 973 | * @hide |
| 974 | */ |
| 975 | public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18; |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 976 | |
| 977 | /** |
Daniel Sandler | 8956dbb | 2011-04-22 07:55:02 -0400 | [diff] [blame] | 978 | * Window type: Navigation bar (when distinct from status bar) |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 979 | * In multiuser systems shows on all users' windows. |
Daniel Sandler | 8956dbb | 2011-04-22 07:55:02 -0400 | [diff] [blame] | 980 | * @hide |
| 981 | */ |
| 982 | public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19; |
| 983 | |
| 984 | /** |
Dianne Hackborn | e8ecde1 | 2011-08-03 18:55:19 -0700 | [diff] [blame] | 985 | * Window type: The volume level overlay/dialog shown when the user |
| 986 | * changes the system volume. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 987 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | e8ecde1 | 2011-08-03 18:55:19 -0700 | [diff] [blame] | 988 | * @hide |
| 989 | */ |
| 990 | public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20; |
| 991 | |
| 992 | /** |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 993 | * Window type: The boot progress dialog, goes on top of everything |
| 994 | * in the world. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 995 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 996 | * @hide |
| 997 | */ |
| 998 | public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21; |
| 999 | |
| 1000 | /** |
Selim Cinek | f83e824 | 2015-05-19 18:08:14 -0700 | [diff] [blame] | 1001 | * Window type to consume input events when the systemUI bars are hidden. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1002 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | df89e65 | 2011-10-06 22:35:11 -0700 | [diff] [blame] | 1003 | * @hide |
| 1004 | */ |
Selim Cinek | f83e824 | 2015-05-19 18:08:14 -0700 | [diff] [blame] | 1005 | public static final int TYPE_INPUT_CONSUMER = FIRST_SYSTEM_WINDOW+22; |
Dianne Hackborn | df89e65 | 2011-10-06 22:35:11 -0700 | [diff] [blame] | 1006 | |
| 1007 | /** |
Daniel Sandler | 7d276c3 | 2012-01-30 14:33:52 -0500 | [diff] [blame] | 1008 | * Window type: Dreams (screen saver) window, just above keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1009 | * In multiuser systems shows only on the owning user's window. |
Daniel Sandler | 7d276c3 | 2012-01-30 14:33:52 -0500 | [diff] [blame] | 1010 | * @hide |
| 1011 | */ |
| 1012 | public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23; |
| 1013 | |
| 1014 | /** |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 1015 | * Window type: Navigation bar panel (when navigation bar is distinct from status bar) |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1016 | * In multiuser systems shows on all users' windows. |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 1017 | * @hide |
| 1018 | */ |
| 1019 | public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24; |
| 1020 | |
| 1021 | /** |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 1022 | * Window type: Display overlay window. Used to simulate secondary display devices. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1023 | * In multiuser systems shows on all users' windows. |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 1024 | * @hide |
| 1025 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 1026 | @UnsupportedAppUsage |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 1027 | public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26; |
| 1028 | |
| 1029 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 1030 | * Window type: Magnification overlay window. Used to highlight the magnified |
| 1031 | * portion of a display when accessibility magnification is enabled. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1032 | * In multiuser systems shows on all users' windows. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 1033 | * @hide |
| 1034 | */ |
| 1035 | public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27; |
| 1036 | |
| 1037 | /** |
keunyoung | a446bf0 | 2013-06-21 19:07:57 -0700 | [diff] [blame] | 1038 | * Window type: Window for Presentation on top of private |
| 1039 | * virtual display. |
| 1040 | */ |
| 1041 | public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30; |
| 1042 | |
| 1043 | /** |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 1044 | * Window type: Windows in the voice interaction layer. |
| 1045 | * @hide |
| 1046 | */ |
| 1047 | public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31; |
| 1048 | |
| 1049 | /** |
Phil Weaver | 40ded28 | 2016-01-25 15:49:02 -0800 | [diff] [blame] | 1050 | * Window type: Windows that are overlaid <em>only</em> by a connected {@link |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 1051 | * android.accessibilityservice.AccessibilityService} for interception of |
| 1052 | * user interactions without changing the windows an accessibility service |
| 1053 | * can introspect. In particular, an accessibility service can introspect |
| 1054 | * only windows that a sighted user can interact with which is they can touch |
| 1055 | * these windows or can type into these windows. For example, if there |
| 1056 | * is a full screen accessibility overlay that is touchable, the windows |
Phil Weaver | 40ded28 | 2016-01-25 15:49:02 -0800 | [diff] [blame] | 1057 | * below it will be introspectable by an accessibility service even though |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 1058 | * they are covered by a touchable window. |
| 1059 | */ |
| 1060 | public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32; |
| 1061 | |
| 1062 | /** |
Jorim Jaggi | 225d3b5 | 2015-04-01 11:18:57 -0700 | [diff] [blame] | 1063 | * Window type: Starting window for voice interaction layer. |
| 1064 | * @hide |
| 1065 | */ |
| 1066 | public static final int TYPE_VOICE_INTERACTION_STARTING = FIRST_SYSTEM_WINDOW+33; |
| 1067 | |
| 1068 | /** |
Filip Gruszczynski | 466f321 | 2015-09-21 17:57:57 -0700 | [diff] [blame] | 1069 | * Window for displaying a handle used for resizing docked stacks. This window is owned |
| 1070 | * by the system process. |
| 1071 | * @hide |
| 1072 | */ |
| 1073 | public static final int TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW+34; |
| 1074 | |
| 1075 | /** |
Jason Monk | 8f7f318 | 2015-11-18 16:35:14 -0500 | [diff] [blame] | 1076 | * Window type: like {@link #TYPE_APPLICATION_ATTACHED_DIALOG}, but used |
| 1077 | * by Quick Settings Tiles. |
| 1078 | * @hide |
| 1079 | */ |
| 1080 | public static final int TYPE_QS_DIALOG = FIRST_SYSTEM_WINDOW+35; |
| 1081 | |
| 1082 | /** |
Muyuan Li | 6ca619f | 2016-03-08 13:30:42 -0800 | [diff] [blame] | 1083 | * Window type: shares similar characteristics with {@link #TYPE_DREAM}. The layer is |
Muyuan Li | 36ca72c | 2016-08-06 20:24:06 -0700 | [diff] [blame] | 1084 | * reserved for screenshot region selection. These windows must not take input focus. |
Muyuan Li | 6ca619f | 2016-03-08 13:30:42 -0800 | [diff] [blame] | 1085 | * @hide |
| 1086 | */ |
| 1087 | public static final int TYPE_SCREENSHOT = FIRST_SYSTEM_WINDOW + 36; |
| 1088 | |
| 1089 | /** |
Wale Ogunwale | 5b6714c | 2016-11-01 20:54:46 -0700 | [diff] [blame] | 1090 | * Window type: Window for Presentation on an external display. |
| 1091 | * @see android.app.Presentation |
| 1092 | * @hide |
| 1093 | */ |
| 1094 | public static final int TYPE_PRESENTATION = FIRST_SYSTEM_WINDOW + 37; |
| 1095 | |
| 1096 | /** |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 1097 | * Window type: Application overlay windows are displayed above all activity windows |
| 1098 | * (types between {@link #FIRST_APPLICATION_WINDOW} and {@link #LAST_APPLICATION_WINDOW}) |
| 1099 | * but below critical system windows like the status bar or IME. |
| 1100 | * <p> |
| 1101 | * The system may change the position, size, or visibility of these windows at anytime |
| 1102 | * to reduce visual clutter to the user and also manage resources. |
| 1103 | * <p> |
| 1104 | * Requires {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission. |
| 1105 | * <p> |
Wale Ogunwale | d993a57 | 2017-02-05 13:52:09 -0800 | [diff] [blame] | 1106 | * The system will adjust the importance of processes with this window type to reduce the |
| 1107 | * chance of the low-memory-killer killing them. |
| 1108 | * <p> |
| 1109 | * In multi-user systems shows only on the owning user's screen. |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 1110 | */ |
| 1111 | public static final int TYPE_APPLICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 38; |
| 1112 | |
| 1113 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1114 | * End of types of system windows. |
| 1115 | */ |
| 1116 | public static final int LAST_SYSTEM_WINDOW = 2999; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1117 | |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 1118 | /** |
Albert Chaulk | e4338f8 | 2017-04-19 15:54:08 -0400 | [diff] [blame] | 1119 | * @hide |
| 1120 | * Used internally when there is no suitable type available. |
| 1121 | */ |
| 1122 | public static final int INVALID_WINDOW_TYPE = -1; |
| 1123 | |
| 1124 | /** |
Wale Ogunwale | 5cd907d | 2017-01-26 14:14:08 -0800 | [diff] [blame] | 1125 | * Return true if the window type is an alert window. |
| 1126 | * |
| 1127 | * @param type The window type. |
| 1128 | * @return If the window type is an alert window. |
| 1129 | * @hide |
| 1130 | */ |
| 1131 | public static boolean isSystemAlertWindowType(int type) { |
| 1132 | switch (type) { |
| 1133 | case TYPE_PHONE: |
| 1134 | case TYPE_PRIORITY_PHONE: |
| 1135 | case TYPE_SYSTEM_ALERT: |
| 1136 | case TYPE_SYSTEM_ERROR: |
| 1137 | case TYPE_SYSTEM_OVERLAY: |
| 1138 | case TYPE_APPLICATION_OVERLAY: |
| 1139 | return true; |
| 1140 | } |
| 1141 | return false; |
| 1142 | } |
| 1143 | |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 1144 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
| 1145 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1146 | public static final int MEMORY_TYPE_NORMAL = 0; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 1147 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
Mathias Agopian | 317a628 | 2009-08-13 17:29:02 -0700 | [diff] [blame] | 1148 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1149 | public static final int MEMORY_TYPE_HARDWARE = 1; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 1150 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
Mathias Agopian | 317a628 | 2009-08-13 17:29:02 -0700 | [diff] [blame] | 1151 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1152 | public static final int MEMORY_TYPE_GPU = 2; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 1153 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
| 1154 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1155 | public static final int MEMORY_TYPE_PUSH_BUFFERS = 3; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1156 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1157 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1158 | * @deprecated this is ignored |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1159 | */ |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1160 | @Deprecated |
| 1161 | public int memoryType; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1162 | |
Mike Lockwood | ef73162 | 2010-01-27 17:51:34 -0500 | [diff] [blame] | 1163 | /** Window flag: as long as this window is visible to the user, allow |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1164 | * the lock screen to activate while the screen is on. |
| 1165 | * This can be used independently, or in combination with |
Christopher Tate | 95f7850 | 2010-01-29 15:57:34 -0800 | [diff] [blame] | 1166 | * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */ |
Mike Lockwood | ef73162 | 2010-01-27 17:51:34 -0500 | [diff] [blame] | 1167 | public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001; |
| 1168 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1169 | /** Window flag: everything behind this window will be dimmed. |
| 1170 | * Use {@link #dimAmount} to control the amount of dim. */ |
| 1171 | public static final int FLAG_DIM_BEHIND = 0x00000002; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1172 | |
| 1173 | /** Window flag: blur everything behind this window. |
| 1174 | * @deprecated Blurring is no longer supported. */ |
| 1175 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1176 | public static final int FLAG_BLUR_BEHIND = 0x00000004; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1177 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1178 | /** Window flag: this window won't ever get key input focus, so the |
| 1179 | * user can not send key or other button events to it. Those will |
| 1180 | * instead go to whatever focusable window is behind it. This flag |
| 1181 | * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that |
| 1182 | * is explicitly set. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1183 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1184 | * <p>Setting this flag also implies that the window will not need to |
| 1185 | * interact with |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1186 | * a soft input method, so it will be Z-ordered and positioned |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1187 | * independently of any active input method (typically this means it |
| 1188 | * gets Z-ordered on top of the input method, so it can use the full |
| 1189 | * screen for its content and cover the input method if needed. You |
| 1190 | * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */ |
| 1191 | public static final int FLAG_NOT_FOCUSABLE = 0x00000008; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1192 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1193 | /** Window flag: this window can never receive touch events. */ |
| 1194 | public static final int FLAG_NOT_TOUCHABLE = 0x00000010; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1195 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 1196 | /** Window flag: even when this window is focusable (its |
| 1197 | * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1198 | * outside of the window to be sent to the windows behind it. Otherwise |
| 1199 | * it will consume all pointer events itself, regardless of whether they |
| 1200 | * are inside of the window. */ |
| 1201 | public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1202 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 1203 | /** Window flag: when set, if the device is asleep when the touch |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1204 | * screen is pressed, you will receive this first touch event. Usually |
| 1205 | * the first touch event is consumed by the system since the user can |
| 1206 | * not see what they are pressing on. |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 1207 | * |
| 1208 | * @deprecated This flag has no effect. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1209 | */ |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 1210 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1211 | public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1212 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1213 | /** Window flag: as long as this window is visible to the user, keep |
| 1214 | * the device's screen turned on and bright. */ |
| 1215 | public static final int FLAG_KEEP_SCREEN_ON = 0x00000080; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1216 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1217 | /** Window flag: place the window within the entire screen, ignoring |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 1218 | * decorations around the border (such as the status bar). The |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1219 | * window must correctly position its contents to take the screen |
| 1220 | * decoration into account. This flag is normally set for you |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 1221 | * by Window as described in {@link Window#setFlags}. |
| 1222 | * |
| 1223 | * <p>Note: on displays that have a {@link DisplayCutout}, the window may be placed |
| 1224 | * such that it avoids the {@link DisplayCutout} area if necessary according to the |
| 1225 | * {@link #layoutInDisplayCutoutMode}. |
| 1226 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1227 | public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1228 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1229 | /** Window flag: allow window to extend outside of the screen. */ |
| 1230 | public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1231 | |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1232 | /** |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 1233 | * Window flag: hide all screen decorations (such as the status bar) while |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1234 | * this window is displayed. This allows the window to use the entire |
| 1235 | * display space for itself -- the status bar will be hidden when |
Chet Haase | 45c89c2 | 2013-04-29 16:04:40 -0700 | [diff] [blame] | 1236 | * an app window with this flag set is on the top layer. A fullscreen window |
| 1237 | * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's |
| 1238 | * {@link #softInputMode} field; the window will stay fullscreen |
| 1239 | * and will not resize. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1240 | * |
| 1241 | * <p>This flag can be controlled in your theme through the |
| 1242 | * {@link android.R.attr#windowFullscreen} attribute; this attribute |
| 1243 | * is automatically set for you in the standard fullscreen themes |
| 1244 | * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen}, |
| 1245 | * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen}, |
| 1246 | * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen}, |
| 1247 | * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen}, |
| 1248 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen}, |
| 1249 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and |
| 1250 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p> |
| 1251 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1252 | public static final int FLAG_FULLSCREEN = 0x00000400; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1253 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 1254 | /** Window flag: override {@link #FLAG_FULLSCREEN} and force the |
| 1255 | * screen decorations (such as the status bar) to be shown. */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1256 | public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1257 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1258 | /** Window flag: turn on dithering when compositing this window to |
Jeff Brown | 3cc321e | 2012-07-16 16:04:23 -0700 | [diff] [blame] | 1259 | * the screen. |
| 1260 | * @deprecated This flag is no longer used. */ |
| 1261 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1262 | public static final int FLAG_DITHER = 0x00001000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1263 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 1264 | /** Window flag: treat the content of the window as secure, preventing |
Jeff Brown | f0681b3 | 2012-10-23 17:35:57 -0700 | [diff] [blame] | 1265 | * it from appearing in screenshots or from being viewed on non-secure |
| 1266 | * displays. |
| 1267 | * |
| 1268 | * <p>See {@link android.view.Display#FLAG_SECURE} for more details about |
| 1269 | * secure surfaces and secure displays. |
| 1270 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1271 | public static final int FLAG_SECURE = 0x00002000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1272 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1273 | /** Window flag: a special mode where the layout parameters are used |
| 1274 | * to perform scaling of the surface when it is composited to the |
| 1275 | * screen. */ |
| 1276 | public static final int FLAG_SCALED = 0x00004000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1277 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1278 | /** Window flag: intended for windows that will often be used when the user is |
| 1279 | * holding the screen against their face, it will aggressively filter the event |
| 1280 | * stream to prevent unintended presses in this situation that may not be |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1281 | * desired for a particular window, when such an event stream is detected, the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1282 | * application will receive a CANCEL motion event to indicate this so applications |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1283 | * can handle this accordingly by taking no action on the event |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1284 | * until the finger is released. */ |
| 1285 | public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1286 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1287 | /** Window flag: a special option only for use in combination with |
| 1288 | * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the |
| 1289 | * screen your window may appear on top of or behind screen decorations |
| 1290 | * such as the status bar. By also including this flag, the window |
| 1291 | * manager will report the inset rectangle needed to ensure your |
| 1292 | * content is not covered by screen decorations. This flag is normally |
| 1293 | * set for you by Window as described in {@link Window#setFlags}.*/ |
| 1294 | public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1295 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1296 | /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with |
| 1297 | * respect to how this window interacts with the current method. That |
| 1298 | * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the |
| 1299 | * window will behave as if it needs to interact with the input method |
| 1300 | * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is |
| 1301 | * not set and this flag is set, then the window will behave as if it |
| 1302 | * doesn't need to interact with the input method and can be placed |
| 1303 | * to use more space and cover the input method. |
| 1304 | */ |
| 1305 | public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1306 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1307 | /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you |
| 1308 | * can set this flag to receive a single special MotionEvent with |
| 1309 | * the action |
| 1310 | * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for |
| 1311 | * touches that occur outside of your window. Note that you will not |
| 1312 | * receive the full down/move/up gesture, only the location of the |
| 1313 | * first down as an ACTION_OUTSIDE. |
| 1314 | */ |
| 1315 | public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1316 | |
Suchi Amalapurapu | d1a9337 | 2009-05-14 17:54:31 -0700 | [diff] [blame] | 1317 | /** Window flag: special flag to let windows be shown when the screen |
| 1318 | * is locked. This will let application windows take precedence over |
| 1319 | * key guard or any other lock screens. Can be used with |
| 1320 | * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 1321 | * directly before showing the key guard window. Can be used with |
| 1322 | * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss |
| 1323 | * non-secure keyguards. This flag only applies to the top-most |
| 1324 | * full-screen window. |
chaviw | 59b9885 | 2017-06-13 12:05:44 -0700 | [diff] [blame] | 1325 | * @deprecated Use {@link android.R.attr#showWhenLocked} or |
| 1326 | * {@link android.app.Activity#setShowWhenLocked(boolean)} instead to prevent an |
| 1327 | * unintentional double life-cycle event. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 1328 | */ |
chaviw | 59b9885 | 2017-06-13 12:05:44 -0700 | [diff] [blame] | 1329 | @Deprecated |
Suchi Amalapurapu | d1a9337 | 2009-05-14 17:54:31 -0700 | [diff] [blame] | 1330 | public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000; |
| 1331 | |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 1332 | /** Window flag: ask that the system wallpaper be shown behind |
| 1333 | * your window. The window surface must be translucent to be able |
| 1334 | * to actually see the wallpaper behind it; this flag just ensures |
| 1335 | * that the wallpaper surface will be there if this window actually |
| 1336 | * has translucent regions. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1337 | * |
| 1338 | * <p>This flag can be controlled in your theme through the |
| 1339 | * {@link android.R.attr#windowShowWallpaper} attribute; this attribute |
| 1340 | * is automatically set for you in the standard wallpaper themes |
| 1341 | * such as {@link android.R.style#Theme_Wallpaper}, |
| 1342 | * {@link android.R.style#Theme_Wallpaper_NoTitleBar}, |
| 1343 | * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen}, |
| 1344 | * {@link android.R.style#Theme_Holo_Wallpaper}, |
| 1345 | * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar}, |
| 1346 | * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and |
| 1347 | * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p> |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 1348 | */ |
| 1349 | public static final int FLAG_SHOW_WALLPAPER = 0x00100000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1350 | |
Dianne Hackborn | 93e462b | 2009-09-15 22:50:40 -0700 | [diff] [blame] | 1351 | /** Window flag: when set as a window is being added or made |
| 1352 | * visible, once the window has been shown then the system will |
| 1353 | * poke the power manager's user activity (as if the user had woken |
chaviw | 59b9885 | 2017-06-13 12:05:44 -0700 | [diff] [blame] | 1354 | * up the device) to turn the screen on. |
| 1355 | * @deprecated Use {@link android.R.attr#turnScreenOn} or |
| 1356 | * {@link android.app.Activity#setTurnScreenOn(boolean)} instead to prevent an |
| 1357 | * unintentional double life-cycle event. |
| 1358 | */ |
| 1359 | @Deprecated |
Dianne Hackborn | 93e462b | 2009-09-15 22:50:40 -0700 | [diff] [blame] | 1360 | public static final int FLAG_TURN_SCREEN_ON = 0x00200000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1361 | |
Jeff Sharkey | 67f9d50 | 2017-08-05 13:49:13 -0600 | [diff] [blame] | 1362 | /** |
| 1363 | * Window flag: when set the window will cause the keyguard to be |
| 1364 | * dismissed, only if it is not a secure lock keyguard. Because such a |
| 1365 | * keyguard is not needed for security, it will never re-appear if the |
| 1366 | * user navigates to another window (in contrast to |
| 1367 | * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily hide both |
| 1368 | * secure and non-secure keyguards but ensure they reappear when the |
| 1369 | * user moves to another UI that doesn't hide them). If the keyguard is |
| 1370 | * currently active and is secure (requires an unlock credential) than |
| 1371 | * the user will still need to confirm it before seeing this window, |
| 1372 | * unless {@link #FLAG_SHOW_WHEN_LOCKED} has also been set. |
| 1373 | * |
| 1374 | * @deprecated Use {@link #FLAG_SHOW_WHEN_LOCKED} or |
| 1375 | * {@link KeyguardManager#requestDismissKeyguard} instead. |
| 1376 | * Since keyguard was dismissed all the time as long as an |
| 1377 | * activity with this flag on its window was focused, |
| 1378 | * keyguard couldn't guard against unintentional touches on |
| 1379 | * the screen, which isn't desired. |
Daniel Sandler | ae069f7 | 2010-06-17 21:56:26 -0400 | [diff] [blame] | 1380 | */ |
Jorim Jaggi | 0796187 | 2016-11-23 11:28:57 +0100 | [diff] [blame] | 1381 | @Deprecated |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 1382 | public static final int FLAG_DISMISS_KEYGUARD = 0x00400000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1383 | |
Jeff Brown | 01ce2e9 | 2010-09-26 22:20:12 -0700 | [diff] [blame] | 1384 | /** Window flag: when set the window will accept for touch events |
| 1385 | * outside of its bounds to be sent to other windows that also |
| 1386 | * support split touch. When this flag is not set, the first pointer |
| 1387 | * that goes down determines the window to which all subsequent touches |
| 1388 | * go until all pointers go up. When this flag is set, each pointer |
| 1389 | * (not necessarily the first) that goes down determines the window |
| 1390 | * to which all subsequent touches of that pointer will go until that |
| 1391 | * pointer goes up thereby enabling touches with multiple pointers |
| 1392 | * to be split across multiple windows. |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 1393 | */ |
Jeff Brown | 01ce2e9 | 2010-09-26 22:20:12 -0700 | [diff] [blame] | 1394 | public static final int FLAG_SPLIT_TOUCH = 0x00800000; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1395 | |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 1396 | /** |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 1397 | * <p>Indicates whether this window should be hardware accelerated. |
| 1398 | * Requesting hardware acceleration does not guarantee it will happen.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1399 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 1400 | * <p>This flag can be controlled programmatically <em>only</em> to enable |
| 1401 | * hardware acceleration. To enable hardware acceleration for a given |
| 1402 | * window programmatically, do the following:</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1403 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 1404 | * <pre> |
| 1405 | * Window w = activity.getWindow(); // in Activity's onCreate() for instance |
| 1406 | * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, |
| 1407 | * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); |
| 1408 | * </pre> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1409 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 1410 | * <p>It is important to remember that this flag <strong>must</strong> |
| 1411 | * be set before setting the content view of your activity or dialog.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1412 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 1413 | * <p>This flag cannot be used to disable hardware acceleration after it |
| 1414 | * was enabled in your manifest using |
| 1415 | * {@link android.R.attr#hardwareAccelerated}. If you need to selectively |
| 1416 | * and programmatically disable hardware acceleration (for automated testing |
| 1417 | * for instance), make sure it is turned off in your manifest and enable it |
| 1418 | * on your activity or dialog when you need it instead, using the method |
| 1419 | * described above.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1420 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 1421 | * <p>This flag is automatically set by the system if the |
| 1422 | * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated} |
| 1423 | * XML attribute is set to true on an activity or on the application.</p> |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 1424 | */ |
| 1425 | public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000; |
Daniel Sandler | 611fae4 | 2010-06-17 10:45:00 -0400 | [diff] [blame] | 1426 | |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1427 | /** |
| 1428 | * Window flag: allow window contents to extend in to the screen's |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1429 | * overscan area, if there is one. The window should still correctly |
| 1430 | * position its contents to take the overscan area into account. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1431 | * |
| 1432 | * <p>This flag can be controlled in your theme through the |
| 1433 | * {@link android.R.attr#windowOverscan} attribute; this attribute |
| 1434 | * is automatically set for you in the standard overscan themes |
Ying Wang | 4e0eb22 | 2013-04-18 20:39:48 -0700 | [diff] [blame] | 1435 | * such as |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1436 | * {@link android.R.style#Theme_Holo_NoActionBar_Overscan}, |
| 1437 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan}, |
| 1438 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and |
| 1439 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p> |
| 1440 | * |
| 1441 | * <p>When this flag is enabled for a window, its normal content may be obscured |
| 1442 | * to some degree by the overscan region of the display. To ensure key parts of |
| 1443 | * that content are visible to the user, you can use |
| 1444 | * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)} |
| 1445 | * to set the point in the view hierarchy where the appropriate offsets should |
| 1446 | * be applied. (This can be done either by directly calling this function, using |
| 1447 | * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy, |
| 1448 | * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect) |
| 1449 | * View.fitSystemWindows(Rect)} method).</p> |
| 1450 | * |
| 1451 | * <p>This mechanism for positioning content elements is identical to its equivalent |
| 1452 | * use with layout and {@link View#setSystemUiVisibility(int) |
| 1453 | * View.setSystemUiVisibility(int)}; here is an example layout that will correctly |
| 1454 | * position its UI elements with this overscan flag is set:</p> |
| 1455 | * |
| 1456 | * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete} |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 1457 | */ |
| 1458 | public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000; |
| 1459 | |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1460 | /** |
| 1461 | * Window flag: request a translucent status bar with minimal system-provided |
| 1462 | * background protection. |
| 1463 | * |
| 1464 | * <p>This flag can be controlled in your theme through the |
| 1465 | * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute |
| 1466 | * is automatically set for you in the standard translucent decor themes |
| 1467 | * such as |
| 1468 | * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor}, |
| 1469 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor}, |
| 1470 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and |
| 1471 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p> |
| 1472 | * |
| 1473 | * <p>When this flag is enabled for a window, it automatically sets |
| 1474 | * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and |
| 1475 | * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p> |
| 1476 | */ |
| 1477 | public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000; |
| 1478 | |
| 1479 | /** |
| 1480 | * Window flag: request a translucent navigation bar with minimal system-provided |
| 1481 | * background protection. |
| 1482 | * |
| 1483 | * <p>This flag can be controlled in your theme through the |
| 1484 | * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute |
| 1485 | * is automatically set for you in the standard translucent decor themes |
| 1486 | * such as |
| 1487 | * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor}, |
| 1488 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor}, |
| 1489 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and |
| 1490 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p> |
| 1491 | * |
| 1492 | * <p>When this flag is enabled for a window, it automatically sets |
| 1493 | * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and |
| 1494 | * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p> |
| 1495 | */ |
| 1496 | public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000; |
| 1497 | |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 1498 | /** |
| 1499 | * Flag for a window in local focus mode. |
| 1500 | * Window in local focus mode can control focus independent of window manager using |
| 1501 | * {@link Window#setLocalFocus(boolean, boolean)}. |
| 1502 | * Usually window in this mode will not get touch/key events from window manager, but will |
| 1503 | * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}. |
| 1504 | */ |
| 1505 | public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000; |
| 1506 | |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 1507 | /** Window flag: Enable touches to slide out of a window into neighboring |
| 1508 | * windows in mid-gesture instead of being captured for the duration of |
| 1509 | * the gesture. |
| 1510 | * |
| 1511 | * This flag changes the behavior of touch focus for this window only. |
| 1512 | * Touches can slide out of the window but they cannot necessarily slide |
| 1513 | * back in (unless the other window with touch focus permits it). |
| 1514 | * |
| 1515 | * {@hide} |
| 1516 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 1517 | @UnsupportedAppUsage |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 1518 | public static final int FLAG_SLIPPERY = 0x20000000; |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 1519 | |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 1520 | /** |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1521 | * Window flag: When requesting layout with an attached window, the attached window may |
| 1522 | * overlap with the screen decorations of the parent window such as the navigation bar. By |
| 1523 | * including this flag, the window manager will layout the attached window within the decor |
| 1524 | * frame of the parent window such that it doesn't overlap with screen decorations. |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 1525 | */ |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1526 | public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000; |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 1527 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1528 | /** |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 1529 | * Flag indicating that this Window is responsible for drawing the background for the |
| 1530 | * system bars. If set, the system bars are drawn with a transparent background and the |
| 1531 | * corresponding areas in this window are filled with the colors specified in |
| 1532 | * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}. |
| 1533 | */ |
| 1534 | public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000; |
| 1535 | |
| 1536 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1537 | * Various behavioral options/flags. Default is none. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1538 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1539 | * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON |
| 1540 | * @see #FLAG_DIM_BEHIND |
| 1541 | * @see #FLAG_NOT_FOCUSABLE |
| 1542 | * @see #FLAG_NOT_TOUCHABLE |
| 1543 | * @see #FLAG_NOT_TOUCH_MODAL |
| 1544 | * @see #FLAG_TOUCHABLE_WHEN_WAKING |
| 1545 | * @see #FLAG_KEEP_SCREEN_ON |
| 1546 | * @see #FLAG_LAYOUT_IN_SCREEN |
| 1547 | * @see #FLAG_LAYOUT_NO_LIMITS |
| 1548 | * @see #FLAG_FULLSCREEN |
| 1549 | * @see #FLAG_FORCE_NOT_FULLSCREEN |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1550 | * @see #FLAG_SECURE |
| 1551 | * @see #FLAG_SCALED |
| 1552 | * @see #FLAG_IGNORE_CHEEK_PRESSES |
| 1553 | * @see #FLAG_LAYOUT_INSET_DECOR |
| 1554 | * @see #FLAG_ALT_FOCUSABLE_IM |
| 1555 | * @see #FLAG_WATCH_OUTSIDE_TOUCH |
| 1556 | * @see #FLAG_SHOW_WHEN_LOCKED |
| 1557 | * @see #FLAG_SHOW_WALLPAPER |
| 1558 | * @see #FLAG_TURN_SCREEN_ON |
| 1559 | * @see #FLAG_DISMISS_KEYGUARD |
| 1560 | * @see #FLAG_SPLIT_TOUCH |
| 1561 | * @see #FLAG_HARDWARE_ACCELERATED |
keunyoung | 30f420f | 2013-08-02 14:23:10 -0700 | [diff] [blame] | 1562 | * @see #FLAG_LOCAL_FOCUS_MODE |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 1563 | * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1564 | */ |
| 1565 | @ViewDebug.ExportedProperty(flagMapping = { |
| 1566 | @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1567 | name = "ALLOW_LOCK_WHILE_SCREEN_ON"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1568 | @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1569 | name = "DIM_BEHIND"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1570 | @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1571 | name = "BLUR_BEHIND"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1572 | @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1573 | name = "NOT_FOCUSABLE"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1574 | @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1575 | name = "NOT_TOUCHABLE"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1576 | @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1577 | name = "NOT_TOUCH_MODAL"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1578 | @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1579 | name = "TOUCHABLE_WHEN_WAKING"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1580 | @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1581 | name = "KEEP_SCREEN_ON"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1582 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1583 | name = "LAYOUT_IN_SCREEN"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1584 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1585 | name = "LAYOUT_NO_LIMITS"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1586 | @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1587 | name = "FULLSCREEN"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1588 | @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1589 | name = "FORCE_NOT_FULLSCREEN"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1590 | @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1591 | name = "DITHER"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1592 | @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1593 | name = "SECURE"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1594 | @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1595 | name = "SCALED"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1596 | @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1597 | name = "IGNORE_CHEEK_PRESSES"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1598 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1599 | name = "LAYOUT_INSET_DECOR"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1600 | @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1601 | name = "ALT_FOCUSABLE_IM"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1602 | @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1603 | name = "WATCH_OUTSIDE_TOUCH"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1604 | @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1605 | name = "SHOW_WHEN_LOCKED"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1606 | @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1607 | name = "SHOW_WALLPAPER"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1608 | @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1609 | name = "TURN_SCREEN_ON"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1610 | @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1611 | name = "DISMISS_KEYGUARD"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1612 | @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1613 | name = "SPLIT_TOUCH"), |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1614 | @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1615 | name = "HARDWARE_ACCELERATED"), |
| 1616 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_OVERSCAN, equals = FLAG_LAYOUT_IN_OVERSCAN, |
| 1617 | name = "LOCAL_FOCUS_MODE"), |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1618 | @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1619 | name = "TRANSLUCENT_STATUS"), |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1620 | @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1621 | name = "TRANSLUCENT_NAVIGATION"), |
| 1622 | @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE, |
| 1623 | name = "LOCAL_FOCUS_MODE"), |
| 1624 | @ViewDebug.FlagToString(mask = FLAG_SLIPPERY, equals = FLAG_SLIPPERY, |
| 1625 | name = "FLAG_SLIPPERY"), |
| 1626 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_ATTACHED_IN_DECOR, equals = FLAG_LAYOUT_ATTACHED_IN_DECOR, |
| 1627 | name = "FLAG_LAYOUT_ATTACHED_IN_DECOR"), |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 1628 | @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1629 | name = "DRAWS_SYSTEM_BAR_BACKGROUNDS") |
Jon Miranda | 4597e98 | 2014-07-29 07:25:49 -0700 | [diff] [blame] | 1630 | }, formatToHexString = true) |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1631 | public int flags; |
| 1632 | |
| 1633 | /** |
John Reck | 61375a8 | 2014-09-18 19:27:48 +0000 | [diff] [blame] | 1634 | * If the window has requested hardware acceleration, but this is not |
| 1635 | * allowed in the process it is in, then still render it as if it is |
| 1636 | * hardware accelerated. This is used for the starting preview windows |
| 1637 | * in the system process, which don't need to have the overhead of |
| 1638 | * hardware acceleration (they are just a static rendering), but should |
| 1639 | * be rendered as such to match the actual window of the app even if it |
| 1640 | * is hardware accelerated. |
| 1641 | * Even if the window isn't hardware accelerated, still do its rendering |
| 1642 | * as if it was. |
| 1643 | * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows |
| 1644 | * that need hardware acceleration (e.g. LockScreen), where hardware acceleration |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1645 | * is generally disabled. This flag must be specified in addition to |
John Reck | 61375a8 | 2014-09-18 19:27:48 +0000 | [diff] [blame] | 1646 | * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system |
| 1647 | * windows. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1648 | * |
John Reck | 61375a8 | 2014-09-18 19:27:48 +0000 | [diff] [blame] | 1649 | * @hide |
| 1650 | */ |
| 1651 | public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001; |
| 1652 | |
| 1653 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1654 | * In the system process, we globally do not use hardware acceleration |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1655 | * because there are many threads doing UI there and they conflict. |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1656 | * If certain parts of the UI that really do want to use hardware |
| 1657 | * acceleration, this flag can be set to force it. This is basically |
| 1658 | * for the lock screen. Anyone else using it, you are probably wrong. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 1659 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1660 | * @hide |
| 1661 | */ |
| 1662 | public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002; |
| 1663 | |
| 1664 | /** |
Chet Haase | a8e5a2b | 2011-10-28 13:18:16 -0700 | [diff] [blame] | 1665 | * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1666 | * may elect to skip these notifications if they are not doing anything productive with |
Chet Haase | a8e5a2b | 2011-10-28 13:18:16 -0700 | [diff] [blame] | 1667 | * them (they do not affect the wallpaper scrolling operation) by calling |
| 1668 | * {@link |
| 1669 | * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}. |
| 1670 | * |
| 1671 | * @hide |
| 1672 | */ |
| 1673 | public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004; |
| 1674 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1675 | /** In a multiuser system if this flag is set and the owner is a system process then this |
| 1676 | * window will appear on all user screens. This overrides the default behavior of window |
| 1677 | * types that normally only appear on the owning user's screen. Refer to each window type |
| 1678 | * to determine its default behavior. |
| 1679 | * |
| 1680 | * {@hide} */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 1681 | @UnsupportedAppUsage |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1682 | public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010; |
| 1683 | |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 1684 | /** |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1685 | * Never animate position changes of the window. |
| 1686 | * |
Robert Carr | b48380a | 2017-04-04 14:56:37 -0700 | [diff] [blame] | 1687 | * {@hide} |
| 1688 | */ |
Artur Satayev | 5a52585 | 2019-10-31 15:15:50 +0000 | [diff] [blame^] | 1689 | @UnsupportedAppUsage |
Robert Carr | b48380a | 2017-04-04 14:56:37 -0700 | [diff] [blame] | 1690 | @TestApi |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1691 | public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040; |
| 1692 | |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 1693 | /** Window flag: special flag to limit the size of the window to be |
| 1694 | * original size ([320x480] x density). Used to create window for applications |
| 1695 | * running under compatibility mode. |
| 1696 | * |
| 1697 | * {@hide} */ |
| 1698 | public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080; |
| 1699 | |
| 1700 | /** Window flag: a special option intended for system dialogs. When |
| 1701 | * this flag is set, the window will demand focus unconditionally when |
| 1702 | * it is created. |
| 1703 | * {@hide} */ |
| 1704 | public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100; |
| 1705 | |
John Spurlock | 3f7cd51 | 2013-10-07 12:25:09 -0400 | [diff] [blame] | 1706 | /** Window flag: maintain the previous translucent decor state when this window |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1707 | * becomes top-most. |
| 1708 | * {@hide} */ |
| 1709 | public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200; |
| 1710 | |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1711 | /** |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 1712 | * Flag whether the current window is a keyguard window, meaning that it will hide all other |
| 1713 | * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set. |
| 1714 | * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}. |
| 1715 | * {@hide} |
| 1716 | */ |
| 1717 | public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400; |
| 1718 | |
| 1719 | /** |
Filip Gruszczynski | b8c0694 | 2014-12-04 15:02:18 -0800 | [diff] [blame] | 1720 | * Flag that prevents the wallpaper behind the current window from receiving touch events. |
| 1721 | * |
| 1722 | * {@hide} |
| 1723 | */ |
| 1724 | public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800; |
| 1725 | |
| 1726 | /** |
Selim Cinek | 4a4a2bddc | 2015-05-07 12:50:19 -0700 | [diff] [blame] | 1727 | * Flag to force the status bar window to be visible all the time. If the bar is hidden when |
| 1728 | * this flag is set it will be shown again and the bar will have a transparent background. |
| 1729 | * This can only be set by {@link LayoutParams#TYPE_STATUS_BAR}. |
| 1730 | * |
| 1731 | * {@hide} |
| 1732 | */ |
| 1733 | public static final int PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT = 0x00001000; |
| 1734 | |
| 1735 | /** |
Robert Carr | 64aadd0 | 2015-11-06 13:54:20 -0800 | [diff] [blame] | 1736 | * Flag indicating that the x, y, width, and height members should be |
Filip Gruszczynski | 1a4dfe5 | 2015-11-15 10:58:57 -0800 | [diff] [blame] | 1737 | * ignored (and thus their previous value preserved). For example |
Robert Carr | 64aadd0 | 2015-11-06 13:54:20 -0800 | [diff] [blame] | 1738 | * because they are being managed externally through repositionChild. |
| 1739 | * |
| 1740 | * {@hide} |
| 1741 | */ |
| 1742 | public static final int PRIVATE_FLAG_PRESERVE_GEOMETRY = 0x00002000; |
| 1743 | |
Filip Gruszczynski | 1a4dfe5 | 2015-11-15 10:58:57 -0800 | [diff] [blame] | 1744 | /** |
| 1745 | * Flag that will make window ignore app visibility and instead depend purely on the decor |
| 1746 | * view visibility for determining window visibility. This is used by recents to keep |
| 1747 | * drawing after it launches an app. |
| 1748 | * @hide |
| 1749 | */ |
| 1750 | public static final int PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY = 0x00004000; |
| 1751 | |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 1752 | /** |
| 1753 | * Flag to indicate that this window is not expected to be replaced across |
| 1754 | * configuration change triggered activity relaunches. In general the WindowManager |
| 1755 | * expects Windows to be replaced after relaunch, and thus it will preserve their surfaces |
| 1756 | * until the replacement is ready to show in order to prevent visual glitch. However |
| 1757 | * some windows, such as PopupWindows expect to be cleared across configuration change, |
| 1758 | * and thus should hint to the WindowManager that it should not wait for a replacement. |
| 1759 | * @hide |
| 1760 | */ |
| 1761 | public static final int PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH = 0x00008000; |
Robert Carr | 64aadd0 | 2015-11-06 13:54:20 -0800 | [diff] [blame] | 1762 | |
| 1763 | /** |
Wale Ogunwale | 8216eb2 | 2015-12-18 10:42:42 -0800 | [diff] [blame] | 1764 | * Flag to indicate that this child window should always be laid-out in the parent |
| 1765 | * frame regardless of the current windowing mode configuration. |
| 1766 | * @hide |
| 1767 | */ |
| 1768 | public static final int PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME = 0x00010000; |
| 1769 | |
| 1770 | /** |
Jorim Jaggi | 8f5701b | 2016-04-04 18:36:02 -0700 | [diff] [blame] | 1771 | * Flag to indicate that this window is always drawing the status bar background, no matter |
| 1772 | * what the other flags are. |
| 1773 | * @hide |
| 1774 | */ |
Jorim Jaggi | a6aabac | 2019-03-11 14:23:16 -0700 | [diff] [blame] | 1775 | public static final int PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS = 0x00020000; |
Jorim Jaggi | 8f5701b | 2016-04-04 18:36:02 -0700 | [diff] [blame] | 1776 | |
| 1777 | /** |
Ruchi Kandoi | 43e38de | 2016-04-14 19:34:53 -0700 | [diff] [blame] | 1778 | * Flag to indicate that this window needs Sustained Performance Mode if |
| 1779 | * the device supports it. |
| 1780 | * @hide |
| 1781 | */ |
John Reck | 60e885f | 2016-04-21 15:40:45 -0700 | [diff] [blame] | 1782 | public static final int PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE = 0x00040000; |
Ruchi Kandoi | 43e38de | 2016-04-14 19:34:53 -0700 | [diff] [blame] | 1783 | |
| 1784 | /** |
Wale Ogunwale | 01ad434 | 2017-06-30 07:07:01 -0700 | [diff] [blame] | 1785 | * Flag to indicate that any window added by an application process that is of type |
| 1786 | * {@link #TYPE_TOAST} or that requires |
| 1787 | * {@link android.app.AppOpsManager#OP_SYSTEM_ALERT_WINDOW} permission should be hidden when |
| 1788 | * this window is visible. |
Jorim Jaggi | 02886a8 | 2016-12-06 09:10:06 -0800 | [diff] [blame] | 1789 | * @hide |
| 1790 | */ |
Philip P. Moltmann | d66dd99 | 2018-09-17 11:26:04 -0700 | [diff] [blame] | 1791 | @SystemApi |
Wale Ogunwale | c0b0f93 | 2017-11-01 12:51:43 -0700 | [diff] [blame] | 1792 | @RequiresPermission(permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS) |
Philip P. Moltmann | 66ce238 | 2018-10-09 13:46:11 -0700 | [diff] [blame] | 1793 | public static final int SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 0x00080000; |
Jorim Jaggi | 02886a8 | 2016-12-06 09:10:06 -0800 | [diff] [blame] | 1794 | |
| 1795 | /** |
Robert Carr | 132c9f5 | 2017-07-31 17:02:30 -0700 | [diff] [blame] | 1796 | * Indicates that this window is the rounded corners overlay present on some |
| 1797 | * devices this means that it will be excluded from: screenshots, |
| 1798 | * screen magnification, and mirroring. |
Phil Weaver | d321075e | 2017-06-13 09:13:35 -0700 | [diff] [blame] | 1799 | * @hide |
| 1800 | */ |
Robert Carr | 132c9f5 | 2017-07-31 17:02:30 -0700 | [diff] [blame] | 1801 | public static final int PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY = 0x00100000; |
Phil Weaver | d321075e | 2017-06-13 09:13:35 -0700 | [diff] [blame] | 1802 | |
| 1803 | /** |
Wale Ogunwale | c0b0f93 | 2017-11-01 12:51:43 -0700 | [diff] [blame] | 1804 | * Flag to indicate that this window should be considered a screen decoration similar to the |
| 1805 | * nav bar and status bar. This will cause this window to affect the window insets reported |
| 1806 | * to other windows when it is visible. |
| 1807 | * @hide |
| 1808 | */ |
| 1809 | @RequiresPermission(permission.STATUS_BAR_SERVICE) |
| 1810 | public static final int PRIVATE_FLAG_IS_SCREEN_DECOR = 0x00400000; |
| 1811 | |
| 1812 | /** |
Tiger Huang | a90dea4 | 2018-08-03 17:20:17 +0800 | [diff] [blame] | 1813 | * Flag to indicate that the status bar window is in a state such that it forces showing |
| 1814 | * the navigation bar unless the navigation bar window is explicitly set to |
| 1815 | * {@link View#GONE}. |
| 1816 | * It only takes effects if this is set by {@link LayoutParams#TYPE_STATUS_BAR}. |
Tiger Huang | 3404601 | 2018-06-29 15:26:52 +0800 | [diff] [blame] | 1817 | * @hide |
| 1818 | */ |
Tiger Huang | a90dea4 | 2018-08-03 17:20:17 +0800 | [diff] [blame] | 1819 | public static final int PRIVATE_FLAG_STATUS_FORCE_SHOW_NAVIGATION = 0x00800000; |
Tiger Huang | 3404601 | 2018-06-29 15:26:52 +0800 | [diff] [blame] | 1820 | |
| 1821 | /** |
Peiyong Lin | 7504538 | 2019-03-04 19:22:33 -0800 | [diff] [blame] | 1822 | * Flag to indicate that the window is color space agnostic, and the color can be |
| 1823 | * interpreted to any color space. |
| 1824 | * @hide |
| 1825 | */ |
| 1826 | public static final int PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC = 0x01000000; |
| 1827 | |
| 1828 | /** |
Philip P. Moltmann | 66ce238 | 2018-10-09 13:46:11 -0700 | [diff] [blame] | 1829 | * An internal annotation for flags that can be specified to {@link #softInputMode}. |
| 1830 | * |
| 1831 | * @hide |
| 1832 | */ |
| 1833 | @SystemApi |
| 1834 | @Retention(RetentionPolicy.SOURCE) |
| 1835 | @IntDef(flag = true, prefix = { "SYSTEM_FLAG_" }, value = { |
| 1836 | SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, |
| 1837 | }) |
| 1838 | public @interface SystemFlags {} |
| 1839 | |
| 1840 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1841 | * Control flags that are private to the platform. |
| 1842 | * @hide |
| 1843 | */ |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1844 | @ViewDebug.ExportedProperty(flagMapping = { |
| 1845 | @ViewDebug.FlagToString( |
| 1846 | mask = PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED, |
| 1847 | equals = PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED, |
| 1848 | name = "FAKE_HARDWARE_ACCELERATED"), |
| 1849 | @ViewDebug.FlagToString( |
| 1850 | mask = PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED, |
| 1851 | equals = PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED, |
| 1852 | name = "FORCE_HARDWARE_ACCELERATED"), |
| 1853 | @ViewDebug.FlagToString( |
| 1854 | mask = PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS, |
| 1855 | equals = PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS, |
| 1856 | name = "WANTS_OFFSET_NOTIFICATIONS"), |
| 1857 | @ViewDebug.FlagToString( |
| 1858 | mask = PRIVATE_FLAG_SHOW_FOR_ALL_USERS, |
| 1859 | equals = PRIVATE_FLAG_SHOW_FOR_ALL_USERS, |
| 1860 | name = "SHOW_FOR_ALL_USERS"), |
| 1861 | @ViewDebug.FlagToString( |
| 1862 | mask = PRIVATE_FLAG_NO_MOVE_ANIMATION, |
| 1863 | equals = PRIVATE_FLAG_NO_MOVE_ANIMATION, |
| 1864 | name = "NO_MOVE_ANIMATION"), |
| 1865 | @ViewDebug.FlagToString( |
| 1866 | mask = PRIVATE_FLAG_COMPATIBLE_WINDOW, |
| 1867 | equals = PRIVATE_FLAG_COMPATIBLE_WINDOW, |
| 1868 | name = "COMPATIBLE_WINDOW"), |
| 1869 | @ViewDebug.FlagToString( |
| 1870 | mask = PRIVATE_FLAG_SYSTEM_ERROR, |
| 1871 | equals = PRIVATE_FLAG_SYSTEM_ERROR, |
| 1872 | name = "SYSTEM_ERROR"), |
| 1873 | @ViewDebug.FlagToString( |
| 1874 | mask = PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR, |
| 1875 | equals = PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR, |
| 1876 | name = "INHERIT_TRANSLUCENT_DECOR"), |
| 1877 | @ViewDebug.FlagToString( |
| 1878 | mask = PRIVATE_FLAG_KEYGUARD, |
| 1879 | equals = PRIVATE_FLAG_KEYGUARD, |
| 1880 | name = "KEYGUARD"), |
| 1881 | @ViewDebug.FlagToString( |
| 1882 | mask = PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS, |
| 1883 | equals = PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS, |
| 1884 | name = "DISABLE_WALLPAPER_TOUCH_EVENTS"), |
| 1885 | @ViewDebug.FlagToString( |
| 1886 | mask = PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT, |
| 1887 | equals = PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT, |
| 1888 | name = "FORCE_STATUS_BAR_VISIBLE_TRANSPARENT"), |
| 1889 | @ViewDebug.FlagToString( |
| 1890 | mask = PRIVATE_FLAG_PRESERVE_GEOMETRY, |
| 1891 | equals = PRIVATE_FLAG_PRESERVE_GEOMETRY, |
| 1892 | name = "PRESERVE_GEOMETRY"), |
| 1893 | @ViewDebug.FlagToString( |
| 1894 | mask = PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY, |
| 1895 | equals = PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY, |
| 1896 | name = "FORCE_DECOR_VIEW_VISIBILITY"), |
| 1897 | @ViewDebug.FlagToString( |
| 1898 | mask = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH, |
| 1899 | equals = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH, |
| 1900 | name = "WILL_NOT_REPLACE_ON_RELAUNCH"), |
| 1901 | @ViewDebug.FlagToString( |
| 1902 | mask = PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME, |
| 1903 | equals = PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME, |
| 1904 | name = "LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME"), |
| 1905 | @ViewDebug.FlagToString( |
Jorim Jaggi | a6aabac | 2019-03-11 14:23:16 -0700 | [diff] [blame] | 1906 | mask = PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS, |
| 1907 | equals = PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1908 | name = "FORCE_DRAW_STATUS_BAR_BACKGROUND"), |
| 1909 | @ViewDebug.FlagToString( |
| 1910 | mask = PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE, |
| 1911 | equals = PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE, |
| 1912 | name = "SUSTAINED_PERFORMANCE_MODE"), |
| 1913 | @ViewDebug.FlagToString( |
Philip P. Moltmann | 66ce238 | 2018-10-09 13:46:11 -0700 | [diff] [blame] | 1914 | mask = SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, |
| 1915 | equals = SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1916 | name = "HIDE_NON_SYSTEM_OVERLAY_WINDOWS"), |
| 1917 | @ViewDebug.FlagToString( |
| 1918 | mask = PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY, |
| 1919 | equals = PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY, |
| 1920 | name = "IS_ROUNDED_CORNERS_OVERLAY"), |
| 1921 | @ViewDebug.FlagToString( |
Wale Ogunwale | c0b0f93 | 2017-11-01 12:51:43 -0700 | [diff] [blame] | 1922 | mask = PRIVATE_FLAG_IS_SCREEN_DECOR, |
| 1923 | equals = PRIVATE_FLAG_IS_SCREEN_DECOR, |
Tiger Huang | 3404601 | 2018-06-29 15:26:52 +0800 | [diff] [blame] | 1924 | name = "IS_SCREEN_DECOR"), |
| 1925 | @ViewDebug.FlagToString( |
Tiger Huang | a90dea4 | 2018-08-03 17:20:17 +0800 | [diff] [blame] | 1926 | mask = PRIVATE_FLAG_STATUS_FORCE_SHOW_NAVIGATION, |
| 1927 | equals = PRIVATE_FLAG_STATUS_FORCE_SHOW_NAVIGATION, |
Peiyong Lin | 7504538 | 2019-03-04 19:22:33 -0800 | [diff] [blame] | 1928 | name = "STATUS_FORCE_SHOW_NAVIGATION"), |
| 1929 | @ViewDebug.FlagToString( |
| 1930 | mask = PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC, |
| 1931 | equals = PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC, |
| 1932 | name = "COLOR_SPACE_AGNOSTIC") |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 1933 | }) |
Artur Satayev | 5a52585 | 2019-10-31 15:15:50 +0000 | [diff] [blame^] | 1934 | @UnsupportedAppUsage |
Robert Carr | b48380a | 2017-04-04 14:56:37 -0700 | [diff] [blame] | 1935 | @TestApi |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1936 | public int privateFlags; |
| 1937 | |
| 1938 | /** |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1939 | * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it |
| 1940 | * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu |
| 1941 | * key. For this case, we should look at windows behind it to determine the appropriate |
| 1942 | * value. |
| 1943 | * |
| 1944 | * @hide |
| 1945 | */ |
| 1946 | public static final int NEEDS_MENU_UNSET = 0; |
| 1947 | |
| 1948 | /** |
| 1949 | * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a |
| 1950 | * menu key. |
| 1951 | * |
| 1952 | * @hide |
| 1953 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 1954 | @UnsupportedAppUsage |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1955 | public static final int NEEDS_MENU_SET_TRUE = 1; |
| 1956 | |
| 1957 | /** |
| 1958 | * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't |
| 1959 | * needs a menu key. |
| 1960 | * |
| 1961 | * @hide |
| 1962 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 1963 | @UnsupportedAppUsage |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1964 | public static final int NEEDS_MENU_SET_FALSE = 2; |
| 1965 | |
| 1966 | /** |
| 1967 | * State variable for a window belonging to an activity that responds to |
| 1968 | * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a |
| 1969 | * physical button this variable is ignored, but on devices where the Menu key is drawn in |
| 1970 | * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}. |
| 1971 | * |
| 1972 | * (Note that Action Bars, when available, are the preferred way to offer additional |
| 1973 | * functions otherwise accessed via an options menu.) |
| 1974 | * |
| 1975 | * {@hide} |
| 1976 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 1977 | @UnsupportedAppUsage |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1978 | public int needsMenuKey = NEEDS_MENU_UNSET; |
| 1979 | |
| 1980 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1981 | * Given a particular set of window manager flags, determine whether |
| 1982 | * such a window may be a target for an input method when it has |
| 1983 | * focus. In particular, this checks the |
| 1984 | * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM} |
| 1985 | * flags and returns true if the combination of the two corresponds |
| 1986 | * to a window that needs to be behind the input method so that the |
| 1987 | * user can type into it. |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1988 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1989 | * @param flags The current window manager flags. |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1990 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1991 | * @return Returns true if such a window should be behind/interact |
| 1992 | * with an input method, false if not. |
| 1993 | */ |
| 1994 | public static boolean mayUseInputMethod(int flags) { |
| 1995 | switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) { |
| 1996 | case 0: |
| 1997 | case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM: |
| 1998 | return true; |
| 1999 | } |
| 2000 | return false; |
| 2001 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2002 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2003 | /** |
| 2004 | * Mask for {@link #softInputMode} of the bits that determine the |
| 2005 | * desired visibility state of the soft input area for this window. |
| 2006 | */ |
| 2007 | public static final int SOFT_INPUT_MASK_STATE = 0x0f; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2008 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2009 | /** |
Yohei Yukawa | a754785 | 2018-03-27 15:47:45 -0700 | [diff] [blame] | 2010 | * Visibility state for {@link #softInputMode}: no state has been specified. The system may |
| 2011 | * show or hide the software keyboard for better user experience when the window gains |
| 2012 | * focus. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2013 | */ |
| 2014 | public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2015 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2016 | /** |
| 2017 | * Visibility state for {@link #softInputMode}: please don't change the state of |
| 2018 | * the soft input area. |
| 2019 | */ |
| 2020 | public static final int SOFT_INPUT_STATE_UNCHANGED = 1; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2021 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2022 | /** |
| 2023 | * Visibility state for {@link #softInputMode}: please hide any soft input |
| 2024 | * area when normally appropriate (when the user is navigating |
| 2025 | * forward to your window). |
| 2026 | */ |
| 2027 | public static final int SOFT_INPUT_STATE_HIDDEN = 2; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2028 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2029 | /** |
| 2030 | * Visibility state for {@link #softInputMode}: please always hide any |
| 2031 | * soft input area when this window receives focus. |
| 2032 | */ |
| 2033 | public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2034 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2035 | /** |
| 2036 | * Visibility state for {@link #softInputMode}: please show the soft |
| 2037 | * input area when normally appropriate (when the user is navigating |
| 2038 | * forward to your window). |
Yohei Yukawa | cf68d52 | 2017-12-12 09:33:26 -0800 | [diff] [blame] | 2039 | * |
| 2040 | * <p>Applications that target {@link android.os.Build.VERSION_CODES#P} and later, this flag |
| 2041 | * is ignored unless there is a focused view that returns {@code true} from |
| 2042 | * {@link View#isInEditMode()} when the window is focused.</p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2043 | */ |
| 2044 | public static final int SOFT_INPUT_STATE_VISIBLE = 4; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2045 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2046 | /** |
| 2047 | * Visibility state for {@link #softInputMode}: please always make the |
| 2048 | * soft input area visible when this window receives input focus. |
Yohei Yukawa | cf68d52 | 2017-12-12 09:33:26 -0800 | [diff] [blame] | 2049 | * |
| 2050 | * <p>Applications that target {@link android.os.Build.VERSION_CODES#P} and later, this flag |
| 2051 | * is ignored unless there is a focused view that returns {@code true} from |
| 2052 | * {@link View#isInEditMode()} when the window is focused.</p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2053 | */ |
| 2054 | public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2055 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2056 | /** |
| 2057 | * Mask for {@link #softInputMode} of the bits that determine the |
| 2058 | * way that the window should be adjusted to accommodate the soft |
| 2059 | * input window. |
| 2060 | */ |
| 2061 | public static final int SOFT_INPUT_MASK_ADJUST = 0xf0; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2062 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2063 | /** Adjustment option for {@link #softInputMode}: nothing specified. |
| 2064 | * The system will try to pick one or |
| 2065 | * the other depending on the contents of the window. |
| 2066 | */ |
| 2067 | public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2068 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2069 | /** Adjustment option for {@link #softInputMode}: set to allow the |
| 2070 | * window to be resized when an input |
| 2071 | * method is shown, so that its contents are not covered by the input |
Scott Main | f10e633 | 2010-06-11 09:03:22 -0700 | [diff] [blame] | 2072 | * method. This can <em>not</em> be combined with |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2073 | * {@link #SOFT_INPUT_ADJUST_PAN}; if |
| 2074 | * neither of these are set, then the system will try to pick one or |
Chet Haase | 45c89c2 | 2013-04-29 16:04:40 -0700 | [diff] [blame] | 2075 | * the other depending on the contents of the window. If the window's |
| 2076 | * layout parameter flags include {@link #FLAG_FULLSCREEN}, this |
| 2077 | * value for {@link #softInputMode} will be ignored; the window will |
| 2078 | * not resize, but will stay fullscreen. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2079 | */ |
| 2080 | public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2081 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2082 | /** Adjustment option for {@link #softInputMode}: set to have a window |
| 2083 | * pan when an input method is |
| 2084 | * shown, so it doesn't need to deal with resizing but just panned |
| 2085 | * by the framework to ensure the current input focus is visible. This |
Scott Main | f10e633 | 2010-06-11 09:03:22 -0700 | [diff] [blame] | 2086 | * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2087 | * neither of these are set, then the system will try to pick one or |
| 2088 | * the other depending on the contents of the window. |
| 2089 | */ |
| 2090 | public static final int SOFT_INPUT_ADJUST_PAN = 0x20; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2091 | |
Dianne Hackborn | dea3ef7 | 2010-10-28 14:24:22 -0700 | [diff] [blame] | 2092 | /** Adjustment option for {@link #softInputMode}: set to have a window |
| 2093 | * not adjust for a shown input method. The window will not be resized, |
| 2094 | * and it will not be panned to make its focus visible. |
| 2095 | */ |
| 2096 | public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30; |
| 2097 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2098 | /** |
| 2099 | * Bit for {@link #softInputMode}: set when the user has navigated |
| 2100 | * forward to the window. This is normally set automatically for |
| 2101 | * you by the system, though you may want to set it in certain cases |
| 2102 | * when you are displaying a window yourself. This flag will always |
| 2103 | * be cleared automatically after the window is displayed. |
| 2104 | */ |
| 2105 | public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100; |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2106 | |
| 2107 | /** |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 2108 | * An internal annotation for flags that can be specified to {@link #softInputMode}. |
| 2109 | * |
| 2110 | * @hide |
| 2111 | */ |
| 2112 | @Retention(RetentionPolicy.SOURCE) |
Jeff Sharkey | ce8db99 | 2017-12-13 20:05:05 -0700 | [diff] [blame] | 2113 | @IntDef(flag = true, prefix = { "SOFT_INPUT_" }, value = { |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 2114 | SOFT_INPUT_STATE_UNSPECIFIED, |
| 2115 | SOFT_INPUT_STATE_UNCHANGED, |
| 2116 | SOFT_INPUT_STATE_HIDDEN, |
| 2117 | SOFT_INPUT_STATE_ALWAYS_HIDDEN, |
| 2118 | SOFT_INPUT_STATE_VISIBLE, |
| 2119 | SOFT_INPUT_STATE_ALWAYS_VISIBLE, |
| 2120 | SOFT_INPUT_ADJUST_UNSPECIFIED, |
| 2121 | SOFT_INPUT_ADJUST_RESIZE, |
| 2122 | SOFT_INPUT_ADJUST_PAN, |
| 2123 | SOFT_INPUT_ADJUST_NOTHING, |
| 2124 | SOFT_INPUT_IS_FORWARD_NAVIGATION, |
| 2125 | }) |
| 2126 | public @interface SoftInputModeFlags {} |
| 2127 | |
| 2128 | /** |
Gilles Debunne | be2c4f9 | 2011-01-17 15:14:32 -0800 | [diff] [blame] | 2129 | * Desired operating mode for any soft input area. May be any combination |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2130 | * of: |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2131 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2132 | * <ul> |
| 2133 | * <li> One of the visibility states |
| 2134 | * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED}, |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 2135 | * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_HIDDEN}, |
| 2136 | * {@link #SOFT_INPUT_STATE_VISIBLE}, or {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2137 | * <li> One of the adjustment options |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 2138 | * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED}, {@link #SOFT_INPUT_ADJUST_RESIZE}, |
| 2139 | * {@link #SOFT_INPUT_ADJUST_PAN}, or {@link #SOFT_INPUT_ADJUST_NOTHING}. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 2140 | * </ul> |
| 2141 | * |
| 2142 | * |
| 2143 | * <p>This flag can be controlled in your theme through the |
| 2144 | * {@link android.R.attr#windowSoftInputMode} attribute.</p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2145 | */ |
Yohei Yukawa | 22dac1c | 2017-02-12 16:54:16 -0800 | [diff] [blame] | 2146 | @SoftInputModeFlags |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2147 | public int softInputMode; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2148 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2149 | /** |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 2150 | * Placement of window within the screen as per {@link Gravity}. Both |
| 2151 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 2152 | * android.graphics.Rect) Gravity.apply} and |
| 2153 | * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) |
| 2154 | * Gravity.applyDisplay} are used during window layout, with this value |
| 2155 | * given as the desired gravity. For example you can specify |
| 2156 | * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and |
| 2157 | * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here |
| 2158 | * to control the behavior of |
| 2159 | * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) |
| 2160 | * Gravity.applyDisplay}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2161 | * |
| 2162 | * @see Gravity |
| 2163 | */ |
| 2164 | public int gravity; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2165 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2166 | /** |
| 2167 | * The horizontal margin, as a percentage of the container's width, |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 2168 | * between the container and the widget. See |
| 2169 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 2170 | * android.graphics.Rect) Gravity.apply} for how this is used. This |
| 2171 | * field is added with {@link #x} to supply the <var>xAdj</var> parameter. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2172 | */ |
| 2173 | public float horizontalMargin; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2174 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2175 | /** |
| 2176 | * The vertical margin, as a percentage of the container's height, |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 2177 | * between the container and the widget. See |
| 2178 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 2179 | * android.graphics.Rect) Gravity.apply} for how this is used. This |
| 2180 | * field is added with {@link #y} to supply the <var>yAdj</var> parameter. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2181 | */ |
| 2182 | public float verticalMargin; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 2183 | |
| 2184 | /** |
| 2185 | * Positive insets between the drawing surface and window content. |
| 2186 | * |
| 2187 | * @hide |
| 2188 | */ |
Alan Viverette | 3aa1ffb | 2014-10-30 12:22:08 -0700 | [diff] [blame] | 2189 | public final Rect surfaceInsets = new Rect(); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 2190 | |
| 2191 | /** |
| 2192 | * Whether the surface insets have been manually set. When set to |
| 2193 | * {@code false}, the view root will automatically determine the |
| 2194 | * appropriate surface insets. |
| 2195 | * |
| 2196 | * @see #surfaceInsets |
| 2197 | * @hide |
| 2198 | */ |
| 2199 | public boolean hasManualSurfaceInsets; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2200 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2201 | /** |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 2202 | * Whether the previous surface insets should be used vs. what is currently set. When set |
| 2203 | * to {@code true}, the view root will ignore surfaces insets in this object and use what |
| 2204 | * it currently has. |
| 2205 | * |
| 2206 | * @see #surfaceInsets |
| 2207 | * @hide |
| 2208 | */ |
| 2209 | public boolean preservePreviousSurfaceInsets = true; |
| 2210 | |
| 2211 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2212 | * The desired bitmap format. May be one of the constants in |
Romain Guy | 4832745 | 2017-01-23 17:03:35 -0800 | [diff] [blame] | 2213 | * {@link android.graphics.PixelFormat}. The choice of format |
| 2214 | * might be overridden by {@link #setColorMode(int)}. Default is OPAQUE. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2215 | */ |
| 2216 | public int format; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2217 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2218 | /** |
| 2219 | * A style resource defining the animations to use for this window. |
| 2220 | * This must be a system resource; it can not be an application resource |
| 2221 | * because the window manager does not have access to applications. |
| 2222 | */ |
| 2223 | public int windowAnimations; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2224 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2225 | /** |
| 2226 | * An alpha value to apply to this entire window. |
| 2227 | * An alpha of 1.0 means fully opaque and 0.0 means fully transparent |
| 2228 | */ |
| 2229 | public float alpha = 1.0f; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2230 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2231 | /** |
| 2232 | * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming |
| 2233 | * to apply. Range is from 1.0 for completely opaque to 0.0 for no |
| 2234 | * dim. |
| 2235 | */ |
| 2236 | public float dimAmount = 1.0f; |
Dianne Hackborn | dea3ef7 | 2010-10-28 14:24:22 -0700 | [diff] [blame] | 2237 | |
| 2238 | /** |
| 2239 | * Default value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 2240 | * indicating that the brightness value is not overridden for this window |
| 2241 | * and normal brightness policy should be used. |
| 2242 | */ |
| 2243 | public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f; |
| 2244 | |
| 2245 | /** |
| 2246 | * Value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 2247 | * indicating that the screen or button backlight brightness should be set |
| 2248 | * to the lowest value when this window is in front. |
| 2249 | */ |
| 2250 | public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f; |
| 2251 | |
| 2252 | /** |
| 2253 | * Value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 2254 | * indicating that the screen or button backlight brightness should be set |
| 2255 | * to the hightest value when this window is in front. |
| 2256 | */ |
| 2257 | public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2258 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2259 | /** |
| 2260 | * This can be used to override the user's preferred brightness of |
| 2261 | * the screen. A value of less than 0, the default, means to use the |
| 2262 | * preferred screen brightness. 0 to 1 adjusts the brightness from |
| 2263 | * dark to full bright. |
| 2264 | */ |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2265 | public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2266 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2267 | /** |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2268 | * This can be used to override the standard behavior of the button and |
| 2269 | * keyboard backlights. A value of less than 0, the default, means to |
| 2270 | * use the standard backlight behavior. 0 to 1 adjusts the brightness |
| 2271 | * from dark to full bright. |
| 2272 | */ |
| 2273 | public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE; |
| 2274 | |
| 2275 | /** |
Robert Carr | 427ba4f | 2017-07-17 18:37:06 -0700 | [diff] [blame] | 2276 | * Unspecified value for {@link #rotationAnimation} indicating |
| 2277 | * a lack of preference. |
| 2278 | * @hide |
| 2279 | */ |
| 2280 | public static final int ROTATION_ANIMATION_UNSPECIFIED = -1; |
| 2281 | |
| 2282 | /** |
Robert Carr | 652aae4 | 2016-10-17 16:48:14 -0700 | [diff] [blame] | 2283 | * Value for {@link #rotationAnimation} which specifies that this |
| 2284 | * window will visually rotate in or out following a rotation. |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2285 | */ |
| 2286 | public static final int ROTATION_ANIMATION_ROTATE = 0; |
| 2287 | |
| 2288 | /** |
Robert Carr | 652aae4 | 2016-10-17 16:48:14 -0700 | [diff] [blame] | 2289 | * Value for {@link #rotationAnimation} which specifies that this |
| 2290 | * window will fade in or out following a rotation. |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2291 | */ |
| 2292 | public static final int ROTATION_ANIMATION_CROSSFADE = 1; |
| 2293 | |
| 2294 | /** |
Robert Carr | 652aae4 | 2016-10-17 16:48:14 -0700 | [diff] [blame] | 2295 | * Value for {@link #rotationAnimation} which specifies that this window |
| 2296 | * will immediately disappear or appear following a rotation. |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2297 | */ |
| 2298 | public static final int ROTATION_ANIMATION_JUMPCUT = 2; |
| 2299 | |
| 2300 | /** |
Robert Carr | 57d9fbd | 2016-08-15 12:00:35 -0700 | [diff] [blame] | 2301 | * Value for {@link #rotationAnimation} to specify seamless rotation mode. |
| 2302 | * This works like JUMPCUT but will fall back to CROSSFADE if rotation |
Robert Carr | 652aae4 | 2016-10-17 16:48:14 -0700 | [diff] [blame] | 2303 | * can't be applied without pausing the screen. For example, this is ideal |
| 2304 | * for Camera apps which don't want the viewfinder contents to ever rotate |
| 2305 | * or fade (and rather to be seamless) but also don't want ROTATION_ANIMATION_JUMPCUT |
| 2306 | * during app transition scenarios where seamless rotation can't be applied. |
Robert Carr | 57d9fbd | 2016-08-15 12:00:35 -0700 | [diff] [blame] | 2307 | */ |
| 2308 | public static final int ROTATION_ANIMATION_SEAMLESS = 3; |
| 2309 | |
| 2310 | /** |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 2311 | * Define the exit and entry animations used on this window when the device is rotated. |
| 2312 | * This only has an affect if the incoming and outgoing topmost |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2313 | * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 2314 | * by other windows. All other situations default to the |
| 2315 | * {@link #ROTATION_ANIMATION_ROTATE} behavior. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2316 | * |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2317 | * @see #ROTATION_ANIMATION_ROTATE |
| 2318 | * @see #ROTATION_ANIMATION_CROSSFADE |
| 2319 | * @see #ROTATION_ANIMATION_JUMPCUT |
| 2320 | */ |
| 2321 | public int rotationAnimation = ROTATION_ANIMATION_ROTATE; |
| 2322 | |
| 2323 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2324 | * Identifier for this window. This will usually be filled in for |
| 2325 | * you. |
| 2326 | */ |
| 2327 | public IBinder token = null; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2328 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2329 | /** |
| 2330 | * Name of the package owning this window. |
| 2331 | */ |
| 2332 | public String packageName = null; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2333 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2334 | /** |
| 2335 | * Specific orientation value for a window. |
| 2336 | * May be any of the same values allowed |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2337 | * for {@link android.content.pm.ActivityInfo#screenOrientation}. |
| 2338 | * If not set, a default value of |
| 2339 | * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2340 | * will be used. |
| 2341 | */ |
| 2342 | public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2343 | |
| 2344 | /** |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2345 | * The preferred refresh rate for the window. |
| 2346 | * |
| 2347 | * This must be one of the supported refresh rates obtained for the display(s) the window |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2348 | * is on. The selected refresh rate will be applied to the display's default mode. |
| 2349 | * |
| 2350 | * This value is ignored if {@link #preferredDisplayModeId} is set. |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2351 | * |
| 2352 | * @see Display#getSupportedRefreshRates() |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2353 | * @deprecated use {@link #preferredDisplayModeId} instead |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2354 | */ |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2355 | @Deprecated |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2356 | public float preferredRefreshRate; |
| 2357 | |
| 2358 | /** |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2359 | * Id of the preferred display mode for the window. |
| 2360 | * <p> |
| 2361 | * This must be one of the supported modes obtained for the display(s) the window is on. |
| 2362 | * A value of {@code 0} means no preference. |
| 2363 | * |
| 2364 | * @see Display#getSupportedModes() |
| 2365 | * @see Display.Mode#getModeId() |
| 2366 | */ |
| 2367 | public int preferredDisplayModeId; |
| 2368 | |
| 2369 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2370 | * Control the visibility of the status bar. |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 2371 | * |
| 2372 | * @see View#STATUS_BAR_VISIBLE |
| 2373 | * @see View#STATUS_BAR_HIDDEN |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2374 | */ |
| 2375 | public int systemUiVisibility; |
| 2376 | |
| 2377 | /** |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 2378 | * @hide |
| 2379 | * The ui visibility as requested by the views in this hierarchy. |
| 2380 | * the combined value should be systemUiVisibility | subtreeSystemUiVisibility. |
| 2381 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 2382 | @UnsupportedAppUsage |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 2383 | public int subtreeSystemUiVisibility; |
| 2384 | |
| 2385 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2386 | * Get callbacks about the system ui visibility changing. |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2387 | * |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2388 | * TODO: Maybe there should be a bitfield of optional callbacks that we need. |
| 2389 | * |
| 2390 | * @hide |
| 2391 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 2392 | @UnsupportedAppUsage |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2393 | public boolean hasSystemUiListeners; |
| 2394 | |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2395 | |
| 2396 | /** @hide */ |
| 2397 | @Retention(RetentionPolicy.SOURCE) |
| 2398 | @IntDef( |
| 2399 | flag = true, |
| 2400 | value = {LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT, |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2401 | LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES, |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2402 | LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER}) |
| 2403 | @interface LayoutInDisplayCutoutMode {} |
| 2404 | |
| 2405 | /** |
| 2406 | * Controls how the window is laid out if there is a {@link DisplayCutout}. |
| 2407 | * |
| 2408 | * <p> |
| 2409 | * Defaults to {@link #LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT}. |
| 2410 | * |
| 2411 | * @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2412 | * @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2413 | * @see #LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER |
| 2414 | * @see DisplayCutout |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2415 | * @see android.R.attr#windowLayoutInDisplayCutoutMode |
| 2416 | * android:windowLayoutInDisplayCutoutMode |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2417 | */ |
| 2418 | @LayoutInDisplayCutoutMode |
| 2419 | public int layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT; |
| 2420 | |
| 2421 | /** |
| 2422 | * The window is allowed to extend into the {@link DisplayCutout} area, only if the |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 2423 | * {@link DisplayCutout} is fully contained within a system bar. Otherwise, the window is |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2424 | * laid out such that it does not overlap with the {@link DisplayCutout} area. |
| 2425 | * |
| 2426 | * <p> |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2427 | * In practice, this means that if the window did not set {@link #FLAG_FULLSCREEN} or |
| 2428 | * {@link View#SYSTEM_UI_FLAG_FULLSCREEN}, it can extend into the cutout area in portrait |
| 2429 | * if the cutout is at the top edge. Similarly for |
| 2430 | * {@link View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} and a cutout at the bottom of the screen. |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 2431 | * Otherwise (i.e. fullscreen or landscape) it is laid out such that it does not overlap the |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2432 | * cutout area. |
| 2433 | * |
| 2434 | * <p> |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 2435 | * The usual precautions for not overlapping with the status and navigation bar are |
| 2436 | * sufficient for ensuring that no important content overlaps with the DisplayCutout. |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2437 | * |
| 2438 | * @see DisplayCutout |
| 2439 | * @see WindowInsets |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2440 | * @see #layoutInDisplayCutoutMode |
| 2441 | * @see android.R.attr#windowLayoutInDisplayCutoutMode |
| 2442 | * android:windowLayoutInDisplayCutoutMode |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2443 | */ |
| 2444 | public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT = 0; |
| 2445 | |
| 2446 | /** |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 2447 | * @deprecated use {@link #LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES} |
| 2448 | * @hide |
| 2449 | */ |
| 2450 | @Deprecated |
| 2451 | public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS = 1; |
| 2452 | |
| 2453 | /** |
| 2454 | * The window is always allowed to extend into the {@link DisplayCutout} areas on the short |
| 2455 | * edges of the screen. |
| 2456 | * |
| 2457 | * The window will never extend into a {@link DisplayCutout} area on the long edges of the |
| 2458 | * screen. |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2459 | * |
| 2460 | * <p> |
| 2461 | * The window must make sure that no important content overlaps with the |
| 2462 | * {@link DisplayCutout}. |
| 2463 | * |
Adrian Roos | ad1da31 | 2018-03-27 19:17:50 +0200 | [diff] [blame] | 2464 | * <p> |
| 2465 | * In this mode, the window extends under cutouts on the short edge of the display in both |
| 2466 | * portrait and landscape, regardless of whether the window is hiding the system bars:<br/> |
| 2467 | * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/fullscreen_top_no_letterbox.png" |
| 2468 | * height="720" |
| 2469 | * alt="Screenshot of a fullscreen activity on a display with a cutout at the top edge in |
| 2470 | * portrait, no letterbox is applied."/> |
| 2471 | * |
| 2472 | * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/landscape_top_no_letterbox.png" |
| 2473 | * width="720" |
| 2474 | * alt="Screenshot of an activity on a display with a cutout at the top edge in landscape, |
| 2475 | * no letterbox is applied."/> |
| 2476 | * |
| 2477 | * <p> |
| 2478 | * A cutout in the corner is considered to be on the short edge: <br/> |
| 2479 | * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/fullscreen_corner_no_letterbox.png" |
| 2480 | * height="720" |
| 2481 | * alt="Screenshot of a fullscreen activity on a display with a cutout in the corner in |
| 2482 | * portrait, no letterbox is applied."/> |
| 2483 | * |
| 2484 | * <p> |
| 2485 | * On the other hand, should the cutout be on the long edge of the display, a letterbox will |
| 2486 | * be applied such that the window does not extend into the cutout on either long edge: |
| 2487 | * <br/> |
| 2488 | * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/portrait_side_letterbox.png" |
| 2489 | * height="720" |
| 2490 | * alt="Screenshot of an activity on a display with a cutout on the long edge in portrait, |
| 2491 | * letterbox is applied."/> |
| 2492 | * |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2493 | * @see DisplayCutout |
| 2494 | * @see WindowInsets#getDisplayCutout() |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2495 | * @see #layoutInDisplayCutoutMode |
| 2496 | * @see android.R.attr#windowLayoutInDisplayCutoutMode |
| 2497 | * android:windowLayoutInDisplayCutoutMode |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2498 | */ |
Adrian Roos | 6a4fa0e | 2018-03-05 19:50:16 +0100 | [diff] [blame] | 2499 | public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES = 1; |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2500 | |
| 2501 | /** |
| 2502 | * The window is never allowed to overlap with the DisplayCutout area. |
| 2503 | * |
| 2504 | * <p> |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2505 | * This should be used with windows that transiently set |
| 2506 | * {@link View#SYSTEM_UI_FLAG_FULLSCREEN} or {@link View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} |
| 2507 | * to avoid a relayout of the window when the respective flag is set or cleared. |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2508 | * |
| 2509 | * @see DisplayCutout |
Adrian Roos | 87526af | 2018-03-27 16:36:25 +0200 | [diff] [blame] | 2510 | * @see #layoutInDisplayCutoutMode |
| 2511 | * @see android.R.attr#windowLayoutInDisplayCutoutMode |
| 2512 | * android:windowLayoutInDisplayCutoutMode |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2513 | */ |
| 2514 | public static final int LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER = 2; |
| 2515 | |
| 2516 | |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2517 | /** |
| 2518 | * When this window has focus, disable touch pad pointer gesture processing. |
| 2519 | * The window will receive raw position updates from the touch pad instead |
| 2520 | * of pointer movements and synthetic touch events. |
| 2521 | * |
| 2522 | * @hide |
| 2523 | */ |
| 2524 | public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001; |
| 2525 | |
| 2526 | /** |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 2527 | * Does not construct an input channel for this window. The channel will therefore |
| 2528 | * be incapable of receiving input. |
| 2529 | * |
| 2530 | * @hide |
| 2531 | */ |
| 2532 | public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002; |
| 2533 | |
| 2534 | /** |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2535 | * When this window has focus, does not call user activity for all input events so |
| 2536 | * the application will have to do it itself. Should only be used by |
| 2537 | * the keyguard and phone app. |
| 2538 | * <p> |
| 2539 | * Should only be used by the keyguard and phone app. |
| 2540 | * </p> |
| 2541 | * |
| 2542 | * @hide |
| 2543 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 2544 | @UnsupportedAppUsage |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2545 | public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004; |
| 2546 | |
| 2547 | /** |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2548 | * Control special features of the input subsystem. |
| 2549 | * |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 2550 | * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 2551 | * @see #INPUT_FEATURE_NO_INPUT_CHANNEL |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2552 | * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2553 | * @hide |
| 2554 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 2555 | @UnsupportedAppUsage |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2556 | public int inputFeatures; |
| 2557 | |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2558 | /** |
| 2559 | * Sets the number of milliseconds before the user activity timeout occurs |
| 2560 | * when this window has focus. A value of -1 uses the standard timeout. |
| 2561 | * A value of 0 uses the minimum support display timeout. |
| 2562 | * <p> |
| 2563 | * This property can only be used to reduce the user specified display timeout; |
| 2564 | * it can never make the timeout longer than it normally would be. |
| 2565 | * </p><p> |
| 2566 | * Should only be used by the keyguard and phone app. |
| 2567 | * </p> |
| 2568 | * |
| 2569 | * @hide |
| 2570 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 2571 | @UnsupportedAppUsage |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2572 | public long userActivityTimeout = -1; |
| 2573 | |
Phil Weaver | 396d549 | 2016-03-22 17:53:50 -0700 | [diff] [blame] | 2574 | /** |
| 2575 | * For windows with an anchor (e.g. PopupWindow), keeps track of the View that anchors the |
| 2576 | * window. |
| 2577 | * |
| 2578 | * @hide |
| 2579 | */ |
Phil Weaver | 8583ae8 | 2018-02-13 11:01:24 -0800 | [diff] [blame] | 2580 | public long accessibilityIdOfAnchor = AccessibilityNodeInfo.UNDEFINED_NODE_ID; |
Phil Weaver | 396d549 | 2016-03-22 17:53:50 -0700 | [diff] [blame] | 2581 | |
Phil Weaver | 9be3c7b | 2016-04-07 15:15:41 -0700 | [diff] [blame] | 2582 | /** |
| 2583 | * The window title isn't kept in sync with what is displayed in the title bar, so we |
| 2584 | * separately track the currently shown title to provide to accessibility. |
| 2585 | * |
| 2586 | * @hide |
| 2587 | */ |
Alan Viverette | 39259dd | 2017-05-25 11:10:46 -0400 | [diff] [blame] | 2588 | @TestApi |
Phil Weaver | 9be3c7b | 2016-04-07 15:15:41 -0700 | [diff] [blame] | 2589 | public CharSequence accessibilityTitle; |
| 2590 | |
Robert Carr | 70f0d22 | 2016-04-10 16:33:08 -0700 | [diff] [blame] | 2591 | /** |
Svetoslav Ganov | aa07653 | 2016-08-01 19:16:43 -0700 | [diff] [blame] | 2592 | * Sets a timeout in milliseconds before which the window will be hidden |
Robert Carr | 70f0d22 | 2016-04-10 16:33:08 -0700 | [diff] [blame] | 2593 | * by the window manager. Useful for transient notifications like toasts |
| 2594 | * so we don't have to rely on client cooperation to ensure the window |
Svetoslav Ganov | aa07653 | 2016-08-01 19:16:43 -0700 | [diff] [blame] | 2595 | * is hidden. Must be specified at window creation time. Note that apps |
| 2596 | * are not prepared to handle their windows being removed without their |
| 2597 | * explicit request and may try to interact with the removed window |
| 2598 | * resulting in undefined behavior and crashes. Therefore, we do hide |
| 2599 | * such windows to prevent them from overlaying other apps. |
Robert Carr | 70f0d22 | 2016-04-10 16:33:08 -0700 | [diff] [blame] | 2600 | * |
| 2601 | * @hide |
| 2602 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 2603 | @UnsupportedAppUsage |
Svetoslav Ganov | aa07653 | 2016-08-01 19:16:43 -0700 | [diff] [blame] | 2604 | public long hideTimeoutMilliseconds = -1; |
Robert Carr | 70f0d22 | 2016-04-10 16:33:08 -0700 | [diff] [blame] | 2605 | |
Romain Guy | 4832745 | 2017-01-23 17:03:35 -0800 | [diff] [blame] | 2606 | /** |
| 2607 | * The color mode requested by this window. The target display may |
| 2608 | * not be able to honor the request. When the color mode is not set |
| 2609 | * to {@link ActivityInfo#COLOR_MODE_DEFAULT}, it might override the |
| 2610 | * pixel format specified in {@link #format}. |
| 2611 | * |
| 2612 | * @hide |
| 2613 | */ |
| 2614 | @ActivityInfo.ColorMode |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 2615 | private int mColorMode = COLOR_MODE_DEFAULT; |
Romain Guy | 4832745 | 2017-01-23 17:03:35 -0800 | [diff] [blame] | 2616 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2617 | public LayoutParams() { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 2618 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2619 | type = TYPE_APPLICATION; |
| 2620 | format = PixelFormat.OPAQUE; |
| 2621 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2622 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2623 | public LayoutParams(int _type) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 2624 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2625 | type = _type; |
| 2626 | format = PixelFormat.OPAQUE; |
| 2627 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2628 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2629 | public LayoutParams(int _type, int _flags) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 2630 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2631 | type = _type; |
| 2632 | flags = _flags; |
| 2633 | format = PixelFormat.OPAQUE; |
| 2634 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2635 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2636 | public LayoutParams(int _type, int _flags, int _format) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 2637 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2638 | type = _type; |
| 2639 | flags = _flags; |
| 2640 | format = _format; |
| 2641 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2642 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2643 | public LayoutParams(int w, int h, int _type, int _flags, int _format) { |
| 2644 | super(w, h); |
| 2645 | type = _type; |
| 2646 | flags = _flags; |
| 2647 | format = _format; |
| 2648 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2649 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2650 | public LayoutParams(int w, int h, int xpos, int ypos, int _type, |
| 2651 | int _flags, int _format) { |
| 2652 | super(w, h); |
| 2653 | x = xpos; |
| 2654 | y = ypos; |
| 2655 | type = _type; |
| 2656 | flags = _flags; |
| 2657 | format = _format; |
| 2658 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2659 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2660 | public final void setTitle(CharSequence title) { |
| 2661 | if (null == title) |
| 2662 | title = ""; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2663 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2664 | mTitle = TextUtils.stringOrSpannedString(title); |
| 2665 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2666 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2667 | public final CharSequence getTitle() { |
Wale Ogunwale | b6e2ead | 2016-02-15 08:28:47 -0800 | [diff] [blame] | 2668 | return mTitle != null ? mTitle : ""; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2669 | } |
Bryce Lee | 53b9fbd | 2015-02-06 12:06:34 -0800 | [diff] [blame] | 2670 | |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 2671 | /** |
| 2672 | * Sets the surface insets based on the elevation (visual z position) of the input view. |
| 2673 | * @hide |
| 2674 | */ |
| 2675 | public final void setSurfaceInsets(View view, boolean manual, boolean preservePrevious) { |
| 2676 | final int surfaceInset = (int) Math.ceil(view.getZ() * 2); |
Vladislav Kaznacheev | cb4bbd7 | 2016-05-12 12:56:31 -0700 | [diff] [blame] | 2677 | // Partial workaround for b/28318973. Every inset change causes a freeform window |
| 2678 | // to jump a little for a few frames. If we never allow surface insets to decrease, |
| 2679 | // they will stabilize quickly (often from the very beginning, as most windows start |
| 2680 | // as focused). |
| 2681 | // TODO(b/22668382) to fix this properly. |
| 2682 | if (surfaceInset == 0) { |
| 2683 | // OK to have 0 (this is the case for non-freeform windows). |
| 2684 | surfaceInsets.set(0, 0, 0, 0); |
| 2685 | } else { |
| 2686 | surfaceInsets.set( |
| 2687 | Math.max(surfaceInset, surfaceInsets.left), |
| 2688 | Math.max(surfaceInset, surfaceInsets.top), |
| 2689 | Math.max(surfaceInset, surfaceInsets.right), |
| 2690 | Math.max(surfaceInset, surfaceInsets.bottom)); |
| 2691 | } |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 2692 | hasManualSurfaceInsets = manual; |
| 2693 | preservePreviousSurfaceInsets = preservePrevious; |
| 2694 | } |
| 2695 | |
Romain Guy | 4832745 | 2017-01-23 17:03:35 -0800 | [diff] [blame] | 2696 | /** |
| 2697 | * <p>Set the color mode of the window. Setting the color mode might |
| 2698 | * override the window's pixel {@link WindowManager.LayoutParams#format format}.</p> |
| 2699 | * |
| 2700 | * <p>The color mode must be one of {@link ActivityInfo#COLOR_MODE_DEFAULT}, |
| 2701 | * {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT} or |
| 2702 | * {@link ActivityInfo#COLOR_MODE_HDR}.</p> |
| 2703 | * |
| 2704 | * @see #getColorMode() |
| 2705 | */ |
| 2706 | public void setColorMode(@ActivityInfo.ColorMode int colorMode) { |
| 2707 | mColorMode = colorMode; |
| 2708 | } |
| 2709 | |
| 2710 | /** |
| 2711 | * Returns the color mode of the window, one of {@link ActivityInfo#COLOR_MODE_DEFAULT}, |
| 2712 | * {@link ActivityInfo#COLOR_MODE_WIDE_COLOR_GAMUT} or {@link ActivityInfo#COLOR_MODE_HDR}. |
| 2713 | * |
| 2714 | * @see #setColorMode(int) |
| 2715 | */ |
| 2716 | @ActivityInfo.ColorMode |
| 2717 | public int getColorMode() { |
| 2718 | return mColorMode; |
| 2719 | } |
| 2720 | |
Bryce Lee | 53b9fbd | 2015-02-06 12:06:34 -0800 | [diff] [blame] | 2721 | /** @hide */ |
| 2722 | @SystemApi |
| 2723 | public final void setUserActivityTimeout(long timeout) { |
| 2724 | userActivityTimeout = timeout; |
| 2725 | } |
| 2726 | |
| 2727 | /** @hide */ |
| 2728 | @SystemApi |
| 2729 | public final long getUserActivityTimeout() { |
| 2730 | return userActivityTimeout; |
| 2731 | } |
| 2732 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2733 | public int describeContents() { |
| 2734 | return 0; |
| 2735 | } |
| 2736 | |
| 2737 | public void writeToParcel(Parcel out, int parcelableFlags) { |
| 2738 | out.writeInt(width); |
| 2739 | out.writeInt(height); |
| 2740 | out.writeInt(x); |
| 2741 | out.writeInt(y); |
| 2742 | out.writeInt(type); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2743 | out.writeInt(flags); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 2744 | out.writeInt(privateFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2745 | out.writeInt(softInputMode); |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2746 | out.writeInt(layoutInDisplayCutoutMode); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2747 | out.writeInt(gravity); |
| 2748 | out.writeFloat(horizontalMargin); |
| 2749 | out.writeFloat(verticalMargin); |
| 2750 | out.writeInt(format); |
| 2751 | out.writeInt(windowAnimations); |
| 2752 | out.writeFloat(alpha); |
| 2753 | out.writeFloat(dimAmount); |
| 2754 | out.writeFloat(screenBrightness); |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2755 | out.writeFloat(buttonBrightness); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2756 | out.writeInt(rotationAnimation); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2757 | out.writeStrongBinder(token); |
| 2758 | out.writeString(packageName); |
| 2759 | TextUtils.writeToParcel(mTitle, out, parcelableFlags); |
| 2760 | out.writeInt(screenOrientation); |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2761 | out.writeFloat(preferredRefreshRate); |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2762 | out.writeInt(preferredDisplayModeId); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2763 | out.writeInt(systemUiVisibility); |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 2764 | out.writeInt(subtreeSystemUiVisibility); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2765 | out.writeInt(hasSystemUiListeners ? 1 : 0); |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2766 | out.writeInt(inputFeatures); |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2767 | out.writeLong(userActivityTimeout); |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 2768 | out.writeInt(surfaceInsets.left); |
| 2769 | out.writeInt(surfaceInsets.top); |
| 2770 | out.writeInt(surfaceInsets.right); |
| 2771 | out.writeInt(surfaceInsets.bottom); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 2772 | out.writeInt(hasManualSurfaceInsets ? 1 : 0); |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 2773 | out.writeInt(preservePreviousSurfaceInsets ? 1 : 0); |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2774 | out.writeInt(needsMenuKey); |
Phil Weaver | 8583ae8 | 2018-02-13 11:01:24 -0800 | [diff] [blame] | 2775 | out.writeLong(accessibilityIdOfAnchor); |
Phil Weaver | 9be3c7b | 2016-04-07 15:15:41 -0700 | [diff] [blame] | 2776 | TextUtils.writeToParcel(accessibilityTitle, out, parcelableFlags); |
Romain Guy | 26a2b97 | 2017-04-17 09:39:51 -0700 | [diff] [blame] | 2777 | out.writeInt(mColorMode); |
Svetoslav Ganov | aa07653 | 2016-08-01 19:16:43 -0700 | [diff] [blame] | 2778 | out.writeLong(hideTimeoutMilliseconds); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2779 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2780 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 2781 | public static final @android.annotation.NonNull Parcelable.Creator<LayoutParams> CREATOR |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2782 | = new Parcelable.Creator<LayoutParams>() { |
| 2783 | public LayoutParams createFromParcel(Parcel in) { |
| 2784 | return new LayoutParams(in); |
| 2785 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2786 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2787 | public LayoutParams[] newArray(int size) { |
| 2788 | return new LayoutParams[size]; |
| 2789 | } |
| 2790 | }; |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2791 | |
| 2792 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2793 | public LayoutParams(Parcel in) { |
| 2794 | width = in.readInt(); |
| 2795 | height = in.readInt(); |
| 2796 | x = in.readInt(); |
| 2797 | y = in.readInt(); |
| 2798 | type = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2799 | flags = in.readInt(); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 2800 | privateFlags = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2801 | softInputMode = in.readInt(); |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2802 | layoutInDisplayCutoutMode = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2803 | gravity = in.readInt(); |
| 2804 | horizontalMargin = in.readFloat(); |
| 2805 | verticalMargin = in.readFloat(); |
| 2806 | format = in.readInt(); |
| 2807 | windowAnimations = in.readInt(); |
| 2808 | alpha = in.readFloat(); |
| 2809 | dimAmount = in.readFloat(); |
| 2810 | screenBrightness = in.readFloat(); |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2811 | buttonBrightness = in.readFloat(); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2812 | rotationAnimation = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2813 | token = in.readStrongBinder(); |
| 2814 | packageName = in.readString(); |
| 2815 | mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); |
| 2816 | screenOrientation = in.readInt(); |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2817 | preferredRefreshRate = in.readFloat(); |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2818 | preferredDisplayModeId = in.readInt(); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2819 | systemUiVisibility = in.readInt(); |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 2820 | subtreeSystemUiVisibility = in.readInt(); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2821 | hasSystemUiListeners = in.readInt() != 0; |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2822 | inputFeatures = in.readInt(); |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2823 | userActivityTimeout = in.readLong(); |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 2824 | surfaceInsets.left = in.readInt(); |
| 2825 | surfaceInsets.top = in.readInt(); |
| 2826 | surfaceInsets.right = in.readInt(); |
| 2827 | surfaceInsets.bottom = in.readInt(); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 2828 | hasManualSurfaceInsets = in.readInt() != 0; |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 2829 | preservePreviousSurfaceInsets = in.readInt() != 0; |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2830 | needsMenuKey = in.readInt(); |
Phil Weaver | 8583ae8 | 2018-02-13 11:01:24 -0800 | [diff] [blame] | 2831 | accessibilityIdOfAnchor = in.readLong(); |
Phil Weaver | 9be3c7b | 2016-04-07 15:15:41 -0700 | [diff] [blame] | 2832 | accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); |
Romain Guy | 26a2b97 | 2017-04-17 09:39:51 -0700 | [diff] [blame] | 2833 | mColorMode = in.readInt(); |
Svetoslav Ganov | aa07653 | 2016-08-01 19:16:43 -0700 | [diff] [blame] | 2834 | hideTimeoutMilliseconds = in.readLong(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2835 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2836 | |
Romain Guy | 7299807 | 2009-06-22 11:09:20 -0700 | [diff] [blame] | 2837 | @SuppressWarnings({"PointlessBitwiseExpression"}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2838 | public static final int LAYOUT_CHANGED = 1<<0; |
| 2839 | public static final int TYPE_CHANGED = 1<<1; |
| 2840 | public static final int FLAGS_CHANGED = 1<<2; |
| 2841 | public static final int FORMAT_CHANGED = 1<<3; |
| 2842 | public static final int ANIMATION_CHANGED = 1<<4; |
| 2843 | public static final int DIM_AMOUNT_CHANGED = 1<<5; |
| 2844 | public static final int TITLE_CHANGED = 1<<6; |
| 2845 | public static final int ALPHA_CHANGED = 1<<7; |
| 2846 | public static final int MEMORY_TYPE_CHANGED = 1<<8; |
| 2847 | public static final int SOFT_INPUT_MODE_CHANGED = 1<<9; |
| 2848 | public static final int SCREEN_ORIENTATION_CHANGED = 1<<10; |
| 2849 | public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11; |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2850 | public static final int ROTATION_ANIMATION_CHANGED = 1<<12; |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2851 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2852 | public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2853 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2854 | public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 2855 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2856 | public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15; |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 2857 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2858 | public static final int INPUT_FEATURES_CHANGED = 1<<16; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 2859 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2860 | public static final int PRIVATE_FLAGS_CHANGED = 1<<17; |
Romain Guy | f21c9b0 | 2011-09-06 16:56:54 -0700 | [diff] [blame] | 2861 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2862 | public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18; |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 2863 | /** {@hide} */ |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 2864 | public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19; |
| 2865 | /** {@hide} */ |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 2866 | public static final int SURFACE_INSETS_CHANGED = 1<<20; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 2867 | /** {@hide} */ |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2868 | public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21; |
| 2869 | /** {@hide} */ |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2870 | public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22; |
| 2871 | /** {@hide} */ |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2872 | public static final int PREFERRED_DISPLAY_MODE_ID = 1 << 23; |
| 2873 | /** {@hide} */ |
Phil Weaver | 396d549 | 2016-03-22 17:53:50 -0700 | [diff] [blame] | 2874 | public static final int ACCESSIBILITY_ANCHOR_CHANGED = 1 << 24; |
| 2875 | /** {@hide} */ |
Alan Viverette | 39259dd | 2017-05-25 11:10:46 -0400 | [diff] [blame] | 2876 | @TestApi |
Phil Weaver | 9be3c7b | 2016-04-07 15:15:41 -0700 | [diff] [blame] | 2877 | public static final int ACCESSIBILITY_TITLE_CHANGED = 1 << 25; |
| 2878 | /** {@hide} */ |
Romain Guy | 26a2b97 | 2017-04-17 09:39:51 -0700 | [diff] [blame] | 2879 | public static final int COLOR_MODE_CHANGED = 1 << 26; |
| 2880 | /** {@hide} */ |
Romain Guy | f21c9b0 | 2011-09-06 16:56:54 -0700 | [diff] [blame] | 2881 | public static final int EVERYTHING_CHANGED = 0xffffffff; |
| 2882 | |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2883 | // internal buffer to backup/restore parameters under compatibility mode. |
| 2884 | private int[] mCompatibilityParamsBackup = null; |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2885 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2886 | public final int copyFrom(LayoutParams o) { |
| 2887 | int changes = 0; |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 2888 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2889 | if (width != o.width) { |
| 2890 | width = o.width; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2891 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2892 | } |
| 2893 | if (height != o.height) { |
| 2894 | height = o.height; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2895 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2896 | } |
| 2897 | if (x != o.x) { |
| 2898 | x = o.x; |
| 2899 | changes |= LAYOUT_CHANGED; |
| 2900 | } |
| 2901 | if (y != o.y) { |
| 2902 | y = o.y; |
| 2903 | changes |= LAYOUT_CHANGED; |
| 2904 | } |
| 2905 | if (horizontalWeight != o.horizontalWeight) { |
| 2906 | horizontalWeight = o.horizontalWeight; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2907 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2908 | } |
| 2909 | if (verticalWeight != o.verticalWeight) { |
| 2910 | verticalWeight = o.verticalWeight; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2911 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2912 | } |
| 2913 | if (horizontalMargin != o.horizontalMargin) { |
| 2914 | horizontalMargin = o.horizontalMargin; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2915 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2916 | } |
| 2917 | if (verticalMargin != o.verticalMargin) { |
| 2918 | verticalMargin = o.verticalMargin; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2919 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2920 | } |
| 2921 | if (type != o.type) { |
| 2922 | type = o.type; |
| 2923 | changes |= TYPE_CHANGED; |
| 2924 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2925 | if (flags != o.flags) { |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 2926 | final int diff = flags ^ o.flags; |
| 2927 | if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) { |
| 2928 | changes |= TRANSLUCENT_FLAGS_CHANGED; |
| 2929 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2930 | flags = o.flags; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2931 | changes |= FLAGS_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2932 | } |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 2933 | if (privateFlags != o.privateFlags) { |
| 2934 | privateFlags = o.privateFlags; |
| 2935 | changes |= PRIVATE_FLAGS_CHANGED; |
| 2936 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2937 | if (softInputMode != o.softInputMode) { |
| 2938 | softInputMode = o.softInputMode; |
| 2939 | changes |= SOFT_INPUT_MODE_CHANGED; |
| 2940 | } |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 2941 | if (layoutInDisplayCutoutMode != o.layoutInDisplayCutoutMode) { |
| 2942 | layoutInDisplayCutoutMode = o.layoutInDisplayCutoutMode; |
| 2943 | changes |= LAYOUT_CHANGED; |
| 2944 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2945 | if (gravity != o.gravity) { |
| 2946 | gravity = o.gravity; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2947 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2948 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2949 | if (format != o.format) { |
| 2950 | format = o.format; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2951 | changes |= FORMAT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2952 | } |
| 2953 | if (windowAnimations != o.windowAnimations) { |
| 2954 | windowAnimations = o.windowAnimations; |
| 2955 | changes |= ANIMATION_CHANGED; |
| 2956 | } |
| 2957 | if (token == null) { |
| 2958 | // NOTE: token only copied if the recipient doesn't |
| 2959 | // already have one. |
| 2960 | token = o.token; |
| 2961 | } |
| 2962 | if (packageName == null) { |
| 2963 | // NOTE: packageName only copied if the recipient doesn't |
| 2964 | // already have one. |
| 2965 | packageName = o.packageName; |
| 2966 | } |
Wale Ogunwale | 1f240c9 | 2016-02-22 18:04:58 -0800 | [diff] [blame] | 2967 | if (!Objects.equals(mTitle, o.mTitle) && o.mTitle != null) { |
Wale Ogunwale | b6e2ead | 2016-02-15 08:28:47 -0800 | [diff] [blame] | 2968 | // NOTE: mTitle only copied if the originator set one. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2969 | mTitle = o.mTitle; |
| 2970 | changes |= TITLE_CHANGED; |
| 2971 | } |
| 2972 | if (alpha != o.alpha) { |
| 2973 | alpha = o.alpha; |
| 2974 | changes |= ALPHA_CHANGED; |
| 2975 | } |
| 2976 | if (dimAmount != o.dimAmount) { |
| 2977 | dimAmount = o.dimAmount; |
| 2978 | changes |= DIM_AMOUNT_CHANGED; |
| 2979 | } |
| 2980 | if (screenBrightness != o.screenBrightness) { |
| 2981 | screenBrightness = o.screenBrightness; |
| 2982 | changes |= SCREEN_BRIGHTNESS_CHANGED; |
| 2983 | } |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 2984 | if (buttonBrightness != o.buttonBrightness) { |
| 2985 | buttonBrightness = o.buttonBrightness; |
| 2986 | changes |= BUTTON_BRIGHTNESS_CHANGED; |
| 2987 | } |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 2988 | if (rotationAnimation != o.rotationAnimation) { |
| 2989 | rotationAnimation = o.rotationAnimation; |
| 2990 | changes |= ROTATION_ANIMATION_CHANGED; |
| 2991 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 2992 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2993 | if (screenOrientation != o.screenOrientation) { |
| 2994 | screenOrientation = o.screenOrientation; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 2995 | changes |= SCREEN_ORIENTATION_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2996 | } |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 2997 | |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 2998 | if (preferredRefreshRate != o.preferredRefreshRate) { |
| 2999 | preferredRefreshRate = o.preferredRefreshRate; |
| 3000 | changes |= PREFERRED_REFRESH_RATE_CHANGED; |
| 3001 | } |
| 3002 | |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 3003 | if (preferredDisplayModeId != o.preferredDisplayModeId) { |
| 3004 | preferredDisplayModeId = o.preferredDisplayModeId; |
| 3005 | changes |= PREFERRED_DISPLAY_MODE_ID; |
| 3006 | } |
| 3007 | |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 3008 | if (systemUiVisibility != o.systemUiVisibility |
| 3009 | || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) { |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 3010 | systemUiVisibility = o.systemUiVisibility; |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 3011 | subtreeSystemUiVisibility = o.subtreeSystemUiVisibility; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 3012 | changes |= SYSTEM_UI_VISIBILITY_CHANGED; |
| 3013 | } |
| 3014 | |
| 3015 | if (hasSystemUiListeners != o.hasSystemUiListeners) { |
| 3016 | hasSystemUiListeners = o.hasSystemUiListeners; |
| 3017 | changes |= SYSTEM_UI_LISTENER_CHANGED; |
| 3018 | } |
| 3019 | |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 3020 | if (inputFeatures != o.inputFeatures) { |
| 3021 | inputFeatures = o.inputFeatures; |
| 3022 | changes |= INPUT_FEATURES_CHANGED; |
| 3023 | } |
| 3024 | |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 3025 | if (userActivityTimeout != o.userActivityTimeout) { |
| 3026 | userActivityTimeout = o.userActivityTimeout; |
| 3027 | changes |= USER_ACTIVITY_TIMEOUT_CHANGED; |
| 3028 | } |
| 3029 | |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 3030 | if (!surfaceInsets.equals(o.surfaceInsets)) { |
| 3031 | surfaceInsets.set(o.surfaceInsets); |
| 3032 | changes |= SURFACE_INSETS_CHANGED; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 3033 | } |
| 3034 | |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 3035 | if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) { |
| 3036 | hasManualSurfaceInsets = o.hasManualSurfaceInsets; |
| 3037 | changes |= SURFACE_INSETS_CHANGED; |
| 3038 | } |
| 3039 | |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 3040 | if (preservePreviousSurfaceInsets != o.preservePreviousSurfaceInsets) { |
| 3041 | preservePreviousSurfaceInsets = o.preservePreviousSurfaceInsets; |
| 3042 | changes |= SURFACE_INSETS_CHANGED; |
| 3043 | } |
| 3044 | |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 3045 | if (needsMenuKey != o.needsMenuKey) { |
| 3046 | needsMenuKey = o.needsMenuKey; |
| 3047 | changes |= NEEDS_MENU_KEY_CHANGED; |
| 3048 | } |
| 3049 | |
Phil Weaver | 396d549 | 2016-03-22 17:53:50 -0700 | [diff] [blame] | 3050 | if (accessibilityIdOfAnchor != o.accessibilityIdOfAnchor) { |
| 3051 | accessibilityIdOfAnchor = o.accessibilityIdOfAnchor; |
| 3052 | changes |= ACCESSIBILITY_ANCHOR_CHANGED; |
| 3053 | } |
| 3054 | |
Phil Weaver | 9be3c7b | 2016-04-07 15:15:41 -0700 | [diff] [blame] | 3055 | if (!Objects.equals(accessibilityTitle, o.accessibilityTitle) |
| 3056 | && o.accessibilityTitle != null) { |
| 3057 | // NOTE: accessibilityTitle only copied if the originator set one. |
| 3058 | accessibilityTitle = o.accessibilityTitle; |
| 3059 | changes |= ACCESSIBILITY_TITLE_CHANGED; |
| 3060 | } |
| 3061 | |
Romain Guy | 26a2b97 | 2017-04-17 09:39:51 -0700 | [diff] [blame] | 3062 | if (mColorMode != o.mColorMode) { |
| 3063 | mColorMode = o.mColorMode; |
| 3064 | changes |= COLOR_MODE_CHANGED; |
| 3065 | } |
| 3066 | |
Robert Carr | 70f0d22 | 2016-04-10 16:33:08 -0700 | [diff] [blame] | 3067 | // This can't change, it's only set at window creation time. |
Svetoslav Ganov | aa07653 | 2016-08-01 19:16:43 -0700 | [diff] [blame] | 3068 | hideTimeoutMilliseconds = o.hideTimeoutMilliseconds; |
Robert Carr | 70f0d22 | 2016-04-10 16:33:08 -0700 | [diff] [blame] | 3069 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3070 | return changes; |
| 3071 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 3072 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3073 | @Override |
| 3074 | public String debug(String output) { |
| 3075 | output += "Contents of " + this + ":"; |
| 3076 | Log.d("Debug", output); |
| 3077 | output = super.debug(""); |
| 3078 | Log.d("Debug", output); |
| 3079 | Log.d("Debug", ""); |
| 3080 | Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}"); |
| 3081 | return ""; |
| 3082 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 3083 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3084 | @Override |
| 3085 | public String toString() { |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3086 | return toString(""); |
| 3087 | } |
| 3088 | |
| 3089 | /** |
| 3090 | * @hide |
| 3091 | */ |
Felipe Leme | da9ea34 | 2018-03-22 15:19:51 -0700 | [diff] [blame] | 3092 | public void dumpDimensions(StringBuilder sb) { |
| 3093 | sb.append('('); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3094 | sb.append(x); |
| 3095 | sb.append(','); |
| 3096 | sb.append(y); |
| 3097 | sb.append(")("); |
Romain Guy | 4832745 | 2017-01-23 17:03:35 -0800 | [diff] [blame] | 3098 | sb.append((width == MATCH_PARENT ? "fill" : (width == WRAP_CONTENT |
| 3099 | ? "wrap" : String.valueOf(width)))); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3100 | sb.append('x'); |
Romain Guy | 4832745 | 2017-01-23 17:03:35 -0800 | [diff] [blame] | 3101 | sb.append((height == MATCH_PARENT ? "fill" : (height == WRAP_CONTENT |
| 3102 | ? "wrap" : String.valueOf(height)))); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3103 | sb.append(")"); |
Felipe Leme | da9ea34 | 2018-03-22 15:19:51 -0700 | [diff] [blame] | 3104 | } |
| 3105 | |
| 3106 | /** |
| 3107 | * @hide |
| 3108 | */ |
| 3109 | public String toString(String prefix) { |
| 3110 | StringBuilder sb = new StringBuilder(256); |
| 3111 | sb.append('{'); |
| 3112 | dumpDimensions(sb); |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 3113 | if (horizontalMargin != 0) { |
| 3114 | sb.append(" hm="); |
| 3115 | sb.append(horizontalMargin); |
| 3116 | } |
| 3117 | if (verticalMargin != 0) { |
| 3118 | sb.append(" vm="); |
| 3119 | sb.append(verticalMargin); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3120 | } |
| 3121 | if (gravity != 0) { |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3122 | sb.append(" gr="); |
| 3123 | sb.append(Gravity.toString(gravity)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3124 | } |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 3125 | if (softInputMode != 0) { |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3126 | sb.append(" sim={"); |
| 3127 | sb.append(softInputModeToString(softInputMode)); |
| 3128 | sb.append('}'); |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 3129 | } |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 3130 | if (layoutInDisplayCutoutMode != 0) { |
| 3131 | sb.append(" layoutInDisplayCutoutMode="); |
| 3132 | sb.append(layoutInDisplayCutoutModeToString(layoutInDisplayCutoutMode)); |
| 3133 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3134 | sb.append(" ty="); |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3135 | sb.append(ViewDebug.intToString(LayoutParams.class, "type", type)); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 3136 | if (format != PixelFormat.OPAQUE) { |
| 3137 | sb.append(" fmt="); |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3138 | sb.append(PixelFormat.formatToString(format)); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 3139 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3140 | if (windowAnimations != 0) { |
| 3141 | sb.append(" wanim=0x"); |
| 3142 | sb.append(Integer.toHexString(windowAnimations)); |
| 3143 | } |
| 3144 | if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { |
| 3145 | sb.append(" or="); |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3146 | sb.append(ActivityInfo.screenOrientationToString(screenOrientation)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3147 | } |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 3148 | if (alpha != 1.0f) { |
| 3149 | sb.append(" alpha="); |
| 3150 | sb.append(alpha); |
| 3151 | } |
| 3152 | if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) { |
| 3153 | sb.append(" sbrt="); |
| 3154 | sb.append(screenBrightness); |
| 3155 | } |
| 3156 | if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) { |
| 3157 | sb.append(" bbrt="); |
| 3158 | sb.append(buttonBrightness); |
| 3159 | } |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 3160 | if (rotationAnimation != ROTATION_ANIMATION_ROTATE) { |
| 3161 | sb.append(" rotAnim="); |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3162 | sb.append(rotationAnimationToString(rotationAnimation)); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 3163 | } |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 3164 | if (preferredRefreshRate != 0) { |
| 3165 | sb.append(" preferredRefreshRate="); |
| 3166 | sb.append(preferredRefreshRate); |
| 3167 | } |
P.Y. Laligand | b3b9eb3 | 2015-05-11 15:02:07 -0700 | [diff] [blame] | 3168 | if (preferredDisplayModeId != 0) { |
| 3169 | sb.append(" preferredDisplayMode="); |
| 3170 | sb.append(preferredDisplayModeId); |
| 3171 | } |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 3172 | if (hasSystemUiListeners) { |
| 3173 | sb.append(" sysuil="); |
| 3174 | sb.append(hasSystemUiListeners); |
| 3175 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 3176 | if (inputFeatures != 0) { |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3177 | sb.append(" if=").append(inputFeatureToString(inputFeatures)); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 3178 | } |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 3179 | if (userActivityTimeout >= 0) { |
| 3180 | sb.append(" userActivityTimeout=").append(userActivityTimeout); |
| 3181 | } |
Andreas Gampe | 007cfa7 | 2015-03-15 14:19:43 -0700 | [diff] [blame] | 3182 | if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 || |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 3183 | surfaceInsets.bottom != 0 || hasManualSurfaceInsets |
| 3184 | || !preservePreviousSurfaceInsets) { |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 3185 | sb.append(" surfaceInsets=").append(surfaceInsets); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 3186 | if (hasManualSurfaceInsets) { |
| 3187 | sb.append(" (manual)"); |
| 3188 | } |
Wale Ogunwale | 246c209 | 2016-04-07 14:12:44 -0700 | [diff] [blame] | 3189 | if (!preservePreviousSurfaceInsets) { |
| 3190 | sb.append(" (!preservePreviousSurfaceInsets)"); |
| 3191 | } |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 3192 | } |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3193 | if (needsMenuKey == NEEDS_MENU_SET_TRUE) { |
| 3194 | sb.append(" needsMenuKey"); |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 3195 | } |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3196 | if (mColorMode != COLOR_MODE_DEFAULT) { |
| 3197 | sb.append(" colorMode=").append(ActivityInfo.colorModeToString(mColorMode)); |
| 3198 | } |
| 3199 | sb.append(System.lineSeparator()); |
| 3200 | sb.append(prefix).append(" fl=").append( |
| 3201 | ViewDebug.flagsToString(LayoutParams.class, "flags", flags)); |
| 3202 | if (privateFlags != 0) { |
| 3203 | sb.append(System.lineSeparator()); |
| 3204 | sb.append(prefix).append(" pfl=").append(ViewDebug.flagsToString( |
| 3205 | LayoutParams.class, "privateFlags", privateFlags)); |
| 3206 | } |
| 3207 | if (systemUiVisibility != 0) { |
| 3208 | sb.append(System.lineSeparator()); |
| 3209 | sb.append(prefix).append(" sysui=").append(ViewDebug.flagsToString( |
| 3210 | View.class, "mSystemUiVisibility", systemUiVisibility)); |
| 3211 | } |
| 3212 | if (subtreeSystemUiVisibility != 0) { |
| 3213 | sb.append(System.lineSeparator()); |
| 3214 | sb.append(prefix).append(" vsysui=").append(ViewDebug.flagsToString( |
| 3215 | View.class, "mSystemUiVisibility", subtreeSystemUiVisibility)); |
| 3216 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3217 | sb.append('}'); |
| 3218 | return sb.toString(); |
| 3219 | } |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 3220 | |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3221 | /** |
Steven Timotius | af03df6 | 2017-07-18 16:56:43 -0700 | [diff] [blame] | 3222 | * @hide |
| 3223 | */ |
| 3224 | public void writeToProto(ProtoOutputStream proto, long fieldId) { |
| 3225 | final long token = proto.start(fieldId); |
Vishnu Nair | 1d0fa07 | 2018-01-04 07:53:00 -0800 | [diff] [blame] | 3226 | proto.write(TYPE, type); |
| 3227 | proto.write(X, x); |
| 3228 | proto.write(Y, y); |
| 3229 | proto.write(WIDTH, width); |
| 3230 | proto.write(HEIGHT, height); |
| 3231 | proto.write(HORIZONTAL_MARGIN, horizontalMargin); |
| 3232 | proto.write(VERTICAL_MARGIN, verticalMargin); |
| 3233 | proto.write(GRAVITY, gravity); |
| 3234 | proto.write(SOFT_INPUT_MODE, softInputMode); |
| 3235 | proto.write(FORMAT, format); |
| 3236 | proto.write(WINDOW_ANIMATIONS, windowAnimations); |
| 3237 | proto.write(ALPHA, alpha); |
| 3238 | proto.write(SCREEN_BRIGHTNESS, screenBrightness); |
| 3239 | proto.write(BUTTON_BRIGHTNESS, buttonBrightness); |
| 3240 | proto.write(ROTATION_ANIMATION, rotationAnimation); |
| 3241 | proto.write(PREFERRED_REFRESH_RATE, preferredRefreshRate); |
| 3242 | proto.write(WindowLayoutParamsProto.PREFERRED_DISPLAY_MODE_ID, preferredDisplayModeId); |
| 3243 | proto.write(HAS_SYSTEM_UI_LISTENERS, hasSystemUiListeners); |
| 3244 | proto.write(INPUT_FEATURE_FLAGS, inputFeatures); |
| 3245 | proto.write(USER_ACTIVITY_TIMEOUT, userActivityTimeout); |
| 3246 | proto.write(NEEDS_MENU_KEY, needsMenuKey); |
| 3247 | proto.write(COLOR_MODE, mColorMode); |
| 3248 | proto.write(FLAGS, flags); |
Vishnu Nair | 1d0fa07 | 2018-01-04 07:53:00 -0800 | [diff] [blame] | 3249 | proto.write(PRIVATE_FLAGS, privateFlags); |
| 3250 | proto.write(SYSTEM_UI_VISIBILITY_FLAGS, systemUiVisibility); |
| 3251 | proto.write(SUBTREE_SYSTEM_UI_VISIBILITY_FLAGS, subtreeSystemUiVisibility); |
Steven Timotius | af03df6 | 2017-07-18 16:56:43 -0700 | [diff] [blame] | 3252 | proto.end(token); |
| 3253 | } |
| 3254 | |
| 3255 | /** |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3256 | * Scale the layout params' coordinates and size. |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 3257 | * @hide |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3258 | */ |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 3259 | public void scale(float scale) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 3260 | x = (int) (x * scale + 0.5f); |
| 3261 | y = (int) (y * scale + 0.5f); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3262 | if (width > 0) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 3263 | width = (int) (width * scale + 0.5f); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3264 | } |
| 3265 | if (height > 0) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 3266 | height = (int) (height * scale + 0.5f); |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 3267 | } |
| 3268 | } |
| 3269 | |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3270 | /** |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3271 | * Backup the layout parameters used in compatibility mode. |
| 3272 | * @see LayoutParams#restore() |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3273 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 3274 | @UnsupportedAppUsage |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3275 | void backup() { |
| 3276 | int[] backup = mCompatibilityParamsBackup; |
| 3277 | if (backup == null) { |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 3278 | // we backup 4 elements, x, y, width, height |
| 3279 | backup = mCompatibilityParamsBackup = new int[4]; |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3280 | } |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3281 | backup[0] = x; |
| 3282 | backup[1] = y; |
| 3283 | backup[2] = width; |
| 3284 | backup[3] = height; |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3285 | } |
| 3286 | |
| 3287 | /** |
| 3288 | * Restore the layout params' coordinates, size and gravity |
| 3289 | * @see LayoutParams#backup() |
| 3290 | */ |
Mathew Inwood | a570dee | 2018-08-17 14:56:00 +0100 | [diff] [blame] | 3291 | @UnsupportedAppUsage |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 3292 | void restore() { |
| 3293 | int[] backup = mCompatibilityParamsBackup; |
| 3294 | if (backup != null) { |
| 3295 | x = backup[0]; |
| 3296 | y = backup[1]; |
| 3297 | width = backup[2]; |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 3298 | height = backup[3]; |
| 3299 | } |
| 3300 | } |
| 3301 | |
Wale Ogunwale | b6e2ead | 2016-02-15 08:28:47 -0800 | [diff] [blame] | 3302 | private CharSequence mTitle = null; |
Siva Velusamy | 0d857b9 | 2015-04-22 10:23:56 -0700 | [diff] [blame] | 3303 | |
| 3304 | /** @hide */ |
| 3305 | @Override |
| 3306 | protected void encodeProperties(@NonNull ViewHierarchyEncoder encoder) { |
| 3307 | super.encodeProperties(encoder); |
| 3308 | |
| 3309 | encoder.addProperty("x", x); |
| 3310 | encoder.addProperty("y", y); |
| 3311 | encoder.addProperty("horizontalWeight", horizontalWeight); |
| 3312 | encoder.addProperty("verticalWeight", verticalWeight); |
| 3313 | encoder.addProperty("type", type); |
| 3314 | encoder.addProperty("flags", flags); |
| 3315 | } |
Jorim Jaggi | e6c6ecb | 2017-07-20 18:09:20 +0200 | [diff] [blame] | 3316 | |
| 3317 | /** |
| 3318 | * @hide |
| 3319 | * @return True if the layout parameters will cause the window to cover the full screen; |
| 3320 | * false otherwise. |
| 3321 | */ |
| 3322 | public boolean isFullscreen() { |
| 3323 | return x == 0 && y == 0 |
| 3324 | && width == WindowManager.LayoutParams.MATCH_PARENT |
| 3325 | && height == WindowManager.LayoutParams.MATCH_PARENT; |
| 3326 | } |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3327 | |
Adrian Roos | fa02da6 | 2018-01-15 16:01:18 +0100 | [diff] [blame] | 3328 | private static String layoutInDisplayCutoutModeToString( |
| 3329 | @LayoutInDisplayCutoutMode int mode) { |
| 3330 | switch (mode) { |
| 3331 | case LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT: |
| 3332 | return "default"; |
| 3333 | case LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS: |
| 3334 | return "always"; |
| 3335 | case LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER: |
| 3336 | return "never"; |
| 3337 | default: |
| 3338 | return "unknown(" + mode + ")"; |
| 3339 | } |
| 3340 | } |
| 3341 | |
Jorim Jaggi | 484851b | 2017-09-22 16:03:27 +0200 | [diff] [blame] | 3342 | private static String softInputModeToString(@SoftInputModeFlags int softInputMode) { |
| 3343 | final StringBuilder result = new StringBuilder(); |
| 3344 | final int state = softInputMode & SOFT_INPUT_MASK_STATE; |
| 3345 | if (state != 0) { |
| 3346 | result.append("state="); |
| 3347 | switch (state) { |
| 3348 | case SOFT_INPUT_STATE_UNCHANGED: |
| 3349 | result.append("unchanged"); |
| 3350 | break; |
| 3351 | case SOFT_INPUT_STATE_HIDDEN: |
| 3352 | result.append("hidden"); |
| 3353 | break; |
| 3354 | case SOFT_INPUT_STATE_ALWAYS_HIDDEN: |
| 3355 | result.append("always_hidden"); |
| 3356 | break; |
| 3357 | case SOFT_INPUT_STATE_VISIBLE: |
| 3358 | result.append("visible"); |
| 3359 | break; |
| 3360 | case SOFT_INPUT_STATE_ALWAYS_VISIBLE: |
| 3361 | result.append("always_visible"); |
| 3362 | break; |
| 3363 | default: |
| 3364 | result.append(state); |
| 3365 | break; |
| 3366 | } |
| 3367 | result.append(' '); |
| 3368 | } |
| 3369 | final int adjust = softInputMode & SOFT_INPUT_MASK_ADJUST; |
| 3370 | if (adjust != 0) { |
| 3371 | result.append("adjust="); |
| 3372 | switch (adjust) { |
| 3373 | case SOFT_INPUT_ADJUST_RESIZE: |
| 3374 | result.append("resize"); |
| 3375 | break; |
| 3376 | case SOFT_INPUT_ADJUST_PAN: |
| 3377 | result.append("pan"); |
| 3378 | break; |
| 3379 | case SOFT_INPUT_ADJUST_NOTHING: |
| 3380 | result.append("nothing"); |
| 3381 | break; |
| 3382 | default: |
| 3383 | result.append(adjust); |
| 3384 | break; |
| 3385 | } |
| 3386 | result.append(' '); |
| 3387 | } |
| 3388 | if ((softInputMode & SOFT_INPUT_IS_FORWARD_NAVIGATION) != 0) { |
| 3389 | result.append("forwardNavigation").append(' '); |
| 3390 | } |
| 3391 | result.deleteCharAt(result.length() - 1); |
| 3392 | return result.toString(); |
| 3393 | } |
| 3394 | |
| 3395 | private static String rotationAnimationToString(int rotationAnimation) { |
| 3396 | switch (rotationAnimation) { |
| 3397 | case ROTATION_ANIMATION_UNSPECIFIED: |
| 3398 | return "UNSPECIFIED"; |
| 3399 | case ROTATION_ANIMATION_ROTATE: |
| 3400 | return "ROTATE"; |
| 3401 | case ROTATION_ANIMATION_CROSSFADE: |
| 3402 | return "CROSSFADE"; |
| 3403 | case ROTATION_ANIMATION_JUMPCUT: |
| 3404 | return "JUMPCUT"; |
| 3405 | case ROTATION_ANIMATION_SEAMLESS: |
| 3406 | return "SEAMLESS"; |
| 3407 | default: |
| 3408 | return Integer.toString(rotationAnimation); |
| 3409 | } |
| 3410 | } |
| 3411 | |
| 3412 | private static String inputFeatureToString(int inputFeature) { |
| 3413 | switch (inputFeature) { |
| 3414 | case INPUT_FEATURE_DISABLE_POINTER_GESTURES: |
| 3415 | return "DISABLE_POINTER_GESTURES"; |
| 3416 | case INPUT_FEATURE_NO_INPUT_CHANNEL: |
| 3417 | return "NO_INPUT_CHANNEL"; |
| 3418 | case INPUT_FEATURE_DISABLE_USER_ACTIVITY: |
| 3419 | return "DISABLE_USER_ACTIVITY"; |
| 3420 | default: |
| 3421 | return Integer.toString(inputFeature); |
| 3422 | } |
| 3423 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3424 | } |
| 3425 | } |