blob: 7f3829a9a8580ce67949a8a77c5daada60a6da4e [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.view;
18
Jeff Browna492c3a2012-08-23 19:48:44 -070019import android.app.Presentation;
20import android.content.Context;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import android.content.pm.ActivityInfo;
Alan Viveretteccb11e12014-07-08 16:04:02 -070022import android.graphics.Insets;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.graphics.PixelFormat;
Alan Viveretteccb11e12014-07-08 16:04:02 -070024import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.os.IBinder;
26import android.os.Parcel;
27import android.os.Parcelable;
28import android.text.TextUtils;
29import android.util.Log;
30
31
32/**
33 * The interface that apps use to talk to the window manager.
34 * <p>
35 * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these.
Jeff Browna492c3a2012-08-23 19:48:44 -070036 * </p><p>
37 * Each window manager instance is bound to a particular {@link Display}.
38 * To obtain a {@link WindowManager} for a different display, use
39 * {@link Context#createDisplayContext} to obtain a {@link Context} for that
40 * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code>
41 * to get the WindowManager.
42 * </p><p>
43 * The simplest way to show a window on another display is to create a
44 * {@link Presentation}. The presentation will automatically obtain a
45 * {@link WindowManager} and {@link Context} for that display.
46 * </p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047 *
48 * @see android.content.Context#getSystemService
49 * @see android.content.Context#WINDOW_SERVICE
50 */
51public interface WindowManager extends ViewManager {
52 /**
53 * Exception that is thrown when trying to add view whose
Jorim Jaggi380ecb82014-03-14 17:25:20 +010054 * {@link LayoutParams} {@link LayoutParams#token}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055 * is invalid.
56 */
57 public static class BadTokenException extends RuntimeException {
58 public BadTokenException() {
59 }
60
61 public BadTokenException(String name) {
62 super(name);
63 }
64 }
65
66 /**
Craig Mautner6018aee2012-10-23 14:27:49 -070067 * Exception that is thrown when calling {@link #addView} to a secondary display that cannot
68 * be found. See {@link android.app.Presentation} for more information on secondary displays.
69 */
70 public static class InvalidDisplayException extends RuntimeException {
71 public InvalidDisplayException() {
72 }
73
74 public InvalidDisplayException(String name) {
75 super(name);
76 }
77 }
78
79 /**
Jeff Browna492c3a2012-08-23 19:48:44 -070080 * Returns the {@link Display} upon which this {@link WindowManager} instance
81 * will create new windows.
82 * <p>
83 * Despite the name of this method, the display that is returned is not
84 * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}).
85 * The returned display could instead be a secondary display that this
86 * window manager instance is managing. Think of it as the display that
87 * this {@link WindowManager} instance uses by default.
88 * </p><p>
89 * To create windows on a different display, you need to obtain a
90 * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager}
91 * class documentation for more information.)
92 * </p>
93 *
94 * @return The display that this window manager is managing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 */
96 public Display getDefaultDisplay();
Jeff Browna492c3a2012-08-23 19:48:44 -070097
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080098 /**
99 * Special variation of {@link #removeView} that immediately invokes
100 * the given view hierarchy's {@link View#onDetachedFromWindow()
101 * View.onDetachedFromWindow()} methods before returning. This is not
102 * for normal applications; using it correctly requires great care.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000103 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800104 * @param view The view to be removed.
105 */
106 public void removeViewImmediate(View view);
Jeff Brownd32460c2012-07-20 16:15:36 -0700107
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800108 public static class LayoutParams extends ViewGroup.LayoutParams
109 implements Parcelable {
110 /**
111 * X position for this window. With the default gravity it is ignored.
Fabrice Di Meglio9e3b0022011-06-06 16:30:29 -0700112 * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or
113 * {@link Gravity#END} it provides an offset from the given edge.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114 */
Romain Guy529b60a2010-08-03 18:05:47 -0700115 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 public int x;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000117
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 /**
119 * Y position for this window. With the default gravity it is ignored.
120 * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
121 * an offset from the given edge.
122 */
Romain Guy529b60a2010-08-03 18:05:47 -0700123 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124 public int y;
125
126 /**
127 * Indicates how much of the extra space will be allocated horizontally
128 * to the view associated with these LayoutParams. Specify 0 if the view
129 * should not be stretched. Otherwise the extra pixels will be pro-rated
130 * among all views whose weight is greater than 0.
131 */
Romain Guy529b60a2010-08-03 18:05:47 -0700132 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800133 public float horizontalWeight;
134
135 /**
136 * Indicates how much of the extra space will be allocated vertically
137 * to the view associated with these LayoutParams. Specify 0 if the view
138 * should not be stretched. Otherwise the extra pixels will be pro-rated
139 * among all views whose weight is greater than 0.
140 */
Romain Guy529b60a2010-08-03 18:05:47 -0700141 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 public float verticalWeight;
Romain Guy529b60a2010-08-03 18:05:47 -0700143
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144 /**
145 * The general type of window. There are three main classes of
146 * window types:
147 * <ul>
148 * <li> <strong>Application windows</strong> (ranging from
149 * {@link #FIRST_APPLICATION_WINDOW} to
150 * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
151 * windows. For these types of windows, the {@link #token} must be
152 * set to the token of the activity they are a part of (this will
153 * normally be done for you if {@link #token} is null).
154 * <li> <strong>Sub-windows</strong> (ranging from
155 * {@link #FIRST_SUB_WINDOW} to
156 * {@link #LAST_SUB_WINDOW}) are associated with another top-level
157 * window. For these types of windows, the {@link #token} must be
158 * the token of the window it is attached to.
159 * <li> <strong>System windows</strong> (ranging from
160 * {@link #FIRST_SYSTEM_WINDOW} to
161 * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
162 * use by the system for specific purposes. They should not normally
163 * be used by applications, and a special permission is required
164 * to use them.
165 * </ul>
Wonsik Kim475e3f02014-03-17 11:17:47 +0000166 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800167 * @see #TYPE_BASE_APPLICATION
168 * @see #TYPE_APPLICATION
169 * @see #TYPE_APPLICATION_STARTING
170 * @see #TYPE_APPLICATION_PANEL
171 * @see #TYPE_APPLICATION_MEDIA
172 * @see #TYPE_APPLICATION_SUB_PANEL
173 * @see #TYPE_APPLICATION_ATTACHED_DIALOG
174 * @see #TYPE_STATUS_BAR
175 * @see #TYPE_SEARCH_BAR
176 * @see #TYPE_PHONE
177 * @see #TYPE_SYSTEM_ALERT
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800178 * @see #TYPE_TOAST
179 * @see #TYPE_SYSTEM_OVERLAY
180 * @see #TYPE_PRIORITY_PHONE
181 * @see #TYPE_STATUS_BAR_PANEL
182 * @see #TYPE_SYSTEM_DIALOG
183 * @see #TYPE_KEYGUARD_DIALOG
184 * @see #TYPE_SYSTEM_ERROR
185 * @see #TYPE_INPUT_METHOD
186 * @see #TYPE_INPUT_METHOD_DIALOG
187 */
Joe Onorato8f2bd432010-03-25 11:45:28 -0700188 @ViewDebug.ExportedProperty(mapping = {
189 @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
190 @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
191 @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
192 @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
193 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
194 @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
195 @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700196 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700197 @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"),
198 @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"),
199 @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"),
200 @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700201 @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"),
202 @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"),
203 @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700204 @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"),
205 @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"),
206 @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
207 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
Jeff Brown3b2b3542010-10-15 00:54:27 -0700208 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700209 @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
210 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700211 @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700212 @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
213 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
214 @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
215 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
216 @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700217 @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"),
218 @ViewDebug.IntToString(from = TYPE_HIDDEN_NAV_CONSUMER, to = "TYPE_HIDDEN_NAV_CONSUMER"),
219 @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"),
Jeff Brownbd6e1502012-08-28 03:27:37 -0700220 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"),
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700221 @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"),
keunyounga446bf02013-06-21 19:07:57 -0700222 @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"),
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700223 @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"),
224 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700225 })
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800226 public int type;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000227
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800228 /**
229 * Start of window types that represent normal application windows.
230 */
231 public static final int FIRST_APPLICATION_WINDOW = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000232
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800233 /**
234 * Window type: an application window that serves as the "base" window
235 * of the overall application; all other application windows will
236 * appear on top of it.
Craig Mautner5962b122012-10-05 14:45:52 -0700237 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800238 */
239 public static final int TYPE_BASE_APPLICATION = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000240
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800241 /**
242 * Window type: a normal application window. The {@link #token} must be
243 * an Activity token identifying who the window belongs to.
Craig Mautner5962b122012-10-05 14:45:52 -0700244 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 */
246 public static final int TYPE_APPLICATION = 2;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000247
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800248 /**
249 * Window type: special application window that is displayed while the
250 * application is starting. Not for use by applications themselves;
251 * this is used by the system to display something until the
252 * application can show its own windows.
Craig Mautner5962b122012-10-05 14:45:52 -0700253 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800254 */
255 public static final int TYPE_APPLICATION_STARTING = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000256
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 /**
258 * End of types of application windows.
259 */
260 public static final int LAST_APPLICATION_WINDOW = 99;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000261
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800262 /**
263 * Start of types of sub-windows. The {@link #token} of these windows
264 * must be set to the window they are attached to. These types of
265 * windows are kept next to their attached window in Z-order, and their
266 * coordinate space is relative to their attached window.
267 */
268 public static final int FIRST_SUB_WINDOW = 1000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000269
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800270 /**
271 * Window type: a panel on top of an application window. These windows
272 * appear on top of their attached window.
273 */
274 public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000275
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800276 /**
John Spurlock33291d82013-03-13 14:45:14 -0400277 * Window type: window for showing media (such as video). These windows
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800278 * are displayed behind their attached window.
279 */
280 public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000281
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800282 /**
283 * Window type: a sub-panel on top of an application window. These
284 * windows are displayed on top their attached window and any
285 * {@link #TYPE_APPLICATION_PANEL} panels.
286 */
287 public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW+2;
288
289 /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
290 * of the window happens as that of a top-level window, <em>not</em>
291 * as a child of its container.
292 */
293 public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000294
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800295 /**
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700296 * Window type: window for showing overlays on top of media windows.
297 * These windows are displayed between TYPE_APPLICATION_MEDIA and the
298 * application window. They should be translucent to be useful. This
299 * is a big ugly hack so:
300 * @hide
301 */
302 public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000303
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700304 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800305 * End of types of sub-windows.
306 */
307 public static final int LAST_SUB_WINDOW = 1999;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000308
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800309 /**
310 * Start of system-specific window types. These are not normally
311 * created by applications.
312 */
313 public static final int FIRST_SYSTEM_WINDOW = 2000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000314
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800315 /**
316 * Window type: the status bar. There can be only one status bar
317 * window; it is placed at the top of the screen, and all other
318 * windows are shifted down so they are below it.
Craig Mautner88400d32012-09-30 12:35:45 -0700319 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800320 */
321 public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000322
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800323 /**
324 * Window type: the search bar. There can be only one search bar
325 * window; it is placed at the top of the screen.
Craig Mautner88400d32012-09-30 12:35:45 -0700326 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800327 */
328 public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000329
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 /**
331 * Window type: phone. These are non-application windows providing
332 * user interaction with the phone (in particular incoming calls).
333 * These windows are normally placed above all applications, but behind
334 * the status bar.
Craig Mautner88400d32012-09-30 12:35:45 -0700335 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800336 */
337 public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000338
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800339 /**
340 * Window type: system window, such as low power alert. These windows
341 * are always on top of application windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700342 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800343 */
344 public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100345
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800346 /**
347 * Window type: keyguard window.
Craig Mautner88400d32012-09-30 12:35:45 -0700348 * In multiuser systems shows on all users' windows.
Jorim Jaggie411fdf2014-07-28 23:00:44 +0200349 * @removed
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800350 */
351 public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100352
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800353 /**
354 * Window type: transient notifications.
Craig Mautner88400d32012-09-30 12:35:45 -0700355 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 */
357 public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000358
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800359 /**
360 * Window type: system overlay windows, which need to be displayed
361 * on top of everything else. These windows must not take input
362 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700363 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800364 */
365 public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000366
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800367 /**
368 * Window type: priority phone UI, which needs to be displayed even if
369 * the keyguard is active. These windows must not take input
370 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700371 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800372 */
373 public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000374
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800375 /**
376 * Window type: panel that slides out from the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700377 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800378 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800379 public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000380
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 /**
382 * Window type: dialogs that the keyguard shows
Craig Mautner88400d32012-09-30 12:35:45 -0700383 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800384 */
385 public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000386
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800387 /**
388 * Window type: internal system error windows, appear on top of
389 * everything they can.
Craig Mautner88400d32012-09-30 12:35:45 -0700390 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 */
392 public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000393
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800394 /**
395 * Window type: internal input methods windows, which appear above
396 * the normal UI. Application windows may be resized or panned to keep
397 * the input focus visible while this window is displayed.
Craig Mautner88400d32012-09-30 12:35:45 -0700398 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800399 */
400 public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11;
401
402 /**
403 * Window type: internal input methods dialog windows, which appear above
404 * the current input method window.
Craig Mautner88400d32012-09-30 12:35:45 -0700405 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800406 */
407 public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
408
409 /**
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700410 * Window type: wallpaper window, placed behind any window that wants
411 * to sit on top of the wallpaper.
Craig Mautner88400d32012-09-30 12:35:45 -0700412 * In multiuser systems shows only on the owning user's window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700413 */
414 public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13;
415
416 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800417 * Window type: panel that slides out from over the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700418 * In multiuser systems shows on all users' windows.
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800419 */
420 public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14;
Jeff Brown3b2b3542010-10-15 00:54:27 -0700421
422 /**
423 * Window type: secure system overlay windows, which need to be displayed
424 * on top of everything else. These windows must not take input
425 * focus, or they will interfere with the keyguard.
426 *
427 * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
428 * system itself is allowed to create these overlays. Applications cannot
429 * obtain permission to create secure system overlays.
Craig Mautner88400d32012-09-30 12:35:45 -0700430 *
431 * In multiuser systems shows only on the owning user's window.
Jeff Brown3b2b3542010-10-15 00:54:27 -0700432 * @hide
433 */
434 public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
435
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800436 /**
Christopher Tatea53146c2010-09-07 11:57:52 -0700437 * Window type: the drag-and-drop pseudowindow. There is only one
438 * drag layer (at most), and it is placed on top of all other windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700439 * In multiuser systems shows only on the owning user's window.
Christopher Tatea53146c2010-09-07 11:57:52 -0700440 * @hide
441 */
Jeff Brown3b2b3542010-10-15 00:54:27 -0700442 public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16;
Christopher Tatea53146c2010-09-07 11:57:52 -0700443
444 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800445 * Window type: panel that slides out from under the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700446 * In multiuser systems shows on all users' windows.
Joe Onoratoa89e9032010-11-24 11:13:44 -0800447 * @hide
Joe Onorato29fc2c92010-11-24 10:26:50 -0800448 */
449 public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
450
Jeff Brown83c09682010-12-23 17:50:18 -0800451 /**
452 * Window type: (mouse) pointer
Craig Mautner88400d32012-09-30 12:35:45 -0700453 * In multiuser systems shows on all users' windows.
Jeff Brown83c09682010-12-23 17:50:18 -0800454 * @hide
455 */
456 public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
Joe Onorato29fc2c92010-11-24 10:26:50 -0800457
458 /**
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400459 * Window type: Navigation bar (when distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700460 * In multiuser systems shows on all users' windows.
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400461 * @hide
462 */
463 public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
464
465 /**
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700466 * Window type: The volume level overlay/dialog shown when the user
467 * changes the system volume.
Craig Mautner88400d32012-09-30 12:35:45 -0700468 * In multiuser systems shows on all users' windows.
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700469 * @hide
470 */
471 public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
472
473 /**
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700474 * Window type: The boot progress dialog, goes on top of everything
475 * in the world.
Craig Mautner88400d32012-09-30 12:35:45 -0700476 * In multiuser systems shows on all users' windows.
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700477 * @hide
478 */
479 public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
480
481 /**
Dianne Hackborndf89e652011-10-06 22:35:11 -0700482 * Window type: Fake window to consume touch events when the navigation
483 * bar is hidden.
Craig Mautner88400d32012-09-30 12:35:45 -0700484 * In multiuser systems shows on all users' windows.
Dianne Hackborndf89e652011-10-06 22:35:11 -0700485 * @hide
486 */
487 public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22;
488
489 /**
Daniel Sandler7d276c32012-01-30 14:33:52 -0500490 * Window type: Dreams (screen saver) window, just above keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700491 * In multiuser systems shows only on the owning user's window.
Daniel Sandler7d276c32012-01-30 14:33:52 -0500492 * @hide
493 */
494 public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
495
496 /**
Jim Millere898ac52012-04-06 17:10:57 -0700497 * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700498 * In multiuser systems shows on all users' windows.
Jim Millere898ac52012-04-06 17:10:57 -0700499 * @hide
500 */
501 public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
502
503 /**
Dianne Hackborna4b7f2f2012-05-21 11:28:41 -0700504 * Window type: Behind the universe of the real windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700505 * In multiuser systems shows on all users' windows.
Dianne Hackborna4b7f2f2012-05-21 11:28:41 -0700506 * @hide
507 */
508 public static final int TYPE_UNIVERSE_BACKGROUND = FIRST_SYSTEM_WINDOW+25;
509
510 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -0700511 * Window type: Display overlay window. Used to simulate secondary display devices.
Craig Mautner88400d32012-09-30 12:35:45 -0700512 * In multiuser systems shows on all users' windows.
Jeff Brownbd6e1502012-08-28 03:27:37 -0700513 * @hide
514 */
515 public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
516
517 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700518 * Window type: Magnification overlay window. Used to highlight the magnified
519 * portion of a display when accessibility magnification is enabled.
Craig Mautner88400d32012-09-30 12:35:45 -0700520 * In multiuser systems shows on all users' windows.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700521 * @hide
522 */
523 public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
524
525 /**
Jim Miller5ecd8112013-01-09 18:50:26 -0800526 * Window type: keyguard scrim window. Shows if keyguard needs to be restarted.
527 * In multiuser systems shows on all users' windows.
528 * @hide
529 */
530 public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29;
531
Craig Mautner88400d32012-09-30 12:35:45 -0700532 /**
keunyounga446bf02013-06-21 19:07:57 -0700533 * Window type: Window for Presentation on top of private
534 * virtual display.
535 */
536 public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30;
537
538 /**
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700539 * Window type: Windows in the voice interaction layer.
540 * @hide
541 */
542 public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31;
543
544 /**
Svetoslav3a5c7212014-10-14 09:54:26 -0700545 * Window type: Windows that are overlaid <em>only</em> by an {@link
546 * android.accessibilityservice.AccessibilityService} for interception of
547 * user interactions without changing the windows an accessibility service
548 * can introspect. In particular, an accessibility service can introspect
549 * only windows that a sighted user can interact with which is they can touch
550 * these windows or can type into these windows. For example, if there
551 * is a full screen accessibility overlay that is touchable, the windows
552 * below it will be introspectable by an accessibility service regardless
553 * they are covered by a touchable window.
554 */
555 public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32;
556
557 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800558 * End of types of system windows.
559 */
560 public static final int LAST_SYSTEM_WINDOW = 2999;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800561
Mathias Agopiand2112302010-12-07 19:38:17 -0800562 /** @deprecated this is ignored, this value is set automatically when needed. */
563 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800564 public static final int MEMORY_TYPE_NORMAL = 0;
Mathias Agopiand2112302010-12-07 19:38:17 -0800565 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700566 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800567 public static final int MEMORY_TYPE_HARDWARE = 1;
Mathias Agopiand2112302010-12-07 19:38:17 -0800568 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700569 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800570 public static final int MEMORY_TYPE_GPU = 2;
Mathias Agopiand2112302010-12-07 19:38:17 -0800571 /** @deprecated this is ignored, this value is set automatically when needed. */
572 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800573 public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000574
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800575 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700576 * @deprecated this is ignored
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800577 */
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700578 @Deprecated
579 public int memoryType;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000580
Mike Lockwoodef731622010-01-27 17:51:34 -0500581 /** Window flag: as long as this window is visible to the user, allow
Wonsik Kim475e3f02014-03-17 11:17:47 +0000582 * the lock screen to activate while the screen is on.
583 * This can be used independently, or in combination with
Christopher Tate95f78502010-01-29 15:57:34 -0800584 * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
Mike Lockwoodef731622010-01-27 17:51:34 -0500585 public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
586
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800587 /** Window flag: everything behind this window will be dimmed.
588 * Use {@link #dimAmount} to control the amount of dim. */
589 public static final int FLAG_DIM_BEHIND = 0x00000002;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700590
591 /** Window flag: blur everything behind this window.
592 * @deprecated Blurring is no longer supported. */
593 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800594 public static final int FLAG_BLUR_BEHIND = 0x00000004;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700595
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800596 /** Window flag: this window won't ever get key input focus, so the
597 * user can not send key or other button events to it. Those will
598 * instead go to whatever focusable window is behind it. This flag
599 * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
600 * is explicitly set.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000601 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800602 * <p>Setting this flag also implies that the window will not need to
603 * interact with
Wonsik Kim475e3f02014-03-17 11:17:47 +0000604 * a soft input method, so it will be Z-ordered and positioned
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 * independently of any active input method (typically this means it
606 * gets Z-ordered on top of the input method, so it can use the full
607 * screen for its content and cover the input method if needed. You
608 * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
609 public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000610
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800611 /** Window flag: this window can never receive touch events. */
612 public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000613
John Spurlock33291d82013-03-13 14:45:14 -0400614 /** Window flag: even when this window is focusable (its
615 * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800616 * outside of the window to be sent to the windows behind it. Otherwise
617 * it will consume all pointer events itself, regardless of whether they
618 * are inside of the window. */
619 public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000620
John Spurlock33291d82013-03-13 14:45:14 -0400621 /** Window flag: when set, if the device is asleep when the touch
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800622 * screen is pressed, you will receive this first touch event. Usually
623 * the first touch event is consumed by the system since the user can
624 * not see what they are pressing on.
Jeff Brown037c33e2014-04-09 00:31:55 -0700625 *
626 * @deprecated This flag has no effect.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800627 */
Jeff Brown037c33e2014-04-09 00:31:55 -0700628 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800629 public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000630
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800631 /** Window flag: as long as this window is visible to the user, keep
632 * the device's screen turned on and bright. */
633 public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000634
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800635 /** Window flag: place the window within the entire screen, ignoring
John Spurlock33291d82013-03-13 14:45:14 -0400636 * decorations around the border (such as the status bar). The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800637 * window must correctly position its contents to take the screen
638 * decoration into account. This flag is normally set for you
639 * by Window as described in {@link Window#setFlags}. */
640 public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000641
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800642 /** Window flag: allow window to extend outside of the screen. */
643 public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000644
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800645 /**
John Spurlock33291d82013-03-13 14:45:14 -0400646 * Window flag: hide all screen decorations (such as the status bar) while
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800647 * this window is displayed. This allows the window to use the entire
648 * display space for itself -- the status bar will be hidden when
Chet Haase45c89c22013-04-29 16:04:40 -0700649 * an app window with this flag set is on the top layer. A fullscreen window
650 * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's
651 * {@link #softInputMode} field; the window will stay fullscreen
652 * and will not resize.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800653 *
654 * <p>This flag can be controlled in your theme through the
655 * {@link android.R.attr#windowFullscreen} attribute; this attribute
656 * is automatically set for you in the standard fullscreen themes
657 * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen},
658 * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen},
659 * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen},
660 * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen},
661 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen},
662 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and
663 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p>
664 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 public static final int FLAG_FULLSCREEN = 0x00000400;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000666
John Spurlock33291d82013-03-13 14:45:14 -0400667 /** Window flag: override {@link #FLAG_FULLSCREEN} and force the
668 * screen decorations (such as the status bar) to be shown. */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800669 public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000670
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800671 /** Window flag: turn on dithering when compositing this window to
Jeff Brown3cc321e2012-07-16 16:04:23 -0700672 * the screen.
673 * @deprecated This flag is no longer used. */
674 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800675 public static final int FLAG_DITHER = 0x00001000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000676
John Spurlock33291d82013-03-13 14:45:14 -0400677 /** Window flag: treat the content of the window as secure, preventing
Jeff Brownf0681b32012-10-23 17:35:57 -0700678 * it from appearing in screenshots or from being viewed on non-secure
679 * displays.
680 *
681 * <p>See {@link android.view.Display#FLAG_SECURE} for more details about
682 * secure surfaces and secure displays.
683 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800684 public static final int FLAG_SECURE = 0x00002000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000685
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800686 /** Window flag: a special mode where the layout parameters are used
687 * to perform scaling of the surface when it is composited to the
688 * screen. */
689 public static final int FLAG_SCALED = 0x00004000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000690
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800691 /** Window flag: intended for windows that will often be used when the user is
692 * holding the screen against their face, it will aggressively filter the event
693 * stream to prevent unintended presses in this situation that may not be
Wonsik Kim475e3f02014-03-17 11:17:47 +0000694 * desired for a particular window, when such an event stream is detected, the
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800695 * application will receive a CANCEL motion event to indicate this so applications
Wonsik Kim475e3f02014-03-17 11:17:47 +0000696 * can handle this accordingly by taking no action on the event
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800697 * until the finger is released. */
698 public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000699
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800700 /** Window flag: a special option only for use in combination with
701 * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
702 * screen your window may appear on top of or behind screen decorations
703 * such as the status bar. By also including this flag, the window
704 * manager will report the inset rectangle needed to ensure your
705 * content is not covered by screen decorations. This flag is normally
706 * set for you by Window as described in {@link Window#setFlags}.*/
707 public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000708
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
710 * respect to how this window interacts with the current method. That
711 * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
712 * window will behave as if it needs to interact with the input method
713 * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
714 * not set and this flag is set, then the window will behave as if it
715 * doesn't need to interact with the input method and can be placed
716 * to use more space and cover the input method.
717 */
718 public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000719
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800720 /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
721 * can set this flag to receive a single special MotionEvent with
722 * the action
723 * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
724 * touches that occur outside of your window. Note that you will not
725 * receive the full down/move/up gesture, only the location of the
726 * first down as an ACTION_OUTSIDE.
727 */
728 public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000729
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700730 /** Window flag: special flag to let windows be shown when the screen
731 * is locked. This will let application windows take precedence over
732 * key guard or any other lock screens. Can be used with
733 * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700734 * directly before showing the key guard window. Can be used with
735 * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
736 * non-secure keyguards. This flag only applies to the top-most
737 * full-screen window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700738 */
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700739 public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
740
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700741 /** Window flag: ask that the system wallpaper be shown behind
742 * your window. The window surface must be translucent to be able
743 * to actually see the wallpaper behind it; this flag just ensures
744 * that the wallpaper surface will be there if this window actually
745 * has translucent regions.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800746 *
747 * <p>This flag can be controlled in your theme through the
748 * {@link android.R.attr#windowShowWallpaper} attribute; this attribute
749 * is automatically set for you in the standard wallpaper themes
750 * such as {@link android.R.style#Theme_Wallpaper},
751 * {@link android.R.style#Theme_Wallpaper_NoTitleBar},
752 * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen},
753 * {@link android.R.style#Theme_Holo_Wallpaper},
754 * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar},
755 * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and
756 * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p>
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700757 */
758 public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000759
Dianne Hackborn93e462b2009-09-15 22:50:40 -0700760 /** Window flag: when set as a window is being added or made
761 * visible, once the window has been shown then the system will
762 * poke the power manager's user activity (as if the user had woken
763 * up the device) to turn the screen on. */
764 public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000765
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700766 /** Window flag: when set the window will cause the keyguard to
767 * be dismissed, only if it is not a secure lock keyguard. Because such
768 * a keyguard is not needed for security, it will never re-appear if
769 * the user navigates to another window (in contrast to
770 * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
771 * hide both secure and non-secure keyguards but ensure they reappear
772 * when the user moves to another UI that doesn't hide them).
773 * If the keyguard is currently active and is secure (requires an
774 * unlock pattern) than the user will still need to confirm it before
775 * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
Daniel Sandlerae069f72010-06-17 21:56:26 -0400776 * also been set.
777 */
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700778 public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000779
Jeff Brown01ce2e92010-09-26 22:20:12 -0700780 /** Window flag: when set the window will accept for touch events
781 * outside of its bounds to be sent to other windows that also
782 * support split touch. When this flag is not set, the first pointer
783 * that goes down determines the window to which all subsequent touches
784 * go until all pointers go up. When this flag is set, each pointer
785 * (not necessarily the first) that goes down determines the window
786 * to which all subsequent touches of that pointer will go until that
787 * pointer goes up thereby enabling touches with multiple pointers
788 * to be split across multiple windows.
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800789 */
Jeff Brown01ce2e92010-09-26 22:20:12 -0700790 public static final int FLAG_SPLIT_TOUCH = 0x00800000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000791
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800792 /**
Romain Guy72f0a272011-01-09 16:01:46 -0800793 * <p>Indicates whether this window should be hardware accelerated.
794 * Requesting hardware acceleration does not guarantee it will happen.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800795 *
Romain Guy72f0a272011-01-09 16:01:46 -0800796 * <p>This flag can be controlled programmatically <em>only</em> to enable
797 * hardware acceleration. To enable hardware acceleration for a given
798 * window programmatically, do the following:</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800799 *
Romain Guy72f0a272011-01-09 16:01:46 -0800800 * <pre>
801 * Window w = activity.getWindow(); // in Activity's onCreate() for instance
802 * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
803 * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
804 * </pre>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800805 *
Romain Guy72f0a272011-01-09 16:01:46 -0800806 * <p>It is important to remember that this flag <strong>must</strong>
807 * be set before setting the content view of your activity or dialog.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800808 *
Romain Guy72f0a272011-01-09 16:01:46 -0800809 * <p>This flag cannot be used to disable hardware acceleration after it
810 * was enabled in your manifest using
811 * {@link android.R.attr#hardwareAccelerated}. If you need to selectively
812 * and programmatically disable hardware acceleration (for automated testing
813 * for instance), make sure it is turned off in your manifest and enable it
814 * on your activity or dialog when you need it instead, using the method
815 * described above.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800816 *
Romain Guy72f0a272011-01-09 16:01:46 -0800817 * <p>This flag is automatically set by the system if the
818 * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
819 * XML attribute is set to true on an activity or on the application.</p>
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800820 */
821 public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000;
Daniel Sandler611fae42010-06-17 10:45:00 -0400822
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800823 /**
824 * Window flag: allow window contents to extend in to the screen's
Dianne Hackbornc652de82013-02-15 16:32:56 -0800825 * overscan area, if there is one. The window should still correctly
826 * position its contents to take the overscan area into account.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800827 *
828 * <p>This flag can be controlled in your theme through the
829 * {@link android.R.attr#windowOverscan} attribute; this attribute
830 * is automatically set for you in the standard overscan themes
Ying Wang4e0eb222013-04-18 20:39:48 -0700831 * such as
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800832 * {@link android.R.style#Theme_Holo_NoActionBar_Overscan},
833 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan},
834 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and
835 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p>
836 *
837 * <p>When this flag is enabled for a window, its normal content may be obscured
838 * to some degree by the overscan region of the display. To ensure key parts of
839 * that content are visible to the user, you can use
840 * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)}
841 * to set the point in the view hierarchy where the appropriate offsets should
842 * be applied. (This can be done either by directly calling this function, using
843 * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy,
844 * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect)
845 * View.fitSystemWindows(Rect)} method).</p>
846 *
847 * <p>This mechanism for positioning content elements is identical to its equivalent
848 * use with layout and {@link View#setSystemUiVisibility(int)
849 * View.setSystemUiVisibility(int)}; here is an example layout that will correctly
850 * position its UI elements with this overscan flag is set:</p>
851 *
852 * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete}
Dianne Hackbornc652de82013-02-15 16:32:56 -0800853 */
854 public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
855
John Spurlockbd957402013-10-03 11:38:39 -0400856 /**
857 * Window flag: request a translucent status bar with minimal system-provided
858 * background protection.
859 *
860 * <p>This flag can be controlled in your theme through the
861 * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute
862 * is automatically set for you in the standard translucent decor themes
863 * such as
864 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
865 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
866 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
867 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
868 *
869 * <p>When this flag is enabled for a window, it automatically sets
870 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
871 * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p>
872 */
873 public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000;
874
875 /**
876 * Window flag: request a translucent navigation bar with minimal system-provided
877 * background protection.
878 *
879 * <p>This flag can be controlled in your theme through the
880 * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute
881 * is automatically set for you in the standard translucent decor themes
882 * such as
883 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
884 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
885 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
886 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
887 *
888 * <p>When this flag is enabled for a window, it automatically sets
889 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
890 * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p>
891 */
892 public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000;
893
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800894 // ----- HIDDEN FLAGS.
895 // These start at the high bit and go down.
Jeff Brown98db5fa2011-06-08 15:37:10 -0700896
Adam Lesinski6a591f52013-10-01 18:11:17 -0700897 /**
898 * Flag for a window in local focus mode.
899 * Window in local focus mode can control focus independent of window manager using
900 * {@link Window#setLocalFocus(boolean, boolean)}.
901 * Usually window in this mode will not get touch/key events from window manager, but will
902 * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}.
903 */
904 public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000;
905
Jeff Brown98db5fa2011-06-08 15:37:10 -0700906 /** Window flag: Enable touches to slide out of a window into neighboring
907 * windows in mid-gesture instead of being captured for the duration of
908 * the gesture.
909 *
910 * This flag changes the behavior of touch focus for this window only.
911 * Touches can slide out of the window but they cannot necessarily slide
912 * back in (unless the other window with touch focus permits it).
913 *
914 * {@hide}
915 */
Adam Lesinski6a591f52013-10-01 18:11:17 -0700916 public static final int FLAG_SLIPPERY = 0x20000000;
Jeff Brown98db5fa2011-06-08 15:37:10 -0700917
Daniel Sandlere02d8082010-10-08 15:13:22 -0400918 /**
919 * Flag for a window belonging to an activity that responds to {@link KeyEvent#KEYCODE_MENU}
920 * and therefore needs a Menu key. For devices where Menu is a physical button this flag is
921 * ignored, but on devices where the Menu key is drawn in software it may be hidden unless
922 * this flag is set.
923 *
924 * (Note that Action Bars, when available, are the preferred way to offer additional
925 * functions otherwise accessed via an options menu.)
926 *
927 * {@hide}
928 */
Adam Lesinski6a591f52013-10-01 18:11:17 -0700929 public static final int FLAG_NEEDS_MENU_KEY = 0x40000000;
Daniel Sandlere02d8082010-10-08 15:13:22 -0400930
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800931 /**
Adrian Roos217ccd22014-05-09 14:29:04 +0200932 * Flag indicating that this Window is responsible for drawing the background for the
933 * system bars. If set, the system bars are drawn with a transparent background and the
934 * corresponding areas in this window are filled with the colors specified in
935 * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}.
936 */
937 public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000;
938
939 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700940 * Various behavioral options/flags. Default is none.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000941 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700942 * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
943 * @see #FLAG_DIM_BEHIND
944 * @see #FLAG_NOT_FOCUSABLE
945 * @see #FLAG_NOT_TOUCHABLE
946 * @see #FLAG_NOT_TOUCH_MODAL
947 * @see #FLAG_TOUCHABLE_WHEN_WAKING
948 * @see #FLAG_KEEP_SCREEN_ON
949 * @see #FLAG_LAYOUT_IN_SCREEN
950 * @see #FLAG_LAYOUT_NO_LIMITS
951 * @see #FLAG_FULLSCREEN
952 * @see #FLAG_FORCE_NOT_FULLSCREEN
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700953 * @see #FLAG_SECURE
954 * @see #FLAG_SCALED
955 * @see #FLAG_IGNORE_CHEEK_PRESSES
956 * @see #FLAG_LAYOUT_INSET_DECOR
957 * @see #FLAG_ALT_FOCUSABLE_IM
958 * @see #FLAG_WATCH_OUTSIDE_TOUCH
959 * @see #FLAG_SHOW_WHEN_LOCKED
960 * @see #FLAG_SHOW_WALLPAPER
961 * @see #FLAG_TURN_SCREEN_ON
962 * @see #FLAG_DISMISS_KEYGUARD
963 * @see #FLAG_SPLIT_TOUCH
964 * @see #FLAG_HARDWARE_ACCELERATED
keunyoung30f420f2013-08-02 14:23:10 -0700965 * @see #FLAG_LOCAL_FOCUS_MODE
Adrian Roos217ccd22014-05-09 14:29:04 +0200966 * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700967 */
968 @ViewDebug.ExportedProperty(flagMapping = {
969 @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON,
970 name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"),
971 @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND,
972 name = "FLAG_DIM_BEHIND"),
973 @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND,
974 name = "FLAG_BLUR_BEHIND"),
975 @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE,
976 name = "FLAG_NOT_FOCUSABLE"),
977 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE,
978 name = "FLAG_NOT_TOUCHABLE"),
979 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL,
980 name = "FLAG_NOT_TOUCH_MODAL"),
981 @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING,
982 name = "FLAG_TOUCHABLE_WHEN_WAKING"),
983 @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON,
984 name = "FLAG_KEEP_SCREEN_ON"),
985 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN,
986 name = "FLAG_LAYOUT_IN_SCREEN"),
987 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS,
988 name = "FLAG_LAYOUT_NO_LIMITS"),
989 @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN,
990 name = "FLAG_FULLSCREEN"),
991 @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN,
992 name = "FLAG_FORCE_NOT_FULLSCREEN"),
993 @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER,
994 name = "FLAG_DITHER"),
995 @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE,
996 name = "FLAG_SECURE"),
997 @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED,
998 name = "FLAG_SCALED"),
999 @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES,
1000 name = "FLAG_IGNORE_CHEEK_PRESSES"),
1001 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR,
1002 name = "FLAG_LAYOUT_INSET_DECOR"),
1003 @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM,
1004 name = "FLAG_ALT_FOCUSABLE_IM"),
1005 @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH,
1006 name = "FLAG_WATCH_OUTSIDE_TOUCH"),
1007 @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED,
1008 name = "FLAG_SHOW_WHEN_LOCKED"),
1009 @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER,
1010 name = "FLAG_SHOW_WALLPAPER"),
1011 @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON,
1012 name = "FLAG_TURN_SCREEN_ON"),
1013 @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD,
1014 name = "FLAG_DISMISS_KEYGUARD"),
1015 @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH,
1016 name = "FLAG_SPLIT_TOUCH"),
1017 @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED,
keunyoung30f420f2013-08-02 14:23:10 -07001018 name = "FLAG_HARDWARE_ACCELERATED"),
1019 @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE,
John Spurlockbd957402013-10-03 11:38:39 -04001020 name = "FLAG_LOCAL_FOCUS_MODE"),
1021 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS,
1022 name = "FLAG_TRANSLUCENT_STATUS"),
1023 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION,
Adrian Roos217ccd22014-05-09 14:29:04 +02001024 name = "FLAG_TRANSLUCENT_NAVIGATION"),
1025 @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
1026 name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS")
Jon Miranda4597e982014-07-29 07:25:49 -07001027 }, formatToHexString = true)
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001028 public int flags;
1029
1030 /**
John Reck61375a82014-09-18 19:27:48 +00001031 * If the window has requested hardware acceleration, but this is not
1032 * allowed in the process it is in, then still render it as if it is
1033 * hardware accelerated. This is used for the starting preview windows
1034 * in the system process, which don't need to have the overhead of
1035 * hardware acceleration (they are just a static rendering), but should
1036 * be rendered as such to match the actual window of the app even if it
1037 * is hardware accelerated.
1038 * Even if the window isn't hardware accelerated, still do its rendering
1039 * as if it was.
1040 * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
1041 * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
1042 * is generally disabled. This flag must be specified in addition to
1043 * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
1044 * windows.
1045 *
1046 * @hide
1047 */
1048 public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
1049
1050 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001051 * In the system process, we globally do not use hardware acceleration
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001052 * because there are many threads doing UI there and they conflict.
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001053 * If certain parts of the UI that really do want to use hardware
1054 * acceleration, this flag can be set to force it. This is basically
1055 * for the lock screen. Anyone else using it, you are probably wrong.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001056 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001057 * @hide
1058 */
1059 public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
1060
1061 /**
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001062 * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001063 * may elect to skip these notifications if they are not doing anything productive with
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001064 * them (they do not affect the wallpaper scrolling operation) by calling
1065 * {@link
1066 * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}.
1067 *
1068 * @hide
1069 */
1070 public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
1071
1072 /**
Dianne Hackborn73ab6a42011-12-13 11:16:23 -08001073 * This is set for a window that has explicitly specified its
1074 * FLAG_NEEDS_MENU_KEY, so we know the value on this window is the
1075 * appropriate one to use. If this is not set, we should look at
1076 * windows behind it to determine the appropriate value.
1077 *
1078 * @hide
1079 */
1080 public static final int PRIVATE_FLAG_SET_NEEDS_MENU_KEY = 0x00000008;
1081
Craig Mautner88400d32012-09-30 12:35:45 -07001082 /** In a multiuser system if this flag is set and the owner is a system process then this
1083 * window will appear on all user screens. This overrides the default behavior of window
1084 * types that normally only appear on the owning user's screen. Refer to each window type
1085 * to determine its default behavior.
1086 *
1087 * {@hide} */
1088 public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
1089
Dianne Hackborn73ab6a42011-12-13 11:16:23 -08001090 /**
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001091 * Never animate position changes of the window.
1092 *
1093 * {@hide} */
1094 public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040;
1095
Adam Lesinski6a591f52013-10-01 18:11:17 -07001096 /** Window flag: special flag to limit the size of the window to be
1097 * original size ([320x480] x density). Used to create window for applications
1098 * running under compatibility mode.
1099 *
1100 * {@hide} */
1101 public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080;
1102
1103 /** Window flag: a special option intended for system dialogs. When
1104 * this flag is set, the window will demand focus unconditionally when
1105 * it is created.
1106 * {@hide} */
1107 public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;
1108
John Spurlock3f7cd512013-10-07 12:25:09 -04001109 /** Window flag: maintain the previous translucent decor state when this window
John Spurlockbd957402013-10-03 11:38:39 -04001110 * becomes top-most.
1111 * {@hide} */
1112 public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200;
1113
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001114 /**
Jorim Jaggi380ecb82014-03-14 17:25:20 +01001115 * Flag whether the current window is a keyguard window, meaning that it will hide all other
1116 * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set.
1117 * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1118 * {@hide}
1119 */
1120 public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400;
1121
1122 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001123 * Control flags that are private to the platform.
1124 * @hide
1125 */
1126 public int privateFlags;
1127
1128 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001129 * Given a particular set of window manager flags, determine whether
1130 * such a window may be a target for an input method when it has
1131 * focus. In particular, this checks the
1132 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
1133 * flags and returns true if the combination of the two corresponds
1134 * to a window that needs to be behind the input method so that the
1135 * user can type into it.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001136 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001137 * @param flags The current window manager flags.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001138 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001139 * @return Returns true if such a window should be behind/interact
1140 * with an input method, false if not.
1141 */
1142 public static boolean mayUseInputMethod(int flags) {
1143 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
1144 case 0:
1145 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
1146 return true;
1147 }
1148 return false;
1149 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001150
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001151 /**
1152 * Mask for {@link #softInputMode} of the bits that determine the
1153 * desired visibility state of the soft input area for this window.
1154 */
1155 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001156
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001157 /**
1158 * Visibility state for {@link #softInputMode}: no state has been specified.
1159 */
1160 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001161
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001162 /**
1163 * Visibility state for {@link #softInputMode}: please don't change the state of
1164 * the soft input area.
1165 */
1166 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001167
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001168 /**
1169 * Visibility state for {@link #softInputMode}: please hide any soft input
1170 * area when normally appropriate (when the user is navigating
1171 * forward to your window).
1172 */
1173 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001174
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001175 /**
1176 * Visibility state for {@link #softInputMode}: please always hide any
1177 * soft input area when this window receives focus.
1178 */
1179 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001180
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001181 /**
1182 * Visibility state for {@link #softInputMode}: please show the soft
1183 * input area when normally appropriate (when the user is navigating
1184 * forward to your window).
1185 */
1186 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001187
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001188 /**
1189 * Visibility state for {@link #softInputMode}: please always make the
1190 * soft input area visible when this window receives input focus.
1191 */
1192 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001193
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001194 /**
1195 * Mask for {@link #softInputMode} of the bits that determine the
1196 * way that the window should be adjusted to accommodate the soft
1197 * input window.
1198 */
1199 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001200
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001201 /** Adjustment option for {@link #softInputMode}: nothing specified.
1202 * The system will try to pick one or
1203 * the other depending on the contents of the window.
1204 */
1205 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001206
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001207 /** Adjustment option for {@link #softInputMode}: set to allow the
1208 * window to be resized when an input
1209 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001210 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001211 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1212 * neither of these are set, then the system will try to pick one or
Chet Haase45c89c22013-04-29 16:04:40 -07001213 * the other depending on the contents of the window. If the window's
1214 * layout parameter flags include {@link #FLAG_FULLSCREEN}, this
1215 * value for {@link #softInputMode} will be ignored; the window will
1216 * not resize, but will stay fullscreen.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001217 */
1218 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001219
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001220 /** Adjustment option for {@link #softInputMode}: set to have a window
1221 * pan when an input method is
1222 * shown, so it doesn't need to deal with resizing but just panned
1223 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001224 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001225 * neither of these are set, then the system will try to pick one or
1226 * the other depending on the contents of the window.
1227 */
1228 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001229
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001230 /** Adjustment option for {@link #softInputMode}: set to have a window
1231 * not adjust for a shown input method. The window will not be resized,
1232 * and it will not be panned to make its focus visible.
1233 */
1234 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1235
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001236 /**
1237 * Bit for {@link #softInputMode}: set when the user has navigated
1238 * forward to the window. This is normally set automatically for
1239 * you by the system, though you may want to set it in certain cases
1240 * when you are displaying a window yourself. This flag will always
1241 * be cleared automatically after the window is displayed.
1242 */
1243 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001244
1245 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001246 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001247 * of:
Wonsik Kim475e3f02014-03-17 11:17:47 +00001248 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001249 * <ul>
1250 * <li> One of the visibility states
1251 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1252 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1253 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1254 * <li> One of the adjustment options
1255 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1256 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1257 * {@link #SOFT_INPUT_ADJUST_PAN}.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -08001258 * </ul>
1259 *
1260 *
1261 * <p>This flag can be controlled in your theme through the
1262 * {@link android.R.attr#windowSoftInputMode} attribute.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001263 */
1264 public int softInputMode;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001265
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001266 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001267 * Placement of window within the screen as per {@link Gravity}. Both
1268 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1269 * android.graphics.Rect) Gravity.apply} and
1270 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1271 * Gravity.applyDisplay} are used during window layout, with this value
1272 * given as the desired gravity. For example you can specify
1273 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1274 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1275 * to control the behavior of
1276 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1277 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 *
1279 * @see Gravity
1280 */
1281 public int gravity;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001282
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001283 /**
1284 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001285 * between the container and the widget. See
1286 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1287 * android.graphics.Rect) Gravity.apply} for how this is used. This
1288 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289 */
1290 public float horizontalMargin;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001291
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001292 /**
1293 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001294 * between the container and the widget. See
1295 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1296 * android.graphics.Rect) Gravity.apply} for how this is used. This
1297 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001298 */
1299 public float verticalMargin;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001300
1301 /**
1302 * Positive insets between the drawing surface and window content.
1303 *
1304 * @hide
1305 */
Alan Viverette49a22e82014-07-12 20:01:27 -07001306 public Rect surfaceInsets = new Rect();
Wonsik Kim475e3f02014-03-17 11:17:47 +00001307
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001308 /**
1309 * The desired bitmap format. May be one of the constants in
1310 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1311 */
1312 public int format;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001313
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001314 /**
1315 * A style resource defining the animations to use for this window.
1316 * This must be a system resource; it can not be an application resource
1317 * because the window manager does not have access to applications.
1318 */
1319 public int windowAnimations;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001320
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001321 /**
1322 * An alpha value to apply to this entire window.
1323 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1324 */
1325 public float alpha = 1.0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001326
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001327 /**
1328 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1329 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1330 * dim.
1331 */
1332 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001333
1334 /**
1335 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1336 * indicating that the brightness value is not overridden for this window
1337 * and normal brightness policy should be used.
1338 */
1339 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1340
1341 /**
1342 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1343 * indicating that the screen or button backlight brightness should be set
1344 * to the lowest value when this window is in front.
1345 */
1346 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1347
1348 /**
1349 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1350 * indicating that the screen or button backlight brightness should be set
1351 * to the hightest value when this window is in front.
1352 */
1353 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001355 /**
1356 * This can be used to override the user's preferred brightness of
1357 * the screen. A value of less than 0, the default, means to use the
1358 * preferred screen brightness. 0 to 1 adjusts the brightness from
1359 * dark to full bright.
1360 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001361 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001362
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001363 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001364 * This can be used to override the standard behavior of the button and
1365 * keyboard backlights. A value of less than 0, the default, means to
1366 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1367 * from dark to full bright.
1368 */
1369 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1370
1371 /**
Craig Mautner3c174372013-02-21 17:54:37 -08001372 * Value for {@link #rotationAnimation} to define the animation used to
1373 * specify that this window will rotate in or out following a rotation.
1374 */
1375 public static final int ROTATION_ANIMATION_ROTATE = 0;
1376
1377 /**
1378 * Value for {@link #rotationAnimation} to define the animation used to
1379 * specify that this window will fade in or out following a rotation.
1380 */
1381 public static final int ROTATION_ANIMATION_CROSSFADE = 1;
1382
1383 /**
1384 * Value for {@link #rotationAnimation} to define the animation used to
1385 * specify that this window will immediately disappear or appear following
1386 * a rotation.
1387 */
1388 public static final int ROTATION_ANIMATION_JUMPCUT = 2;
1389
1390 /**
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001391 * Define the exit and entry animations used on this window when the device is rotated.
1392 * This only has an affect if the incoming and outgoing topmost
Craig Mautner3c174372013-02-21 17:54:37 -08001393 * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001394 * by other windows. All other situations default to the
1395 * {@link #ROTATION_ANIMATION_ROTATE} behavior.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001396 *
Craig Mautner3c174372013-02-21 17:54:37 -08001397 * @see #ROTATION_ANIMATION_ROTATE
1398 * @see #ROTATION_ANIMATION_CROSSFADE
1399 * @see #ROTATION_ANIMATION_JUMPCUT
1400 */
1401 public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
1402
1403 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001404 * Identifier for this window. This will usually be filled in for
1405 * you.
1406 */
1407 public IBinder token = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001408
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001409 /**
1410 * Name of the package owning this window.
1411 */
1412 public String packageName = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001413
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001414 /**
1415 * Specific orientation value for a window.
1416 * May be any of the same values allowed
Wonsik Kim475e3f02014-03-17 11:17:47 +00001417 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1418 * If not set, a default value of
1419 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001420 * will be used.
1421 */
1422 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001423
1424 /**
Michael Wright3f145a22014-07-22 19:46:03 -07001425 * The preferred refresh rate for the window.
1426 *
1427 * This must be one of the supported refresh rates obtained for the display(s) the window
1428 * is on.
1429 *
1430 * @see Display#getSupportedRefreshRates()
1431 */
1432 public float preferredRefreshRate;
1433
1434 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001435 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001436 *
1437 * @see View#STATUS_BAR_VISIBLE
1438 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001439 */
1440 public int systemUiVisibility;
1441
1442 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001443 * @hide
1444 * The ui visibility as requested by the views in this hierarchy.
1445 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1446 */
1447 public int subtreeSystemUiVisibility;
1448
1449 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001450 * Get callbacks about the system ui visibility changing.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001451 *
Joe Onorato664644d2011-01-23 17:53:23 -08001452 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1453 *
1454 * @hide
1455 */
1456 public boolean hasSystemUiListeners;
1457
Jeff Brown474dcb52011-06-14 20:22:50 -07001458 /**
1459 * When this window has focus, disable touch pad pointer gesture processing.
1460 * The window will receive raw position updates from the touch pad instead
1461 * of pointer movements and synthetic touch events.
1462 *
1463 * @hide
1464 */
1465 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1466
1467 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001468 * Does not construct an input channel for this window. The channel will therefore
1469 * be incapable of receiving input.
1470 *
1471 * @hide
1472 */
1473 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1474
1475 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001476 * When this window has focus, does not call user activity for all input events so
1477 * the application will have to do it itself. Should only be used by
1478 * the keyguard and phone app.
1479 * <p>
1480 * Should only be used by the keyguard and phone app.
1481 * </p>
1482 *
1483 * @hide
1484 */
1485 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1486
1487 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001488 * Control special features of the input subsystem.
1489 *
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001490 * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001491 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001492 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001493 * @hide
1494 */
1495 public int inputFeatures;
1496
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001497 /**
1498 * Sets the number of milliseconds before the user activity timeout occurs
1499 * when this window has focus. A value of -1 uses the standard timeout.
1500 * A value of 0 uses the minimum support display timeout.
1501 * <p>
1502 * This property can only be used to reduce the user specified display timeout;
1503 * it can never make the timeout longer than it normally would be.
1504 * </p><p>
1505 * Should only be used by the keyguard and phone app.
1506 * </p>
1507 *
1508 * @hide
1509 */
1510 public long userActivityTimeout = -1;
1511
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001512 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001513 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001514 type = TYPE_APPLICATION;
1515 format = PixelFormat.OPAQUE;
1516 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001517
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001518 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001519 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001520 type = _type;
1521 format = PixelFormat.OPAQUE;
1522 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001523
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001524 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001525 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001526 type = _type;
1527 flags = _flags;
1528 format = PixelFormat.OPAQUE;
1529 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001530
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001531 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001532 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001533 type = _type;
1534 flags = _flags;
1535 format = _format;
1536 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001538 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1539 super(w, h);
1540 type = _type;
1541 flags = _flags;
1542 format = _format;
1543 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001544
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001545 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1546 int _flags, int _format) {
1547 super(w, h);
1548 x = xpos;
1549 y = ypos;
1550 type = _type;
1551 flags = _flags;
1552 format = _format;
1553 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001554
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001555 public final void setTitle(CharSequence title) {
1556 if (null == title)
1557 title = "";
Wonsik Kim475e3f02014-03-17 11:17:47 +00001558
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001559 mTitle = TextUtils.stringOrSpannedString(title);
1560 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001561
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001562 public final CharSequence getTitle() {
1563 return mTitle;
1564 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001566 public int describeContents() {
1567 return 0;
1568 }
1569
1570 public void writeToParcel(Parcel out, int parcelableFlags) {
1571 out.writeInt(width);
1572 out.writeInt(height);
1573 out.writeInt(x);
1574 out.writeInt(y);
1575 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001576 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001577 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001578 out.writeInt(softInputMode);
1579 out.writeInt(gravity);
1580 out.writeFloat(horizontalMargin);
1581 out.writeFloat(verticalMargin);
1582 out.writeInt(format);
1583 out.writeInt(windowAnimations);
1584 out.writeFloat(alpha);
1585 out.writeFloat(dimAmount);
1586 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001587 out.writeFloat(buttonBrightness);
Craig Mautner3c174372013-02-21 17:54:37 -08001588 out.writeInt(rotationAnimation);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001589 out.writeStrongBinder(token);
1590 out.writeString(packageName);
1591 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1592 out.writeInt(screenOrientation);
Michael Wright3f145a22014-07-22 19:46:03 -07001593 out.writeFloat(preferredRefreshRate);
Joe Onorato664644d2011-01-23 17:53:23 -08001594 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001595 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001596 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001597 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001598 out.writeLong(userActivityTimeout);
Alan Viverette49a22e82014-07-12 20:01:27 -07001599 out.writeInt(surfaceInsets.left);
1600 out.writeInt(surfaceInsets.top);
1601 out.writeInt(surfaceInsets.right);
1602 out.writeInt(surfaceInsets.bottom);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001603 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001604
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001605 public static final Parcelable.Creator<LayoutParams> CREATOR
1606 = new Parcelable.Creator<LayoutParams>() {
1607 public LayoutParams createFromParcel(Parcel in) {
1608 return new LayoutParams(in);
1609 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001610
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001611 public LayoutParams[] newArray(int size) {
1612 return new LayoutParams[size];
1613 }
1614 };
Wonsik Kim475e3f02014-03-17 11:17:47 +00001615
1616
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 public LayoutParams(Parcel in) {
1618 width = in.readInt();
1619 height = in.readInt();
1620 x = in.readInt();
1621 y = in.readInt();
1622 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001623 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001624 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001625 softInputMode = in.readInt();
1626 gravity = in.readInt();
1627 horizontalMargin = in.readFloat();
1628 verticalMargin = in.readFloat();
1629 format = in.readInt();
1630 windowAnimations = in.readInt();
1631 alpha = in.readFloat();
1632 dimAmount = in.readFloat();
1633 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001634 buttonBrightness = in.readFloat();
Craig Mautner3c174372013-02-21 17:54:37 -08001635 rotationAnimation = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001636 token = in.readStrongBinder();
1637 packageName = in.readString();
1638 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1639 screenOrientation = in.readInt();
Michael Wright3f145a22014-07-22 19:46:03 -07001640 preferredRefreshRate = in.readFloat();
Joe Onorato664644d2011-01-23 17:53:23 -08001641 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001642 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001643 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001644 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001645 userActivityTimeout = in.readLong();
Alan Viverette49a22e82014-07-12 20:01:27 -07001646 surfaceInsets.left = in.readInt();
1647 surfaceInsets.top = in.readInt();
1648 surfaceInsets.right = in.readInt();
1649 surfaceInsets.bottom = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001650 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001651
Romain Guy72998072009-06-22 11:09:20 -07001652 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001653 public static final int LAYOUT_CHANGED = 1<<0;
1654 public static final int TYPE_CHANGED = 1<<1;
1655 public static final int FLAGS_CHANGED = 1<<2;
1656 public static final int FORMAT_CHANGED = 1<<3;
1657 public static final int ANIMATION_CHANGED = 1<<4;
1658 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1659 public static final int TITLE_CHANGED = 1<<6;
1660 public static final int ALPHA_CHANGED = 1<<7;
1661 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1662 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1663 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1664 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Craig Mautner3c174372013-02-21 17:54:37 -08001665 public static final int ROTATION_ANIMATION_CHANGED = 1<<12;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001666 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001667 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13;
Joe Onorato664644d2011-01-23 17:53:23 -08001668 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001669 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14;
Joe Onorato664644d2011-01-23 17:53:23 -08001670 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001671 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15;
Jeff Brown474dcb52011-06-14 20:22:50 -07001672 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001673 public static final int INPUT_FEATURES_CHANGED = 1<<16;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001674 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001675 public static final int PRIVATE_FLAGS_CHANGED = 1<<17;
Romain Guyf21c9b02011-09-06 16:56:54 -07001676 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001677 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18;
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001678 /** {@hide} */
John Spurlockbd957402013-10-03 11:38:39 -04001679 public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
1680 /** {@hide} */
Alan Viverette49a22e82014-07-12 20:01:27 -07001681 public static final int SURFACE_INSETS_CHANGED = 1<<20;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001682 /** {@hide} */
Michael Wright3f145a22014-07-22 19:46:03 -07001683 public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
1684 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001685 public static final int EVERYTHING_CHANGED = 0xffffffff;
1686
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001687 // internal buffer to backup/restore parameters under compatibility mode.
1688 private int[] mCompatibilityParamsBackup = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001689
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001690 public final int copyFrom(LayoutParams o) {
1691 int changes = 0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001692
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001693 if (width != o.width) {
1694 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001695 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001696 }
1697 if (height != o.height) {
1698 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001699 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001700 }
1701 if (x != o.x) {
1702 x = o.x;
1703 changes |= LAYOUT_CHANGED;
1704 }
1705 if (y != o.y) {
1706 y = o.y;
1707 changes |= LAYOUT_CHANGED;
1708 }
1709 if (horizontalWeight != o.horizontalWeight) {
1710 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001711 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001712 }
1713 if (verticalWeight != o.verticalWeight) {
1714 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001715 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001716 }
1717 if (horizontalMargin != o.horizontalMargin) {
1718 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001719 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001720 }
1721 if (verticalMargin != o.verticalMargin) {
1722 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001723 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001724 }
1725 if (type != o.type) {
1726 type = o.type;
1727 changes |= TYPE_CHANGED;
1728 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001729 if (flags != o.flags) {
John Spurlockbd957402013-10-03 11:38:39 -04001730 final int diff = flags ^ o.flags;
1731 if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) {
1732 changes |= TRANSLUCENT_FLAGS_CHANGED;
1733 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001734 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001735 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001736 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001737 if (privateFlags != o.privateFlags) {
1738 privateFlags = o.privateFlags;
1739 changes |= PRIVATE_FLAGS_CHANGED;
1740 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001741 if (softInputMode != o.softInputMode) {
1742 softInputMode = o.softInputMode;
1743 changes |= SOFT_INPUT_MODE_CHANGED;
1744 }
1745 if (gravity != o.gravity) {
1746 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001747 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001748 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001749 if (format != o.format) {
1750 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001751 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001752 }
1753 if (windowAnimations != o.windowAnimations) {
1754 windowAnimations = o.windowAnimations;
1755 changes |= ANIMATION_CHANGED;
1756 }
1757 if (token == null) {
1758 // NOTE: token only copied if the recipient doesn't
1759 // already have one.
1760 token = o.token;
1761 }
1762 if (packageName == null) {
1763 // NOTE: packageName only copied if the recipient doesn't
1764 // already have one.
1765 packageName = o.packageName;
1766 }
1767 if (!mTitle.equals(o.mTitle)) {
1768 mTitle = o.mTitle;
1769 changes |= TITLE_CHANGED;
1770 }
1771 if (alpha != o.alpha) {
1772 alpha = o.alpha;
1773 changes |= ALPHA_CHANGED;
1774 }
1775 if (dimAmount != o.dimAmount) {
1776 dimAmount = o.dimAmount;
1777 changes |= DIM_AMOUNT_CHANGED;
1778 }
1779 if (screenBrightness != o.screenBrightness) {
1780 screenBrightness = o.screenBrightness;
1781 changes |= SCREEN_BRIGHTNESS_CHANGED;
1782 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001783 if (buttonBrightness != o.buttonBrightness) {
1784 buttonBrightness = o.buttonBrightness;
1785 changes |= BUTTON_BRIGHTNESS_CHANGED;
1786 }
Craig Mautner3c174372013-02-21 17:54:37 -08001787 if (rotationAnimation != o.rotationAnimation) {
1788 rotationAnimation = o.rotationAnimation;
1789 changes |= ROTATION_ANIMATION_CHANGED;
1790 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001791
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001792 if (screenOrientation != o.screenOrientation) {
1793 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07001794 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001795 }
Romain Guy529b60a2010-08-03 18:05:47 -07001796
Michael Wright3f145a22014-07-22 19:46:03 -07001797 if (preferredRefreshRate != o.preferredRefreshRate) {
1798 preferredRefreshRate = o.preferredRefreshRate;
1799 changes |= PREFERRED_REFRESH_RATE_CHANGED;
1800 }
1801
Joe Onorato14782f72011-01-25 19:53:17 -08001802 if (systemUiVisibility != o.systemUiVisibility
1803 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08001804 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08001805 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08001806 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
1807 }
1808
1809 if (hasSystemUiListeners != o.hasSystemUiListeners) {
1810 hasSystemUiListeners = o.hasSystemUiListeners;
1811 changes |= SYSTEM_UI_LISTENER_CHANGED;
1812 }
1813
Jeff Brown474dcb52011-06-14 20:22:50 -07001814 if (inputFeatures != o.inputFeatures) {
1815 inputFeatures = o.inputFeatures;
1816 changes |= INPUT_FEATURES_CHANGED;
1817 }
1818
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001819 if (userActivityTimeout != o.userActivityTimeout) {
1820 userActivityTimeout = o.userActivityTimeout;
1821 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
1822 }
1823
Alan Viverette49a22e82014-07-12 20:01:27 -07001824 if (!surfaceInsets.equals(o.surfaceInsets)) {
1825 surfaceInsets.set(o.surfaceInsets);
1826 changes |= SURFACE_INSETS_CHANGED;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001827 }
1828
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001829 return changes;
1830 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001831
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001832 @Override
1833 public String debug(String output) {
1834 output += "Contents of " + this + ":";
1835 Log.d("Debug", output);
1836 output = super.debug("");
1837 Log.d("Debug", output);
1838 Log.d("Debug", "");
1839 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
1840 return "";
1841 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001842
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001843 @Override
1844 public String toString() {
1845 StringBuilder sb = new StringBuilder(256);
1846 sb.append("WM.LayoutParams{");
1847 sb.append("(");
1848 sb.append(x);
1849 sb.append(',');
1850 sb.append(y);
1851 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08001852 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001853 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08001854 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001855 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001856 if (horizontalMargin != 0) {
1857 sb.append(" hm=");
1858 sb.append(horizontalMargin);
1859 }
1860 if (verticalMargin != 0) {
1861 sb.append(" vm=");
1862 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001863 }
1864 if (gravity != 0) {
1865 sb.append(" gr=#");
1866 sb.append(Integer.toHexString(gravity));
1867 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001868 if (softInputMode != 0) {
1869 sb.append(" sim=#");
1870 sb.append(Integer.toHexString(softInputMode));
1871 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001872 sb.append(" ty=");
1873 sb.append(type);
1874 sb.append(" fl=#");
1875 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001876 if (privateFlags != 0) {
Adam Lesinski95c42972013-10-02 10:13:27 -07001877 if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
1878 sb.append(" compatible=true");
1879 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001880 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
1881 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001882 if (format != PixelFormat.OPAQUE) {
1883 sb.append(" fmt=");
1884 sb.append(format);
1885 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001886 if (windowAnimations != 0) {
1887 sb.append(" wanim=0x");
1888 sb.append(Integer.toHexString(windowAnimations));
1889 }
1890 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
1891 sb.append(" or=");
1892 sb.append(screenOrientation);
1893 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001894 if (alpha != 1.0f) {
1895 sb.append(" alpha=");
1896 sb.append(alpha);
1897 }
1898 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1899 sb.append(" sbrt=");
1900 sb.append(screenBrightness);
1901 }
1902 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1903 sb.append(" bbrt=");
1904 sb.append(buttonBrightness);
1905 }
Craig Mautner3c174372013-02-21 17:54:37 -08001906 if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
1907 sb.append(" rotAnim=");
1908 sb.append(rotationAnimation);
1909 }
Michael Wright3f145a22014-07-22 19:46:03 -07001910 if (preferredRefreshRate != 0) {
1911 sb.append(" preferredRefreshRate=");
1912 sb.append(preferredRefreshRate);
1913 }
Joe Onorato664644d2011-01-23 17:53:23 -08001914 if (systemUiVisibility != 0) {
1915 sb.append(" sysui=0x");
1916 sb.append(Integer.toHexString(systemUiVisibility));
1917 }
Joe Onorato14782f72011-01-25 19:53:17 -08001918 if (subtreeSystemUiVisibility != 0) {
1919 sb.append(" vsysui=0x");
1920 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
1921 }
Joe Onorato664644d2011-01-23 17:53:23 -08001922 if (hasSystemUiListeners) {
1923 sb.append(" sysuil=");
1924 sb.append(hasSystemUiListeners);
1925 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001926 if (inputFeatures != 0) {
1927 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
1928 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001929 if (userActivityTimeout >= 0) {
1930 sb.append(" userActivityTimeout=").append(userActivityTimeout);
1931 }
Alan Viverette49a22e82014-07-12 20:01:27 -07001932 if (!surfaceInsets.equals(Insets.NONE)) {
1933 sb.append(" surfaceInsets=").append(surfaceInsets);
Alan Viveretteccb11e12014-07-08 16:04:02 -07001934 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001935 sb.append('}');
1936 return sb.toString();
1937 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07001938
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001939 /**
1940 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07001941 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001942 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07001943 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07001944 x = (int) (x * scale + 0.5f);
1945 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001946 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07001947 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001948 }
1949 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07001950 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07001951 }
1952 }
1953
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001954 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001955 * Backup the layout parameters used in compatibility mode.
1956 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001957 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001958 void backup() {
1959 int[] backup = mCompatibilityParamsBackup;
1960 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07001961 // we backup 4 elements, x, y, width, height
1962 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001963 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001964 backup[0] = x;
1965 backup[1] = y;
1966 backup[2] = width;
1967 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001968 }
1969
1970 /**
1971 * Restore the layout params' coordinates, size and gravity
1972 * @see LayoutParams#backup()
1973 */
1974 void restore() {
1975 int[] backup = mCompatibilityParamsBackup;
1976 if (backup != null) {
1977 x = backup[0];
1978 y = backup[1];
1979 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001980 height = backup[3];
1981 }
1982 }
1983
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001984 private CharSequence mTitle = "";
1985 }
1986}