blob: 2d230e16783c9432bafd53b45dfd16d39a137bdb [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
Bryce Lee53b9fbd2015-02-06 12:06:34 -080019import android.annotation.SystemApi;
Jeff Browna492c3a2012-08-23 19:48:44 -070020import android.app.Presentation;
21import android.content.Context;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.pm.ActivityInfo;
23import 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>
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700166 *
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
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700173 * @see #TYPE_APPLICATION_ABOVE_SUB_PANEL
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800174 * @see #TYPE_APPLICATION_ATTACHED_DIALOG
175 * @see #TYPE_STATUS_BAR
176 * @see #TYPE_SEARCH_BAR
177 * @see #TYPE_PHONE
178 * @see #TYPE_SYSTEM_ALERT
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800179 * @see #TYPE_TOAST
180 * @see #TYPE_SYSTEM_OVERLAY
181 * @see #TYPE_PRIORITY_PHONE
182 * @see #TYPE_STATUS_BAR_PANEL
183 * @see #TYPE_SYSTEM_DIALOG
184 * @see #TYPE_KEYGUARD_DIALOG
185 * @see #TYPE_SYSTEM_ERROR
186 * @see #TYPE_INPUT_METHOD
187 * @see #TYPE_INPUT_METHOD_DIALOG
188 */
Joe Onorato8f2bd432010-03-25 11:45:28 -0700189 @ViewDebug.ExportedProperty(mapping = {
190 @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
191 @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
192 @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
193 @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
194 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
195 @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700196 @ViewDebug.IntToString(from = TYPE_APPLICATION_ABOVE_SUB_PANEL, to = "TYPE_APPLICATION_ABOVE_SUB_PANEL"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700197 @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700198 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700199 @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"),
200 @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"),
201 @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"),
202 @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700203 @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"),
204 @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"),
205 @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700206 @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"),
207 @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"),
208 @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
209 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
Jeff Brown3b2b3542010-10-15 00:54:27 -0700210 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700211 @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
212 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700213 @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700214 @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
215 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
216 @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
217 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
218 @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700219 @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"),
220 @ViewDebug.IntToString(from = TYPE_HIDDEN_NAV_CONSUMER, to = "TYPE_HIDDEN_NAV_CONSUMER"),
221 @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"),
Jeff Brownbd6e1502012-08-28 03:27:37 -0700222 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"),
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700223 @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"),
keunyounga446bf02013-06-21 19:07:57 -0700224 @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"),
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700225 @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"),
226 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"),
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700227 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION_STARTING, to = "TYPE_VOICE_INTERACTION_STARTING"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700228 })
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800229 public int type;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000230
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800231 /**
232 * Start of window types that represent normal application windows.
233 */
234 public static final int FIRST_APPLICATION_WINDOW = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000235
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800236 /**
237 * Window type: an application window that serves as the "base" window
238 * of the overall application; all other application windows will
239 * appear on top of it.
Craig Mautner5962b122012-10-05 14:45:52 -0700240 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800241 */
242 public static final int TYPE_BASE_APPLICATION = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000243
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800244 /**
245 * Window type: a normal application window. The {@link #token} must be
246 * an Activity token identifying who the window belongs to.
Craig Mautner5962b122012-10-05 14:45:52 -0700247 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800248 */
249 public static final int TYPE_APPLICATION = 2;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000250
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800251 /**
252 * Window type: special application window that is displayed while the
253 * application is starting. Not for use by applications themselves;
254 * this is used by the system to display something until the
255 * application can show its own windows.
Craig Mautner5962b122012-10-05 14:45:52 -0700256 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 */
258 public static final int TYPE_APPLICATION_STARTING = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000259
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800260 /**
261 * End of types of application windows.
262 */
263 public static final int LAST_APPLICATION_WINDOW = 99;
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 /**
266 * Start of types of sub-windows. The {@link #token} of these windows
267 * must be set to the window they are attached to. These types of
268 * windows are kept next to their attached window in Z-order, and their
269 * coordinate space is relative to their attached window.
270 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700271 public static final int FIRST_SUB_WINDOW = 1000;
272
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800273 /**
274 * Window type: a panel on top of an application window. These windows
275 * appear on top of their attached window.
276 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700277 public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
278
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800279 /**
John Spurlock33291d82013-03-13 14:45:14 -0400280 * Window type: window for showing media (such as video). These windows
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800281 * are displayed behind their attached window.
282 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700283 public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1;
284
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800285 /**
286 * Window type: a sub-panel on top of an application window. These
287 * windows are displayed on top their attached window and any
288 * {@link #TYPE_APPLICATION_PANEL} panels.
289 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700290 public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800291
292 /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
293 * of the window happens as that of a top-level window, <em>not</em>
294 * as a child of its container.
295 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700296 public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3;
297
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800298 /**
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700299 * Window type: window for showing overlays on top of media windows.
300 * These windows are displayed between TYPE_APPLICATION_MEDIA and the
301 * application window. They should be translucent to be useful. This
302 * is a big ugly hack so:
303 * @hide
304 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700305 public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW + 4;
306
307 /**
308 * Window type: a above sub-panel on top of an application window and it's
309 * sub-panel windows. These windows are displayed on top of their attached window
310 * and any {@link #TYPE_APPLICATION_SUB_PANEL} panels.
311 */
312 public static final int TYPE_APPLICATION_ABOVE_SUB_PANEL = FIRST_SUB_WINDOW + 5;
313
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700314 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800315 * End of types of sub-windows.
316 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700317 public static final int LAST_SUB_WINDOW = 1999;
318
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800319 /**
320 * Start of system-specific window types. These are not normally
321 * created by applications.
322 */
323 public static final int FIRST_SYSTEM_WINDOW = 2000;
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700324
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800325 /**
326 * Window type: the status bar. There can be only one status bar
327 * window; it is placed at the top of the screen, and all other
328 * windows are shifted down so they are below it.
Craig Mautner88400d32012-09-30 12:35:45 -0700329 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 */
331 public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000332
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800333 /**
334 * Window type: the search bar. There can be only one search bar
335 * window; it is placed at the top of the screen.
Craig Mautner88400d32012-09-30 12:35:45 -0700336 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800337 */
338 public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000339
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800340 /**
341 * Window type: phone. These are non-application windows providing
342 * user interaction with the phone (in particular incoming calls).
343 * These windows are normally placed above all applications, but behind
344 * the status bar.
Craig Mautner88400d32012-09-30 12:35:45 -0700345 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800346 */
347 public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000348
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800349 /**
350 * Window type: system window, such as low power alert. These windows
351 * are always on top of application windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700352 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800353 */
354 public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100355
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 /**
357 * Window type: keyguard window.
Craig Mautner88400d32012-09-30 12:35:45 -0700358 * In multiuser systems shows on all users' windows.
Jorim Jaggie411fdf2014-07-28 23:00:44 +0200359 * @removed
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800360 */
361 public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100362
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800363 /**
364 * Window type: transient notifications.
Craig Mautner88400d32012-09-30 12:35:45 -0700365 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800366 */
367 public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000368
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800369 /**
370 * Window type: system overlay windows, which need to be displayed
371 * on top of everything else. These windows must not take input
372 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700373 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800374 */
375 public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000376
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800377 /**
378 * Window type: priority phone UI, which needs to be displayed even if
379 * the keyguard is active. These windows must not take input
380 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700381 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800382 */
383 public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000384
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800385 /**
386 * Window type: panel that slides out from the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700387 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800388 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800389 public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000390
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 /**
392 * Window type: dialogs that the keyguard shows
Craig Mautner88400d32012-09-30 12:35:45 -0700393 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800394 */
395 public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000396
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800397 /**
398 * Window type: internal system error windows, appear on top of
399 * everything they can.
Craig Mautner88400d32012-09-30 12:35:45 -0700400 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800401 */
402 public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000403
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800404 /**
405 * Window type: internal input methods windows, which appear above
406 * the normal UI. Application windows may be resized or panned to keep
407 * the input focus visible while this window is displayed.
Craig Mautner88400d32012-09-30 12:35:45 -0700408 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800409 */
410 public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11;
411
412 /**
413 * Window type: internal input methods dialog windows, which appear above
414 * the current input method window.
Craig Mautner88400d32012-09-30 12:35:45 -0700415 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 */
417 public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
418
419 /**
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700420 * Window type: wallpaper window, placed behind any window that wants
421 * to sit on top of the wallpaper.
Craig Mautner88400d32012-09-30 12:35:45 -0700422 * In multiuser systems shows only on the owning user's window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700423 */
424 public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13;
425
426 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800427 * Window type: panel that slides out from over the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700428 * In multiuser systems shows on all users' windows.
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800429 */
430 public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14;
Jeff Brown3b2b3542010-10-15 00:54:27 -0700431
432 /**
433 * Window type: secure system overlay windows, which need to be displayed
434 * on top of everything else. These windows must not take input
435 * focus, or they will interfere with the keyguard.
436 *
437 * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
438 * system itself is allowed to create these overlays. Applications cannot
439 * obtain permission to create secure system overlays.
Craig Mautner88400d32012-09-30 12:35:45 -0700440 *
441 * In multiuser systems shows only on the owning user's window.
Jeff Brown3b2b3542010-10-15 00:54:27 -0700442 * @hide
443 */
444 public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
445
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800446 /**
Christopher Tatea53146c2010-09-07 11:57:52 -0700447 * Window type: the drag-and-drop pseudowindow. There is only one
448 * drag layer (at most), and it is placed on top of all other windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700449 * In multiuser systems shows only on the owning user's window.
Christopher Tatea53146c2010-09-07 11:57:52 -0700450 * @hide
451 */
Jeff Brown3b2b3542010-10-15 00:54:27 -0700452 public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16;
Christopher Tatea53146c2010-09-07 11:57:52 -0700453
454 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800455 * Window type: panel that slides out from under the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700456 * In multiuser systems shows on all users' windows.
Joe Onoratoa89e9032010-11-24 11:13:44 -0800457 * @hide
Joe Onorato29fc2c92010-11-24 10:26:50 -0800458 */
459 public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
460
Jeff Brown83c09682010-12-23 17:50:18 -0800461 /**
462 * Window type: (mouse) pointer
Craig Mautner88400d32012-09-30 12:35:45 -0700463 * In multiuser systems shows on all users' windows.
Jeff Brown83c09682010-12-23 17:50:18 -0800464 * @hide
465 */
466 public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
Joe Onorato29fc2c92010-11-24 10:26:50 -0800467
468 /**
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400469 * Window type: Navigation bar (when distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700470 * In multiuser systems shows on all users' windows.
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400471 * @hide
472 */
473 public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
474
475 /**
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700476 * Window type: The volume level overlay/dialog shown when the user
477 * changes the system volume.
Craig Mautner88400d32012-09-30 12:35:45 -0700478 * In multiuser systems shows on all users' windows.
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700479 * @hide
480 */
481 public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
482
483 /**
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700484 * Window type: The boot progress dialog, goes on top of everything
485 * in the world.
Craig Mautner88400d32012-09-30 12:35:45 -0700486 * In multiuser systems shows on all users' windows.
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700487 * @hide
488 */
489 public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
490
491 /**
Dianne Hackborndf89e652011-10-06 22:35:11 -0700492 * Window type: Fake window to consume touch events when the navigation
493 * bar is hidden.
Craig Mautner88400d32012-09-30 12:35:45 -0700494 * In multiuser systems shows on all users' windows.
Dianne Hackborndf89e652011-10-06 22:35:11 -0700495 * @hide
496 */
497 public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22;
498
499 /**
Daniel Sandler7d276c32012-01-30 14:33:52 -0500500 * Window type: Dreams (screen saver) window, just above keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700501 * In multiuser systems shows only on the owning user's window.
Daniel Sandler7d276c32012-01-30 14:33:52 -0500502 * @hide
503 */
504 public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
505
506 /**
Jim Millere898ac52012-04-06 17:10:57 -0700507 * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700508 * In multiuser systems shows on all users' windows.
Jim Millere898ac52012-04-06 17:10:57 -0700509 * @hide
510 */
511 public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
512
513 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -0700514 * Window type: Display overlay window. Used to simulate secondary display devices.
Craig Mautner88400d32012-09-30 12:35:45 -0700515 * In multiuser systems shows on all users' windows.
Jeff Brownbd6e1502012-08-28 03:27:37 -0700516 * @hide
517 */
518 public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
519
520 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700521 * Window type: Magnification overlay window. Used to highlight the magnified
522 * portion of a display when accessibility magnification is enabled.
Craig Mautner88400d32012-09-30 12:35:45 -0700523 * In multiuser systems shows on all users' windows.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700524 * @hide
525 */
526 public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
527
528 /**
Jim Miller5ecd8112013-01-09 18:50:26 -0800529 * Window type: keyguard scrim window. Shows if keyguard needs to be restarted.
530 * In multiuser systems shows on all users' windows.
531 * @hide
532 */
533 public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29;
534
Craig Mautner88400d32012-09-30 12:35:45 -0700535 /**
keunyounga446bf02013-06-21 19:07:57 -0700536 * Window type: Window for Presentation on top of private
537 * virtual display.
538 */
539 public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30;
540
541 /**
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700542 * Window type: Windows in the voice interaction layer.
543 * @hide
544 */
545 public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31;
546
547 /**
Svetoslav3a5c7212014-10-14 09:54:26 -0700548 * Window type: Windows that are overlaid <em>only</em> by an {@link
549 * android.accessibilityservice.AccessibilityService} for interception of
550 * user interactions without changing the windows an accessibility service
551 * can introspect. In particular, an accessibility service can introspect
552 * only windows that a sighted user can interact with which is they can touch
553 * these windows or can type into these windows. For example, if there
554 * is a full screen accessibility overlay that is touchable, the windows
555 * below it will be introspectable by an accessibility service regardless
556 * they are covered by a touchable window.
557 */
558 public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32;
559
560 /**
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700561 * Window type: Starting window for voice interaction layer.
562 * @hide
563 */
564 public static final int TYPE_VOICE_INTERACTION_STARTING = FIRST_SYSTEM_WINDOW+33;
565
566 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800567 * End of types of system windows.
568 */
569 public static final int LAST_SYSTEM_WINDOW = 2999;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800570
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_NORMAL = 0;
Mathias Agopiand2112302010-12-07 19:38:17 -0800574 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700575 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800576 public static final int MEMORY_TYPE_HARDWARE = 1;
Mathias Agopiand2112302010-12-07 19:38:17 -0800577 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700578 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800579 public static final int MEMORY_TYPE_GPU = 2;
Mathias Agopiand2112302010-12-07 19:38:17 -0800580 /** @deprecated this is ignored, this value is set automatically when needed. */
581 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800582 public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000583
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800584 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700585 * @deprecated this is ignored
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800586 */
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700587 @Deprecated
588 public int memoryType;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000589
Mike Lockwoodef731622010-01-27 17:51:34 -0500590 /** Window flag: as long as this window is visible to the user, allow
Wonsik Kim475e3f02014-03-17 11:17:47 +0000591 * the lock screen to activate while the screen is on.
592 * This can be used independently, or in combination with
Christopher Tate95f78502010-01-29 15:57:34 -0800593 * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
Mike Lockwoodef731622010-01-27 17:51:34 -0500594 public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
595
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800596 /** Window flag: everything behind this window will be dimmed.
597 * Use {@link #dimAmount} to control the amount of dim. */
598 public static final int FLAG_DIM_BEHIND = 0x00000002;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700599
600 /** Window flag: blur everything behind this window.
601 * @deprecated Blurring is no longer supported. */
602 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800603 public static final int FLAG_BLUR_BEHIND = 0x00000004;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700604
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 /** Window flag: this window won't ever get key input focus, so the
606 * user can not send key or other button events to it. Those will
607 * instead go to whatever focusable window is behind it. This flag
608 * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
609 * is explicitly set.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000610 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800611 * <p>Setting this flag also implies that the window will not need to
612 * interact with
Wonsik Kim475e3f02014-03-17 11:17:47 +0000613 * a soft input method, so it will be Z-ordered and positioned
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800614 * independently of any active input method (typically this means it
615 * gets Z-ordered on top of the input method, so it can use the full
616 * screen for its content and cover the input method if needed. You
617 * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
618 public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 /** Window flag: this window can never receive touch events. */
621 public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000622
John Spurlock33291d82013-03-13 14:45:14 -0400623 /** Window flag: even when this window is focusable (its
624 * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625 * outside of the window to be sent to the windows behind it. Otherwise
626 * it will consume all pointer events itself, regardless of whether they
627 * are inside of the window. */
628 public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000629
John Spurlock33291d82013-03-13 14:45:14 -0400630 /** Window flag: when set, if the device is asleep when the touch
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800631 * screen is pressed, you will receive this first touch event. Usually
632 * the first touch event is consumed by the system since the user can
633 * not see what they are pressing on.
Jeff Brown037c33e2014-04-09 00:31:55 -0700634 *
635 * @deprecated This flag has no effect.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800636 */
Jeff Brown037c33e2014-04-09 00:31:55 -0700637 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800638 public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000639
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800640 /** Window flag: as long as this window is visible to the user, keep
641 * the device's screen turned on and bright. */
642 public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000643
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800644 /** Window flag: place the window within the entire screen, ignoring
John Spurlock33291d82013-03-13 14:45:14 -0400645 * decorations around the border (such as the status bar). The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 * window must correctly position its contents to take the screen
647 * decoration into account. This flag is normally set for you
648 * by Window as described in {@link Window#setFlags}. */
649 public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000650
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800651 /** Window flag: allow window to extend outside of the screen. */
652 public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000653
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800654 /**
John Spurlock33291d82013-03-13 14:45:14 -0400655 * Window flag: hide all screen decorations (such as the status bar) while
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800656 * this window is displayed. This allows the window to use the entire
657 * display space for itself -- the status bar will be hidden when
Chet Haase45c89c22013-04-29 16:04:40 -0700658 * an app window with this flag set is on the top layer. A fullscreen window
659 * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's
660 * {@link #softInputMode} field; the window will stay fullscreen
661 * and will not resize.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800662 *
663 * <p>This flag can be controlled in your theme through the
664 * {@link android.R.attr#windowFullscreen} attribute; this attribute
665 * is automatically set for you in the standard fullscreen themes
666 * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen},
667 * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen},
668 * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen},
669 * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen},
670 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen},
671 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and
672 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p>
673 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800674 public static final int FLAG_FULLSCREEN = 0x00000400;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000675
John Spurlock33291d82013-03-13 14:45:14 -0400676 /** Window flag: override {@link #FLAG_FULLSCREEN} and force the
677 * screen decorations (such as the status bar) to be shown. */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800678 public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000679
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800680 /** Window flag: turn on dithering when compositing this window to
Jeff Brown3cc321e2012-07-16 16:04:23 -0700681 * the screen.
682 * @deprecated This flag is no longer used. */
683 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800684 public static final int FLAG_DITHER = 0x00001000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000685
John Spurlock33291d82013-03-13 14:45:14 -0400686 /** Window flag: treat the content of the window as secure, preventing
Jeff Brownf0681b32012-10-23 17:35:57 -0700687 * it from appearing in screenshots or from being viewed on non-secure
688 * displays.
689 *
690 * <p>See {@link android.view.Display#FLAG_SECURE} for more details about
691 * secure surfaces and secure displays.
692 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800693 public static final int FLAG_SECURE = 0x00002000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000694
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800695 /** Window flag: a special mode where the layout parameters are used
696 * to perform scaling of the surface when it is composited to the
697 * screen. */
698 public static final int FLAG_SCALED = 0x00004000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000699
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800700 /** Window flag: intended for windows that will often be used when the user is
701 * holding the screen against their face, it will aggressively filter the event
702 * stream to prevent unintended presses in this situation that may not be
Wonsik Kim475e3f02014-03-17 11:17:47 +0000703 * desired for a particular window, when such an event stream is detected, the
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800704 * application will receive a CANCEL motion event to indicate this so applications
Wonsik Kim475e3f02014-03-17 11:17:47 +0000705 * can handle this accordingly by taking no action on the event
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800706 * until the finger is released. */
707 public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000708
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 /** Window flag: a special option only for use in combination with
710 * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
711 * screen your window may appear on top of or behind screen decorations
712 * such as the status bar. By also including this flag, the window
713 * manager will report the inset rectangle needed to ensure your
714 * content is not covered by screen decorations. This flag is normally
715 * set for you by Window as described in {@link Window#setFlags}.*/
716 public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000717
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800718 /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
719 * respect to how this window interacts with the current method. That
720 * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
721 * window will behave as if it needs to interact with the input method
722 * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
723 * not set and this flag is set, then the window will behave as if it
724 * doesn't need to interact with the input method and can be placed
725 * to use more space and cover the input method.
726 */
727 public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000728
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800729 /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
730 * can set this flag to receive a single special MotionEvent with
731 * the action
732 * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
733 * touches that occur outside of your window. Note that you will not
734 * receive the full down/move/up gesture, only the location of the
735 * first down as an ACTION_OUTSIDE.
736 */
737 public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000738
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700739 /** Window flag: special flag to let windows be shown when the screen
740 * is locked. This will let application windows take precedence over
741 * key guard or any other lock screens. Can be used with
742 * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700743 * directly before showing the key guard window. Can be used with
744 * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
745 * non-secure keyguards. This flag only applies to the top-most
746 * full-screen window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700747 */
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700748 public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
749
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700750 /** Window flag: ask that the system wallpaper be shown behind
751 * your window. The window surface must be translucent to be able
752 * to actually see the wallpaper behind it; this flag just ensures
753 * that the wallpaper surface will be there if this window actually
754 * has translucent regions.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800755 *
756 * <p>This flag can be controlled in your theme through the
757 * {@link android.R.attr#windowShowWallpaper} attribute; this attribute
758 * is automatically set for you in the standard wallpaper themes
759 * such as {@link android.R.style#Theme_Wallpaper},
760 * {@link android.R.style#Theme_Wallpaper_NoTitleBar},
761 * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen},
762 * {@link android.R.style#Theme_Holo_Wallpaper},
763 * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar},
764 * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and
765 * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p>
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700766 */
767 public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000768
Dianne Hackborn93e462b2009-09-15 22:50:40 -0700769 /** Window flag: when set as a window is being added or made
770 * visible, once the window has been shown then the system will
771 * poke the power manager's user activity (as if the user had woken
772 * up the device) to turn the screen on. */
773 public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000774
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700775 /** Window flag: when set the window will cause the keyguard to
776 * be dismissed, only if it is not a secure lock keyguard. Because such
777 * a keyguard is not needed for security, it will never re-appear if
778 * the user navigates to another window (in contrast to
779 * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
780 * hide both secure and non-secure keyguards but ensure they reappear
781 * when the user moves to another UI that doesn't hide them).
782 * If the keyguard is currently active and is secure (requires an
783 * unlock pattern) than the user will still need to confirm it before
784 * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
Daniel Sandlerae069f72010-06-17 21:56:26 -0400785 * also been set.
786 */
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700787 public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000788
Jeff Brown01ce2e92010-09-26 22:20:12 -0700789 /** Window flag: when set the window will accept for touch events
790 * outside of its bounds to be sent to other windows that also
791 * support split touch. When this flag is not set, the first pointer
792 * that goes down determines the window to which all subsequent touches
793 * go until all pointers go up. When this flag is set, each pointer
794 * (not necessarily the first) that goes down determines the window
795 * to which all subsequent touches of that pointer will go until that
796 * pointer goes up thereby enabling touches with multiple pointers
797 * to be split across multiple windows.
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800798 */
Jeff Brown01ce2e92010-09-26 22:20:12 -0700799 public static final int FLAG_SPLIT_TOUCH = 0x00800000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000800
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800801 /**
Romain Guy72f0a272011-01-09 16:01:46 -0800802 * <p>Indicates whether this window should be hardware accelerated.
803 * Requesting hardware acceleration does not guarantee it will happen.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800804 *
Romain Guy72f0a272011-01-09 16:01:46 -0800805 * <p>This flag can be controlled programmatically <em>only</em> to enable
806 * hardware acceleration. To enable hardware acceleration for a given
807 * window programmatically, do the following:</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800808 *
Romain Guy72f0a272011-01-09 16:01:46 -0800809 * <pre>
810 * Window w = activity.getWindow(); // in Activity's onCreate() for instance
811 * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
812 * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
813 * </pre>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800814 *
Romain Guy72f0a272011-01-09 16:01:46 -0800815 * <p>It is important to remember that this flag <strong>must</strong>
816 * be set before setting the content view of your activity or dialog.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800817 *
Romain Guy72f0a272011-01-09 16:01:46 -0800818 * <p>This flag cannot be used to disable hardware acceleration after it
819 * was enabled in your manifest using
820 * {@link android.R.attr#hardwareAccelerated}. If you need to selectively
821 * and programmatically disable hardware acceleration (for automated testing
822 * for instance), make sure it is turned off in your manifest and enable it
823 * on your activity or dialog when you need it instead, using the method
824 * described above.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800825 *
Romain Guy72f0a272011-01-09 16:01:46 -0800826 * <p>This flag is automatically set by the system if the
827 * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
828 * XML attribute is set to true on an activity or on the application.</p>
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800829 */
830 public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000;
Daniel Sandler611fae42010-06-17 10:45:00 -0400831
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800832 /**
833 * Window flag: allow window contents to extend in to the screen's
Dianne Hackbornc652de82013-02-15 16:32:56 -0800834 * overscan area, if there is one. The window should still correctly
835 * position its contents to take the overscan area into account.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800836 *
837 * <p>This flag can be controlled in your theme through the
838 * {@link android.R.attr#windowOverscan} attribute; this attribute
839 * is automatically set for you in the standard overscan themes
Ying Wang4e0eb222013-04-18 20:39:48 -0700840 * such as
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800841 * {@link android.R.style#Theme_Holo_NoActionBar_Overscan},
842 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan},
843 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and
844 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p>
845 *
846 * <p>When this flag is enabled for a window, its normal content may be obscured
847 * to some degree by the overscan region of the display. To ensure key parts of
848 * that content are visible to the user, you can use
849 * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)}
850 * to set the point in the view hierarchy where the appropriate offsets should
851 * be applied. (This can be done either by directly calling this function, using
852 * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy,
853 * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect)
854 * View.fitSystemWindows(Rect)} method).</p>
855 *
856 * <p>This mechanism for positioning content elements is identical to its equivalent
857 * use with layout and {@link View#setSystemUiVisibility(int)
858 * View.setSystemUiVisibility(int)}; here is an example layout that will correctly
859 * position its UI elements with this overscan flag is set:</p>
860 *
861 * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete}
Dianne Hackbornc652de82013-02-15 16:32:56 -0800862 */
863 public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
864
John Spurlockbd957402013-10-03 11:38:39 -0400865 /**
866 * Window flag: request a translucent status bar with minimal system-provided
867 * background protection.
868 *
869 * <p>This flag can be controlled in your theme through the
870 * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute
871 * is automatically set for you in the standard translucent decor themes
872 * such as
873 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
874 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
875 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
876 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
877 *
878 * <p>When this flag is enabled for a window, it automatically sets
879 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
880 * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p>
881 */
882 public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000;
883
884 /**
885 * Window flag: request a translucent navigation bar with minimal system-provided
886 * background protection.
887 *
888 * <p>This flag can be controlled in your theme through the
889 * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute
890 * is automatically set for you in the standard translucent decor themes
891 * such as
892 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
893 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
894 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
895 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
896 *
897 * <p>When this flag is enabled for a window, it automatically sets
898 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
899 * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p>
900 */
901 public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000;
902
Adam Lesinski6a591f52013-10-01 18:11:17 -0700903 /**
904 * Flag for a window in local focus mode.
905 * Window in local focus mode can control focus independent of window manager using
906 * {@link Window#setLocalFocus(boolean, boolean)}.
907 * Usually window in this mode will not get touch/key events from window manager, but will
908 * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}.
909 */
910 public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000;
911
Jeff Brown98db5fa2011-06-08 15:37:10 -0700912 /** Window flag: Enable touches to slide out of a window into neighboring
913 * windows in mid-gesture instead of being captured for the duration of
914 * the gesture.
915 *
916 * This flag changes the behavior of touch focus for this window only.
917 * Touches can slide out of the window but they cannot necessarily slide
918 * back in (unless the other window with touch focus permits it).
919 *
920 * {@hide}
921 */
Adam Lesinski6a591f52013-10-01 18:11:17 -0700922 public static final int FLAG_SLIPPERY = 0x20000000;
Jeff Brown98db5fa2011-06-08 15:37:10 -0700923
Daniel Sandlere02d8082010-10-08 15:13:22 -0400924 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -0700925 * Window flag: When requesting layout with an attached window, the attached window may
926 * overlap with the screen decorations of the parent window such as the navigation bar. By
927 * including this flag, the window manager will layout the attached window within the decor
928 * frame of the parent window such that it doesn't overlap with screen decorations.
Daniel Sandlere02d8082010-10-08 15:13:22 -0400929 */
Wale Ogunwale393b1c12014-10-18 16:22:01 -0700930 public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000;
Daniel Sandlere02d8082010-10-08 15:13:22 -0400931
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800932 /**
Adrian Roos217ccd22014-05-09 14:29:04 +0200933 * Flag indicating that this Window is responsible for drawing the background for the
934 * system bars. If set, the system bars are drawn with a transparent background and the
935 * corresponding areas in this window are filled with the colors specified in
936 * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}.
937 */
938 public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000;
939
940 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700941 * Various behavioral options/flags. Default is none.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000942 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700943 * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
944 * @see #FLAG_DIM_BEHIND
945 * @see #FLAG_NOT_FOCUSABLE
946 * @see #FLAG_NOT_TOUCHABLE
947 * @see #FLAG_NOT_TOUCH_MODAL
948 * @see #FLAG_TOUCHABLE_WHEN_WAKING
949 * @see #FLAG_KEEP_SCREEN_ON
950 * @see #FLAG_LAYOUT_IN_SCREEN
951 * @see #FLAG_LAYOUT_NO_LIMITS
952 * @see #FLAG_FULLSCREEN
953 * @see #FLAG_FORCE_NOT_FULLSCREEN
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700954 * @see #FLAG_SECURE
955 * @see #FLAG_SCALED
956 * @see #FLAG_IGNORE_CHEEK_PRESSES
957 * @see #FLAG_LAYOUT_INSET_DECOR
958 * @see #FLAG_ALT_FOCUSABLE_IM
959 * @see #FLAG_WATCH_OUTSIDE_TOUCH
960 * @see #FLAG_SHOW_WHEN_LOCKED
961 * @see #FLAG_SHOW_WALLPAPER
962 * @see #FLAG_TURN_SCREEN_ON
963 * @see #FLAG_DISMISS_KEYGUARD
964 * @see #FLAG_SPLIT_TOUCH
965 * @see #FLAG_HARDWARE_ACCELERATED
keunyoung30f420f2013-08-02 14:23:10 -0700966 * @see #FLAG_LOCAL_FOCUS_MODE
Adrian Roos217ccd22014-05-09 14:29:04 +0200967 * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700968 */
969 @ViewDebug.ExportedProperty(flagMapping = {
970 @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON,
971 name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"),
972 @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND,
973 name = "FLAG_DIM_BEHIND"),
974 @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND,
975 name = "FLAG_BLUR_BEHIND"),
976 @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE,
977 name = "FLAG_NOT_FOCUSABLE"),
978 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE,
979 name = "FLAG_NOT_TOUCHABLE"),
980 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL,
981 name = "FLAG_NOT_TOUCH_MODAL"),
982 @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING,
983 name = "FLAG_TOUCHABLE_WHEN_WAKING"),
984 @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON,
985 name = "FLAG_KEEP_SCREEN_ON"),
986 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN,
987 name = "FLAG_LAYOUT_IN_SCREEN"),
988 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS,
989 name = "FLAG_LAYOUT_NO_LIMITS"),
990 @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN,
991 name = "FLAG_FULLSCREEN"),
992 @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN,
993 name = "FLAG_FORCE_NOT_FULLSCREEN"),
994 @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER,
995 name = "FLAG_DITHER"),
996 @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE,
997 name = "FLAG_SECURE"),
998 @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED,
999 name = "FLAG_SCALED"),
1000 @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES,
1001 name = "FLAG_IGNORE_CHEEK_PRESSES"),
1002 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR,
1003 name = "FLAG_LAYOUT_INSET_DECOR"),
1004 @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM,
1005 name = "FLAG_ALT_FOCUSABLE_IM"),
1006 @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH,
1007 name = "FLAG_WATCH_OUTSIDE_TOUCH"),
1008 @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED,
1009 name = "FLAG_SHOW_WHEN_LOCKED"),
1010 @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER,
1011 name = "FLAG_SHOW_WALLPAPER"),
1012 @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON,
1013 name = "FLAG_TURN_SCREEN_ON"),
1014 @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD,
1015 name = "FLAG_DISMISS_KEYGUARD"),
1016 @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH,
1017 name = "FLAG_SPLIT_TOUCH"),
1018 @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED,
keunyoung30f420f2013-08-02 14:23:10 -07001019 name = "FLAG_HARDWARE_ACCELERATED"),
1020 @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE,
John Spurlockbd957402013-10-03 11:38:39 -04001021 name = "FLAG_LOCAL_FOCUS_MODE"),
1022 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS,
1023 name = "FLAG_TRANSLUCENT_STATUS"),
1024 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION,
Adrian Roos217ccd22014-05-09 14:29:04 +02001025 name = "FLAG_TRANSLUCENT_NAVIGATION"),
1026 @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
1027 name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS")
Jon Miranda4597e982014-07-29 07:25:49 -07001028 }, formatToHexString = true)
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001029 public int flags;
1030
1031 /**
John Reck61375a82014-09-18 19:27:48 +00001032 * If the window has requested hardware acceleration, but this is not
1033 * allowed in the process it is in, then still render it as if it is
1034 * hardware accelerated. This is used for the starting preview windows
1035 * in the system process, which don't need to have the overhead of
1036 * hardware acceleration (they are just a static rendering), but should
1037 * be rendered as such to match the actual window of the app even if it
1038 * is hardware accelerated.
1039 * Even if the window isn't hardware accelerated, still do its rendering
1040 * as if it was.
1041 * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
1042 * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
1043 * is generally disabled. This flag must be specified in addition to
1044 * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
1045 * windows.
1046 *
1047 * @hide
1048 */
1049 public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
1050
1051 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001052 * In the system process, we globally do not use hardware acceleration
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001053 * because there are many threads doing UI there and they conflict.
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001054 * If certain parts of the UI that really do want to use hardware
1055 * acceleration, this flag can be set to force it. This is basically
1056 * for the lock screen. Anyone else using it, you are probably wrong.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001057 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001058 * @hide
1059 */
1060 public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
1061
1062 /**
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001063 * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001064 * may elect to skip these notifications if they are not doing anything productive with
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001065 * them (they do not affect the wallpaper scrolling operation) by calling
1066 * {@link
1067 * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}.
1068 *
1069 * @hide
1070 */
1071 public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
1072
Craig Mautner88400d32012-09-30 12:35:45 -07001073 /** In a multiuser system if this flag is set and the owner is a system process then this
1074 * window will appear on all user screens. This overrides the default behavior of window
1075 * types that normally only appear on the owning user's screen. Refer to each window type
1076 * to determine its default behavior.
1077 *
1078 * {@hide} */
1079 public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
1080
Dianne Hackborn73ab6a42011-12-13 11:16:23 -08001081 /**
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001082 * Never animate position changes of the window.
1083 *
1084 * {@hide} */
1085 public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040;
1086
Adam Lesinski6a591f52013-10-01 18:11:17 -07001087 /** Window flag: special flag to limit the size of the window to be
1088 * original size ([320x480] x density). Used to create window for applications
1089 * running under compatibility mode.
1090 *
1091 * {@hide} */
1092 public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080;
1093
1094 /** Window flag: a special option intended for system dialogs. When
1095 * this flag is set, the window will demand focus unconditionally when
1096 * it is created.
1097 * {@hide} */
1098 public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;
1099
John Spurlock3f7cd512013-10-07 12:25:09 -04001100 /** Window flag: maintain the previous translucent decor state when this window
John Spurlockbd957402013-10-03 11:38:39 -04001101 * becomes top-most.
1102 * {@hide} */
1103 public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200;
1104
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001105 /**
Jorim Jaggi380ecb82014-03-14 17:25:20 +01001106 * Flag whether the current window is a keyguard window, meaning that it will hide all other
1107 * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set.
1108 * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1109 * {@hide}
1110 */
1111 public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400;
1112
1113 /**
Filip Gruszczynskib8c06942014-12-04 15:02:18 -08001114 * Flag that prevents the wallpaper behind the current window from receiving touch events.
1115 *
1116 * {@hide}
1117 */
1118 public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800;
1119
1120 /**
Selim Cinek4a4a2bddc2015-05-07 12:50:19 -07001121 * Flag to force the status bar window to be visible all the time. If the bar is hidden when
1122 * this flag is set it will be shown again and the bar will have a transparent background.
1123 * This can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1124 *
1125 * {@hide}
1126 */
1127 public static final int PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT = 0x00001000;
1128
1129 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001130 * Control flags that are private to the platform.
1131 * @hide
1132 */
1133 public int privateFlags;
1134
1135 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001136 * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it
1137 * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu
1138 * key. For this case, we should look at windows behind it to determine the appropriate
1139 * value.
1140 *
1141 * @hide
1142 */
1143 public static final int NEEDS_MENU_UNSET = 0;
1144
1145 /**
1146 * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a
1147 * menu key.
1148 *
1149 * @hide
1150 */
1151 public static final int NEEDS_MENU_SET_TRUE = 1;
1152
1153 /**
1154 * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't
1155 * needs a menu key.
1156 *
1157 * @hide
1158 */
1159 public static final int NEEDS_MENU_SET_FALSE = 2;
1160
1161 /**
1162 * State variable for a window belonging to an activity that responds to
1163 * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a
1164 * physical button this variable is ignored, but on devices where the Menu key is drawn in
1165 * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}.
1166 *
1167 * (Note that Action Bars, when available, are the preferred way to offer additional
1168 * functions otherwise accessed via an options menu.)
1169 *
1170 * {@hide}
1171 */
1172 public int needsMenuKey = NEEDS_MENU_UNSET;
1173
1174 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001175 * Given a particular set of window manager flags, determine whether
1176 * such a window may be a target for an input method when it has
1177 * focus. In particular, this checks the
1178 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
1179 * flags and returns true if the combination of the two corresponds
1180 * to a window that needs to be behind the input method so that the
1181 * user can type into it.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001182 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001183 * @param flags The current window manager flags.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001184 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001185 * @return Returns true if such a window should be behind/interact
1186 * with an input method, false if not.
1187 */
1188 public static boolean mayUseInputMethod(int flags) {
1189 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
1190 case 0:
1191 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
1192 return true;
1193 }
1194 return false;
1195 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001196
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001197 /**
1198 * Mask for {@link #softInputMode} of the bits that determine the
1199 * desired visibility state of the soft input area for this window.
1200 */
1201 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001202
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001203 /**
1204 * Visibility state for {@link #softInputMode}: no state has been specified.
1205 */
1206 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001207
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001208 /**
1209 * Visibility state for {@link #softInputMode}: please don't change the state of
1210 * the soft input area.
1211 */
1212 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001213
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001214 /**
1215 * Visibility state for {@link #softInputMode}: please hide any soft input
1216 * area when normally appropriate (when the user is navigating
1217 * forward to your window).
1218 */
1219 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001220
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001221 /**
1222 * Visibility state for {@link #softInputMode}: please always hide any
1223 * soft input area when this window receives focus.
1224 */
1225 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001226
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001227 /**
1228 * Visibility state for {@link #softInputMode}: please show the soft
1229 * input area when normally appropriate (when the user is navigating
1230 * forward to your window).
1231 */
1232 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001233
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001234 /**
1235 * Visibility state for {@link #softInputMode}: please always make the
1236 * soft input area visible when this window receives input focus.
1237 */
1238 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001239
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001240 /**
1241 * Mask for {@link #softInputMode} of the bits that determine the
1242 * way that the window should be adjusted to accommodate the soft
1243 * input window.
1244 */
1245 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001246
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001247 /** Adjustment option for {@link #softInputMode}: nothing specified.
1248 * The system will try to pick one or
1249 * the other depending on the contents of the window.
1250 */
1251 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001252
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001253 /** Adjustment option for {@link #softInputMode}: set to allow the
1254 * window to be resized when an input
1255 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001256 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001257 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1258 * neither of these are set, then the system will try to pick one or
Chet Haase45c89c22013-04-29 16:04:40 -07001259 * the other depending on the contents of the window. If the window's
1260 * layout parameter flags include {@link #FLAG_FULLSCREEN}, this
1261 * value for {@link #softInputMode} will be ignored; the window will
1262 * not resize, but will stay fullscreen.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001263 */
1264 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001265
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001266 /** Adjustment option for {@link #softInputMode}: set to have a window
1267 * pan when an input method is
1268 * shown, so it doesn't need to deal with resizing but just panned
1269 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001270 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001271 * neither of these are set, then the system will try to pick one or
1272 * the other depending on the contents of the window.
1273 */
1274 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001275
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001276 /** Adjustment option for {@link #softInputMode}: set to have a window
1277 * not adjust for a shown input method. The window will not be resized,
1278 * and it will not be panned to make its focus visible.
1279 */
1280 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1281
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001282 /**
1283 * Bit for {@link #softInputMode}: set when the user has navigated
1284 * forward to the window. This is normally set automatically for
1285 * you by the system, though you may want to set it in certain cases
1286 * when you are displaying a window yourself. This flag will always
1287 * be cleared automatically after the window is displayed.
1288 */
1289 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001290
1291 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001292 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001293 * of:
Wonsik Kim475e3f02014-03-17 11:17:47 +00001294 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001295 * <ul>
1296 * <li> One of the visibility states
1297 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1298 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1299 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1300 * <li> One of the adjustment options
1301 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1302 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1303 * {@link #SOFT_INPUT_ADJUST_PAN}.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -08001304 * </ul>
1305 *
1306 *
1307 * <p>This flag can be controlled in your theme through the
1308 * {@link android.R.attr#windowSoftInputMode} attribute.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001309 */
1310 public int softInputMode;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001311
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001312 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001313 * Placement of window within the screen as per {@link Gravity}. Both
1314 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1315 * android.graphics.Rect) Gravity.apply} and
1316 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1317 * Gravity.applyDisplay} are used during window layout, with this value
1318 * given as the desired gravity. For example you can specify
1319 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1320 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1321 * to control the behavior of
1322 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1323 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001324 *
1325 * @see Gravity
1326 */
1327 public int gravity;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001328
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001329 /**
1330 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001331 * between the container and the widget. See
1332 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1333 * android.graphics.Rect) Gravity.apply} for how this is used. This
1334 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001335 */
1336 public float horizontalMargin;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001337
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001338 /**
1339 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001340 * between the container and the widget. See
1341 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1342 * android.graphics.Rect) Gravity.apply} for how this is used. This
1343 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001344 */
1345 public float verticalMargin;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001346
1347 /**
1348 * Positive insets between the drawing surface and window content.
1349 *
1350 * @hide
1351 */
Alan Viverette3aa1ffb2014-10-30 12:22:08 -07001352 public final Rect surfaceInsets = new Rect();
Alan Viverette5435a302015-01-29 10:25:34 -08001353
1354 /**
1355 * Whether the surface insets have been manually set. When set to
1356 * {@code false}, the view root will automatically determine the
1357 * appropriate surface insets.
1358 *
1359 * @see #surfaceInsets
1360 * @hide
1361 */
1362 public boolean hasManualSurfaceInsets;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001363
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001364 /**
1365 * The desired bitmap format. May be one of the constants in
1366 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1367 */
1368 public int format;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001370 /**
1371 * A style resource defining the animations to use for this window.
1372 * This must be a system resource; it can not be an application resource
1373 * because the window manager does not have access to applications.
1374 */
1375 public int windowAnimations;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001376
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001377 /**
1378 * An alpha value to apply to this entire window.
1379 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1380 */
1381 public float alpha = 1.0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001382
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001383 /**
1384 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1385 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1386 * dim.
1387 */
1388 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001389
1390 /**
1391 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1392 * indicating that the brightness value is not overridden for this window
1393 * and normal brightness policy should be used.
1394 */
1395 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1396
1397 /**
1398 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1399 * indicating that the screen or button backlight brightness should be set
1400 * to the lowest value when this window is in front.
1401 */
1402 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1403
1404 /**
1405 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1406 * indicating that the screen or button backlight brightness should be set
1407 * to the hightest value when this window is in front.
1408 */
1409 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001410
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001411 /**
1412 * This can be used to override the user's preferred brightness of
1413 * the screen. A value of less than 0, the default, means to use the
1414 * preferred screen brightness. 0 to 1 adjusts the brightness from
1415 * dark to full bright.
1416 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001417 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001418
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001419 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001420 * This can be used to override the standard behavior of the button and
1421 * keyboard backlights. A value of less than 0, the default, means to
1422 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1423 * from dark to full bright.
1424 */
1425 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1426
1427 /**
Craig Mautner3c174372013-02-21 17:54:37 -08001428 * Value for {@link #rotationAnimation} to define the animation used to
1429 * specify that this window will rotate in or out following a rotation.
1430 */
1431 public static final int ROTATION_ANIMATION_ROTATE = 0;
1432
1433 /**
1434 * Value for {@link #rotationAnimation} to define the animation used to
1435 * specify that this window will fade in or out following a rotation.
1436 */
1437 public static final int ROTATION_ANIMATION_CROSSFADE = 1;
1438
1439 /**
1440 * Value for {@link #rotationAnimation} to define the animation used to
1441 * specify that this window will immediately disappear or appear following
1442 * a rotation.
1443 */
1444 public static final int ROTATION_ANIMATION_JUMPCUT = 2;
1445
1446 /**
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001447 * Define the exit and entry animations used on this window when the device is rotated.
1448 * This only has an affect if the incoming and outgoing topmost
Craig Mautner3c174372013-02-21 17:54:37 -08001449 * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001450 * by other windows. All other situations default to the
1451 * {@link #ROTATION_ANIMATION_ROTATE} behavior.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001452 *
Craig Mautner3c174372013-02-21 17:54:37 -08001453 * @see #ROTATION_ANIMATION_ROTATE
1454 * @see #ROTATION_ANIMATION_CROSSFADE
1455 * @see #ROTATION_ANIMATION_JUMPCUT
1456 */
1457 public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
1458
1459 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001460 * Identifier for this window. This will usually be filled in for
1461 * you.
1462 */
1463 public IBinder token = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001464
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001465 /**
1466 * Name of the package owning this window.
1467 */
1468 public String packageName = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001469
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001470 /**
1471 * Specific orientation value for a window.
1472 * May be any of the same values allowed
Wonsik Kim475e3f02014-03-17 11:17:47 +00001473 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1474 * If not set, a default value of
1475 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001476 * will be used.
1477 */
1478 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001479
1480 /**
Michael Wright3f145a22014-07-22 19:46:03 -07001481 * The preferred refresh rate for the window.
1482 *
1483 * This must be one of the supported refresh rates obtained for the display(s) the window
1484 * is on.
1485 *
1486 * @see Display#getSupportedRefreshRates()
1487 */
1488 public float preferredRefreshRate;
1489
1490 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001491 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001492 *
1493 * @see View#STATUS_BAR_VISIBLE
1494 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001495 */
1496 public int systemUiVisibility;
1497
1498 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001499 * @hide
1500 * The ui visibility as requested by the views in this hierarchy.
1501 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1502 */
1503 public int subtreeSystemUiVisibility;
1504
1505 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001506 * Get callbacks about the system ui visibility changing.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001507 *
Joe Onorato664644d2011-01-23 17:53:23 -08001508 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1509 *
1510 * @hide
1511 */
1512 public boolean hasSystemUiListeners;
1513
Jeff Brown474dcb52011-06-14 20:22:50 -07001514 /**
1515 * When this window has focus, disable touch pad pointer gesture processing.
1516 * The window will receive raw position updates from the touch pad instead
1517 * of pointer movements and synthetic touch events.
1518 *
1519 * @hide
1520 */
1521 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1522
1523 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001524 * Does not construct an input channel for this window. The channel will therefore
1525 * be incapable of receiving input.
1526 *
1527 * @hide
1528 */
1529 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1530
1531 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001532 * When this window has focus, does not call user activity for all input events so
1533 * the application will have to do it itself. Should only be used by
1534 * the keyguard and phone app.
1535 * <p>
1536 * Should only be used by the keyguard and phone app.
1537 * </p>
1538 *
1539 * @hide
1540 */
1541 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1542
1543 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001544 * Control special features of the input subsystem.
1545 *
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001546 * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001547 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001548 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001549 * @hide
1550 */
1551 public int inputFeatures;
1552
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001553 /**
1554 * Sets the number of milliseconds before the user activity timeout occurs
1555 * when this window has focus. A value of -1 uses the standard timeout.
1556 * A value of 0 uses the minimum support display timeout.
1557 * <p>
1558 * This property can only be used to reduce the user specified display timeout;
1559 * it can never make the timeout longer than it normally would be.
1560 * </p><p>
1561 * Should only be used by the keyguard and phone app.
1562 * </p>
1563 *
1564 * @hide
1565 */
1566 public long userActivityTimeout = -1;
1567
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001568 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001569 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001570 type = TYPE_APPLICATION;
1571 format = PixelFormat.OPAQUE;
1572 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001573
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001574 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001575 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001576 type = _type;
1577 format = PixelFormat.OPAQUE;
1578 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001579
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001580 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001581 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001582 type = _type;
1583 flags = _flags;
1584 format = PixelFormat.OPAQUE;
1585 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001586
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001587 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001588 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001589 type = _type;
1590 flags = _flags;
1591 format = _format;
1592 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001593
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001594 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1595 super(w, h);
1596 type = _type;
1597 flags = _flags;
1598 format = _format;
1599 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001600
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001601 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1602 int _flags, int _format) {
1603 super(w, h);
1604 x = xpos;
1605 y = ypos;
1606 type = _type;
1607 flags = _flags;
1608 format = _format;
1609 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001610
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001611 public final void setTitle(CharSequence title) {
1612 if (null == title)
1613 title = "";
Wonsik Kim475e3f02014-03-17 11:17:47 +00001614
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001615 mTitle = TextUtils.stringOrSpannedString(title);
1616 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001617
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001618 public final CharSequence getTitle() {
1619 return mTitle;
1620 }
Bryce Lee53b9fbd2015-02-06 12:06:34 -08001621
1622 /** @hide */
1623 @SystemApi
1624 public final void setUserActivityTimeout(long timeout) {
1625 userActivityTimeout = timeout;
1626 }
1627
1628 /** @hide */
1629 @SystemApi
1630 public final long getUserActivityTimeout() {
1631 return userActivityTimeout;
1632 }
1633
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001634 public int describeContents() {
1635 return 0;
1636 }
1637
1638 public void writeToParcel(Parcel out, int parcelableFlags) {
1639 out.writeInt(width);
1640 out.writeInt(height);
1641 out.writeInt(x);
1642 out.writeInt(y);
1643 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001644 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001645 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001646 out.writeInt(softInputMode);
1647 out.writeInt(gravity);
1648 out.writeFloat(horizontalMargin);
1649 out.writeFloat(verticalMargin);
1650 out.writeInt(format);
1651 out.writeInt(windowAnimations);
1652 out.writeFloat(alpha);
1653 out.writeFloat(dimAmount);
1654 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001655 out.writeFloat(buttonBrightness);
Craig Mautner3c174372013-02-21 17:54:37 -08001656 out.writeInt(rotationAnimation);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001657 out.writeStrongBinder(token);
1658 out.writeString(packageName);
1659 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1660 out.writeInt(screenOrientation);
Michael Wright3f145a22014-07-22 19:46:03 -07001661 out.writeFloat(preferredRefreshRate);
Joe Onorato664644d2011-01-23 17:53:23 -08001662 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001663 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001664 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001665 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001666 out.writeLong(userActivityTimeout);
Alan Viverette49a22e82014-07-12 20:01:27 -07001667 out.writeInt(surfaceInsets.left);
1668 out.writeInt(surfaceInsets.top);
1669 out.writeInt(surfaceInsets.right);
1670 out.writeInt(surfaceInsets.bottom);
Alan Viverette5435a302015-01-29 10:25:34 -08001671 out.writeInt(hasManualSurfaceInsets ? 1 : 0);
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001672 out.writeInt(needsMenuKey);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001673 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001674
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001675 public static final Parcelable.Creator<LayoutParams> CREATOR
1676 = new Parcelable.Creator<LayoutParams>() {
1677 public LayoutParams createFromParcel(Parcel in) {
1678 return new LayoutParams(in);
1679 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001680
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001681 public LayoutParams[] newArray(int size) {
1682 return new LayoutParams[size];
1683 }
1684 };
Wonsik Kim475e3f02014-03-17 11:17:47 +00001685
1686
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001687 public LayoutParams(Parcel in) {
1688 width = in.readInt();
1689 height = in.readInt();
1690 x = in.readInt();
1691 y = in.readInt();
1692 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001693 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001694 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001695 softInputMode = in.readInt();
1696 gravity = in.readInt();
1697 horizontalMargin = in.readFloat();
1698 verticalMargin = in.readFloat();
1699 format = in.readInt();
1700 windowAnimations = in.readInt();
1701 alpha = in.readFloat();
1702 dimAmount = in.readFloat();
1703 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001704 buttonBrightness = in.readFloat();
Craig Mautner3c174372013-02-21 17:54:37 -08001705 rotationAnimation = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001706 token = in.readStrongBinder();
1707 packageName = in.readString();
1708 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1709 screenOrientation = in.readInt();
Michael Wright3f145a22014-07-22 19:46:03 -07001710 preferredRefreshRate = in.readFloat();
Joe Onorato664644d2011-01-23 17:53:23 -08001711 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001712 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001713 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001714 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001715 userActivityTimeout = in.readLong();
Alan Viverette49a22e82014-07-12 20:01:27 -07001716 surfaceInsets.left = in.readInt();
1717 surfaceInsets.top = in.readInt();
1718 surfaceInsets.right = in.readInt();
1719 surfaceInsets.bottom = in.readInt();
Alan Viverette5435a302015-01-29 10:25:34 -08001720 hasManualSurfaceInsets = in.readInt() != 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001721 needsMenuKey = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001722 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001723
Romain Guy72998072009-06-22 11:09:20 -07001724 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001725 public static final int LAYOUT_CHANGED = 1<<0;
1726 public static final int TYPE_CHANGED = 1<<1;
1727 public static final int FLAGS_CHANGED = 1<<2;
1728 public static final int FORMAT_CHANGED = 1<<3;
1729 public static final int ANIMATION_CHANGED = 1<<4;
1730 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1731 public static final int TITLE_CHANGED = 1<<6;
1732 public static final int ALPHA_CHANGED = 1<<7;
1733 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1734 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1735 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1736 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Craig Mautner3c174372013-02-21 17:54:37 -08001737 public static final int ROTATION_ANIMATION_CHANGED = 1<<12;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001738 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001739 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13;
Joe Onorato664644d2011-01-23 17:53:23 -08001740 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001741 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14;
Joe Onorato664644d2011-01-23 17:53:23 -08001742 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001743 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15;
Jeff Brown474dcb52011-06-14 20:22:50 -07001744 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001745 public static final int INPUT_FEATURES_CHANGED = 1<<16;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001746 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001747 public static final int PRIVATE_FLAGS_CHANGED = 1<<17;
Romain Guyf21c9b02011-09-06 16:56:54 -07001748 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001749 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18;
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001750 /** {@hide} */
John Spurlockbd957402013-10-03 11:38:39 -04001751 public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
1752 /** {@hide} */
Alan Viverette49a22e82014-07-12 20:01:27 -07001753 public static final int SURFACE_INSETS_CHANGED = 1<<20;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001754 /** {@hide} */
Michael Wright3f145a22014-07-22 19:46:03 -07001755 public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
1756 /** {@hide} */
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001757 public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22;
1758 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001759 public static final int EVERYTHING_CHANGED = 0xffffffff;
1760
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001761 // internal buffer to backup/restore parameters under compatibility mode.
1762 private int[] mCompatibilityParamsBackup = null;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001763
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001764 public final int copyFrom(LayoutParams o) {
1765 int changes = 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001766
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001767 if (width != o.width) {
1768 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001769 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001770 }
1771 if (height != o.height) {
1772 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001773 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001774 }
1775 if (x != o.x) {
1776 x = o.x;
1777 changes |= LAYOUT_CHANGED;
1778 }
1779 if (y != o.y) {
1780 y = o.y;
1781 changes |= LAYOUT_CHANGED;
1782 }
1783 if (horizontalWeight != o.horizontalWeight) {
1784 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001785 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001786 }
1787 if (verticalWeight != o.verticalWeight) {
1788 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001789 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001790 }
1791 if (horizontalMargin != o.horizontalMargin) {
1792 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001793 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001794 }
1795 if (verticalMargin != o.verticalMargin) {
1796 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001797 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001798 }
1799 if (type != o.type) {
1800 type = o.type;
1801 changes |= TYPE_CHANGED;
1802 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001803 if (flags != o.flags) {
John Spurlockbd957402013-10-03 11:38:39 -04001804 final int diff = flags ^ o.flags;
1805 if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) {
1806 changes |= TRANSLUCENT_FLAGS_CHANGED;
1807 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001808 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001809 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001810 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001811 if (privateFlags != o.privateFlags) {
1812 privateFlags = o.privateFlags;
1813 changes |= PRIVATE_FLAGS_CHANGED;
1814 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001815 if (softInputMode != o.softInputMode) {
1816 softInputMode = o.softInputMode;
1817 changes |= SOFT_INPUT_MODE_CHANGED;
1818 }
1819 if (gravity != o.gravity) {
1820 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001821 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001822 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001823 if (format != o.format) {
1824 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001825 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001826 }
1827 if (windowAnimations != o.windowAnimations) {
1828 windowAnimations = o.windowAnimations;
1829 changes |= ANIMATION_CHANGED;
1830 }
1831 if (token == null) {
1832 // NOTE: token only copied if the recipient doesn't
1833 // already have one.
1834 token = o.token;
1835 }
1836 if (packageName == null) {
1837 // NOTE: packageName only copied if the recipient doesn't
1838 // already have one.
1839 packageName = o.packageName;
1840 }
1841 if (!mTitle.equals(o.mTitle)) {
1842 mTitle = o.mTitle;
1843 changes |= TITLE_CHANGED;
1844 }
1845 if (alpha != o.alpha) {
1846 alpha = o.alpha;
1847 changes |= ALPHA_CHANGED;
1848 }
1849 if (dimAmount != o.dimAmount) {
1850 dimAmount = o.dimAmount;
1851 changes |= DIM_AMOUNT_CHANGED;
1852 }
1853 if (screenBrightness != o.screenBrightness) {
1854 screenBrightness = o.screenBrightness;
1855 changes |= SCREEN_BRIGHTNESS_CHANGED;
1856 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001857 if (buttonBrightness != o.buttonBrightness) {
1858 buttonBrightness = o.buttonBrightness;
1859 changes |= BUTTON_BRIGHTNESS_CHANGED;
1860 }
Craig Mautner3c174372013-02-21 17:54:37 -08001861 if (rotationAnimation != o.rotationAnimation) {
1862 rotationAnimation = o.rotationAnimation;
1863 changes |= ROTATION_ANIMATION_CHANGED;
1864 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001865
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001866 if (screenOrientation != o.screenOrientation) {
1867 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07001868 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001869 }
Romain Guy529b60a2010-08-03 18:05:47 -07001870
Michael Wright3f145a22014-07-22 19:46:03 -07001871 if (preferredRefreshRate != o.preferredRefreshRate) {
1872 preferredRefreshRate = o.preferredRefreshRate;
1873 changes |= PREFERRED_REFRESH_RATE_CHANGED;
1874 }
1875
Joe Onorato14782f72011-01-25 19:53:17 -08001876 if (systemUiVisibility != o.systemUiVisibility
1877 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08001878 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08001879 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08001880 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
1881 }
1882
1883 if (hasSystemUiListeners != o.hasSystemUiListeners) {
1884 hasSystemUiListeners = o.hasSystemUiListeners;
1885 changes |= SYSTEM_UI_LISTENER_CHANGED;
1886 }
1887
Jeff Brown474dcb52011-06-14 20:22:50 -07001888 if (inputFeatures != o.inputFeatures) {
1889 inputFeatures = o.inputFeatures;
1890 changes |= INPUT_FEATURES_CHANGED;
1891 }
1892
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001893 if (userActivityTimeout != o.userActivityTimeout) {
1894 userActivityTimeout = o.userActivityTimeout;
1895 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
1896 }
1897
Alan Viverette49a22e82014-07-12 20:01:27 -07001898 if (!surfaceInsets.equals(o.surfaceInsets)) {
1899 surfaceInsets.set(o.surfaceInsets);
1900 changes |= SURFACE_INSETS_CHANGED;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001901 }
1902
Alan Viverette5435a302015-01-29 10:25:34 -08001903 if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) {
1904 hasManualSurfaceInsets = o.hasManualSurfaceInsets;
1905 changes |= SURFACE_INSETS_CHANGED;
1906 }
1907
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001908 if (needsMenuKey != o.needsMenuKey) {
1909 needsMenuKey = o.needsMenuKey;
1910 changes |= NEEDS_MENU_KEY_CHANGED;
1911 }
1912
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001913 return changes;
1914 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001915
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001916 @Override
1917 public String debug(String output) {
1918 output += "Contents of " + this + ":";
1919 Log.d("Debug", output);
1920 output = super.debug("");
1921 Log.d("Debug", output);
1922 Log.d("Debug", "");
1923 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
1924 return "";
1925 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001926
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001927 @Override
1928 public String toString() {
1929 StringBuilder sb = new StringBuilder(256);
1930 sb.append("WM.LayoutParams{");
1931 sb.append("(");
1932 sb.append(x);
1933 sb.append(',');
1934 sb.append(y);
1935 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08001936 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001937 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08001938 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001939 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001940 if (horizontalMargin != 0) {
1941 sb.append(" hm=");
1942 sb.append(horizontalMargin);
1943 }
1944 if (verticalMargin != 0) {
1945 sb.append(" vm=");
1946 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001947 }
1948 if (gravity != 0) {
1949 sb.append(" gr=#");
1950 sb.append(Integer.toHexString(gravity));
1951 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001952 if (softInputMode != 0) {
1953 sb.append(" sim=#");
1954 sb.append(Integer.toHexString(softInputMode));
1955 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001956 sb.append(" ty=");
1957 sb.append(type);
1958 sb.append(" fl=#");
1959 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001960 if (privateFlags != 0) {
Adam Lesinski95c42972013-10-02 10:13:27 -07001961 if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
1962 sb.append(" compatible=true");
1963 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001964 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
1965 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001966 if (format != PixelFormat.OPAQUE) {
1967 sb.append(" fmt=");
1968 sb.append(format);
1969 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001970 if (windowAnimations != 0) {
1971 sb.append(" wanim=0x");
1972 sb.append(Integer.toHexString(windowAnimations));
1973 }
1974 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
1975 sb.append(" or=");
1976 sb.append(screenOrientation);
1977 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001978 if (alpha != 1.0f) {
1979 sb.append(" alpha=");
1980 sb.append(alpha);
1981 }
1982 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1983 sb.append(" sbrt=");
1984 sb.append(screenBrightness);
1985 }
1986 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1987 sb.append(" bbrt=");
1988 sb.append(buttonBrightness);
1989 }
Craig Mautner3c174372013-02-21 17:54:37 -08001990 if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
1991 sb.append(" rotAnim=");
1992 sb.append(rotationAnimation);
1993 }
Michael Wright3f145a22014-07-22 19:46:03 -07001994 if (preferredRefreshRate != 0) {
1995 sb.append(" preferredRefreshRate=");
1996 sb.append(preferredRefreshRate);
1997 }
Joe Onorato664644d2011-01-23 17:53:23 -08001998 if (systemUiVisibility != 0) {
1999 sb.append(" sysui=0x");
2000 sb.append(Integer.toHexString(systemUiVisibility));
2001 }
Joe Onorato14782f72011-01-25 19:53:17 -08002002 if (subtreeSystemUiVisibility != 0) {
2003 sb.append(" vsysui=0x");
2004 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
2005 }
Joe Onorato664644d2011-01-23 17:53:23 -08002006 if (hasSystemUiListeners) {
2007 sb.append(" sysuil=");
2008 sb.append(hasSystemUiListeners);
2009 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002010 if (inputFeatures != 0) {
2011 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
2012 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07002013 if (userActivityTimeout >= 0) {
2014 sb.append(" userActivityTimeout=").append(userActivityTimeout);
2015 }
Andreas Gampe007cfa72015-03-15 14:19:43 -07002016 if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 ||
Andreas Gampe11090062015-03-16 09:45:34 -07002017 surfaceInsets.bottom != 0 || hasManualSurfaceInsets) {
Alan Viverette49a22e82014-07-12 20:01:27 -07002018 sb.append(" surfaceInsets=").append(surfaceInsets);
Alan Viverette5435a302015-01-29 10:25:34 -08002019 if (hasManualSurfaceInsets) {
2020 sb.append(" (manual)");
2021 }
Alan Viveretteccb11e12014-07-08 16:04:02 -07002022 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002023 if (needsMenuKey != NEEDS_MENU_UNSET) {
2024 sb.append(" needsMenuKey=");
2025 sb.append(needsMenuKey);
2026 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002027 sb.append('}');
2028 return sb.toString();
2029 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002030
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002031 /**
2032 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002033 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002034 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002035 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002036 x = (int) (x * scale + 0.5f);
2037 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002038 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002039 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002040 }
2041 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002042 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002043 }
2044 }
2045
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002046 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002047 * Backup the layout parameters used in compatibility mode.
2048 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002049 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002050 void backup() {
2051 int[] backup = mCompatibilityParamsBackup;
2052 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002053 // we backup 4 elements, x, y, width, height
2054 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002055 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002056 backup[0] = x;
2057 backup[1] = y;
2058 backup[2] = width;
2059 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002060 }
2061
2062 /**
2063 * Restore the layout params' coordinates, size and gravity
2064 * @see LayoutParams#backup()
2065 */
2066 void restore() {
2067 int[] backup = mCompatibilityParamsBackup;
2068 if (backup != null) {
2069 x = backup[0];
2070 y = backup[1];
2071 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002072 height = backup[3];
2073 }
2074 }
2075
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002076 private CharSequence mTitle = "";
2077 }
2078}