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