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 | |
Bryce Lee | 53b9fbd | 2015-02-06 12:06:34 -0800 | [diff] [blame] | 19 | import android.annotation.SystemApi; |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 20 | import android.app.Presentation; |
| 21 | import android.content.Context; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.pm.ActivityInfo; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 23 | import android.graphics.Insets; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | import android.graphics.PixelFormat; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 25 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.os.IBinder; |
| 27 | import android.os.Parcel; |
| 28 | import android.os.Parcelable; |
| 29 | import android.text.TextUtils; |
| 30 | import android.util.Log; |
| 31 | |
| 32 | |
| 33 | /** |
| 34 | * The interface that apps use to talk to the window manager. |
| 35 | * <p> |
| 36 | * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these. |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 37 | * </p><p> |
| 38 | * Each window manager instance is bound to a particular {@link Display}. |
| 39 | * To obtain a {@link WindowManager} for a different display, use |
| 40 | * {@link Context#createDisplayContext} to obtain a {@link Context} for that |
| 41 | * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> |
| 42 | * to get the WindowManager. |
| 43 | * </p><p> |
| 44 | * The simplest way to show a window on another display is to create a |
| 45 | * {@link Presentation}. The presentation will automatically obtain a |
| 46 | * {@link WindowManager} and {@link Context} for that display. |
| 47 | * </p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | * |
| 49 | * @see android.content.Context#getSystemService |
| 50 | * @see android.content.Context#WINDOW_SERVICE |
| 51 | */ |
| 52 | public interface WindowManager extends ViewManager { |
| 53 | /** |
| 54 | * Exception that is thrown when trying to add view whose |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 55 | * {@link LayoutParams} {@link LayoutParams#token} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | * is invalid. |
| 57 | */ |
| 58 | public static class BadTokenException extends RuntimeException { |
| 59 | public BadTokenException() { |
| 60 | } |
| 61 | |
| 62 | public BadTokenException(String name) { |
| 63 | super(name); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** |
Craig Mautner | 6018aee | 2012-10-23 14:27:49 -0700 | [diff] [blame] | 68 | * Exception that is thrown when calling {@link #addView} to a secondary display that cannot |
| 69 | * be found. See {@link android.app.Presentation} for more information on secondary displays. |
| 70 | */ |
| 71 | public static class InvalidDisplayException extends RuntimeException { |
| 72 | public InvalidDisplayException() { |
| 73 | } |
| 74 | |
| 75 | public InvalidDisplayException(String name) { |
| 76 | super(name); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /** |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 81 | * Returns the {@link Display} upon which this {@link WindowManager} instance |
| 82 | * will create new windows. |
| 83 | * <p> |
| 84 | * Despite the name of this method, the display that is returned is not |
| 85 | * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}). |
| 86 | * The returned display could instead be a secondary display that this |
| 87 | * window manager instance is managing. Think of it as the display that |
| 88 | * this {@link WindowManager} instance uses by default. |
| 89 | * </p><p> |
| 90 | * To create windows on a different display, you need to obtain a |
| 91 | * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager} |
| 92 | * class documentation for more information.) |
| 93 | * </p> |
| 94 | * |
| 95 | * @return The display that this window manager is managing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | */ |
| 97 | public Display getDefaultDisplay(); |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 98 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 | /** |
| 100 | * Special variation of {@link #removeView} that immediately invokes |
| 101 | * the given view hierarchy's {@link View#onDetachedFromWindow() |
| 102 | * View.onDetachedFromWindow()} methods before returning. This is not |
| 103 | * for normal applications; using it correctly requires great care. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 104 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | * @param view The view to be removed. |
| 106 | */ |
| 107 | public void removeViewImmediate(View view); |
Jeff Brown | d32460c | 2012-07-20 16:15:36 -0700 | [diff] [blame] | 108 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | public static class LayoutParams extends ViewGroup.LayoutParams |
| 110 | implements Parcelable { |
| 111 | /** |
| 112 | * 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] | 113 | * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or |
| 114 | * {@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] | 115 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 116 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 117 | public int x; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 118 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | /** |
| 120 | * Y position for this window. With the default gravity it is ignored. |
| 121 | * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides |
| 122 | * an offset from the given edge. |
| 123 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 124 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 125 | public int y; |
| 126 | |
| 127 | /** |
| 128 | * Indicates how much of the extra space will be allocated horizontally |
| 129 | * to the view associated with these LayoutParams. Specify 0 if the view |
| 130 | * should not be stretched. Otherwise the extra pixels will be pro-rated |
| 131 | * among all views whose weight is greater than 0. |
| 132 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 133 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 134 | public float horizontalWeight; |
| 135 | |
| 136 | /** |
| 137 | * Indicates how much of the extra space will be allocated vertically |
| 138 | * to the view associated with these LayoutParams. Specify 0 if the view |
| 139 | * should not be stretched. Otherwise the extra pixels will be pro-rated |
| 140 | * among all views whose weight is greater than 0. |
| 141 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 142 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 143 | public float verticalWeight; |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 144 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 145 | /** |
| 146 | * The general type of window. There are three main classes of |
| 147 | * window types: |
| 148 | * <ul> |
| 149 | * <li> <strong>Application windows</strong> (ranging from |
| 150 | * {@link #FIRST_APPLICATION_WINDOW} to |
| 151 | * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application |
| 152 | * windows. For these types of windows, the {@link #token} must be |
| 153 | * set to the token of the activity they are a part of (this will |
| 154 | * normally be done for you if {@link #token} is null). |
| 155 | * <li> <strong>Sub-windows</strong> (ranging from |
| 156 | * {@link #FIRST_SUB_WINDOW} to |
| 157 | * {@link #LAST_SUB_WINDOW}) are associated with another top-level |
| 158 | * window. For these types of windows, the {@link #token} must be |
| 159 | * the token of the window it is attached to. |
| 160 | * <li> <strong>System windows</strong> (ranging from |
| 161 | * {@link #FIRST_SYSTEM_WINDOW} to |
| 162 | * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for |
| 163 | * use by the system for specific purposes. They should not normally |
| 164 | * be used by applications, and a special permission is required |
| 165 | * to use them. |
| 166 | * </ul> |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 167 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 168 | * @see #TYPE_BASE_APPLICATION |
| 169 | * @see #TYPE_APPLICATION |
| 170 | * @see #TYPE_APPLICATION_STARTING |
| 171 | * @see #TYPE_APPLICATION_PANEL |
| 172 | * @see #TYPE_APPLICATION_MEDIA |
| 173 | * @see #TYPE_APPLICATION_SUB_PANEL |
| 174 | * @see #TYPE_APPLICATION_ATTACHED_DIALOG |
| 175 | * @see #TYPE_STATUS_BAR |
| 176 | * @see #TYPE_SEARCH_BAR |
| 177 | * @see #TYPE_PHONE |
| 178 | * @see #TYPE_SYSTEM_ALERT |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 179 | * @see #TYPE_TOAST |
| 180 | * @see #TYPE_SYSTEM_OVERLAY |
| 181 | * @see #TYPE_PRIORITY_PHONE |
| 182 | * @see #TYPE_STATUS_BAR_PANEL |
| 183 | * @see #TYPE_SYSTEM_DIALOG |
| 184 | * @see #TYPE_KEYGUARD_DIALOG |
| 185 | * @see #TYPE_SYSTEM_ERROR |
| 186 | * @see #TYPE_INPUT_METHOD |
| 187 | * @see #TYPE_INPUT_METHOD_DIALOG |
| 188 | */ |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 189 | @ViewDebug.ExportedProperty(mapping = { |
| 190 | @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"), |
| 191 | @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"), |
| 192 | @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"), |
| 193 | @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"), |
| 194 | @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"), |
| 195 | @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"), |
| 196 | @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"), |
Scott Anderson | aeb7723 | 2012-05-31 18:55:54 -0700 | [diff] [blame] | 197 | @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 198 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"), |
| 199 | @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"), |
| 200 | @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"), |
| 201 | @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 202 | @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"), |
| 203 | @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"), |
| 204 | @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 205 | @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"), |
| 206 | @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"), |
| 207 | @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"), |
| 208 | @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"), |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 209 | @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"), |
Jeff Brown | bfcb60a | 2011-09-08 18:51:14 -0700 | [diff] [blame] | 210 | @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"), |
| 211 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"), |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 212 | @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"), |
Jeff Brown | bfcb60a | 2011-09-08 18:51:14 -0700 | [diff] [blame] | 213 | @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"), |
| 214 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"), |
| 215 | @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"), |
| 216 | @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"), |
| 217 | @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"), |
Scott Anderson | aeb7723 | 2012-05-31 18:55:54 -0700 | [diff] [blame] | 218 | @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"), |
| 219 | @ViewDebug.IntToString(from = TYPE_HIDDEN_NAV_CONSUMER, to = "TYPE_HIDDEN_NAV_CONSUMER"), |
| 220 | @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"), |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 221 | @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"), |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 222 | @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"), |
keunyoung | a446bf0 | 2013-06-21 19:07:57 -0700 | [diff] [blame] | 223 | @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"), |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 224 | @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"), |
| 225 | @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 226 | }) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 227 | public int type; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 228 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 229 | /** |
| 230 | * Start of window types that represent normal application windows. |
| 231 | */ |
| 232 | public static final int FIRST_APPLICATION_WINDOW = 1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 233 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 234 | /** |
| 235 | * Window type: an application window that serves as the "base" window |
| 236 | * of the overall application; all other application windows will |
| 237 | * appear on top of it. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 238 | * 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] | 239 | */ |
| 240 | public static final int TYPE_BASE_APPLICATION = 1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 241 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 242 | /** |
| 243 | * Window type: a normal application window. The {@link #token} must be |
| 244 | * an Activity token identifying who the window belongs to. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 245 | * 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] | 246 | */ |
| 247 | public static final int TYPE_APPLICATION = 2; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 248 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 249 | /** |
| 250 | * Window type: special application window that is displayed while the |
| 251 | * application is starting. Not for use by applications themselves; |
| 252 | * this is used by the system to display something until the |
| 253 | * application can show its own windows. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 254 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 255 | */ |
| 256 | public static final int TYPE_APPLICATION_STARTING = 3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 257 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 258 | /** |
| 259 | * End of types of application windows. |
| 260 | */ |
| 261 | public static final int LAST_APPLICATION_WINDOW = 99; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 262 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 263 | /** |
| 264 | * Start of types of sub-windows. The {@link #token} of these windows |
| 265 | * must be set to the window they are attached to. These types of |
| 266 | * windows are kept next to their attached window in Z-order, and their |
| 267 | * coordinate space is relative to their attached window. |
| 268 | */ |
| 269 | public static final int FIRST_SUB_WINDOW = 1000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 270 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 271 | /** |
| 272 | * Window type: a panel on top of an application window. These windows |
| 273 | * appear on top of their attached window. |
| 274 | */ |
| 275 | public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 276 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 277 | /** |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 278 | * 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] | 279 | * are displayed behind their attached window. |
| 280 | */ |
| 281 | public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 282 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 283 | /** |
| 284 | * Window type: a sub-panel on top of an application window. These |
| 285 | * windows are displayed on top their attached window and any |
| 286 | * {@link #TYPE_APPLICATION_PANEL} panels. |
| 287 | */ |
| 288 | public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW+2; |
| 289 | |
| 290 | /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout |
| 291 | * of the window happens as that of a top-level window, <em>not</em> |
| 292 | * as a child of its container. |
| 293 | */ |
| 294 | public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 295 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 296 | /** |
Dianne Hackborn | c4d5d02 | 2009-05-21 17:32:42 -0700 | [diff] [blame] | 297 | * Window type: window for showing overlays on top of media windows. |
| 298 | * These windows are displayed between TYPE_APPLICATION_MEDIA and the |
| 299 | * application window. They should be translucent to be useful. This |
| 300 | * is a big ugly hack so: |
| 301 | * @hide |
| 302 | */ |
| 303 | public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 304 | |
Dianne Hackborn | c4d5d02 | 2009-05-21 17:32:42 -0700 | [diff] [blame] | 305 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 306 | * End of types of sub-windows. |
| 307 | */ |
| 308 | public static final int LAST_SUB_WINDOW = 1999; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 309 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 310 | /** |
| 311 | * Start of system-specific window types. These are not normally |
| 312 | * created by applications. |
| 313 | */ |
| 314 | public static final int FIRST_SYSTEM_WINDOW = 2000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 315 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 316 | /** |
| 317 | * Window type: the status bar. There can be only one status bar |
| 318 | * window; it is placed at the top of the screen, and all other |
| 319 | * windows are shifted down so they are below it. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 320 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 321 | */ |
| 322 | public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 323 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 324 | /** |
| 325 | * Window type: the search bar. There can be only one search bar |
| 326 | * window; it is placed at the top of the screen. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 327 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 328 | */ |
| 329 | public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 330 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 331 | /** |
| 332 | * Window type: phone. These are non-application windows providing |
| 333 | * user interaction with the phone (in particular incoming calls). |
| 334 | * These windows are normally placed above all applications, but behind |
| 335 | * the status bar. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 336 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 337 | */ |
| 338 | public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 339 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 340 | /** |
| 341 | * Window type: system window, such as low power alert. These windows |
| 342 | * are always on top of application windows. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 343 | * 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] | 344 | */ |
| 345 | public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3; |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 346 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 347 | /** |
| 348 | * Window type: keyguard window. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 349 | * In multiuser systems shows on all users' windows. |
Jorim Jaggi | e411fdf | 2014-07-28 23:00:44 +0200 | [diff] [blame] | 350 | * @removed |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 351 | */ |
| 352 | public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4; |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 353 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | /** |
| 355 | * Window type: transient notifications. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 356 | * 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] | 357 | */ |
| 358 | public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 359 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 360 | /** |
| 361 | * Window type: system overlay windows, which need to be displayed |
| 362 | * on top of everything else. These windows must not take input |
| 363 | * focus, or they will interfere with the keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 364 | * 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] | 365 | */ |
| 366 | public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 367 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 368 | /** |
| 369 | * Window type: priority phone UI, which needs to be displayed even if |
| 370 | * the keyguard is active. These windows must not take input |
| 371 | * focus, or they will interfere with the keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 372 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 373 | */ |
| 374 | public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 375 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 376 | /** |
| 377 | * Window type: panel that slides out from the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 378 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 379 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 380 | public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 381 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 382 | /** |
| 383 | * Window type: dialogs that the keyguard shows |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 384 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 385 | */ |
| 386 | public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 387 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 388 | /** |
| 389 | * Window type: internal system error windows, appear on top of |
| 390 | * everything they can. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 391 | * 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] | 392 | */ |
| 393 | public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 394 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 395 | /** |
| 396 | * Window type: internal input methods windows, which appear above |
| 397 | * the normal UI. Application windows may be resized or panned to keep |
| 398 | * the input focus visible while this window is displayed. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 399 | * 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] | 400 | */ |
| 401 | public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11; |
| 402 | |
| 403 | /** |
| 404 | * Window type: internal input methods dialog windows, which appear above |
| 405 | * the current input method window. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 406 | * 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] | 407 | */ |
| 408 | public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12; |
| 409 | |
| 410 | /** |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 411 | * Window type: wallpaper window, placed behind any window that wants |
| 412 | * to sit on top of the wallpaper. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 413 | * In multiuser systems shows only on the owning user's window. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 414 | */ |
| 415 | public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13; |
| 416 | |
| 417 | /** |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 418 | * Window type: panel that slides out from over the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 419 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | badc47e | 2009-11-08 17:37:07 -0800 | [diff] [blame] | 420 | */ |
| 421 | public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14; |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 422 | |
| 423 | /** |
| 424 | * Window type: secure system overlay windows, which need to be displayed |
| 425 | * on top of everything else. These windows must not take input |
| 426 | * focus, or they will interfere with the keyguard. |
| 427 | * |
| 428 | * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the |
| 429 | * system itself is allowed to create these overlays. Applications cannot |
| 430 | * obtain permission to create secure system overlays. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 431 | * |
| 432 | * In multiuser systems shows only on the owning user's window. |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 433 | * @hide |
| 434 | */ |
| 435 | public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15; |
| 436 | |
Dianne Hackborn | badc47e | 2009-11-08 17:37:07 -0800 | [diff] [blame] | 437 | /** |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 438 | * Window type: the drag-and-drop pseudowindow. There is only one |
| 439 | * 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] | 440 | * In multiuser systems shows only on the owning user's window. |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 441 | * @hide |
| 442 | */ |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 443 | public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16; |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 444 | |
| 445 | /** |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 446 | * Window type: panel that slides out from under the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 447 | * In multiuser systems shows on all users' windows. |
Joe Onorato | a89e903 | 2010-11-24 11:13:44 -0800 | [diff] [blame] | 448 | * @hide |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 449 | */ |
| 450 | public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17; |
| 451 | |
Jeff Brown | 83c0968 | 2010-12-23 17:50:18 -0800 | [diff] [blame] | 452 | /** |
| 453 | * Window type: (mouse) pointer |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 454 | * In multiuser systems shows on all users' windows. |
Jeff Brown | 83c0968 | 2010-12-23 17:50:18 -0800 | [diff] [blame] | 455 | * @hide |
| 456 | */ |
| 457 | public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18; |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 458 | |
| 459 | /** |
Daniel Sandler | 8956dbb | 2011-04-22 07:55:02 -0400 | [diff] [blame] | 460 | * Window type: Navigation bar (when distinct from status bar) |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 461 | * In multiuser systems shows on all users' windows. |
Daniel Sandler | 8956dbb | 2011-04-22 07:55:02 -0400 | [diff] [blame] | 462 | * @hide |
| 463 | */ |
| 464 | public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19; |
| 465 | |
| 466 | /** |
Dianne Hackborn | e8ecde1 | 2011-08-03 18:55:19 -0700 | [diff] [blame] | 467 | * Window type: The volume level overlay/dialog shown when the user |
| 468 | * changes the system volume. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 469 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | e8ecde1 | 2011-08-03 18:55:19 -0700 | [diff] [blame] | 470 | * @hide |
| 471 | */ |
| 472 | public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20; |
| 473 | |
| 474 | /** |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 475 | * Window type: The boot progress dialog, goes on top of everything |
| 476 | * in the world. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 477 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 478 | * @hide |
| 479 | */ |
| 480 | public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21; |
| 481 | |
| 482 | /** |
Dianne Hackborn | df89e65 | 2011-10-06 22:35:11 -0700 | [diff] [blame] | 483 | * Window type: Fake window to consume touch events when the navigation |
| 484 | * bar is hidden. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 485 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | df89e65 | 2011-10-06 22:35:11 -0700 | [diff] [blame] | 486 | * @hide |
| 487 | */ |
| 488 | public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22; |
| 489 | |
| 490 | /** |
Daniel Sandler | 7d276c3 | 2012-01-30 14:33:52 -0500 | [diff] [blame] | 491 | * Window type: Dreams (screen saver) window, just above keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 492 | * In multiuser systems shows only on the owning user's window. |
Daniel Sandler | 7d276c3 | 2012-01-30 14:33:52 -0500 | [diff] [blame] | 493 | * @hide |
| 494 | */ |
| 495 | public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23; |
| 496 | |
| 497 | /** |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 498 | * 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] | 499 | * In multiuser systems shows on all users' windows. |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 500 | * @hide |
| 501 | */ |
| 502 | public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24; |
| 503 | |
| 504 | /** |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 505 | * Window type: Display overlay window. Used to simulate secondary display devices. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 506 | * In multiuser systems shows on all users' windows. |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 507 | * @hide |
| 508 | */ |
| 509 | public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26; |
| 510 | |
| 511 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 512 | * Window type: Magnification overlay window. Used to highlight the magnified |
| 513 | * portion of a display when accessibility magnification is enabled. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 514 | * In multiuser systems shows on all users' windows. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 515 | * @hide |
| 516 | */ |
| 517 | public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27; |
| 518 | |
| 519 | /** |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 520 | * Window type: keyguard scrim window. Shows if keyguard needs to be restarted. |
| 521 | * In multiuser systems shows on all users' windows. |
| 522 | * @hide |
| 523 | */ |
| 524 | public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29; |
| 525 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 526 | /** |
keunyoung | a446bf0 | 2013-06-21 19:07:57 -0700 | [diff] [blame] | 527 | * Window type: Window for Presentation on top of private |
| 528 | * virtual display. |
| 529 | */ |
| 530 | public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30; |
| 531 | |
| 532 | /** |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 533 | * Window type: Windows in the voice interaction layer. |
| 534 | * @hide |
| 535 | */ |
| 536 | public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31; |
| 537 | |
| 538 | /** |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 539 | * Window type: Windows that are overlaid <em>only</em> by an {@link |
| 540 | * android.accessibilityservice.AccessibilityService} for interception of |
| 541 | * user interactions without changing the windows an accessibility service |
| 542 | * can introspect. In particular, an accessibility service can introspect |
| 543 | * only windows that a sighted user can interact with which is they can touch |
| 544 | * these windows or can type into these windows. For example, if there |
| 545 | * is a full screen accessibility overlay that is touchable, the windows |
| 546 | * below it will be introspectable by an accessibility service regardless |
| 547 | * they are covered by a touchable window. |
| 548 | */ |
| 549 | public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32; |
| 550 | |
| 551 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 552 | * End of types of system windows. |
| 553 | */ |
| 554 | public static final int LAST_SYSTEM_WINDOW = 2999; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 555 | |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 556 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
| 557 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 558 | public static final int MEMORY_TYPE_NORMAL = 0; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 559 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
Mathias Agopian | 317a628 | 2009-08-13 17:29:02 -0700 | [diff] [blame] | 560 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 561 | public static final int MEMORY_TYPE_HARDWARE = 1; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 562 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
Mathias Agopian | 317a628 | 2009-08-13 17:29:02 -0700 | [diff] [blame] | 563 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 564 | public static final int MEMORY_TYPE_GPU = 2; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 565 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
| 566 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 567 | public static final int MEMORY_TYPE_PUSH_BUFFERS = 3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 568 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 569 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 570 | * @deprecated this is ignored |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 571 | */ |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 572 | @Deprecated |
| 573 | public int memoryType; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 574 | |
Mike Lockwood | ef73162 | 2010-01-27 17:51:34 -0500 | [diff] [blame] | 575 | /** Window flag: as long as this window is visible to the user, allow |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 576 | * the lock screen to activate while the screen is on. |
| 577 | * This can be used independently, or in combination with |
Christopher Tate | 95f7850 | 2010-01-29 15:57:34 -0800 | [diff] [blame] | 578 | * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */ |
Mike Lockwood | ef73162 | 2010-01-27 17:51:34 -0500 | [diff] [blame] | 579 | public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001; |
| 580 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 581 | /** Window flag: everything behind this window will be dimmed. |
| 582 | * Use {@link #dimAmount} to control the amount of dim. */ |
| 583 | public static final int FLAG_DIM_BEHIND = 0x00000002; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 584 | |
| 585 | /** Window flag: blur everything behind this window. |
| 586 | * @deprecated Blurring is no longer supported. */ |
| 587 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 588 | public static final int FLAG_BLUR_BEHIND = 0x00000004; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 589 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 590 | /** Window flag: this window won't ever get key input focus, so the |
| 591 | * user can not send key or other button events to it. Those will |
| 592 | * instead go to whatever focusable window is behind it. This flag |
| 593 | * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that |
| 594 | * is explicitly set. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 595 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 596 | * <p>Setting this flag also implies that the window will not need to |
| 597 | * interact with |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 598 | * 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] | 599 | * independently of any active input method (typically this means it |
| 600 | * gets Z-ordered on top of the input method, so it can use the full |
| 601 | * screen for its content and cover the input method if needed. You |
| 602 | * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */ |
| 603 | public static final int FLAG_NOT_FOCUSABLE = 0x00000008; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 604 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | /** Window flag: this window can never receive touch events. */ |
| 606 | public static final int FLAG_NOT_TOUCHABLE = 0x00000010; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 607 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 608 | /** Window flag: even when this window is focusable (its |
| 609 | * {@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] | 610 | * outside of the window to be sent to the windows behind it. Otherwise |
| 611 | * it will consume all pointer events itself, regardless of whether they |
| 612 | * are inside of the window. */ |
| 613 | public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 614 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 615 | /** 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] | 616 | * screen is pressed, you will receive this first touch event. Usually |
| 617 | * the first touch event is consumed by the system since the user can |
| 618 | * not see what they are pressing on. |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 619 | * |
| 620 | * @deprecated This flag has no effect. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 621 | */ |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 622 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 623 | public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 624 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 625 | /** Window flag: as long as this window is visible to the user, keep |
| 626 | * the device's screen turned on and bright. */ |
| 627 | public static final int FLAG_KEEP_SCREEN_ON = 0x00000080; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 628 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 629 | /** Window flag: place the window within the entire screen, ignoring |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 630 | * decorations around the border (such as the status bar). The |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 631 | * window must correctly position its contents to take the screen |
| 632 | * decoration into account. This flag is normally set for you |
| 633 | * by Window as described in {@link Window#setFlags}. */ |
| 634 | public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 635 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 636 | /** Window flag: allow window to extend outside of the screen. */ |
| 637 | public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 638 | |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 639 | /** |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 640 | * 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] | 641 | * this window is displayed. This allows the window to use the entire |
| 642 | * display space for itself -- the status bar will be hidden when |
Chet Haase | 45c89c2 | 2013-04-29 16:04:40 -0700 | [diff] [blame] | 643 | * an app window with this flag set is on the top layer. A fullscreen window |
| 644 | * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's |
| 645 | * {@link #softInputMode} field; the window will stay fullscreen |
| 646 | * and will not resize. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 647 | * |
| 648 | * <p>This flag can be controlled in your theme through the |
| 649 | * {@link android.R.attr#windowFullscreen} attribute; this attribute |
| 650 | * is automatically set for you in the standard fullscreen themes |
| 651 | * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen}, |
| 652 | * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen}, |
| 653 | * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen}, |
| 654 | * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen}, |
| 655 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen}, |
| 656 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and |
| 657 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p> |
| 658 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 659 | public static final int FLAG_FULLSCREEN = 0x00000400; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 660 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 661 | /** Window flag: override {@link #FLAG_FULLSCREEN} and force the |
| 662 | * screen decorations (such as the status bar) to be shown. */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 663 | public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 664 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 665 | /** Window flag: turn on dithering when compositing this window to |
Jeff Brown | 3cc321e | 2012-07-16 16:04:23 -0700 | [diff] [blame] | 666 | * the screen. |
| 667 | * @deprecated This flag is no longer used. */ |
| 668 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 669 | public static final int FLAG_DITHER = 0x00001000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 670 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 671 | /** Window flag: treat the content of the window as secure, preventing |
Jeff Brown | f0681b3 | 2012-10-23 17:35:57 -0700 | [diff] [blame] | 672 | * it from appearing in screenshots or from being viewed on non-secure |
| 673 | * displays. |
| 674 | * |
| 675 | * <p>See {@link android.view.Display#FLAG_SECURE} for more details about |
| 676 | * secure surfaces and secure displays. |
| 677 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 678 | public static final int FLAG_SECURE = 0x00002000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 679 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 680 | /** Window flag: a special mode where the layout parameters are used |
| 681 | * to perform scaling of the surface when it is composited to the |
| 682 | * screen. */ |
| 683 | public static final int FLAG_SCALED = 0x00004000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 684 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 685 | /** Window flag: intended for windows that will often be used when the user is |
| 686 | * holding the screen against their face, it will aggressively filter the event |
| 687 | * stream to prevent unintended presses in this situation that may not be |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 688 | * 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] | 689 | * application will receive a CANCEL motion event to indicate this so applications |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 690 | * 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] | 691 | * until the finger is released. */ |
| 692 | public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 693 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 694 | /** Window flag: a special option only for use in combination with |
| 695 | * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the |
| 696 | * screen your window may appear on top of or behind screen decorations |
| 697 | * such as the status bar. By also including this flag, the window |
| 698 | * manager will report the inset rectangle needed to ensure your |
| 699 | * content is not covered by screen decorations. This flag is normally |
| 700 | * set for you by Window as described in {@link Window#setFlags}.*/ |
| 701 | public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 702 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 703 | /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with |
| 704 | * respect to how this window interacts with the current method. That |
| 705 | * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the |
| 706 | * window will behave as if it needs to interact with the input method |
| 707 | * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is |
| 708 | * not set and this flag is set, then the window will behave as if it |
| 709 | * doesn't need to interact with the input method and can be placed |
| 710 | * to use more space and cover the input method. |
| 711 | */ |
| 712 | public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 713 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 714 | /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you |
| 715 | * can set this flag to receive a single special MotionEvent with |
| 716 | * the action |
| 717 | * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for |
| 718 | * touches that occur outside of your window. Note that you will not |
| 719 | * receive the full down/move/up gesture, only the location of the |
| 720 | * first down as an ACTION_OUTSIDE. |
| 721 | */ |
| 722 | public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 723 | |
Suchi Amalapurapu | d1a9337 | 2009-05-14 17:54:31 -0700 | [diff] [blame] | 724 | /** Window flag: special flag to let windows be shown when the screen |
| 725 | * is locked. This will let application windows take precedence over |
| 726 | * key guard or any other lock screens. Can be used with |
| 727 | * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 728 | * directly before showing the key guard window. Can be used with |
| 729 | * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss |
| 730 | * non-secure keyguards. This flag only applies to the top-most |
| 731 | * full-screen window. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 732 | */ |
Suchi Amalapurapu | d1a9337 | 2009-05-14 17:54:31 -0700 | [diff] [blame] | 733 | public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000; |
| 734 | |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 735 | /** Window flag: ask that the system wallpaper be shown behind |
| 736 | * your window. The window surface must be translucent to be able |
| 737 | * to actually see the wallpaper behind it; this flag just ensures |
| 738 | * that the wallpaper surface will be there if this window actually |
| 739 | * has translucent regions. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 740 | * |
| 741 | * <p>This flag can be controlled in your theme through the |
| 742 | * {@link android.R.attr#windowShowWallpaper} attribute; this attribute |
| 743 | * is automatically set for you in the standard wallpaper themes |
| 744 | * such as {@link android.R.style#Theme_Wallpaper}, |
| 745 | * {@link android.R.style#Theme_Wallpaper_NoTitleBar}, |
| 746 | * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen}, |
| 747 | * {@link android.R.style#Theme_Holo_Wallpaper}, |
| 748 | * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar}, |
| 749 | * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and |
| 750 | * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p> |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 751 | */ |
| 752 | public static final int FLAG_SHOW_WALLPAPER = 0x00100000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 753 | |
Dianne Hackborn | 93e462b | 2009-09-15 22:50:40 -0700 | [diff] [blame] | 754 | /** Window flag: when set as a window is being added or made |
| 755 | * visible, once the window has been shown then the system will |
| 756 | * poke the power manager's user activity (as if the user had woken |
| 757 | * up the device) to turn the screen on. */ |
| 758 | public static final int FLAG_TURN_SCREEN_ON = 0x00200000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 759 | |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 760 | /** Window flag: when set the window will cause the keyguard to |
| 761 | * be dismissed, only if it is not a secure lock keyguard. Because such |
| 762 | * a keyguard is not needed for security, it will never re-appear if |
| 763 | * the user navigates to another window (in contrast to |
| 764 | * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily |
| 765 | * hide both secure and non-secure keyguards but ensure they reappear |
| 766 | * when the user moves to another UI that doesn't hide them). |
| 767 | * If the keyguard is currently active and is secure (requires an |
| 768 | * unlock pattern) than the user will still need to confirm it before |
| 769 | * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has |
Daniel Sandler | ae069f7 | 2010-06-17 21:56:26 -0400 | [diff] [blame] | 770 | * also been set. |
| 771 | */ |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 772 | public static final int FLAG_DISMISS_KEYGUARD = 0x00400000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 773 | |
Jeff Brown | 01ce2e9 | 2010-09-26 22:20:12 -0700 | [diff] [blame] | 774 | /** Window flag: when set the window will accept for touch events |
| 775 | * outside of its bounds to be sent to other windows that also |
| 776 | * support split touch. When this flag is not set, the first pointer |
| 777 | * that goes down determines the window to which all subsequent touches |
| 778 | * go until all pointers go up. When this flag is set, each pointer |
| 779 | * (not necessarily the first) that goes down determines the window |
| 780 | * to which all subsequent touches of that pointer will go until that |
| 781 | * pointer goes up thereby enabling touches with multiple pointers |
| 782 | * to be split across multiple windows. |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 783 | */ |
Jeff Brown | 01ce2e9 | 2010-09-26 22:20:12 -0700 | [diff] [blame] | 784 | public static final int FLAG_SPLIT_TOUCH = 0x00800000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 785 | |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 786 | /** |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 787 | * <p>Indicates whether this window should be hardware accelerated. |
| 788 | * Requesting hardware acceleration does not guarantee it will happen.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 789 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 790 | * <p>This flag can be controlled programmatically <em>only</em> to enable |
| 791 | * hardware acceleration. To enable hardware acceleration for a given |
| 792 | * window programmatically, do the following:</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 793 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 794 | * <pre> |
| 795 | * Window w = activity.getWindow(); // in Activity's onCreate() for instance |
| 796 | * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, |
| 797 | * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); |
| 798 | * </pre> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 799 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 800 | * <p>It is important to remember that this flag <strong>must</strong> |
| 801 | * 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] | 802 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 803 | * <p>This flag cannot be used to disable hardware acceleration after it |
| 804 | * was enabled in your manifest using |
| 805 | * {@link android.R.attr#hardwareAccelerated}. If you need to selectively |
| 806 | * and programmatically disable hardware acceleration (for automated testing |
| 807 | * for instance), make sure it is turned off in your manifest and enable it |
| 808 | * on your activity or dialog when you need it instead, using the method |
| 809 | * described above.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 810 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 811 | * <p>This flag is automatically set by the system if the |
| 812 | * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated} |
| 813 | * 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] | 814 | */ |
| 815 | public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000; |
Daniel Sandler | 611fae4 | 2010-06-17 10:45:00 -0400 | [diff] [blame] | 816 | |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 817 | /** |
| 818 | * Window flag: allow window contents to extend in to the screen's |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 819 | * overscan area, if there is one. The window should still correctly |
| 820 | * position its contents to take the overscan area into account. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 821 | * |
| 822 | * <p>This flag can be controlled in your theme through the |
| 823 | * {@link android.R.attr#windowOverscan} attribute; this attribute |
| 824 | * is automatically set for you in the standard overscan themes |
Ying Wang | 4e0eb22 | 2013-04-18 20:39:48 -0700 | [diff] [blame] | 825 | * such as |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 826 | * {@link android.R.style#Theme_Holo_NoActionBar_Overscan}, |
| 827 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan}, |
| 828 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and |
| 829 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p> |
| 830 | * |
| 831 | * <p>When this flag is enabled for a window, its normal content may be obscured |
| 832 | * to some degree by the overscan region of the display. To ensure key parts of |
| 833 | * that content are visible to the user, you can use |
| 834 | * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)} |
| 835 | * to set the point in the view hierarchy where the appropriate offsets should |
| 836 | * be applied. (This can be done either by directly calling this function, using |
| 837 | * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy, |
| 838 | * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect) |
| 839 | * View.fitSystemWindows(Rect)} method).</p> |
| 840 | * |
| 841 | * <p>This mechanism for positioning content elements is identical to its equivalent |
| 842 | * use with layout and {@link View#setSystemUiVisibility(int) |
| 843 | * View.setSystemUiVisibility(int)}; here is an example layout that will correctly |
| 844 | * position its UI elements with this overscan flag is set:</p> |
| 845 | * |
| 846 | * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete} |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 847 | */ |
| 848 | public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000; |
| 849 | |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 850 | /** |
| 851 | * Window flag: request a translucent status bar with minimal system-provided |
| 852 | * background protection. |
| 853 | * |
| 854 | * <p>This flag can be controlled in your theme through the |
| 855 | * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute |
| 856 | * is automatically set for you in the standard translucent decor themes |
| 857 | * such as |
| 858 | * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor}, |
| 859 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor}, |
| 860 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and |
| 861 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p> |
| 862 | * |
| 863 | * <p>When this flag is enabled for a window, it automatically sets |
| 864 | * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and |
| 865 | * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p> |
| 866 | */ |
| 867 | public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000; |
| 868 | |
| 869 | /** |
| 870 | * Window flag: request a translucent navigation bar with minimal system-provided |
| 871 | * background protection. |
| 872 | * |
| 873 | * <p>This flag can be controlled in your theme through the |
| 874 | * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute |
| 875 | * is automatically set for you in the standard translucent decor themes |
| 876 | * such as |
| 877 | * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor}, |
| 878 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor}, |
| 879 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and |
| 880 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p> |
| 881 | * |
| 882 | * <p>When this flag is enabled for a window, it automatically sets |
| 883 | * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and |
| 884 | * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p> |
| 885 | */ |
| 886 | public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000; |
| 887 | |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 888 | /** |
| 889 | * Flag for a window in local focus mode. |
| 890 | * Window in local focus mode can control focus independent of window manager using |
| 891 | * {@link Window#setLocalFocus(boolean, boolean)}. |
| 892 | * Usually window in this mode will not get touch/key events from window manager, but will |
| 893 | * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}. |
| 894 | */ |
| 895 | public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000; |
| 896 | |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 897 | /** Window flag: Enable touches to slide out of a window into neighboring |
| 898 | * windows in mid-gesture instead of being captured for the duration of |
| 899 | * the gesture. |
| 900 | * |
| 901 | * This flag changes the behavior of touch focus for this window only. |
| 902 | * Touches can slide out of the window but they cannot necessarily slide |
| 903 | * back in (unless the other window with touch focus permits it). |
| 904 | * |
| 905 | * {@hide} |
| 906 | */ |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 907 | public static final int FLAG_SLIPPERY = 0x20000000; |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 908 | |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 909 | /** |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 910 | * Window flag: When requesting layout with an attached window, the attached window may |
| 911 | * overlap with the screen decorations of the parent window such as the navigation bar. By |
| 912 | * including this flag, the window manager will layout the attached window within the decor |
| 913 | * frame of the parent window such that it doesn't overlap with screen decorations. |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 914 | */ |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 915 | public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000; |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 916 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 917 | /** |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 918 | * Flag indicating that this Window is responsible for drawing the background for the |
| 919 | * system bars. If set, the system bars are drawn with a transparent background and the |
| 920 | * corresponding areas in this window are filled with the colors specified in |
| 921 | * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}. |
| 922 | */ |
| 923 | public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000; |
| 924 | |
| 925 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 926 | * Various behavioral options/flags. Default is none. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 927 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 928 | * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON |
| 929 | * @see #FLAG_DIM_BEHIND |
| 930 | * @see #FLAG_NOT_FOCUSABLE |
| 931 | * @see #FLAG_NOT_TOUCHABLE |
| 932 | * @see #FLAG_NOT_TOUCH_MODAL |
| 933 | * @see #FLAG_TOUCHABLE_WHEN_WAKING |
| 934 | * @see #FLAG_KEEP_SCREEN_ON |
| 935 | * @see #FLAG_LAYOUT_IN_SCREEN |
| 936 | * @see #FLAG_LAYOUT_NO_LIMITS |
| 937 | * @see #FLAG_FULLSCREEN |
| 938 | * @see #FLAG_FORCE_NOT_FULLSCREEN |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 939 | * @see #FLAG_SECURE |
| 940 | * @see #FLAG_SCALED |
| 941 | * @see #FLAG_IGNORE_CHEEK_PRESSES |
| 942 | * @see #FLAG_LAYOUT_INSET_DECOR |
| 943 | * @see #FLAG_ALT_FOCUSABLE_IM |
| 944 | * @see #FLAG_WATCH_OUTSIDE_TOUCH |
| 945 | * @see #FLAG_SHOW_WHEN_LOCKED |
| 946 | * @see #FLAG_SHOW_WALLPAPER |
| 947 | * @see #FLAG_TURN_SCREEN_ON |
| 948 | * @see #FLAG_DISMISS_KEYGUARD |
| 949 | * @see #FLAG_SPLIT_TOUCH |
| 950 | * @see #FLAG_HARDWARE_ACCELERATED |
keunyoung | 30f420f | 2013-08-02 14:23:10 -0700 | [diff] [blame] | 951 | * @see #FLAG_LOCAL_FOCUS_MODE |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 952 | * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 953 | */ |
| 954 | @ViewDebug.ExportedProperty(flagMapping = { |
| 955 | @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, |
| 956 | name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"), |
| 957 | @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND, |
| 958 | name = "FLAG_DIM_BEHIND"), |
| 959 | @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND, |
| 960 | name = "FLAG_BLUR_BEHIND"), |
| 961 | @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE, |
| 962 | name = "FLAG_NOT_FOCUSABLE"), |
| 963 | @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE, |
| 964 | name = "FLAG_NOT_TOUCHABLE"), |
| 965 | @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL, |
| 966 | name = "FLAG_NOT_TOUCH_MODAL"), |
| 967 | @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING, |
| 968 | name = "FLAG_TOUCHABLE_WHEN_WAKING"), |
| 969 | @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON, |
| 970 | name = "FLAG_KEEP_SCREEN_ON"), |
| 971 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN, |
| 972 | name = "FLAG_LAYOUT_IN_SCREEN"), |
| 973 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS, |
| 974 | name = "FLAG_LAYOUT_NO_LIMITS"), |
| 975 | @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN, |
| 976 | name = "FLAG_FULLSCREEN"), |
| 977 | @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN, |
| 978 | name = "FLAG_FORCE_NOT_FULLSCREEN"), |
| 979 | @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER, |
| 980 | name = "FLAG_DITHER"), |
| 981 | @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE, |
| 982 | name = "FLAG_SECURE"), |
| 983 | @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED, |
| 984 | name = "FLAG_SCALED"), |
| 985 | @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES, |
| 986 | name = "FLAG_IGNORE_CHEEK_PRESSES"), |
| 987 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR, |
| 988 | name = "FLAG_LAYOUT_INSET_DECOR"), |
| 989 | @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM, |
| 990 | name = "FLAG_ALT_FOCUSABLE_IM"), |
| 991 | @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH, |
| 992 | name = "FLAG_WATCH_OUTSIDE_TOUCH"), |
| 993 | @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED, |
| 994 | name = "FLAG_SHOW_WHEN_LOCKED"), |
| 995 | @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER, |
| 996 | name = "FLAG_SHOW_WALLPAPER"), |
| 997 | @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON, |
| 998 | name = "FLAG_TURN_SCREEN_ON"), |
| 999 | @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD, |
| 1000 | name = "FLAG_DISMISS_KEYGUARD"), |
| 1001 | @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH, |
| 1002 | name = "FLAG_SPLIT_TOUCH"), |
| 1003 | @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED, |
keunyoung | 30f420f | 2013-08-02 14:23:10 -0700 | [diff] [blame] | 1004 | name = "FLAG_HARDWARE_ACCELERATED"), |
| 1005 | @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE, |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1006 | name = "FLAG_LOCAL_FOCUS_MODE"), |
| 1007 | @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS, |
| 1008 | name = "FLAG_TRANSLUCENT_STATUS"), |
| 1009 | @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION, |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 1010 | name = "FLAG_TRANSLUCENT_NAVIGATION"), |
| 1011 | @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, |
| 1012 | name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS") |
Jon Miranda | 4597e98 | 2014-07-29 07:25:49 -0700 | [diff] [blame] | 1013 | }, formatToHexString = true) |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1014 | public int flags; |
| 1015 | |
| 1016 | /** |
John Reck | 61375a8 | 2014-09-18 19:27:48 +0000 | [diff] [blame] | 1017 | * If the window has requested hardware acceleration, but this is not |
| 1018 | * allowed in the process it is in, then still render it as if it is |
| 1019 | * hardware accelerated. This is used for the starting preview windows |
| 1020 | * in the system process, which don't need to have the overhead of |
| 1021 | * hardware acceleration (they are just a static rendering), but should |
| 1022 | * be rendered as such to match the actual window of the app even if it |
| 1023 | * is hardware accelerated. |
| 1024 | * Even if the window isn't hardware accelerated, still do its rendering |
| 1025 | * as if it was. |
| 1026 | * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows |
| 1027 | * that need hardware acceleration (e.g. LockScreen), where hardware acceleration |
| 1028 | * is generally disabled. This flag must be specified in addition to |
| 1029 | * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system |
| 1030 | * windows. |
| 1031 | * |
| 1032 | * @hide |
| 1033 | */ |
| 1034 | public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001; |
| 1035 | |
| 1036 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1037 | * In the system process, we globally do not use hardware acceleration |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1038 | * because there are many threads doing UI there and they conflict. |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1039 | * If certain parts of the UI that really do want to use hardware |
| 1040 | * acceleration, this flag can be set to force it. This is basically |
| 1041 | * for the lock screen. Anyone else using it, you are probably wrong. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1042 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1043 | * @hide |
| 1044 | */ |
| 1045 | public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002; |
| 1046 | |
| 1047 | /** |
Chet Haase | a8e5a2b | 2011-10-28 13:18:16 -0700 | [diff] [blame] | 1048 | * 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] | 1049 | * 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] | 1050 | * them (they do not affect the wallpaper scrolling operation) by calling |
| 1051 | * {@link |
| 1052 | * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}. |
| 1053 | * |
| 1054 | * @hide |
| 1055 | */ |
| 1056 | public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004; |
| 1057 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1058 | /** In a multiuser system if this flag is set and the owner is a system process then this |
| 1059 | * window will appear on all user screens. This overrides the default behavior of window |
| 1060 | * types that normally only appear on the owning user's screen. Refer to each window type |
| 1061 | * to determine its default behavior. |
| 1062 | * |
| 1063 | * {@hide} */ |
| 1064 | public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010; |
| 1065 | |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 1066 | /** |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1067 | * Never animate position changes of the window. |
| 1068 | * |
| 1069 | * {@hide} */ |
| 1070 | public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040; |
| 1071 | |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 1072 | /** Window flag: special flag to limit the size of the window to be |
| 1073 | * original size ([320x480] x density). Used to create window for applications |
| 1074 | * running under compatibility mode. |
| 1075 | * |
| 1076 | * {@hide} */ |
| 1077 | public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080; |
| 1078 | |
| 1079 | /** Window flag: a special option intended for system dialogs. When |
| 1080 | * this flag is set, the window will demand focus unconditionally when |
| 1081 | * it is created. |
| 1082 | * {@hide} */ |
| 1083 | public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100; |
| 1084 | |
John Spurlock | 3f7cd51 | 2013-10-07 12:25:09 -0400 | [diff] [blame] | 1085 | /** Window flag: maintain the previous translucent decor state when this window |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1086 | * becomes top-most. |
| 1087 | * {@hide} */ |
| 1088 | public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200; |
| 1089 | |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1090 | /** |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 1091 | * Flag whether the current window is a keyguard window, meaning that it will hide all other |
| 1092 | * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set. |
| 1093 | * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}. |
| 1094 | * {@hide} |
| 1095 | */ |
| 1096 | public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400; |
| 1097 | |
| 1098 | /** |
Filip Gruszczynski | b8c0694 | 2014-12-04 15:02:18 -0800 | [diff] [blame] | 1099 | * Flag that prevents the wallpaper behind the current window from receiving touch events. |
| 1100 | * |
| 1101 | * {@hide} |
| 1102 | */ |
| 1103 | public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800; |
| 1104 | |
| 1105 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1106 | * Control flags that are private to the platform. |
| 1107 | * @hide |
| 1108 | */ |
| 1109 | public int privateFlags; |
| 1110 | |
| 1111 | /** |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1112 | * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it |
| 1113 | * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu |
| 1114 | * key. For this case, we should look at windows behind it to determine the appropriate |
| 1115 | * value. |
| 1116 | * |
| 1117 | * @hide |
| 1118 | */ |
| 1119 | public static final int NEEDS_MENU_UNSET = 0; |
| 1120 | |
| 1121 | /** |
| 1122 | * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a |
| 1123 | * menu key. |
| 1124 | * |
| 1125 | * @hide |
| 1126 | */ |
| 1127 | public static final int NEEDS_MENU_SET_TRUE = 1; |
| 1128 | |
| 1129 | /** |
| 1130 | * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't |
| 1131 | * needs a menu key. |
| 1132 | * |
| 1133 | * @hide |
| 1134 | */ |
| 1135 | public static final int NEEDS_MENU_SET_FALSE = 2; |
| 1136 | |
| 1137 | /** |
| 1138 | * State variable for a window belonging to an activity that responds to |
| 1139 | * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a |
| 1140 | * physical button this variable is ignored, but on devices where the Menu key is drawn in |
| 1141 | * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}. |
| 1142 | * |
| 1143 | * (Note that Action Bars, when available, are the preferred way to offer additional |
| 1144 | * functions otherwise accessed via an options menu.) |
| 1145 | * |
| 1146 | * {@hide} |
| 1147 | */ |
| 1148 | public int needsMenuKey = NEEDS_MENU_UNSET; |
| 1149 | |
| 1150 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1151 | * Given a particular set of window manager flags, determine whether |
| 1152 | * such a window may be a target for an input method when it has |
| 1153 | * focus. In particular, this checks the |
| 1154 | * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM} |
| 1155 | * flags and returns true if the combination of the two corresponds |
| 1156 | * to a window that needs to be behind the input method so that the |
| 1157 | * user can type into it. |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1158 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1159 | * @param flags The current window manager flags. |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1160 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1161 | * @return Returns true if such a window should be behind/interact |
| 1162 | * with an input method, false if not. |
| 1163 | */ |
| 1164 | public static boolean mayUseInputMethod(int flags) { |
| 1165 | switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) { |
| 1166 | case 0: |
| 1167 | case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM: |
| 1168 | return true; |
| 1169 | } |
| 1170 | return false; |
| 1171 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1172 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1173 | /** |
| 1174 | * Mask for {@link #softInputMode} of the bits that determine the |
| 1175 | * desired visibility state of the soft input area for this window. |
| 1176 | */ |
| 1177 | public static final int SOFT_INPUT_MASK_STATE = 0x0f; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1178 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1179 | /** |
| 1180 | * Visibility state for {@link #softInputMode}: no state has been specified. |
| 1181 | */ |
| 1182 | public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1183 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1184 | /** |
| 1185 | * Visibility state for {@link #softInputMode}: please don't change the state of |
| 1186 | * the soft input area. |
| 1187 | */ |
| 1188 | public static final int SOFT_INPUT_STATE_UNCHANGED = 1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1189 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1190 | /** |
| 1191 | * Visibility state for {@link #softInputMode}: please hide any soft input |
| 1192 | * area when normally appropriate (when the user is navigating |
| 1193 | * forward to your window). |
| 1194 | */ |
| 1195 | public static final int SOFT_INPUT_STATE_HIDDEN = 2; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1196 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1197 | /** |
| 1198 | * Visibility state for {@link #softInputMode}: please always hide any |
| 1199 | * soft input area when this window receives focus. |
| 1200 | */ |
| 1201 | public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1202 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1203 | /** |
| 1204 | * Visibility state for {@link #softInputMode}: please show the soft |
| 1205 | * input area when normally appropriate (when the user is navigating |
| 1206 | * forward to your window). |
| 1207 | */ |
| 1208 | public static final int SOFT_INPUT_STATE_VISIBLE = 4; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1209 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1210 | /** |
| 1211 | * Visibility state for {@link #softInputMode}: please always make the |
| 1212 | * soft input area visible when this window receives input focus. |
| 1213 | */ |
| 1214 | public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1215 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1216 | /** |
| 1217 | * Mask for {@link #softInputMode} of the bits that determine the |
| 1218 | * way that the window should be adjusted to accommodate the soft |
| 1219 | * input window. |
| 1220 | */ |
| 1221 | public static final int SOFT_INPUT_MASK_ADJUST = 0xf0; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1222 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1223 | /** Adjustment option for {@link #softInputMode}: nothing specified. |
| 1224 | * The system will try to pick one or |
| 1225 | * the other depending on the contents of the window. |
| 1226 | */ |
| 1227 | public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1228 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1229 | /** Adjustment option for {@link #softInputMode}: set to allow the |
| 1230 | * window to be resized when an input |
| 1231 | * 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] | 1232 | * method. This can <em>not</em> be combined with |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1233 | * {@link #SOFT_INPUT_ADJUST_PAN}; if |
| 1234 | * 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] | 1235 | * the other depending on the contents of the window. If the window's |
| 1236 | * layout parameter flags include {@link #FLAG_FULLSCREEN}, this |
| 1237 | * value for {@link #softInputMode} will be ignored; the window will |
| 1238 | * not resize, but will stay fullscreen. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1239 | */ |
| 1240 | public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1241 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1242 | /** Adjustment option for {@link #softInputMode}: set to have a window |
| 1243 | * pan when an input method is |
| 1244 | * shown, so it doesn't need to deal with resizing but just panned |
| 1245 | * by the framework to ensure the current input focus is visible. This |
Scott Main | f10e633 | 2010-06-11 09:03:22 -0700 | [diff] [blame] | 1246 | * 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] | 1247 | * neither of these are set, then the system will try to pick one or |
| 1248 | * the other depending on the contents of the window. |
| 1249 | */ |
| 1250 | public static final int SOFT_INPUT_ADJUST_PAN = 0x20; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1251 | |
Dianne Hackborn | dea3ef7 | 2010-10-28 14:24:22 -0700 | [diff] [blame] | 1252 | /** Adjustment option for {@link #softInputMode}: set to have a window |
| 1253 | * not adjust for a shown input method. The window will not be resized, |
| 1254 | * and it will not be panned to make its focus visible. |
| 1255 | */ |
| 1256 | public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30; |
| 1257 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1258 | /** |
| 1259 | * Bit for {@link #softInputMode}: set when the user has navigated |
| 1260 | * forward to the window. This is normally set automatically for |
| 1261 | * you by the system, though you may want to set it in certain cases |
| 1262 | * when you are displaying a window yourself. This flag will always |
| 1263 | * be cleared automatically after the window is displayed. |
| 1264 | */ |
| 1265 | public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100; |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1266 | |
| 1267 | /** |
Gilles Debunne | be2c4f9 | 2011-01-17 15:14:32 -0800 | [diff] [blame] | 1268 | * 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] | 1269 | * of: |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1270 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1271 | * <ul> |
| 1272 | * <li> One of the visibility states |
| 1273 | * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED}, |
| 1274 | * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or |
| 1275 | * {@link #SOFT_INPUT_STATE_VISIBLE}. |
| 1276 | * <li> One of the adjustment options |
| 1277 | * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED}, |
| 1278 | * {@link #SOFT_INPUT_ADJUST_RESIZE}, or |
| 1279 | * {@link #SOFT_INPUT_ADJUST_PAN}. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1280 | * </ul> |
| 1281 | * |
| 1282 | * |
| 1283 | * <p>This flag can be controlled in your theme through the |
| 1284 | * {@link android.R.attr#windowSoftInputMode} attribute.</p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1285 | */ |
| 1286 | public int softInputMode; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1287 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1288 | /** |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1289 | * Placement of window within the screen as per {@link Gravity}. Both |
| 1290 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 1291 | * android.graphics.Rect) Gravity.apply} and |
| 1292 | * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) |
| 1293 | * Gravity.applyDisplay} are used during window layout, with this value |
| 1294 | * given as the desired gravity. For example you can specify |
| 1295 | * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and |
| 1296 | * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here |
| 1297 | * to control the behavior of |
| 1298 | * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) |
| 1299 | * Gravity.applyDisplay}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1300 | * |
| 1301 | * @see Gravity |
| 1302 | */ |
| 1303 | public int gravity; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1304 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1305 | /** |
| 1306 | * The horizontal margin, as a percentage of the container's width, |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1307 | * between the container and the widget. See |
| 1308 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 1309 | * android.graphics.Rect) Gravity.apply} for how this is used. This |
| 1310 | * 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] | 1311 | */ |
| 1312 | public float horizontalMargin; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1313 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1314 | /** |
| 1315 | * The vertical margin, as a percentage of the container's height, |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1316 | * between the container and the widget. See |
| 1317 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 1318 | * android.graphics.Rect) Gravity.apply} for how this is used. This |
| 1319 | * 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] | 1320 | */ |
| 1321 | public float verticalMargin; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 1322 | |
| 1323 | /** |
| 1324 | * Positive insets between the drawing surface and window content. |
| 1325 | * |
| 1326 | * @hide |
| 1327 | */ |
Alan Viverette | 3aa1ffb | 2014-10-30 12:22:08 -0700 | [diff] [blame] | 1328 | public final Rect surfaceInsets = new Rect(); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 1329 | |
| 1330 | /** |
| 1331 | * Whether the surface insets have been manually set. When set to |
| 1332 | * {@code false}, the view root will automatically determine the |
| 1333 | * appropriate surface insets. |
| 1334 | * |
| 1335 | * @see #surfaceInsets |
| 1336 | * @hide |
| 1337 | */ |
| 1338 | public boolean hasManualSurfaceInsets; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1339 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1340 | /** |
| 1341 | * The desired bitmap format. May be one of the constants in |
| 1342 | * {@link android.graphics.PixelFormat}. Default is OPAQUE. |
| 1343 | */ |
| 1344 | public int format; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1346 | /** |
| 1347 | * A style resource defining the animations to use for this window. |
| 1348 | * This must be a system resource; it can not be an application resource |
| 1349 | * because the window manager does not have access to applications. |
| 1350 | */ |
| 1351 | public int windowAnimations; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1352 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1353 | /** |
| 1354 | * An alpha value to apply to this entire window. |
| 1355 | * An alpha of 1.0 means fully opaque and 0.0 means fully transparent |
| 1356 | */ |
| 1357 | public float alpha = 1.0f; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1358 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1359 | /** |
| 1360 | * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming |
| 1361 | * to apply. Range is from 1.0 for completely opaque to 0.0 for no |
| 1362 | * dim. |
| 1363 | */ |
| 1364 | public float dimAmount = 1.0f; |
Dianne Hackborn | dea3ef7 | 2010-10-28 14:24:22 -0700 | [diff] [blame] | 1365 | |
| 1366 | /** |
| 1367 | * Default value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 1368 | * indicating that the brightness value is not overridden for this window |
| 1369 | * and normal brightness policy should be used. |
| 1370 | */ |
| 1371 | public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f; |
| 1372 | |
| 1373 | /** |
| 1374 | * Value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 1375 | * indicating that the screen or button backlight brightness should be set |
| 1376 | * to the lowest value when this window is in front. |
| 1377 | */ |
| 1378 | public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f; |
| 1379 | |
| 1380 | /** |
| 1381 | * Value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 1382 | * indicating that the screen or button backlight brightness should be set |
| 1383 | * to the hightest value when this window is in front. |
| 1384 | */ |
| 1385 | public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1386 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1387 | /** |
| 1388 | * This can be used to override the user's preferred brightness of |
| 1389 | * the screen. A value of less than 0, the default, means to use the |
| 1390 | * preferred screen brightness. 0 to 1 adjusts the brightness from |
| 1391 | * dark to full bright. |
| 1392 | */ |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1393 | public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1394 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1395 | /** |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1396 | * This can be used to override the standard behavior of the button and |
| 1397 | * keyboard backlights. A value of less than 0, the default, means to |
| 1398 | * use the standard backlight behavior. 0 to 1 adjusts the brightness |
| 1399 | * from dark to full bright. |
| 1400 | */ |
| 1401 | public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE; |
| 1402 | |
| 1403 | /** |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1404 | * Value for {@link #rotationAnimation} to define the animation used to |
| 1405 | * specify that this window will rotate in or out following a rotation. |
| 1406 | */ |
| 1407 | public static final int ROTATION_ANIMATION_ROTATE = 0; |
| 1408 | |
| 1409 | /** |
| 1410 | * Value for {@link #rotationAnimation} to define the animation used to |
| 1411 | * specify that this window will fade in or out following a rotation. |
| 1412 | */ |
| 1413 | public static final int ROTATION_ANIMATION_CROSSFADE = 1; |
| 1414 | |
| 1415 | /** |
| 1416 | * Value for {@link #rotationAnimation} to define the animation used to |
| 1417 | * specify that this window will immediately disappear or appear following |
| 1418 | * a rotation. |
| 1419 | */ |
| 1420 | public static final int ROTATION_ANIMATION_JUMPCUT = 2; |
| 1421 | |
| 1422 | /** |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 1423 | * Define the exit and entry animations used on this window when the device is rotated. |
| 1424 | * This only has an affect if the incoming and outgoing topmost |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1425 | * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 1426 | * by other windows. All other situations default to the |
| 1427 | * {@link #ROTATION_ANIMATION_ROTATE} behavior. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1428 | * |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1429 | * @see #ROTATION_ANIMATION_ROTATE |
| 1430 | * @see #ROTATION_ANIMATION_CROSSFADE |
| 1431 | * @see #ROTATION_ANIMATION_JUMPCUT |
| 1432 | */ |
| 1433 | public int rotationAnimation = ROTATION_ANIMATION_ROTATE; |
| 1434 | |
| 1435 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1436 | * Identifier for this window. This will usually be filled in for |
| 1437 | * you. |
| 1438 | */ |
| 1439 | public IBinder token = null; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1440 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1441 | /** |
| 1442 | * Name of the package owning this window. |
| 1443 | */ |
| 1444 | public String packageName = null; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1445 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1446 | /** |
| 1447 | * Specific orientation value for a window. |
| 1448 | * May be any of the same values allowed |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1449 | * for {@link android.content.pm.ActivityInfo#screenOrientation}. |
| 1450 | * If not set, a default value of |
| 1451 | * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1452 | * will be used. |
| 1453 | */ |
| 1454 | public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1455 | |
| 1456 | /** |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 1457 | * The preferred refresh rate for the window. |
| 1458 | * |
| 1459 | * This must be one of the supported refresh rates obtained for the display(s) the window |
| 1460 | * is on. |
| 1461 | * |
| 1462 | * @see Display#getSupportedRefreshRates() |
| 1463 | */ |
| 1464 | public float preferredRefreshRate; |
| 1465 | |
| 1466 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1467 | * Control the visibility of the status bar. |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1468 | * |
| 1469 | * @see View#STATUS_BAR_VISIBLE |
| 1470 | * @see View#STATUS_BAR_HIDDEN |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1471 | */ |
| 1472 | public int systemUiVisibility; |
| 1473 | |
| 1474 | /** |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1475 | * @hide |
| 1476 | * The ui visibility as requested by the views in this hierarchy. |
| 1477 | * the combined value should be systemUiVisibility | subtreeSystemUiVisibility. |
| 1478 | */ |
| 1479 | public int subtreeSystemUiVisibility; |
| 1480 | |
| 1481 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1482 | * Get callbacks about the system ui visibility changing. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1483 | * |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1484 | * TODO: Maybe there should be a bitfield of optional callbacks that we need. |
| 1485 | * |
| 1486 | * @hide |
| 1487 | */ |
| 1488 | public boolean hasSystemUiListeners; |
| 1489 | |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1490 | /** |
| 1491 | * When this window has focus, disable touch pad pointer gesture processing. |
| 1492 | * The window will receive raw position updates from the touch pad instead |
| 1493 | * of pointer movements and synthetic touch events. |
| 1494 | * |
| 1495 | * @hide |
| 1496 | */ |
| 1497 | public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001; |
| 1498 | |
| 1499 | /** |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 1500 | * Does not construct an input channel for this window. The channel will therefore |
| 1501 | * be incapable of receiving input. |
| 1502 | * |
| 1503 | * @hide |
| 1504 | */ |
| 1505 | public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002; |
| 1506 | |
| 1507 | /** |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1508 | * When this window has focus, does not call user activity for all input events so |
| 1509 | * the application will have to do it itself. Should only be used by |
| 1510 | * the keyguard and phone app. |
| 1511 | * <p> |
| 1512 | * Should only be used by the keyguard and phone app. |
| 1513 | * </p> |
| 1514 | * |
| 1515 | * @hide |
| 1516 | */ |
| 1517 | public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004; |
| 1518 | |
| 1519 | /** |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1520 | * Control special features of the input subsystem. |
| 1521 | * |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 1522 | * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 1523 | * @see #INPUT_FEATURE_NO_INPUT_CHANNEL |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1524 | * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1525 | * @hide |
| 1526 | */ |
| 1527 | public int inputFeatures; |
| 1528 | |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1529 | /** |
| 1530 | * Sets the number of milliseconds before the user activity timeout occurs |
| 1531 | * when this window has focus. A value of -1 uses the standard timeout. |
| 1532 | * A value of 0 uses the minimum support display timeout. |
| 1533 | * <p> |
| 1534 | * This property can only be used to reduce the user specified display timeout; |
| 1535 | * it can never make the timeout longer than it normally would be. |
| 1536 | * </p><p> |
| 1537 | * Should only be used by the keyguard and phone app. |
| 1538 | * </p> |
| 1539 | * |
| 1540 | * @hide |
| 1541 | */ |
| 1542 | public long userActivityTimeout = -1; |
| 1543 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1544 | public LayoutParams() { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1545 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1546 | type = TYPE_APPLICATION; |
| 1547 | format = PixelFormat.OPAQUE; |
| 1548 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1549 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1550 | public LayoutParams(int _type) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1551 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1552 | type = _type; |
| 1553 | format = PixelFormat.OPAQUE; |
| 1554 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1555 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1556 | public LayoutParams(int _type, int _flags) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1557 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1558 | type = _type; |
| 1559 | flags = _flags; |
| 1560 | format = PixelFormat.OPAQUE; |
| 1561 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1562 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1563 | public LayoutParams(int _type, int _flags, int _format) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1564 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1565 | type = _type; |
| 1566 | flags = _flags; |
| 1567 | format = _format; |
| 1568 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1569 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1570 | public LayoutParams(int w, int h, int _type, int _flags, int _format) { |
| 1571 | super(w, h); |
| 1572 | type = _type; |
| 1573 | flags = _flags; |
| 1574 | format = _format; |
| 1575 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1576 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1577 | public LayoutParams(int w, int h, int xpos, int ypos, int _type, |
| 1578 | int _flags, int _format) { |
| 1579 | super(w, h); |
| 1580 | x = xpos; |
| 1581 | y = ypos; |
| 1582 | type = _type; |
| 1583 | flags = _flags; |
| 1584 | format = _format; |
| 1585 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1586 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1587 | public final void setTitle(CharSequence title) { |
| 1588 | if (null == title) |
| 1589 | title = ""; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1590 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1591 | mTitle = TextUtils.stringOrSpannedString(title); |
| 1592 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1593 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1594 | public final CharSequence getTitle() { |
| 1595 | return mTitle; |
| 1596 | } |
Bryce Lee | 53b9fbd | 2015-02-06 12:06:34 -0800 | [diff] [blame] | 1597 | |
| 1598 | /** @hide */ |
| 1599 | @SystemApi |
| 1600 | public final void setUserActivityTimeout(long timeout) { |
| 1601 | userActivityTimeout = timeout; |
| 1602 | } |
| 1603 | |
| 1604 | /** @hide */ |
| 1605 | @SystemApi |
| 1606 | public final long getUserActivityTimeout() { |
| 1607 | return userActivityTimeout; |
| 1608 | } |
| 1609 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1610 | public int describeContents() { |
| 1611 | return 0; |
| 1612 | } |
| 1613 | |
| 1614 | public void writeToParcel(Parcel out, int parcelableFlags) { |
| 1615 | out.writeInt(width); |
| 1616 | out.writeInt(height); |
| 1617 | out.writeInt(x); |
| 1618 | out.writeInt(y); |
| 1619 | out.writeInt(type); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1620 | out.writeInt(flags); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1621 | out.writeInt(privateFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1622 | out.writeInt(softInputMode); |
| 1623 | out.writeInt(gravity); |
| 1624 | out.writeFloat(horizontalMargin); |
| 1625 | out.writeFloat(verticalMargin); |
| 1626 | out.writeInt(format); |
| 1627 | out.writeInt(windowAnimations); |
| 1628 | out.writeFloat(alpha); |
| 1629 | out.writeFloat(dimAmount); |
| 1630 | out.writeFloat(screenBrightness); |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1631 | out.writeFloat(buttonBrightness); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1632 | out.writeInt(rotationAnimation); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1633 | out.writeStrongBinder(token); |
| 1634 | out.writeString(packageName); |
| 1635 | TextUtils.writeToParcel(mTitle, out, parcelableFlags); |
| 1636 | out.writeInt(screenOrientation); |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 1637 | out.writeFloat(preferredRefreshRate); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1638 | out.writeInt(systemUiVisibility); |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1639 | out.writeInt(subtreeSystemUiVisibility); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1640 | out.writeInt(hasSystemUiListeners ? 1 : 0); |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1641 | out.writeInt(inputFeatures); |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1642 | out.writeLong(userActivityTimeout); |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 1643 | out.writeInt(surfaceInsets.left); |
| 1644 | out.writeInt(surfaceInsets.top); |
| 1645 | out.writeInt(surfaceInsets.right); |
| 1646 | out.writeInt(surfaceInsets.bottom); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 1647 | out.writeInt(hasManualSurfaceInsets ? 1 : 0); |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1648 | out.writeInt(needsMenuKey); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1649 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1650 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1651 | public static final Parcelable.Creator<LayoutParams> CREATOR |
| 1652 | = new Parcelable.Creator<LayoutParams>() { |
| 1653 | public LayoutParams createFromParcel(Parcel in) { |
| 1654 | return new LayoutParams(in); |
| 1655 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1656 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1657 | public LayoutParams[] newArray(int size) { |
| 1658 | return new LayoutParams[size]; |
| 1659 | } |
| 1660 | }; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1661 | |
| 1662 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1663 | public LayoutParams(Parcel in) { |
| 1664 | width = in.readInt(); |
| 1665 | height = in.readInt(); |
| 1666 | x = in.readInt(); |
| 1667 | y = in.readInt(); |
| 1668 | type = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1669 | flags = in.readInt(); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1670 | privateFlags = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1671 | softInputMode = in.readInt(); |
| 1672 | gravity = in.readInt(); |
| 1673 | horizontalMargin = in.readFloat(); |
| 1674 | verticalMargin = in.readFloat(); |
| 1675 | format = in.readInt(); |
| 1676 | windowAnimations = in.readInt(); |
| 1677 | alpha = in.readFloat(); |
| 1678 | dimAmount = in.readFloat(); |
| 1679 | screenBrightness = in.readFloat(); |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1680 | buttonBrightness = in.readFloat(); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1681 | rotationAnimation = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1682 | token = in.readStrongBinder(); |
| 1683 | packageName = in.readString(); |
| 1684 | mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); |
| 1685 | screenOrientation = in.readInt(); |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 1686 | preferredRefreshRate = in.readFloat(); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1687 | systemUiVisibility = in.readInt(); |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1688 | subtreeSystemUiVisibility = in.readInt(); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1689 | hasSystemUiListeners = in.readInt() != 0; |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1690 | inputFeatures = in.readInt(); |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1691 | userActivityTimeout = in.readLong(); |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 1692 | surfaceInsets.left = in.readInt(); |
| 1693 | surfaceInsets.top = in.readInt(); |
| 1694 | surfaceInsets.right = in.readInt(); |
| 1695 | surfaceInsets.bottom = in.readInt(); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 1696 | hasManualSurfaceInsets = in.readInt() != 0; |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1697 | needsMenuKey = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1698 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1699 | |
Romain Guy | 7299807 | 2009-06-22 11:09:20 -0700 | [diff] [blame] | 1700 | @SuppressWarnings({"PointlessBitwiseExpression"}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1701 | public static final int LAYOUT_CHANGED = 1<<0; |
| 1702 | public static final int TYPE_CHANGED = 1<<1; |
| 1703 | public static final int FLAGS_CHANGED = 1<<2; |
| 1704 | public static final int FORMAT_CHANGED = 1<<3; |
| 1705 | public static final int ANIMATION_CHANGED = 1<<4; |
| 1706 | public static final int DIM_AMOUNT_CHANGED = 1<<5; |
| 1707 | public static final int TITLE_CHANGED = 1<<6; |
| 1708 | public static final int ALPHA_CHANGED = 1<<7; |
| 1709 | public static final int MEMORY_TYPE_CHANGED = 1<<8; |
| 1710 | public static final int SOFT_INPUT_MODE_CHANGED = 1<<9; |
| 1711 | public static final int SCREEN_ORIENTATION_CHANGED = 1<<10; |
| 1712 | public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11; |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1713 | public static final int ROTATION_ANIMATION_CHANGED = 1<<12; |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1714 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1715 | public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1716 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1717 | public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1718 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1719 | public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15; |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1720 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1721 | public static final int INPUT_FEATURES_CHANGED = 1<<16; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1722 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1723 | public static final int PRIVATE_FLAGS_CHANGED = 1<<17; |
Romain Guy | f21c9b0 | 2011-09-06 16:56:54 -0700 | [diff] [blame] | 1724 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1725 | public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18; |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1726 | /** {@hide} */ |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1727 | public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19; |
| 1728 | /** {@hide} */ |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 1729 | public static final int SURFACE_INSETS_CHANGED = 1<<20; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 1730 | /** {@hide} */ |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 1731 | public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21; |
| 1732 | /** {@hide} */ |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1733 | public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22; |
| 1734 | /** {@hide} */ |
Romain Guy | f21c9b0 | 2011-09-06 16:56:54 -0700 | [diff] [blame] | 1735 | public static final int EVERYTHING_CHANGED = 0xffffffff; |
| 1736 | |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1737 | // internal buffer to backup/restore parameters under compatibility mode. |
| 1738 | private int[] mCompatibilityParamsBackup = null; |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1739 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1740 | public final int copyFrom(LayoutParams o) { |
| 1741 | int changes = 0; |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1742 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1743 | if (width != o.width) { |
| 1744 | width = o.width; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1745 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1746 | } |
| 1747 | if (height != o.height) { |
| 1748 | height = o.height; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1749 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1750 | } |
| 1751 | if (x != o.x) { |
| 1752 | x = o.x; |
| 1753 | changes |= LAYOUT_CHANGED; |
| 1754 | } |
| 1755 | if (y != o.y) { |
| 1756 | y = o.y; |
| 1757 | changes |= LAYOUT_CHANGED; |
| 1758 | } |
| 1759 | if (horizontalWeight != o.horizontalWeight) { |
| 1760 | horizontalWeight = o.horizontalWeight; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1761 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1762 | } |
| 1763 | if (verticalWeight != o.verticalWeight) { |
| 1764 | verticalWeight = o.verticalWeight; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1765 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1766 | } |
| 1767 | if (horizontalMargin != o.horizontalMargin) { |
| 1768 | horizontalMargin = o.horizontalMargin; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1769 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1770 | } |
| 1771 | if (verticalMargin != o.verticalMargin) { |
| 1772 | verticalMargin = o.verticalMargin; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1773 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1774 | } |
| 1775 | if (type != o.type) { |
| 1776 | type = o.type; |
| 1777 | changes |= TYPE_CHANGED; |
| 1778 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1779 | if (flags != o.flags) { |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1780 | final int diff = flags ^ o.flags; |
| 1781 | if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) { |
| 1782 | changes |= TRANSLUCENT_FLAGS_CHANGED; |
| 1783 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1784 | flags = o.flags; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1785 | changes |= FLAGS_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1786 | } |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1787 | if (privateFlags != o.privateFlags) { |
| 1788 | privateFlags = o.privateFlags; |
| 1789 | changes |= PRIVATE_FLAGS_CHANGED; |
| 1790 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1791 | if (softInputMode != o.softInputMode) { |
| 1792 | softInputMode = o.softInputMode; |
| 1793 | changes |= SOFT_INPUT_MODE_CHANGED; |
| 1794 | } |
| 1795 | if (gravity != o.gravity) { |
| 1796 | gravity = o.gravity; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1797 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1798 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1799 | if (format != o.format) { |
| 1800 | format = o.format; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1801 | changes |= FORMAT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1802 | } |
| 1803 | if (windowAnimations != o.windowAnimations) { |
| 1804 | windowAnimations = o.windowAnimations; |
| 1805 | changes |= ANIMATION_CHANGED; |
| 1806 | } |
| 1807 | if (token == null) { |
| 1808 | // NOTE: token only copied if the recipient doesn't |
| 1809 | // already have one. |
| 1810 | token = o.token; |
| 1811 | } |
| 1812 | if (packageName == null) { |
| 1813 | // NOTE: packageName only copied if the recipient doesn't |
| 1814 | // already have one. |
| 1815 | packageName = o.packageName; |
| 1816 | } |
| 1817 | if (!mTitle.equals(o.mTitle)) { |
| 1818 | mTitle = o.mTitle; |
| 1819 | changes |= TITLE_CHANGED; |
| 1820 | } |
| 1821 | if (alpha != o.alpha) { |
| 1822 | alpha = o.alpha; |
| 1823 | changes |= ALPHA_CHANGED; |
| 1824 | } |
| 1825 | if (dimAmount != o.dimAmount) { |
| 1826 | dimAmount = o.dimAmount; |
| 1827 | changes |= DIM_AMOUNT_CHANGED; |
| 1828 | } |
| 1829 | if (screenBrightness != o.screenBrightness) { |
| 1830 | screenBrightness = o.screenBrightness; |
| 1831 | changes |= SCREEN_BRIGHTNESS_CHANGED; |
| 1832 | } |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1833 | if (buttonBrightness != o.buttonBrightness) { |
| 1834 | buttonBrightness = o.buttonBrightness; |
| 1835 | changes |= BUTTON_BRIGHTNESS_CHANGED; |
| 1836 | } |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1837 | if (rotationAnimation != o.rotationAnimation) { |
| 1838 | rotationAnimation = o.rotationAnimation; |
| 1839 | changes |= ROTATION_ANIMATION_CHANGED; |
| 1840 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1841 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1842 | if (screenOrientation != o.screenOrientation) { |
| 1843 | screenOrientation = o.screenOrientation; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1844 | changes |= SCREEN_ORIENTATION_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1845 | } |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 1846 | |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 1847 | if (preferredRefreshRate != o.preferredRefreshRate) { |
| 1848 | preferredRefreshRate = o.preferredRefreshRate; |
| 1849 | changes |= PREFERRED_REFRESH_RATE_CHANGED; |
| 1850 | } |
| 1851 | |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1852 | if (systemUiVisibility != o.systemUiVisibility |
| 1853 | || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) { |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1854 | systemUiVisibility = o.systemUiVisibility; |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1855 | subtreeSystemUiVisibility = o.subtreeSystemUiVisibility; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1856 | changes |= SYSTEM_UI_VISIBILITY_CHANGED; |
| 1857 | } |
| 1858 | |
| 1859 | if (hasSystemUiListeners != o.hasSystemUiListeners) { |
| 1860 | hasSystemUiListeners = o.hasSystemUiListeners; |
| 1861 | changes |= SYSTEM_UI_LISTENER_CHANGED; |
| 1862 | } |
| 1863 | |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1864 | if (inputFeatures != o.inputFeatures) { |
| 1865 | inputFeatures = o.inputFeatures; |
| 1866 | changes |= INPUT_FEATURES_CHANGED; |
| 1867 | } |
| 1868 | |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1869 | if (userActivityTimeout != o.userActivityTimeout) { |
| 1870 | userActivityTimeout = o.userActivityTimeout; |
| 1871 | changes |= USER_ACTIVITY_TIMEOUT_CHANGED; |
| 1872 | } |
| 1873 | |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 1874 | if (!surfaceInsets.equals(o.surfaceInsets)) { |
| 1875 | surfaceInsets.set(o.surfaceInsets); |
| 1876 | changes |= SURFACE_INSETS_CHANGED; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 1877 | } |
| 1878 | |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 1879 | if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) { |
| 1880 | hasManualSurfaceInsets = o.hasManualSurfaceInsets; |
| 1881 | changes |= SURFACE_INSETS_CHANGED; |
| 1882 | } |
| 1883 | |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1884 | if (needsMenuKey != o.needsMenuKey) { |
| 1885 | needsMenuKey = o.needsMenuKey; |
| 1886 | changes |= NEEDS_MENU_KEY_CHANGED; |
| 1887 | } |
| 1888 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1889 | return changes; |
| 1890 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1891 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1892 | @Override |
| 1893 | public String debug(String output) { |
| 1894 | output += "Contents of " + this + ":"; |
| 1895 | Log.d("Debug", output); |
| 1896 | output = super.debug(""); |
| 1897 | Log.d("Debug", output); |
| 1898 | Log.d("Debug", ""); |
| 1899 | Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}"); |
| 1900 | return ""; |
| 1901 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1902 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1903 | @Override |
| 1904 | public String toString() { |
| 1905 | StringBuilder sb = new StringBuilder(256); |
| 1906 | sb.append("WM.LayoutParams{"); |
| 1907 | sb.append("("); |
| 1908 | sb.append(x); |
| 1909 | sb.append(','); |
| 1910 | sb.append(y); |
| 1911 | sb.append(")("); |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1912 | sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width))); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1913 | sb.append('x'); |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1914 | sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height))); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1915 | sb.append(")"); |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1916 | if (horizontalMargin != 0) { |
| 1917 | sb.append(" hm="); |
| 1918 | sb.append(horizontalMargin); |
| 1919 | } |
| 1920 | if (verticalMargin != 0) { |
| 1921 | sb.append(" vm="); |
| 1922 | sb.append(verticalMargin); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1923 | } |
| 1924 | if (gravity != 0) { |
| 1925 | sb.append(" gr=#"); |
| 1926 | sb.append(Integer.toHexString(gravity)); |
| 1927 | } |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1928 | if (softInputMode != 0) { |
| 1929 | sb.append(" sim=#"); |
| 1930 | sb.append(Integer.toHexString(softInputMode)); |
| 1931 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1932 | sb.append(" ty="); |
| 1933 | sb.append(type); |
| 1934 | sb.append(" fl=#"); |
| 1935 | sb.append(Integer.toHexString(flags)); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1936 | if (privateFlags != 0) { |
Adam Lesinski | 95c4297 | 2013-10-02 10:13:27 -0700 | [diff] [blame] | 1937 | if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) { |
| 1938 | sb.append(" compatible=true"); |
| 1939 | } |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1940 | sb.append(" pfl=0x").append(Integer.toHexString(privateFlags)); |
| 1941 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1942 | if (format != PixelFormat.OPAQUE) { |
| 1943 | sb.append(" fmt="); |
| 1944 | sb.append(format); |
| 1945 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1946 | if (windowAnimations != 0) { |
| 1947 | sb.append(" wanim=0x"); |
| 1948 | sb.append(Integer.toHexString(windowAnimations)); |
| 1949 | } |
| 1950 | if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { |
| 1951 | sb.append(" or="); |
| 1952 | sb.append(screenOrientation); |
| 1953 | } |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1954 | if (alpha != 1.0f) { |
| 1955 | sb.append(" alpha="); |
| 1956 | sb.append(alpha); |
| 1957 | } |
| 1958 | if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) { |
| 1959 | sb.append(" sbrt="); |
| 1960 | sb.append(screenBrightness); |
| 1961 | } |
| 1962 | if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) { |
| 1963 | sb.append(" bbrt="); |
| 1964 | sb.append(buttonBrightness); |
| 1965 | } |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1966 | if (rotationAnimation != ROTATION_ANIMATION_ROTATE) { |
| 1967 | sb.append(" rotAnim="); |
| 1968 | sb.append(rotationAnimation); |
| 1969 | } |
Michael Wright | 3f145a2 | 2014-07-22 19:46:03 -0700 | [diff] [blame] | 1970 | if (preferredRefreshRate != 0) { |
| 1971 | sb.append(" preferredRefreshRate="); |
| 1972 | sb.append(preferredRefreshRate); |
| 1973 | } |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1974 | if (systemUiVisibility != 0) { |
| 1975 | sb.append(" sysui=0x"); |
| 1976 | sb.append(Integer.toHexString(systemUiVisibility)); |
| 1977 | } |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1978 | if (subtreeSystemUiVisibility != 0) { |
| 1979 | sb.append(" vsysui=0x"); |
| 1980 | sb.append(Integer.toHexString(subtreeSystemUiVisibility)); |
| 1981 | } |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1982 | if (hasSystemUiListeners) { |
| 1983 | sb.append(" sysuil="); |
| 1984 | sb.append(hasSystemUiListeners); |
| 1985 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1986 | if (inputFeatures != 0) { |
| 1987 | sb.append(" if=0x").append(Integer.toHexString(inputFeatures)); |
| 1988 | } |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1989 | if (userActivityTimeout >= 0) { |
| 1990 | sb.append(" userActivityTimeout=").append(userActivityTimeout); |
| 1991 | } |
Andreas Gampe | 007cfa7 | 2015-03-15 14:19:43 -0700 | [diff] [blame] | 1992 | if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 || |
Andreas Gampe | 1109006 | 2015-03-16 09:45:34 -0700 | [diff] [blame^] | 1993 | surfaceInsets.bottom != 0 || hasManualSurfaceInsets) { |
Alan Viverette | 49a22e8 | 2014-07-12 20:01:27 -0700 | [diff] [blame] | 1994 | sb.append(" surfaceInsets=").append(surfaceInsets); |
Alan Viverette | 5435a30 | 2015-01-29 10:25:34 -0800 | [diff] [blame] | 1995 | if (hasManualSurfaceInsets) { |
| 1996 | sb.append(" (manual)"); |
| 1997 | } |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame] | 1998 | } |
Wale Ogunwale | 393b1c1 | 2014-10-18 16:22:01 -0700 | [diff] [blame] | 1999 | if (needsMenuKey != NEEDS_MENU_UNSET) { |
| 2000 | sb.append(" needsMenuKey="); |
| 2001 | sb.append(needsMenuKey); |
| 2002 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2003 | sb.append('}'); |
| 2004 | return sb.toString(); |
| 2005 | } |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 2006 | |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 2007 | /** |
| 2008 | * Scale the layout params' coordinates and size. |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 2009 | * @hide |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 2010 | */ |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 2011 | public void scale(float scale) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 2012 | x = (int) (x * scale + 0.5f); |
| 2013 | y = (int) (y * scale + 0.5f); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2014 | if (width > 0) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 2015 | width = (int) (width * scale + 0.5f); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2016 | } |
| 2017 | if (height > 0) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 2018 | height = (int) (height * scale + 0.5f); |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 2019 | } |
| 2020 | } |
| 2021 | |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 2022 | /** |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2023 | * Backup the layout parameters used in compatibility mode. |
| 2024 | * @see LayoutParams#restore() |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 2025 | */ |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2026 | void backup() { |
| 2027 | int[] backup = mCompatibilityParamsBackup; |
| 2028 | if (backup == null) { |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 2029 | // we backup 4 elements, x, y, width, height |
| 2030 | backup = mCompatibilityParamsBackup = new int[4]; |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 2031 | } |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2032 | backup[0] = x; |
| 2033 | backup[1] = y; |
| 2034 | backup[2] = width; |
| 2035 | backup[3] = height; |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 2036 | } |
| 2037 | |
| 2038 | /** |
| 2039 | * Restore the layout params' coordinates, size and gravity |
| 2040 | * @see LayoutParams#backup() |
| 2041 | */ |
| 2042 | void restore() { |
| 2043 | int[] backup = mCompatibilityParamsBackup; |
| 2044 | if (backup != null) { |
| 2045 | x = backup[0]; |
| 2046 | y = backup[1]; |
| 2047 | width = backup[2]; |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 2048 | height = backup[3]; |
| 2049 | } |
| 2050 | } |
| 2051 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2052 | private CharSequence mTitle = ""; |
| 2053 | } |
| 2054 | } |