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