blob: edf4297afdead35df091db9ba3d512689bf6f00e [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
Siva Velusamy0d857b92015-04-22 10:23:56 -070019import android.annotation.NonNull;
Bryce Lee53b9fbd2015-02-06 12:06:34 -080020import android.annotation.SystemApi;
Jeff Browna492c3a2012-08-23 19:48:44 -070021import android.app.Presentation;
22import android.content.Context;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.pm.ActivityInfo;
24import android.graphics.PixelFormat;
Alan Viveretteccb11e12014-07-08 16:04:02 -070025import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.os.IBinder;
27import android.os.Parcel;
28import android.os.Parcelable;
29import android.text.TextUtils;
30import android.util.Log;
31
32
33/**
34 * The interface that apps use to talk to the window manager.
35 * <p>
36 * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these.
Jeff Browna492c3a2012-08-23 19:48:44 -070037 * </p><p>
38 * Each window manager instance is bound to a particular {@link Display}.
39 * To obtain a {@link WindowManager} for a different display, use
40 * {@link Context#createDisplayContext} to obtain a {@link Context} for that
41 * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code>
42 * to get the WindowManager.
43 * </p><p>
44 * The simplest way to show a window on another display is to create a
45 * {@link Presentation}. The presentation will automatically obtain a
46 * {@link WindowManager} and {@link Context} for that display.
47 * </p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048 *
49 * @see android.content.Context#getSystemService
50 * @see android.content.Context#WINDOW_SERVICE
51 */
52public interface WindowManager extends ViewManager {
Jorim Jaggi61f39a72015-10-29 16:54:18 +010053
54 /** @hide */
55 int DOCKED_INVALID = -1;
56 /** @hide */
57 int DOCKED_LEFT = 1;
58 /** @hide */
59 int DOCKED_TOP = 2;
60 /** @hide */
61 int DOCKED_RIGHT = 3;
62 /** @hide */
63 int DOCKED_BOTTOM = 4;
64
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065 /**
66 * Exception that is thrown when trying to add view whose
Jorim Jaggi380ecb82014-03-14 17:25:20 +010067 * {@link LayoutParams} {@link LayoutParams#token}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 * is invalid.
69 */
70 public static class BadTokenException extends RuntimeException {
71 public BadTokenException() {
72 }
73
74 public BadTokenException(String name) {
75 super(name);
76 }
77 }
78
79 /**
Craig Mautner6018aee2012-10-23 14:27:49 -070080 * Exception that is thrown when calling {@link #addView} to a secondary display that cannot
81 * be found. See {@link android.app.Presentation} for more information on secondary displays.
82 */
83 public static class InvalidDisplayException extends RuntimeException {
84 public InvalidDisplayException() {
85 }
86
87 public InvalidDisplayException(String name) {
88 super(name);
89 }
90 }
91
92 /**
Jeff Browna492c3a2012-08-23 19:48:44 -070093 * Returns the {@link Display} upon which this {@link WindowManager} instance
94 * will create new windows.
95 * <p>
96 * Despite the name of this method, the display that is returned is not
97 * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}).
98 * The returned display could instead be a secondary display that this
99 * window manager instance is managing. Think of it as the display that
100 * this {@link WindowManager} instance uses by default.
101 * </p><p>
102 * To create windows on a different display, you need to obtain a
103 * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager}
104 * class documentation for more information.)
105 * </p>
106 *
107 * @return The display that this window manager is managing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800108 */
109 public Display getDefaultDisplay();
Jeff Browna492c3a2012-08-23 19:48:44 -0700110
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800111 /**
112 * Special variation of {@link #removeView} that immediately invokes
113 * the given view hierarchy's {@link View#onDetachedFromWindow()
114 * View.onDetachedFromWindow()} methods before returning. This is not
115 * for normal applications; using it correctly requires great care.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700116 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800117 * @param view The view to be removed.
118 */
119 public void removeViewImmediate(View view);
Jeff Brownd32460c2012-07-20 16:15:36 -0700120
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800121 public static class LayoutParams extends ViewGroup.LayoutParams
122 implements Parcelable {
123 /**
124 * X position for this window. With the default gravity it is ignored.
Fabrice Di Meglio9e3b0022011-06-06 16:30:29 -0700125 * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or
126 * {@link Gravity#END} it provides an offset from the given edge.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127 */
Romain Guy529b60a2010-08-03 18:05:47 -0700128 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 public int x;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700130
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 /**
132 * Y position for this window. With the default gravity it is ignored.
133 * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
134 * an offset from the given edge.
135 */
Romain Guy529b60a2010-08-03 18:05:47 -0700136 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 public int y;
138
139 /**
140 * Indicates how much of the extra space will be allocated horizontally
141 * to the view associated with these LayoutParams. Specify 0 if the view
142 * should not be stretched. Otherwise the extra pixels will be pro-rated
143 * among all views whose weight is greater than 0.
144 */
Romain Guy529b60a2010-08-03 18:05:47 -0700145 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146 public float horizontalWeight;
147
148 /**
149 * Indicates how much of the extra space will be allocated vertically
150 * to the view associated with these LayoutParams. Specify 0 if the view
151 * should not be stretched. Otherwise the extra pixels will be pro-rated
152 * among all views whose weight is greater than 0.
153 */
Romain Guy529b60a2010-08-03 18:05:47 -0700154 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800155 public float verticalWeight;
Romain Guy529b60a2010-08-03 18:05:47 -0700156
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800157 /**
158 * The general type of window. There are three main classes of
159 * window types:
160 * <ul>
161 * <li> <strong>Application windows</strong> (ranging from
162 * {@link #FIRST_APPLICATION_WINDOW} to
163 * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
164 * windows. For these types of windows, the {@link #token} must be
165 * set to the token of the activity they are a part of (this will
166 * normally be done for you if {@link #token} is null).
167 * <li> <strong>Sub-windows</strong> (ranging from
168 * {@link #FIRST_SUB_WINDOW} to
169 * {@link #LAST_SUB_WINDOW}) are associated with another top-level
170 * window. For these types of windows, the {@link #token} must be
171 * the token of the window it is attached to.
172 * <li> <strong>System windows</strong> (ranging from
173 * {@link #FIRST_SYSTEM_WINDOW} to
174 * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
175 * use by the system for specific purposes. They should not normally
176 * be used by applications, and a special permission is required
177 * to use them.
178 * </ul>
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700179 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800180 * @see #TYPE_BASE_APPLICATION
181 * @see #TYPE_APPLICATION
182 * @see #TYPE_APPLICATION_STARTING
183 * @see #TYPE_APPLICATION_PANEL
184 * @see #TYPE_APPLICATION_MEDIA
185 * @see #TYPE_APPLICATION_SUB_PANEL
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700186 * @see #TYPE_APPLICATION_ABOVE_SUB_PANEL
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800187 * @see #TYPE_APPLICATION_ATTACHED_DIALOG
188 * @see #TYPE_STATUS_BAR
189 * @see #TYPE_SEARCH_BAR
190 * @see #TYPE_PHONE
191 * @see #TYPE_SYSTEM_ALERT
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800192 * @see #TYPE_TOAST
193 * @see #TYPE_SYSTEM_OVERLAY
194 * @see #TYPE_PRIORITY_PHONE
195 * @see #TYPE_STATUS_BAR_PANEL
196 * @see #TYPE_SYSTEM_DIALOG
197 * @see #TYPE_KEYGUARD_DIALOG
198 * @see #TYPE_SYSTEM_ERROR
199 * @see #TYPE_INPUT_METHOD
200 * @see #TYPE_INPUT_METHOD_DIALOG
201 */
Joe Onorato8f2bd432010-03-25 11:45:28 -0700202 @ViewDebug.ExportedProperty(mapping = {
203 @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
204 @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
205 @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
206 @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
207 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
208 @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700209 @ViewDebug.IntToString(from = TYPE_APPLICATION_ABOVE_SUB_PANEL, to = "TYPE_APPLICATION_ABOVE_SUB_PANEL"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700210 @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700211 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700212 @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"),
213 @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"),
214 @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"),
215 @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700216 @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"),
217 @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"),
218 @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700219 @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"),
220 @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"),
221 @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
222 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
Jeff Brown3b2b3542010-10-15 00:54:27 -0700223 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700224 @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
225 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700226 @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700227 @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
228 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
229 @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
230 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
231 @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700232 @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"),
Selim Cinekf83e8242015-05-19 18:08:14 -0700233 @ViewDebug.IntToString(from = TYPE_INPUT_CONSUMER, to = "TYPE_INPUT_CONSUMER"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700234 @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"),
Jeff Brownbd6e1502012-08-28 03:27:37 -0700235 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"),
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700236 @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"),
keunyounga446bf02013-06-21 19:07:57 -0700237 @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"),
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700238 @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"),
239 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"),
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700240 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION_STARTING, to = "TYPE_VOICE_INTERACTION_STARTING"),
Filip Gruszczynski466f3212015-09-21 17:57:57 -0700241 @ViewDebug.IntToString(from = TYPE_DOCK_DIVIDER, to = "TYPE_DOCK_DIVIDER"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700242 })
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800243 public int type;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 /**
246 * Start of window types that represent normal application windows.
247 */
248 public static final int FIRST_APPLICATION_WINDOW = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700249
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800250 /**
251 * Window type: an application window that serves as the "base" window
252 * of the overall application; all other application windows will
253 * appear on top of it.
Craig Mautner5962b122012-10-05 14:45:52 -0700254 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800255 */
256 public static final int TYPE_BASE_APPLICATION = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700257
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800258 /**
259 * Window type: a normal application window. The {@link #token} must be
260 * an Activity token identifying who the window belongs to.
Craig Mautner5962b122012-10-05 14:45:52 -0700261 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800262 */
263 public static final int TYPE_APPLICATION = 2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 /**
266 * Window type: special application window that is displayed while the
267 * application is starting. Not for use by applications themselves;
268 * this is used by the system to display something until the
269 * application can show its own windows.
Craig Mautner5962b122012-10-05 14:45:52 -0700270 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800271 */
272 public static final int TYPE_APPLICATION_STARTING = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700273
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800274 /**
275 * End of types of application windows.
276 */
277 public static final int LAST_APPLICATION_WINDOW = 99;
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700278
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800279 /**
280 * Start of types of sub-windows. The {@link #token} of these windows
281 * must be set to the window they are attached to. These types of
282 * windows are kept next to their attached window in Z-order, and their
283 * coordinate space is relative to their attached window.
284 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700285 public static final int FIRST_SUB_WINDOW = 1000;
286
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800287 /**
288 * Window type: a panel on top of an application window. These windows
289 * appear on top of their attached window.
290 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700291 public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
292
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800293 /**
John Spurlock33291d82013-03-13 14:45:14 -0400294 * Window type: window for showing media (such as video). These windows
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800295 * are displayed behind their attached window.
296 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700297 public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1;
298
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800299 /**
300 * Window type: a sub-panel on top of an application window. These
301 * windows are displayed on top their attached window and any
302 * {@link #TYPE_APPLICATION_PANEL} panels.
303 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700304 public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800305
306 /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
307 * of the window happens as that of a top-level window, <em>not</em>
308 * as a child of its container.
309 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700310 public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3;
311
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800312 /**
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700313 * Window type: window for showing overlays on top of media windows.
314 * These windows are displayed between TYPE_APPLICATION_MEDIA and the
315 * application window. They should be translucent to be useful. This
316 * is a big ugly hack so:
317 * @hide
318 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700319 public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW + 4;
320
321 /**
322 * Window type: a above sub-panel on top of an application window and it's
323 * sub-panel windows. These windows are displayed on top of their attached window
324 * and any {@link #TYPE_APPLICATION_SUB_PANEL} panels.
Wale Ogunwale3540f932015-06-02 11:07:07 -0700325 * @hide
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700326 */
327 public static final int TYPE_APPLICATION_ABOVE_SUB_PANEL = FIRST_SUB_WINDOW + 5;
328
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700329 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 * End of types of sub-windows.
331 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700332 public static final int LAST_SUB_WINDOW = 1999;
333
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800334 /**
335 * Start of system-specific window types. These are not normally
336 * created by applications.
337 */
338 public static final int FIRST_SYSTEM_WINDOW = 2000;
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700339
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800340 /**
341 * Window type: the status bar. There can be only one status bar
342 * window; it is placed at the top of the screen, and all other
343 * windows are shifted down so they are below it.
Craig Mautner88400d32012-09-30 12:35:45 -0700344 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800345 */
346 public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700347
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800348 /**
349 * Window type: the search bar. There can be only one search bar
350 * window; it is placed at the top of the screen.
Craig Mautner88400d32012-09-30 12:35:45 -0700351 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800352 */
353 public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800355 /**
356 * Window type: phone. These are non-application windows providing
357 * user interaction with the phone (in particular incoming calls).
358 * These windows are normally placed above all applications, but behind
359 * the status bar.
Craig Mautner88400d32012-09-30 12:35:45 -0700360 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800361 */
362 public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700363
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800364 /**
365 * Window type: system window, such as low power alert. These windows
366 * are always on top of application windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700367 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800368 */
369 public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100370
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800371 /**
372 * Window type: keyguard window.
Craig Mautner88400d32012-09-30 12:35:45 -0700373 * In multiuser systems shows on all users' windows.
Jorim Jaggie411fdf2014-07-28 23:00:44 +0200374 * @removed
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800375 */
376 public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100377
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800378 /**
379 * Window type: transient notifications.
Craig Mautner88400d32012-09-30 12:35:45 -0700380 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 */
382 public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700383
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800384 /**
385 * Window type: system overlay windows, which need to be displayed
386 * on top of everything else. These windows must not take input
387 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700388 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800389 */
390 public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700391
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800392 /**
393 * Window type: priority phone UI, which needs to be displayed even if
394 * the keyguard is active. These windows must not take input
395 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700396 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800397 */
398 public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700399
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800400 /**
401 * Window type: panel that slides out from the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700402 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800403 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800404 public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700405
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800406 /**
407 * Window type: dialogs that the keyguard shows
Craig Mautner88400d32012-09-30 12:35:45 -0700408 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800409 */
410 public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700411
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800412 /**
413 * Window type: internal system error windows, appear on top of
414 * everything they can.
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_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700418
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800419 /**
420 * Window type: internal input methods windows, which appear above
421 * the normal UI. Application windows may be resized or panned to keep
422 * the input focus visible while this window is displayed.
Craig Mautner88400d32012-09-30 12:35:45 -0700423 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800424 */
425 public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11;
426
427 /**
428 * Window type: internal input methods dialog windows, which appear above
429 * the current input method window.
Craig Mautner88400d32012-09-30 12:35:45 -0700430 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800431 */
432 public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
433
434 /**
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700435 * Window type: wallpaper window, placed behind any window that wants
436 * to sit on top of the wallpaper.
Craig Mautner88400d32012-09-30 12:35:45 -0700437 * In multiuser systems shows only on the owning user's window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700438 */
439 public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13;
440
441 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800442 * Window type: panel that slides out from over the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700443 * In multiuser systems shows on all users' windows.
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800444 */
445 public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14;
Jeff Brown3b2b3542010-10-15 00:54:27 -0700446
447 /**
448 * Window type: secure system overlay windows, which need to be displayed
449 * on top of everything else. These windows must not take input
450 * focus, or they will interfere with the keyguard.
451 *
452 * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
453 * system itself is allowed to create these overlays. Applications cannot
454 * obtain permission to create secure system overlays.
Craig Mautner88400d32012-09-30 12:35:45 -0700455 *
456 * In multiuser systems shows only on the owning user's window.
Jeff Brown3b2b3542010-10-15 00:54:27 -0700457 * @hide
458 */
459 public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
460
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800461 /**
Christopher Tatea53146c2010-09-07 11:57:52 -0700462 * Window type: the drag-and-drop pseudowindow. There is only one
463 * drag layer (at most), and it is placed on top of all other windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700464 * In multiuser systems shows only on the owning user's window.
Christopher Tatea53146c2010-09-07 11:57:52 -0700465 * @hide
466 */
Jeff Brown3b2b3542010-10-15 00:54:27 -0700467 public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16;
Christopher Tatea53146c2010-09-07 11:57:52 -0700468
469 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800470 * Window type: panel that slides out from under the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700471 * In multiuser systems shows on all users' windows.
Joe Onoratoa89e9032010-11-24 11:13:44 -0800472 * @hide
Joe Onorato29fc2c92010-11-24 10:26:50 -0800473 */
474 public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
475
Jeff Brown83c09682010-12-23 17:50:18 -0800476 /**
477 * Window type: (mouse) pointer
Craig Mautner88400d32012-09-30 12:35:45 -0700478 * In multiuser systems shows on all users' windows.
Jeff Brown83c09682010-12-23 17:50:18 -0800479 * @hide
480 */
481 public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
Joe Onorato29fc2c92010-11-24 10:26:50 -0800482
483 /**
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400484 * Window type: Navigation bar (when distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700485 * In multiuser systems shows on all users' windows.
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400486 * @hide
487 */
488 public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
489
490 /**
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700491 * Window type: The volume level overlay/dialog shown when the user
492 * changes the system volume.
Craig Mautner88400d32012-09-30 12:35:45 -0700493 * In multiuser systems shows on all users' windows.
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700494 * @hide
495 */
496 public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
497
498 /**
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700499 * Window type: The boot progress dialog, goes on top of everything
500 * in the world.
Craig Mautner88400d32012-09-30 12:35:45 -0700501 * In multiuser systems shows on all users' windows.
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700502 * @hide
503 */
504 public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
505
506 /**
Selim Cinekf83e8242015-05-19 18:08:14 -0700507 * Window type to consume input events when the systemUI bars are hidden.
Craig Mautner88400d32012-09-30 12:35:45 -0700508 * In multiuser systems shows on all users' windows.
Dianne Hackborndf89e652011-10-06 22:35:11 -0700509 * @hide
510 */
Selim Cinekf83e8242015-05-19 18:08:14 -0700511 public static final int TYPE_INPUT_CONSUMER = FIRST_SYSTEM_WINDOW+22;
Dianne Hackborndf89e652011-10-06 22:35:11 -0700512
513 /**
Daniel Sandler7d276c32012-01-30 14:33:52 -0500514 * Window type: Dreams (screen saver) window, just above keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700515 * In multiuser systems shows only on the owning user's window.
Daniel Sandler7d276c32012-01-30 14:33:52 -0500516 * @hide
517 */
518 public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
519
520 /**
Jim Millere898ac52012-04-06 17:10:57 -0700521 * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700522 * In multiuser systems shows on all users' windows.
Jim Millere898ac52012-04-06 17:10:57 -0700523 * @hide
524 */
525 public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
526
527 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -0700528 * Window type: Display overlay window. Used to simulate secondary display devices.
Craig Mautner88400d32012-09-30 12:35:45 -0700529 * In multiuser systems shows on all users' windows.
Jeff Brownbd6e1502012-08-28 03:27:37 -0700530 * @hide
531 */
532 public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
533
534 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700535 * Window type: Magnification overlay window. Used to highlight the magnified
536 * portion of a display when accessibility magnification is enabled.
Craig Mautner88400d32012-09-30 12:35:45 -0700537 * In multiuser systems shows on all users' windows.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700538 * @hide
539 */
540 public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
541
542 /**
Jim Miller5ecd8112013-01-09 18:50:26 -0800543 * Window type: keyguard scrim window. Shows if keyguard needs to be restarted.
544 * In multiuser systems shows on all users' windows.
545 * @hide
546 */
547 public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29;
548
Craig Mautner88400d32012-09-30 12:35:45 -0700549 /**
keunyounga446bf02013-06-21 19:07:57 -0700550 * Window type: Window for Presentation on top of private
551 * virtual display.
552 */
553 public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30;
554
555 /**
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700556 * Window type: Windows in the voice interaction layer.
557 * @hide
558 */
559 public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31;
560
561 /**
Svetoslav3a5c7212014-10-14 09:54:26 -0700562 * Window type: Windows that are overlaid <em>only</em> by an {@link
563 * android.accessibilityservice.AccessibilityService} for interception of
564 * user interactions without changing the windows an accessibility service
565 * can introspect. In particular, an accessibility service can introspect
566 * only windows that a sighted user can interact with which is they can touch
567 * these windows or can type into these windows. For example, if there
568 * is a full screen accessibility overlay that is touchable, the windows
569 * below it will be introspectable by an accessibility service regardless
570 * they are covered by a touchable window.
571 */
572 public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32;
573
574 /**
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700575 * Window type: Starting window for voice interaction layer.
576 * @hide
577 */
578 public static final int TYPE_VOICE_INTERACTION_STARTING = FIRST_SYSTEM_WINDOW+33;
579
580 /**
Filip Gruszczynski466f3212015-09-21 17:57:57 -0700581 * Window for displaying a handle used for resizing docked stacks. This window is owned
582 * by the system process.
583 * @hide
584 */
585 public static final int TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW+34;
586
587 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800588 * End of types of system windows.
589 */
590 public static final int LAST_SYSTEM_WINDOW = 2999;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800591
Mathias Agopiand2112302010-12-07 19:38:17 -0800592 /** @deprecated this is ignored, this value is set automatically when needed. */
593 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800594 public static final int MEMORY_TYPE_NORMAL = 0;
Mathias Agopiand2112302010-12-07 19:38:17 -0800595 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700596 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800597 public static final int MEMORY_TYPE_HARDWARE = 1;
Mathias Agopiand2112302010-12-07 19:38:17 -0800598 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700599 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800600 public static final int MEMORY_TYPE_GPU = 2;
Mathias Agopiand2112302010-12-07 19:38:17 -0800601 /** @deprecated this is ignored, this value is set automatically when needed. */
602 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800603 public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700604
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700606 * @deprecated this is ignored
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800607 */
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700608 @Deprecated
609 public int memoryType;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700610
Mike Lockwoodef731622010-01-27 17:51:34 -0500611 /** Window flag: as long as this window is visible to the user, allow
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700612 * the lock screen to activate while the screen is on.
613 * This can be used independently, or in combination with
Christopher Tate95f78502010-01-29 15:57:34 -0800614 * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
Mike Lockwoodef731622010-01-27 17:51:34 -0500615 public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
616
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800617 /** Window flag: everything behind this window will be dimmed.
618 * Use {@link #dimAmount} to control the amount of dim. */
619 public static final int FLAG_DIM_BEHIND = 0x00000002;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700620
621 /** Window flag: blur everything behind this window.
622 * @deprecated Blurring is no longer supported. */
623 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800624 public static final int FLAG_BLUR_BEHIND = 0x00000004;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700625
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800626 /** Window flag: this window won't ever get key input focus, so the
627 * user can not send key or other button events to it. Those will
628 * instead go to whatever focusable window is behind it. This flag
629 * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
630 * is explicitly set.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700631 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800632 * <p>Setting this flag also implies that the window will not need to
633 * interact with
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700634 * a soft input method, so it will be Z-ordered and positioned
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800635 * independently of any active input method (typically this means it
636 * gets Z-ordered on top of the input method, so it can use the full
637 * screen for its content and cover the input method if needed. You
638 * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
639 public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700640
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800641 /** Window flag: this window can never receive touch events. */
642 public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700643
John Spurlock33291d82013-03-13 14:45:14 -0400644 /** Window flag: even when this window is focusable (its
645 * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 * outside of the window to be sent to the windows behind it. Otherwise
647 * it will consume all pointer events itself, regardless of whether they
648 * are inside of the window. */
649 public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700650
John Spurlock33291d82013-03-13 14:45:14 -0400651 /** Window flag: when set, if the device is asleep when the touch
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800652 * screen is pressed, you will receive this first touch event. Usually
653 * the first touch event is consumed by the system since the user can
654 * not see what they are pressing on.
Jeff Brown037c33e2014-04-09 00:31:55 -0700655 *
656 * @deprecated This flag has no effect.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800657 */
Jeff Brown037c33e2014-04-09 00:31:55 -0700658 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800659 public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700660
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800661 /** Window flag: as long as this window is visible to the user, keep
662 * the device's screen turned on and bright. */
663 public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 /** Window flag: place the window within the entire screen, ignoring
John Spurlock33291d82013-03-13 14:45:14 -0400666 * decorations around the border (such as the status bar). The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800667 * window must correctly position its contents to take the screen
668 * decoration into account. This flag is normally set for you
669 * by Window as described in {@link Window#setFlags}. */
670 public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700671
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 /** Window flag: allow window to extend outside of the screen. */
673 public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700674
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800675 /**
John Spurlock33291d82013-03-13 14:45:14 -0400676 * Window flag: hide all screen decorations (such as the status bar) while
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800677 * this window is displayed. This allows the window to use the entire
678 * display space for itself -- the status bar will be hidden when
Chet Haase45c89c22013-04-29 16:04:40 -0700679 * an app window with this flag set is on the top layer. A fullscreen window
680 * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's
681 * {@link #softInputMode} field; the window will stay fullscreen
682 * and will not resize.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800683 *
684 * <p>This flag can be controlled in your theme through the
685 * {@link android.R.attr#windowFullscreen} attribute; this attribute
686 * is automatically set for you in the standard fullscreen themes
687 * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen},
688 * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen},
689 * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen},
690 * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen},
691 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen},
692 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and
693 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p>
694 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800695 public static final int FLAG_FULLSCREEN = 0x00000400;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700696
John Spurlock33291d82013-03-13 14:45:14 -0400697 /** Window flag: override {@link #FLAG_FULLSCREEN} and force the
698 * screen decorations (such as the status bar) to be shown. */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800699 public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700700
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800701 /** Window flag: turn on dithering when compositing this window to
Jeff Brown3cc321e2012-07-16 16:04:23 -0700702 * the screen.
703 * @deprecated This flag is no longer used. */
704 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800705 public static final int FLAG_DITHER = 0x00001000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700706
John Spurlock33291d82013-03-13 14:45:14 -0400707 /** Window flag: treat the content of the window as secure, preventing
Jeff Brownf0681b32012-10-23 17:35:57 -0700708 * it from appearing in screenshots or from being viewed on non-secure
709 * displays.
710 *
711 * <p>See {@link android.view.Display#FLAG_SECURE} for more details about
712 * secure surfaces and secure displays.
713 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800714 public static final int FLAG_SECURE = 0x00002000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700715
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800716 /** Window flag: a special mode where the layout parameters are used
717 * to perform scaling of the surface when it is composited to the
718 * screen. */
719 public static final int FLAG_SCALED = 0x00004000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721 /** Window flag: intended for windows that will often be used when the user is
722 * holding the screen against their face, it will aggressively filter the event
723 * stream to prevent unintended presses in this situation that may not be
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700724 * desired for a particular window, when such an event stream is detected, the
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800725 * application will receive a CANCEL motion event to indicate this so applications
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700726 * can handle this accordingly by taking no action on the event
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800727 * until the finger is released. */
728 public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700729
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800730 /** Window flag: a special option only for use in combination with
731 * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
732 * screen your window may appear on top of or behind screen decorations
733 * such as the status bar. By also including this flag, the window
734 * manager will report the inset rectangle needed to ensure your
735 * content is not covered by screen decorations. This flag is normally
736 * set for you by Window as described in {@link Window#setFlags}.*/
737 public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700738
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800739 /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
740 * respect to how this window interacts with the current method. That
741 * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
742 * window will behave as if it needs to interact with the input method
743 * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
744 * not set and this flag is set, then the window will behave as if it
745 * doesn't need to interact with the input method and can be placed
746 * to use more space and cover the input method.
747 */
748 public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700749
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800750 /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
751 * can set this flag to receive a single special MotionEvent with
752 * the action
753 * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
754 * touches that occur outside of your window. Note that you will not
755 * receive the full down/move/up gesture, only the location of the
756 * first down as an ACTION_OUTSIDE.
757 */
758 public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700759
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700760 /** Window flag: special flag to let windows be shown when the screen
761 * is locked. This will let application windows take precedence over
762 * key guard or any other lock screens. Can be used with
763 * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700764 * directly before showing the key guard window. Can be used with
765 * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
766 * non-secure keyguards. This flag only applies to the top-most
767 * full-screen window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700768 */
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700769 public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
770
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700771 /** Window flag: ask that the system wallpaper be shown behind
772 * your window. The window surface must be translucent to be able
773 * to actually see the wallpaper behind it; this flag just ensures
774 * that the wallpaper surface will be there if this window actually
775 * has translucent regions.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800776 *
777 * <p>This flag can be controlled in your theme through the
778 * {@link android.R.attr#windowShowWallpaper} attribute; this attribute
779 * is automatically set for you in the standard wallpaper themes
780 * such as {@link android.R.style#Theme_Wallpaper},
781 * {@link android.R.style#Theme_Wallpaper_NoTitleBar},
782 * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen},
783 * {@link android.R.style#Theme_Holo_Wallpaper},
784 * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar},
785 * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and
786 * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p>
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700787 */
788 public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700789
Dianne Hackborn93e462b2009-09-15 22:50:40 -0700790 /** Window flag: when set as a window is being added or made
791 * visible, once the window has been shown then the system will
792 * poke the power manager's user activity (as if the user had woken
793 * up the device) to turn the screen on. */
794 public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700795
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700796 /** Window flag: when set the window will cause the keyguard to
797 * be dismissed, only if it is not a secure lock keyguard. Because such
798 * a keyguard is not needed for security, it will never re-appear if
799 * the user navigates to another window (in contrast to
800 * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
801 * hide both secure and non-secure keyguards but ensure they reappear
802 * when the user moves to another UI that doesn't hide them).
803 * If the keyguard is currently active and is secure (requires an
804 * unlock pattern) than the user will still need to confirm it before
805 * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
Daniel Sandlerae069f72010-06-17 21:56:26 -0400806 * also been set.
807 */
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700808 public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700809
Jeff Brown01ce2e92010-09-26 22:20:12 -0700810 /** Window flag: when set the window will accept for touch events
811 * outside of its bounds to be sent to other windows that also
812 * support split touch. When this flag is not set, the first pointer
813 * that goes down determines the window to which all subsequent touches
814 * go until all pointers go up. When this flag is set, each pointer
815 * (not necessarily the first) that goes down determines the window
816 * to which all subsequent touches of that pointer will go until that
817 * pointer goes up thereby enabling touches with multiple pointers
818 * to be split across multiple windows.
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800819 */
Jeff Brown01ce2e92010-09-26 22:20:12 -0700820 public static final int FLAG_SPLIT_TOUCH = 0x00800000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700821
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800822 /**
Romain Guy72f0a272011-01-09 16:01:46 -0800823 * <p>Indicates whether this window should be hardware accelerated.
824 * Requesting hardware acceleration does not guarantee it will happen.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800825 *
Romain Guy72f0a272011-01-09 16:01:46 -0800826 * <p>This flag can be controlled programmatically <em>only</em> to enable
827 * hardware acceleration. To enable hardware acceleration for a given
828 * window programmatically, do the following:</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800829 *
Romain Guy72f0a272011-01-09 16:01:46 -0800830 * <pre>
831 * Window w = activity.getWindow(); // in Activity's onCreate() for instance
832 * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
833 * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
834 * </pre>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800835 *
Romain Guy72f0a272011-01-09 16:01:46 -0800836 * <p>It is important to remember that this flag <strong>must</strong>
837 * be set before setting the content view of your activity or dialog.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800838 *
Romain Guy72f0a272011-01-09 16:01:46 -0800839 * <p>This flag cannot be used to disable hardware acceleration after it
840 * was enabled in your manifest using
841 * {@link android.R.attr#hardwareAccelerated}. If you need to selectively
842 * and programmatically disable hardware acceleration (for automated testing
843 * for instance), make sure it is turned off in your manifest and enable it
844 * on your activity or dialog when you need it instead, using the method
845 * described above.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800846 *
Romain Guy72f0a272011-01-09 16:01:46 -0800847 * <p>This flag is automatically set by the system if the
848 * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
849 * XML attribute is set to true on an activity or on the application.</p>
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800850 */
851 public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000;
Daniel Sandler611fae42010-06-17 10:45:00 -0400852
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800853 /**
854 * Window flag: allow window contents to extend in to the screen's
Dianne Hackbornc652de82013-02-15 16:32:56 -0800855 * overscan area, if there is one. The window should still correctly
856 * position its contents to take the overscan area into account.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800857 *
858 * <p>This flag can be controlled in your theme through the
859 * {@link android.R.attr#windowOverscan} attribute; this attribute
860 * is automatically set for you in the standard overscan themes
Ying Wang4e0eb222013-04-18 20:39:48 -0700861 * such as
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800862 * {@link android.R.style#Theme_Holo_NoActionBar_Overscan},
863 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan},
864 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and
865 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p>
866 *
867 * <p>When this flag is enabled for a window, its normal content may be obscured
868 * to some degree by the overscan region of the display. To ensure key parts of
869 * that content are visible to the user, you can use
870 * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)}
871 * to set the point in the view hierarchy where the appropriate offsets should
872 * be applied. (This can be done either by directly calling this function, using
873 * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy,
874 * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect)
875 * View.fitSystemWindows(Rect)} method).</p>
876 *
877 * <p>This mechanism for positioning content elements is identical to its equivalent
878 * use with layout and {@link View#setSystemUiVisibility(int)
879 * View.setSystemUiVisibility(int)}; here is an example layout that will correctly
880 * position its UI elements with this overscan flag is set:</p>
881 *
882 * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete}
Dianne Hackbornc652de82013-02-15 16:32:56 -0800883 */
884 public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
885
John Spurlockbd957402013-10-03 11:38:39 -0400886 /**
887 * Window flag: request a translucent status bar with minimal system-provided
888 * background protection.
889 *
890 * <p>This flag can be controlled in your theme through the
891 * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute
892 * is automatically set for you in the standard translucent decor themes
893 * such as
894 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
895 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
896 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
897 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
898 *
899 * <p>When this flag is enabled for a window, it automatically sets
900 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
901 * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p>
902 */
903 public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000;
904
905 /**
906 * Window flag: request a translucent navigation bar with minimal system-provided
907 * background protection.
908 *
909 * <p>This flag can be controlled in your theme through the
910 * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute
911 * is automatically set for you in the standard translucent decor themes
912 * such as
913 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
914 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
915 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
916 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
917 *
918 * <p>When this flag is enabled for a window, it automatically sets
919 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
920 * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p>
921 */
922 public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000;
923
Adam Lesinski6a591f52013-10-01 18:11:17 -0700924 /**
925 * Flag for a window in local focus mode.
926 * Window in local focus mode can control focus independent of window manager using
927 * {@link Window#setLocalFocus(boolean, boolean)}.
928 * Usually window in this mode will not get touch/key events from window manager, but will
929 * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}.
930 */
931 public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000;
932
Jeff Brown98db5fa2011-06-08 15:37:10 -0700933 /** Window flag: Enable touches to slide out of a window into neighboring
934 * windows in mid-gesture instead of being captured for the duration of
935 * the gesture.
936 *
937 * This flag changes the behavior of touch focus for this window only.
938 * Touches can slide out of the window but they cannot necessarily slide
939 * back in (unless the other window with touch focus permits it).
940 *
941 * {@hide}
942 */
Adam Lesinski6a591f52013-10-01 18:11:17 -0700943 public static final int FLAG_SLIPPERY = 0x20000000;
Jeff Brown98db5fa2011-06-08 15:37:10 -0700944
Daniel Sandlere02d8082010-10-08 15:13:22 -0400945 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -0700946 * Window flag: When requesting layout with an attached window, the attached window may
947 * overlap with the screen decorations of the parent window such as the navigation bar. By
948 * including this flag, the window manager will layout the attached window within the decor
949 * frame of the parent window such that it doesn't overlap with screen decorations.
Daniel Sandlere02d8082010-10-08 15:13:22 -0400950 */
Wale Ogunwale393b1c12014-10-18 16:22:01 -0700951 public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000;
Daniel Sandlere02d8082010-10-08 15:13:22 -0400952
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800953 /**
Adrian Roos217ccd22014-05-09 14:29:04 +0200954 * Flag indicating that this Window is responsible for drawing the background for the
955 * system bars. If set, the system bars are drawn with a transparent background and the
956 * corresponding areas in this window are filled with the colors specified in
957 * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}.
958 */
959 public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000;
960
961 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700962 * Various behavioral options/flags. Default is none.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700963 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700964 * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
965 * @see #FLAG_DIM_BEHIND
966 * @see #FLAG_NOT_FOCUSABLE
967 * @see #FLAG_NOT_TOUCHABLE
968 * @see #FLAG_NOT_TOUCH_MODAL
969 * @see #FLAG_TOUCHABLE_WHEN_WAKING
970 * @see #FLAG_KEEP_SCREEN_ON
971 * @see #FLAG_LAYOUT_IN_SCREEN
972 * @see #FLAG_LAYOUT_NO_LIMITS
973 * @see #FLAG_FULLSCREEN
974 * @see #FLAG_FORCE_NOT_FULLSCREEN
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700975 * @see #FLAG_SECURE
976 * @see #FLAG_SCALED
977 * @see #FLAG_IGNORE_CHEEK_PRESSES
978 * @see #FLAG_LAYOUT_INSET_DECOR
979 * @see #FLAG_ALT_FOCUSABLE_IM
980 * @see #FLAG_WATCH_OUTSIDE_TOUCH
981 * @see #FLAG_SHOW_WHEN_LOCKED
982 * @see #FLAG_SHOW_WALLPAPER
983 * @see #FLAG_TURN_SCREEN_ON
984 * @see #FLAG_DISMISS_KEYGUARD
985 * @see #FLAG_SPLIT_TOUCH
986 * @see #FLAG_HARDWARE_ACCELERATED
keunyoung30f420f2013-08-02 14:23:10 -0700987 * @see #FLAG_LOCAL_FOCUS_MODE
Adrian Roos217ccd22014-05-09 14:29:04 +0200988 * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700989 */
990 @ViewDebug.ExportedProperty(flagMapping = {
991 @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON,
992 name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"),
993 @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND,
994 name = "FLAG_DIM_BEHIND"),
995 @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND,
996 name = "FLAG_BLUR_BEHIND"),
997 @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE,
998 name = "FLAG_NOT_FOCUSABLE"),
999 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE,
1000 name = "FLAG_NOT_TOUCHABLE"),
1001 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL,
1002 name = "FLAG_NOT_TOUCH_MODAL"),
1003 @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING,
1004 name = "FLAG_TOUCHABLE_WHEN_WAKING"),
1005 @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON,
1006 name = "FLAG_KEEP_SCREEN_ON"),
1007 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN,
1008 name = "FLAG_LAYOUT_IN_SCREEN"),
1009 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS,
1010 name = "FLAG_LAYOUT_NO_LIMITS"),
1011 @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN,
1012 name = "FLAG_FULLSCREEN"),
1013 @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN,
1014 name = "FLAG_FORCE_NOT_FULLSCREEN"),
1015 @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER,
1016 name = "FLAG_DITHER"),
1017 @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE,
1018 name = "FLAG_SECURE"),
1019 @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED,
1020 name = "FLAG_SCALED"),
1021 @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES,
1022 name = "FLAG_IGNORE_CHEEK_PRESSES"),
1023 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR,
1024 name = "FLAG_LAYOUT_INSET_DECOR"),
1025 @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM,
1026 name = "FLAG_ALT_FOCUSABLE_IM"),
1027 @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH,
1028 name = "FLAG_WATCH_OUTSIDE_TOUCH"),
1029 @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED,
1030 name = "FLAG_SHOW_WHEN_LOCKED"),
1031 @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER,
1032 name = "FLAG_SHOW_WALLPAPER"),
1033 @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON,
1034 name = "FLAG_TURN_SCREEN_ON"),
1035 @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD,
1036 name = "FLAG_DISMISS_KEYGUARD"),
1037 @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH,
1038 name = "FLAG_SPLIT_TOUCH"),
1039 @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED,
keunyoung30f420f2013-08-02 14:23:10 -07001040 name = "FLAG_HARDWARE_ACCELERATED"),
1041 @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE,
John Spurlockbd957402013-10-03 11:38:39 -04001042 name = "FLAG_LOCAL_FOCUS_MODE"),
1043 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS,
1044 name = "FLAG_TRANSLUCENT_STATUS"),
1045 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION,
Adrian Roos217ccd22014-05-09 14:29:04 +02001046 name = "FLAG_TRANSLUCENT_NAVIGATION"),
1047 @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
1048 name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS")
Jon Miranda4597e982014-07-29 07:25:49 -07001049 }, formatToHexString = true)
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001050 public int flags;
1051
1052 /**
John Reck61375a82014-09-18 19:27:48 +00001053 * If the window has requested hardware acceleration, but this is not
1054 * allowed in the process it is in, then still render it as if it is
1055 * hardware accelerated. This is used for the starting preview windows
1056 * in the system process, which don't need to have the overhead of
1057 * hardware acceleration (they are just a static rendering), but should
1058 * be rendered as such to match the actual window of the app even if it
1059 * is hardware accelerated.
1060 * Even if the window isn't hardware accelerated, still do its rendering
1061 * as if it was.
1062 * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
1063 * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001064 * is generally disabled. This flag must be specified in addition to
John Reck61375a82014-09-18 19:27:48 +00001065 * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
1066 * windows.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001067 *
John Reck61375a82014-09-18 19:27:48 +00001068 * @hide
1069 */
1070 public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
1071
1072 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001073 * In the system process, we globally do not use hardware acceleration
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001074 * because there are many threads doing UI there and they conflict.
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001075 * If certain parts of the UI that really do want to use hardware
1076 * acceleration, this flag can be set to force it. This is basically
1077 * for the lock screen. Anyone else using it, you are probably wrong.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001078 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001079 * @hide
1080 */
1081 public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
1082
1083 /**
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001084 * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001085 * may elect to skip these notifications if they are not doing anything productive with
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001086 * them (they do not affect the wallpaper scrolling operation) by calling
1087 * {@link
1088 * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}.
1089 *
1090 * @hide
1091 */
1092 public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
1093
Craig Mautner88400d32012-09-30 12:35:45 -07001094 /** In a multiuser system if this flag is set and the owner is a system process then this
1095 * window will appear on all user screens. This overrides the default behavior of window
1096 * types that normally only appear on the owning user's screen. Refer to each window type
1097 * to determine its default behavior.
1098 *
1099 * {@hide} */
1100 public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
1101
Dianne Hackborn73ab6a42011-12-13 11:16:23 -08001102 /**
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001103 * Never animate position changes of the window.
1104 *
1105 * {@hide} */
1106 public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040;
1107
Adam Lesinski6a591f52013-10-01 18:11:17 -07001108 /** Window flag: special flag to limit the size of the window to be
1109 * original size ([320x480] x density). Used to create window for applications
1110 * running under compatibility mode.
1111 *
1112 * {@hide} */
1113 public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080;
1114
1115 /** Window flag: a special option intended for system dialogs. When
1116 * this flag is set, the window will demand focus unconditionally when
1117 * it is created.
1118 * {@hide} */
1119 public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;
1120
John Spurlock3f7cd512013-10-07 12:25:09 -04001121 /** Window flag: maintain the previous translucent decor state when this window
John Spurlockbd957402013-10-03 11:38:39 -04001122 * becomes top-most.
1123 * {@hide} */
1124 public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200;
1125
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001126 /**
Jorim Jaggi380ecb82014-03-14 17:25:20 +01001127 * Flag whether the current window is a keyguard window, meaning that it will hide all other
1128 * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set.
1129 * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1130 * {@hide}
1131 */
1132 public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400;
1133
1134 /**
Filip Gruszczynskib8c06942014-12-04 15:02:18 -08001135 * Flag that prevents the wallpaper behind the current window from receiving touch events.
1136 *
1137 * {@hide}
1138 */
1139 public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800;
1140
1141 /**
Selim Cinek4a4a2bddc2015-05-07 12:50:19 -07001142 * Flag to force the status bar window to be visible all the time. If the bar is hidden when
1143 * this flag is set it will be shown again and the bar will have a transparent background.
1144 * This can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1145 *
1146 * {@hide}
1147 */
1148 public static final int PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT = 0x00001000;
1149
1150 /**
Robert Carr64aadd02015-11-06 13:54:20 -08001151 * Flag indicating that the x, y, width, and height members should be
1152 * ignored (and thus their previous value preserved). For example
1153 * because they are being managed externally through repositionChild.
1154 *
1155 * {@hide}
1156 */
1157 public static final int PRIVATE_FLAG_PRESERVE_GEOMETRY = 0x00002000;
1158
1159
1160 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001161 * Control flags that are private to the platform.
1162 * @hide
1163 */
1164 public int privateFlags;
1165
1166 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001167 * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it
1168 * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu
1169 * key. For this case, we should look at windows behind it to determine the appropriate
1170 * value.
1171 *
1172 * @hide
1173 */
1174 public static final int NEEDS_MENU_UNSET = 0;
1175
1176 /**
1177 * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a
1178 * menu key.
1179 *
1180 * @hide
1181 */
1182 public static final int NEEDS_MENU_SET_TRUE = 1;
1183
1184 /**
1185 * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't
1186 * needs a menu key.
1187 *
1188 * @hide
1189 */
1190 public static final int NEEDS_MENU_SET_FALSE = 2;
1191
1192 /**
1193 * State variable for a window belonging to an activity that responds to
1194 * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a
1195 * physical button this variable is ignored, but on devices where the Menu key is drawn in
1196 * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}.
1197 *
1198 * (Note that Action Bars, when available, are the preferred way to offer additional
1199 * functions otherwise accessed via an options menu.)
1200 *
1201 * {@hide}
1202 */
1203 public int needsMenuKey = NEEDS_MENU_UNSET;
1204
1205 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001206 * Given a particular set of window manager flags, determine whether
1207 * such a window may be a target for an input method when it has
1208 * focus. In particular, this checks the
1209 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
1210 * flags and returns true if the combination of the two corresponds
1211 * to a window that needs to be behind the input method so that the
1212 * user can type into it.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001213 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001214 * @param flags The current window manager flags.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001215 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001216 * @return Returns true if such a window should be behind/interact
1217 * with an input method, false if not.
1218 */
1219 public static boolean mayUseInputMethod(int flags) {
1220 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
1221 case 0:
1222 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
1223 return true;
1224 }
1225 return false;
1226 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001227
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001228 /**
1229 * Mask for {@link #softInputMode} of the bits that determine the
1230 * desired visibility state of the soft input area for this window.
1231 */
1232 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001233
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001234 /**
1235 * Visibility state for {@link #softInputMode}: no state has been specified.
1236 */
1237 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001238
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001239 /**
1240 * Visibility state for {@link #softInputMode}: please don't change the state of
1241 * the soft input area.
1242 */
1243 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245 /**
1246 * Visibility state for {@link #softInputMode}: please hide any soft input
1247 * area when normally appropriate (when the user is navigating
1248 * forward to your window).
1249 */
1250 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001251
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001252 /**
1253 * Visibility state for {@link #softInputMode}: please always hide any
1254 * soft input area when this window receives focus.
1255 */
1256 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001257
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001258 /**
1259 * Visibility state for {@link #softInputMode}: please show the soft
1260 * input area when normally appropriate (when the user is navigating
1261 * forward to your window).
1262 */
1263 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001265 /**
1266 * Visibility state for {@link #softInputMode}: please always make the
1267 * soft input area visible when this window receives input focus.
1268 */
1269 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001270
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001271 /**
1272 * Mask for {@link #softInputMode} of the bits that determine the
1273 * way that the window should be adjusted to accommodate the soft
1274 * input window.
1275 */
1276 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001277
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 /** Adjustment option for {@link #softInputMode}: nothing specified.
1279 * The system will try to pick one or
1280 * the other depending on the contents of the window.
1281 */
1282 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001283
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001284 /** Adjustment option for {@link #softInputMode}: set to allow the
1285 * window to be resized when an input
1286 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001287 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001288 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1289 * neither of these are set, then the system will try to pick one or
Chet Haase45c89c22013-04-29 16:04:40 -07001290 * the other depending on the contents of the window. If the window's
1291 * layout parameter flags include {@link #FLAG_FULLSCREEN}, this
1292 * value for {@link #softInputMode} will be ignored; the window will
1293 * not resize, but will stay fullscreen.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001294 */
1295 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001296
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001297 /** Adjustment option for {@link #softInputMode}: set to have a window
1298 * pan when an input method is
1299 * shown, so it doesn't need to deal with resizing but just panned
1300 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001301 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001302 * neither of these are set, then the system will try to pick one or
1303 * the other depending on the contents of the window.
1304 */
1305 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001306
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001307 /** Adjustment option for {@link #softInputMode}: set to have a window
1308 * not adjust for a shown input method. The window will not be resized,
1309 * and it will not be panned to make its focus visible.
1310 */
1311 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1312
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001313 /**
1314 * Bit for {@link #softInputMode}: set when the user has navigated
1315 * forward to the window. This is normally set automatically for
1316 * you by the system, though you may want to set it in certain cases
1317 * when you are displaying a window yourself. This flag will always
1318 * be cleared automatically after the window is displayed.
1319 */
1320 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001321
1322 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001323 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001324 * of:
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001325 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001326 * <ul>
1327 * <li> One of the visibility states
1328 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1329 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1330 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1331 * <li> One of the adjustment options
1332 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1333 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1334 * {@link #SOFT_INPUT_ADJUST_PAN}.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -08001335 * </ul>
1336 *
1337 *
1338 * <p>This flag can be controlled in your theme through the
1339 * {@link android.R.attr#windowSoftInputMode} attribute.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001340 */
1341 public int softInputMode;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001342
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001343 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001344 * Placement of window within the screen as per {@link Gravity}. Both
1345 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1346 * android.graphics.Rect) Gravity.apply} and
1347 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1348 * Gravity.applyDisplay} are used during window layout, with this value
1349 * given as the desired gravity. For example you can specify
1350 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1351 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1352 * to control the behavior of
1353 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1354 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001355 *
1356 * @see Gravity
1357 */
1358 public int gravity;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 /**
1361 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001362 * between the container and the widget. See
1363 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1364 * android.graphics.Rect) Gravity.apply} for how this is used. This
1365 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001366 */
1367 public float horizontalMargin;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001368
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001369 /**
1370 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001371 * between the container and the widget. See
1372 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1373 * android.graphics.Rect) Gravity.apply} for how this is used. This
1374 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001375 */
1376 public float verticalMargin;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001377
1378 /**
1379 * Positive insets between the drawing surface and window content.
1380 *
1381 * @hide
1382 */
Alan Viverette3aa1ffb2014-10-30 12:22:08 -07001383 public final Rect surfaceInsets = new Rect();
Alan Viverette5435a302015-01-29 10:25:34 -08001384
1385 /**
1386 * Whether the surface insets have been manually set. When set to
1387 * {@code false}, the view root will automatically determine the
1388 * appropriate surface insets.
1389 *
1390 * @see #surfaceInsets
1391 * @hide
1392 */
1393 public boolean hasManualSurfaceInsets;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001394
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001395 /**
1396 * The desired bitmap format. May be one of the constants in
1397 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1398 */
1399 public int format;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001400
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001401 /**
1402 * A style resource defining the animations to use for this window.
1403 * This must be a system resource; it can not be an application resource
1404 * because the window manager does not have access to applications.
1405 */
1406 public int windowAnimations;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001407
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001408 /**
1409 * An alpha value to apply to this entire window.
1410 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1411 */
1412 public float alpha = 1.0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001413
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001414 /**
1415 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1416 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1417 * dim.
1418 */
1419 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001420
1421 /**
1422 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1423 * indicating that the brightness value is not overridden for this window
1424 * and normal brightness policy should be used.
1425 */
1426 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1427
1428 /**
1429 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1430 * indicating that the screen or button backlight brightness should be set
1431 * to the lowest value when this window is in front.
1432 */
1433 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1434
1435 /**
1436 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1437 * indicating that the screen or button backlight brightness should be set
1438 * to the hightest value when this window is in front.
1439 */
1440 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001441
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001442 /**
1443 * This can be used to override the user's preferred brightness of
1444 * the screen. A value of less than 0, the default, means to use the
1445 * preferred screen brightness. 0 to 1 adjusts the brightness from
1446 * dark to full bright.
1447 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001448 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001449
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001450 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001451 * This can be used to override the standard behavior of the button and
1452 * keyboard backlights. A value of less than 0, the default, means to
1453 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1454 * from dark to full bright.
1455 */
1456 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1457
1458 /**
Craig Mautner3c174372013-02-21 17:54:37 -08001459 * Value for {@link #rotationAnimation} to define the animation used to
1460 * specify that this window will rotate in or out following a rotation.
1461 */
1462 public static final int ROTATION_ANIMATION_ROTATE = 0;
1463
1464 /**
1465 * Value for {@link #rotationAnimation} to define the animation used to
1466 * specify that this window will fade in or out following a rotation.
1467 */
1468 public static final int ROTATION_ANIMATION_CROSSFADE = 1;
1469
1470 /**
1471 * Value for {@link #rotationAnimation} to define the animation used to
1472 * specify that this window will immediately disappear or appear following
1473 * a rotation.
1474 */
1475 public static final int ROTATION_ANIMATION_JUMPCUT = 2;
1476
1477 /**
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001478 * Define the exit and entry animations used on this window when the device is rotated.
1479 * This only has an affect if the incoming and outgoing topmost
Craig Mautner3c174372013-02-21 17:54:37 -08001480 * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001481 * by other windows. All other situations default to the
1482 * {@link #ROTATION_ANIMATION_ROTATE} behavior.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001483 *
Craig Mautner3c174372013-02-21 17:54:37 -08001484 * @see #ROTATION_ANIMATION_ROTATE
1485 * @see #ROTATION_ANIMATION_CROSSFADE
1486 * @see #ROTATION_ANIMATION_JUMPCUT
1487 */
1488 public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
1489
1490 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001491 * Identifier for this window. This will usually be filled in for
1492 * you.
1493 */
1494 public IBinder token = null;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001495
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001496 /**
1497 * Name of the package owning this window.
1498 */
1499 public String packageName = null;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001500
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001501 /**
1502 * Specific orientation value for a window.
1503 * May be any of the same values allowed
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001504 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1505 * If not set, a default value of
1506 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001507 * will be used.
1508 */
1509 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001510
1511 /**
Michael Wright3f145a22014-07-22 19:46:03 -07001512 * The preferred refresh rate for the window.
1513 *
1514 * This must be one of the supported refresh rates obtained for the display(s) the window
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001515 * is on. The selected refresh rate will be applied to the display's default mode.
1516 *
1517 * This value is ignored if {@link #preferredDisplayModeId} is set.
Michael Wright3f145a22014-07-22 19:46:03 -07001518 *
1519 * @see Display#getSupportedRefreshRates()
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001520 * @deprecated use {@link #preferredDisplayModeId} instead
Michael Wright3f145a22014-07-22 19:46:03 -07001521 */
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001522 @Deprecated
Michael Wright3f145a22014-07-22 19:46:03 -07001523 public float preferredRefreshRate;
1524
1525 /**
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001526 * Id of the preferred display mode for the window.
1527 * <p>
1528 * This must be one of the supported modes obtained for the display(s) the window is on.
1529 * A value of {@code 0} means no preference.
1530 *
1531 * @see Display#getSupportedModes()
1532 * @see Display.Mode#getModeId()
1533 */
1534 public int preferredDisplayModeId;
1535
1536 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001537 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001538 *
1539 * @see View#STATUS_BAR_VISIBLE
1540 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001541 */
1542 public int systemUiVisibility;
1543
1544 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001545 * @hide
1546 * The ui visibility as requested by the views in this hierarchy.
1547 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1548 */
1549 public int subtreeSystemUiVisibility;
1550
1551 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001552 * Get callbacks about the system ui visibility changing.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001553 *
Joe Onorato664644d2011-01-23 17:53:23 -08001554 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1555 *
1556 * @hide
1557 */
1558 public boolean hasSystemUiListeners;
1559
Jeff Brown474dcb52011-06-14 20:22:50 -07001560 /**
1561 * When this window has focus, disable touch pad pointer gesture processing.
1562 * The window will receive raw position updates from the touch pad instead
1563 * of pointer movements and synthetic touch events.
1564 *
1565 * @hide
1566 */
1567 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1568
1569 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001570 * Does not construct an input channel for this window. The channel will therefore
1571 * be incapable of receiving input.
1572 *
1573 * @hide
1574 */
1575 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1576
1577 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001578 * When this window has focus, does not call user activity for all input events so
1579 * the application will have to do it itself. Should only be used by
1580 * the keyguard and phone app.
1581 * <p>
1582 * Should only be used by the keyguard and phone app.
1583 * </p>
1584 *
1585 * @hide
1586 */
1587 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1588
1589 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001590 * Control special features of the input subsystem.
1591 *
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001592 * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001593 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001594 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001595 * @hide
1596 */
1597 public int inputFeatures;
1598
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001599 /**
1600 * Sets the number of milliseconds before the user activity timeout occurs
1601 * when this window has focus. A value of -1 uses the standard timeout.
1602 * A value of 0 uses the minimum support display timeout.
1603 * <p>
1604 * This property can only be used to reduce the user specified display timeout;
1605 * it can never make the timeout longer than it normally would be.
1606 * </p><p>
1607 * Should only be used by the keyguard and phone app.
1608 * </p>
1609 *
1610 * @hide
1611 */
1612 public long userActivityTimeout = -1;
1613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001614 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001615 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001616 type = TYPE_APPLICATION;
1617 format = PixelFormat.OPAQUE;
1618 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001620 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001621 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001622 type = _type;
1623 format = PixelFormat.OPAQUE;
1624 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001625
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001626 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001627 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001628 type = _type;
1629 flags = _flags;
1630 format = PixelFormat.OPAQUE;
1631 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001632
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001633 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001634 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001635 type = _type;
1636 flags = _flags;
1637 format = _format;
1638 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001639
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001640 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1641 super(w, h);
1642 type = _type;
1643 flags = _flags;
1644 format = _format;
1645 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001646
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001647 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1648 int _flags, int _format) {
1649 super(w, h);
1650 x = xpos;
1651 y = ypos;
1652 type = _type;
1653 flags = _flags;
1654 format = _format;
1655 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001656
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001657 public final void setTitle(CharSequence title) {
1658 if (null == title)
1659 title = "";
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001660
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001661 mTitle = TextUtils.stringOrSpannedString(title);
1662 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001663
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001664 public final CharSequence getTitle() {
1665 return mTitle;
1666 }
Bryce Lee53b9fbd2015-02-06 12:06:34 -08001667
1668 /** @hide */
1669 @SystemApi
1670 public final void setUserActivityTimeout(long timeout) {
1671 userActivityTimeout = timeout;
1672 }
1673
1674 /** @hide */
1675 @SystemApi
1676 public final long getUserActivityTimeout() {
1677 return userActivityTimeout;
1678 }
1679
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001680 public int describeContents() {
1681 return 0;
1682 }
1683
1684 public void writeToParcel(Parcel out, int parcelableFlags) {
1685 out.writeInt(width);
1686 out.writeInt(height);
1687 out.writeInt(x);
1688 out.writeInt(y);
1689 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001690 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001691 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001692 out.writeInt(softInputMode);
1693 out.writeInt(gravity);
1694 out.writeFloat(horizontalMargin);
1695 out.writeFloat(verticalMargin);
1696 out.writeInt(format);
1697 out.writeInt(windowAnimations);
1698 out.writeFloat(alpha);
1699 out.writeFloat(dimAmount);
1700 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001701 out.writeFloat(buttonBrightness);
Craig Mautner3c174372013-02-21 17:54:37 -08001702 out.writeInt(rotationAnimation);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001703 out.writeStrongBinder(token);
1704 out.writeString(packageName);
1705 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1706 out.writeInt(screenOrientation);
Michael Wright3f145a22014-07-22 19:46:03 -07001707 out.writeFloat(preferredRefreshRate);
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001708 out.writeInt(preferredDisplayModeId);
Joe Onorato664644d2011-01-23 17:53:23 -08001709 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001710 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001711 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001712 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001713 out.writeLong(userActivityTimeout);
Alan Viverette49a22e82014-07-12 20:01:27 -07001714 out.writeInt(surfaceInsets.left);
1715 out.writeInt(surfaceInsets.top);
1716 out.writeInt(surfaceInsets.right);
1717 out.writeInt(surfaceInsets.bottom);
Alan Viverette5435a302015-01-29 10:25:34 -08001718 out.writeInt(hasManualSurfaceInsets ? 1 : 0);
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001719 out.writeInt(needsMenuKey);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001720 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001721
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001722 public static final Parcelable.Creator<LayoutParams> CREATOR
1723 = new Parcelable.Creator<LayoutParams>() {
1724 public LayoutParams createFromParcel(Parcel in) {
1725 return new LayoutParams(in);
1726 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001727
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001728 public LayoutParams[] newArray(int size) {
1729 return new LayoutParams[size];
1730 }
1731 };
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001732
1733
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001734 public LayoutParams(Parcel in) {
1735 width = in.readInt();
1736 height = in.readInt();
1737 x = in.readInt();
1738 y = in.readInt();
1739 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001740 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001741 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001742 softInputMode = in.readInt();
1743 gravity = in.readInt();
1744 horizontalMargin = in.readFloat();
1745 verticalMargin = in.readFloat();
1746 format = in.readInt();
1747 windowAnimations = in.readInt();
1748 alpha = in.readFloat();
1749 dimAmount = in.readFloat();
1750 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001751 buttonBrightness = in.readFloat();
Craig Mautner3c174372013-02-21 17:54:37 -08001752 rotationAnimation = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001753 token = in.readStrongBinder();
1754 packageName = in.readString();
1755 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1756 screenOrientation = in.readInt();
Michael Wright3f145a22014-07-22 19:46:03 -07001757 preferredRefreshRate = in.readFloat();
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001758 preferredDisplayModeId = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001759 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001760 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001761 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001762 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001763 userActivityTimeout = in.readLong();
Alan Viverette49a22e82014-07-12 20:01:27 -07001764 surfaceInsets.left = in.readInt();
1765 surfaceInsets.top = in.readInt();
1766 surfaceInsets.right = in.readInt();
1767 surfaceInsets.bottom = in.readInt();
Alan Viverette5435a302015-01-29 10:25:34 -08001768 hasManualSurfaceInsets = in.readInt() != 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001769 needsMenuKey = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001770 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001771
Romain Guy72998072009-06-22 11:09:20 -07001772 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001773 public static final int LAYOUT_CHANGED = 1<<0;
1774 public static final int TYPE_CHANGED = 1<<1;
1775 public static final int FLAGS_CHANGED = 1<<2;
1776 public static final int FORMAT_CHANGED = 1<<3;
1777 public static final int ANIMATION_CHANGED = 1<<4;
1778 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1779 public static final int TITLE_CHANGED = 1<<6;
1780 public static final int ALPHA_CHANGED = 1<<7;
1781 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1782 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1783 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1784 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Craig Mautner3c174372013-02-21 17:54:37 -08001785 public static final int ROTATION_ANIMATION_CHANGED = 1<<12;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001786 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001787 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13;
Joe Onorato664644d2011-01-23 17:53:23 -08001788 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001789 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14;
Joe Onorato664644d2011-01-23 17:53:23 -08001790 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001791 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15;
Jeff Brown474dcb52011-06-14 20:22:50 -07001792 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001793 public static final int INPUT_FEATURES_CHANGED = 1<<16;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001794 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001795 public static final int PRIVATE_FLAGS_CHANGED = 1<<17;
Romain Guyf21c9b02011-09-06 16:56:54 -07001796 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001797 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18;
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001798 /** {@hide} */
John Spurlockbd957402013-10-03 11:38:39 -04001799 public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
1800 /** {@hide} */
Alan Viverette49a22e82014-07-12 20:01:27 -07001801 public static final int SURFACE_INSETS_CHANGED = 1<<20;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001802 /** {@hide} */
Michael Wright3f145a22014-07-22 19:46:03 -07001803 public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
1804 /** {@hide} */
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001805 public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22;
1806 /** {@hide} */
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001807 public static final int PREFERRED_DISPLAY_MODE_ID = 1 << 23;
1808 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001809 public static final int EVERYTHING_CHANGED = 0xffffffff;
1810
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001811 // internal buffer to backup/restore parameters under compatibility mode.
1812 private int[] mCompatibilityParamsBackup = null;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001813
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001814 public final int copyFrom(LayoutParams o) {
1815 int changes = 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001816
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001817 if (width != o.width) {
1818 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001819 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001820 }
1821 if (height != o.height) {
1822 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001823 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001824 }
1825 if (x != o.x) {
1826 x = o.x;
1827 changes |= LAYOUT_CHANGED;
1828 }
1829 if (y != o.y) {
1830 y = o.y;
1831 changes |= LAYOUT_CHANGED;
1832 }
1833 if (horizontalWeight != o.horizontalWeight) {
1834 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001835 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001836 }
1837 if (verticalWeight != o.verticalWeight) {
1838 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001839 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001840 }
1841 if (horizontalMargin != o.horizontalMargin) {
1842 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001843 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001844 }
1845 if (verticalMargin != o.verticalMargin) {
1846 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001847 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001848 }
1849 if (type != o.type) {
1850 type = o.type;
1851 changes |= TYPE_CHANGED;
1852 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001853 if (flags != o.flags) {
John Spurlockbd957402013-10-03 11:38:39 -04001854 final int diff = flags ^ o.flags;
1855 if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) {
1856 changes |= TRANSLUCENT_FLAGS_CHANGED;
1857 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001858 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001859 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001860 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001861 if (privateFlags != o.privateFlags) {
1862 privateFlags = o.privateFlags;
1863 changes |= PRIVATE_FLAGS_CHANGED;
1864 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001865 if (softInputMode != o.softInputMode) {
1866 softInputMode = o.softInputMode;
1867 changes |= SOFT_INPUT_MODE_CHANGED;
1868 }
1869 if (gravity != o.gravity) {
1870 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001871 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001872 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001873 if (format != o.format) {
1874 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001875 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001876 }
1877 if (windowAnimations != o.windowAnimations) {
1878 windowAnimations = o.windowAnimations;
1879 changes |= ANIMATION_CHANGED;
1880 }
1881 if (token == null) {
1882 // NOTE: token only copied if the recipient doesn't
1883 // already have one.
1884 token = o.token;
1885 }
1886 if (packageName == null) {
1887 // NOTE: packageName only copied if the recipient doesn't
1888 // already have one.
1889 packageName = o.packageName;
1890 }
1891 if (!mTitle.equals(o.mTitle)) {
1892 mTitle = o.mTitle;
1893 changes |= TITLE_CHANGED;
1894 }
1895 if (alpha != o.alpha) {
1896 alpha = o.alpha;
1897 changes |= ALPHA_CHANGED;
1898 }
1899 if (dimAmount != o.dimAmount) {
1900 dimAmount = o.dimAmount;
1901 changes |= DIM_AMOUNT_CHANGED;
1902 }
1903 if (screenBrightness != o.screenBrightness) {
1904 screenBrightness = o.screenBrightness;
1905 changes |= SCREEN_BRIGHTNESS_CHANGED;
1906 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001907 if (buttonBrightness != o.buttonBrightness) {
1908 buttonBrightness = o.buttonBrightness;
1909 changes |= BUTTON_BRIGHTNESS_CHANGED;
1910 }
Craig Mautner3c174372013-02-21 17:54:37 -08001911 if (rotationAnimation != o.rotationAnimation) {
1912 rotationAnimation = o.rotationAnimation;
1913 changes |= ROTATION_ANIMATION_CHANGED;
1914 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001915
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001916 if (screenOrientation != o.screenOrientation) {
1917 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07001918 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001919 }
Romain Guy529b60a2010-08-03 18:05:47 -07001920
Michael Wright3f145a22014-07-22 19:46:03 -07001921 if (preferredRefreshRate != o.preferredRefreshRate) {
1922 preferredRefreshRate = o.preferredRefreshRate;
1923 changes |= PREFERRED_REFRESH_RATE_CHANGED;
1924 }
1925
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001926 if (preferredDisplayModeId != o.preferredDisplayModeId) {
1927 preferredDisplayModeId = o.preferredDisplayModeId;
1928 changes |= PREFERRED_DISPLAY_MODE_ID;
1929 }
1930
Joe Onorato14782f72011-01-25 19:53:17 -08001931 if (systemUiVisibility != o.systemUiVisibility
1932 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08001933 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08001934 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08001935 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
1936 }
1937
1938 if (hasSystemUiListeners != o.hasSystemUiListeners) {
1939 hasSystemUiListeners = o.hasSystemUiListeners;
1940 changes |= SYSTEM_UI_LISTENER_CHANGED;
1941 }
1942
Jeff Brown474dcb52011-06-14 20:22:50 -07001943 if (inputFeatures != o.inputFeatures) {
1944 inputFeatures = o.inputFeatures;
1945 changes |= INPUT_FEATURES_CHANGED;
1946 }
1947
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001948 if (userActivityTimeout != o.userActivityTimeout) {
1949 userActivityTimeout = o.userActivityTimeout;
1950 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
1951 }
1952
Alan Viverette49a22e82014-07-12 20:01:27 -07001953 if (!surfaceInsets.equals(o.surfaceInsets)) {
1954 surfaceInsets.set(o.surfaceInsets);
1955 changes |= SURFACE_INSETS_CHANGED;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001956 }
1957
Alan Viverette5435a302015-01-29 10:25:34 -08001958 if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) {
1959 hasManualSurfaceInsets = o.hasManualSurfaceInsets;
1960 changes |= SURFACE_INSETS_CHANGED;
1961 }
1962
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001963 if (needsMenuKey != o.needsMenuKey) {
1964 needsMenuKey = o.needsMenuKey;
1965 changes |= NEEDS_MENU_KEY_CHANGED;
1966 }
1967
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001968 return changes;
1969 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001970
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001971 @Override
1972 public String debug(String output) {
1973 output += "Contents of " + this + ":";
1974 Log.d("Debug", output);
1975 output = super.debug("");
1976 Log.d("Debug", output);
1977 Log.d("Debug", "");
1978 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
1979 return "";
1980 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001981
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001982 @Override
1983 public String toString() {
1984 StringBuilder sb = new StringBuilder(256);
1985 sb.append("WM.LayoutParams{");
1986 sb.append("(");
1987 sb.append(x);
1988 sb.append(',');
1989 sb.append(y);
1990 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08001991 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001992 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08001993 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001994 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001995 if (horizontalMargin != 0) {
1996 sb.append(" hm=");
1997 sb.append(horizontalMargin);
1998 }
1999 if (verticalMargin != 0) {
2000 sb.append(" vm=");
2001 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002002 }
2003 if (gravity != 0) {
2004 sb.append(" gr=#");
2005 sb.append(Integer.toHexString(gravity));
2006 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07002007 if (softInputMode != 0) {
2008 sb.append(" sim=#");
2009 sb.append(Integer.toHexString(softInputMode));
2010 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002011 sb.append(" ty=");
2012 sb.append(type);
2013 sb.append(" fl=#");
2014 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07002015 if (privateFlags != 0) {
Adam Lesinski95c42972013-10-02 10:13:27 -07002016 if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
2017 sb.append(" compatible=true");
2018 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07002019 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
2020 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002021 if (format != PixelFormat.OPAQUE) {
2022 sb.append(" fmt=");
2023 sb.append(format);
2024 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002025 if (windowAnimations != 0) {
2026 sb.append(" wanim=0x");
2027 sb.append(Integer.toHexString(windowAnimations));
2028 }
2029 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
2030 sb.append(" or=");
2031 sb.append(screenOrientation);
2032 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07002033 if (alpha != 1.0f) {
2034 sb.append(" alpha=");
2035 sb.append(alpha);
2036 }
2037 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
2038 sb.append(" sbrt=");
2039 sb.append(screenBrightness);
2040 }
2041 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
2042 sb.append(" bbrt=");
2043 sb.append(buttonBrightness);
2044 }
Craig Mautner3c174372013-02-21 17:54:37 -08002045 if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
2046 sb.append(" rotAnim=");
2047 sb.append(rotationAnimation);
2048 }
Michael Wright3f145a22014-07-22 19:46:03 -07002049 if (preferredRefreshRate != 0) {
2050 sb.append(" preferredRefreshRate=");
2051 sb.append(preferredRefreshRate);
2052 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07002053 if (preferredDisplayModeId != 0) {
2054 sb.append(" preferredDisplayMode=");
2055 sb.append(preferredDisplayModeId);
2056 }
Joe Onorato664644d2011-01-23 17:53:23 -08002057 if (systemUiVisibility != 0) {
2058 sb.append(" sysui=0x");
2059 sb.append(Integer.toHexString(systemUiVisibility));
2060 }
Joe Onorato14782f72011-01-25 19:53:17 -08002061 if (subtreeSystemUiVisibility != 0) {
2062 sb.append(" vsysui=0x");
2063 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
2064 }
Joe Onorato664644d2011-01-23 17:53:23 -08002065 if (hasSystemUiListeners) {
2066 sb.append(" sysuil=");
2067 sb.append(hasSystemUiListeners);
2068 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002069 if (inputFeatures != 0) {
2070 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
2071 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07002072 if (userActivityTimeout >= 0) {
2073 sb.append(" userActivityTimeout=").append(userActivityTimeout);
2074 }
Andreas Gampe007cfa72015-03-15 14:19:43 -07002075 if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 ||
Andreas Gampe11090062015-03-16 09:45:34 -07002076 surfaceInsets.bottom != 0 || hasManualSurfaceInsets) {
Alan Viverette49a22e82014-07-12 20:01:27 -07002077 sb.append(" surfaceInsets=").append(surfaceInsets);
Alan Viverette5435a302015-01-29 10:25:34 -08002078 if (hasManualSurfaceInsets) {
2079 sb.append(" (manual)");
2080 }
Alan Viveretteccb11e12014-07-08 16:04:02 -07002081 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002082 if (needsMenuKey != NEEDS_MENU_UNSET) {
2083 sb.append(" needsMenuKey=");
2084 sb.append(needsMenuKey);
2085 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002086 sb.append('}');
2087 return sb.toString();
2088 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002089
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002090 /**
2091 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002092 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002093 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002094 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002095 x = (int) (x * scale + 0.5f);
2096 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002097 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002098 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002099 }
2100 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002101 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002102 }
2103 }
2104
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002105 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002106 * Backup the layout parameters used in compatibility mode.
2107 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002108 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002109 void backup() {
2110 int[] backup = mCompatibilityParamsBackup;
2111 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002112 // we backup 4 elements, x, y, width, height
2113 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002114 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002115 backup[0] = x;
2116 backup[1] = y;
2117 backup[2] = width;
2118 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002119 }
2120
2121 /**
2122 * Restore the layout params' coordinates, size and gravity
2123 * @see LayoutParams#backup()
2124 */
2125 void restore() {
2126 int[] backup = mCompatibilityParamsBackup;
2127 if (backup != null) {
2128 x = backup[0];
2129 y = backup[1];
2130 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002131 height = backup[3];
2132 }
2133 }
2134
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002135 private CharSequence mTitle = "";
Siva Velusamy0d857b92015-04-22 10:23:56 -07002136
2137 /** @hide */
2138 @Override
2139 protected void encodeProperties(@NonNull ViewHierarchyEncoder encoder) {
2140 super.encodeProperties(encoder);
2141
2142 encoder.addProperty("x", x);
2143 encoder.addProperty("y", y);
2144 encoder.addProperty("horizontalWeight", horizontalWeight);
2145 encoder.addProperty("verticalWeight", verticalWeight);
2146 encoder.addProperty("type", type);
2147 encoder.addProperty("flags", flags);
2148 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002149 }
2150}