blob: 2d0435f4c7e33ad9b34ef223b816f834a616acbb [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 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001151 * Control flags that are private to the platform.
1152 * @hide
1153 */
1154 public int privateFlags;
1155
1156 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001157 * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it
1158 * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu
1159 * key. For this case, we should look at windows behind it to determine the appropriate
1160 * value.
1161 *
1162 * @hide
1163 */
1164 public static final int NEEDS_MENU_UNSET = 0;
1165
1166 /**
1167 * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a
1168 * menu key.
1169 *
1170 * @hide
1171 */
1172 public static final int NEEDS_MENU_SET_TRUE = 1;
1173
1174 /**
1175 * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't
1176 * needs a menu key.
1177 *
1178 * @hide
1179 */
1180 public static final int NEEDS_MENU_SET_FALSE = 2;
1181
1182 /**
1183 * State variable for a window belonging to an activity that responds to
1184 * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a
1185 * physical button this variable is ignored, but on devices where the Menu key is drawn in
1186 * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}.
1187 *
1188 * (Note that Action Bars, when available, are the preferred way to offer additional
1189 * functions otherwise accessed via an options menu.)
1190 *
1191 * {@hide}
1192 */
1193 public int needsMenuKey = NEEDS_MENU_UNSET;
1194
1195 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001196 * Given a particular set of window manager flags, determine whether
1197 * such a window may be a target for an input method when it has
1198 * focus. In particular, this checks the
1199 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
1200 * flags and returns true if the combination of the two corresponds
1201 * to a window that needs to be behind the input method so that the
1202 * user can type into it.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001203 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204 * @param flags The current window manager flags.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001205 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001206 * @return Returns true if such a window should be behind/interact
1207 * with an input method, false if not.
1208 */
1209 public static boolean mayUseInputMethod(int flags) {
1210 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
1211 case 0:
1212 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
1213 return true;
1214 }
1215 return false;
1216 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001217
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001218 /**
1219 * Mask for {@link #softInputMode} of the bits that determine the
1220 * desired visibility state of the soft input area for this window.
1221 */
1222 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001223
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001224 /**
1225 * Visibility state for {@link #softInputMode}: no state has been specified.
1226 */
1227 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001228
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001229 /**
1230 * Visibility state for {@link #softInputMode}: please don't change the state of
1231 * the soft input area.
1232 */
1233 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001234
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001235 /**
1236 * Visibility state for {@link #softInputMode}: please hide any soft input
1237 * area when normally appropriate (when the user is navigating
1238 * forward to your window).
1239 */
1240 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001241
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001242 /**
1243 * Visibility state for {@link #softInputMode}: please always hide any
1244 * soft input area when this window receives focus.
1245 */
1246 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001247
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001248 /**
1249 * Visibility state for {@link #softInputMode}: please show the soft
1250 * input area when normally appropriate (when the user is navigating
1251 * forward to your window).
1252 */
1253 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001254
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001255 /**
1256 * Visibility state for {@link #softInputMode}: please always make the
1257 * soft input area visible when this window receives input focus.
1258 */
1259 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001260
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001261 /**
1262 * Mask for {@link #softInputMode} of the bits that determine the
1263 * way that the window should be adjusted to accommodate the soft
1264 * input window.
1265 */
1266 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001267
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001268 /** Adjustment option for {@link #softInputMode}: nothing specified.
1269 * The system will try to pick one or
1270 * the other depending on the contents of the window.
1271 */
1272 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001273
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001274 /** Adjustment option for {@link #softInputMode}: set to allow the
1275 * window to be resized when an input
1276 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001277 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1279 * neither of these are set, then the system will try to pick one or
Chet Haase45c89c22013-04-29 16:04:40 -07001280 * the other depending on the contents of the window. If the window's
1281 * layout parameter flags include {@link #FLAG_FULLSCREEN}, this
1282 * value for {@link #softInputMode} will be ignored; the window will
1283 * not resize, but will stay fullscreen.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001284 */
1285 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001286
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001287 /** Adjustment option for {@link #softInputMode}: set to have a window
1288 * pan when an input method is
1289 * shown, so it doesn't need to deal with resizing but just panned
1290 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001291 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001292 * neither of these are set, then the system will try to pick one or
1293 * the other depending on the contents of the window.
1294 */
1295 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001296
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001297 /** Adjustment option for {@link #softInputMode}: set to have a window
1298 * not adjust for a shown input method. The window will not be resized,
1299 * and it will not be panned to make its focus visible.
1300 */
1301 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1302
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001303 /**
1304 * Bit for {@link #softInputMode}: set when the user has navigated
1305 * forward to the window. This is normally set automatically for
1306 * you by the system, though you may want to set it in certain cases
1307 * when you are displaying a window yourself. This flag will always
1308 * be cleared automatically after the window is displayed.
1309 */
1310 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001311
1312 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001313 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001314 * of:
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001315 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001316 * <ul>
1317 * <li> One of the visibility states
1318 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1319 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1320 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1321 * <li> One of the adjustment options
1322 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1323 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1324 * {@link #SOFT_INPUT_ADJUST_PAN}.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -08001325 * </ul>
1326 *
1327 *
1328 * <p>This flag can be controlled in your theme through the
1329 * {@link android.R.attr#windowSoftInputMode} attribute.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001330 */
1331 public int softInputMode;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001332
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001333 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001334 * Placement of window within the screen as per {@link Gravity}. Both
1335 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1336 * android.graphics.Rect) Gravity.apply} and
1337 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1338 * Gravity.applyDisplay} are used during window layout, with this value
1339 * given as the desired gravity. For example you can specify
1340 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1341 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1342 * to control the behavior of
1343 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1344 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001345 *
1346 * @see Gravity
1347 */
1348 public int gravity;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001349
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001350 /**
1351 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001352 * between the container and the widget. See
1353 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1354 * android.graphics.Rect) Gravity.apply} for how this is used. This
1355 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001356 */
1357 public float horizontalMargin;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001358
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001359 /**
1360 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001361 * between the container and the widget. See
1362 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1363 * android.graphics.Rect) Gravity.apply} for how this is used. This
1364 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001365 */
1366 public float verticalMargin;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001367
1368 /**
1369 * Positive insets between the drawing surface and window content.
1370 *
1371 * @hide
1372 */
Alan Viverette3aa1ffb2014-10-30 12:22:08 -07001373 public final Rect surfaceInsets = new Rect();
Alan Viverette5435a302015-01-29 10:25:34 -08001374
1375 /**
1376 * Whether the surface insets have been manually set. When set to
1377 * {@code false}, the view root will automatically determine the
1378 * appropriate surface insets.
1379 *
1380 * @see #surfaceInsets
1381 * @hide
1382 */
1383 public boolean hasManualSurfaceInsets;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001384
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001385 /**
1386 * The desired bitmap format. May be one of the constants in
1387 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1388 */
1389 public int format;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001390
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001391 /**
1392 * A style resource defining the animations to use for this window.
1393 * This must be a system resource; it can not be an application resource
1394 * because the window manager does not have access to applications.
1395 */
1396 public int windowAnimations;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001397
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001398 /**
1399 * An alpha value to apply to this entire window.
1400 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1401 */
1402 public float alpha = 1.0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001403
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001404 /**
1405 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1406 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1407 * dim.
1408 */
1409 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001410
1411 /**
1412 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1413 * indicating that the brightness value is not overridden for this window
1414 * and normal brightness policy should be used.
1415 */
1416 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1417
1418 /**
1419 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1420 * indicating that the screen or button backlight brightness should be set
1421 * to the lowest value when this window is in front.
1422 */
1423 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1424
1425 /**
1426 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1427 * indicating that the screen or button backlight brightness should be set
1428 * to the hightest value when this window is in front.
1429 */
1430 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001431
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001432 /**
1433 * This can be used to override the user's preferred brightness of
1434 * the screen. A value of less than 0, the default, means to use the
1435 * preferred screen brightness. 0 to 1 adjusts the brightness from
1436 * dark to full bright.
1437 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001438 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001439
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001440 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001441 * This can be used to override the standard behavior of the button and
1442 * keyboard backlights. A value of less than 0, the default, means to
1443 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1444 * from dark to full bright.
1445 */
1446 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1447
1448 /**
Craig Mautner3c174372013-02-21 17:54:37 -08001449 * Value for {@link #rotationAnimation} to define the animation used to
1450 * specify that this window will rotate in or out following a rotation.
1451 */
1452 public static final int ROTATION_ANIMATION_ROTATE = 0;
1453
1454 /**
1455 * Value for {@link #rotationAnimation} to define the animation used to
1456 * specify that this window will fade in or out following a rotation.
1457 */
1458 public static final int ROTATION_ANIMATION_CROSSFADE = 1;
1459
1460 /**
1461 * Value for {@link #rotationAnimation} to define the animation used to
1462 * specify that this window will immediately disappear or appear following
1463 * a rotation.
1464 */
1465 public static final int ROTATION_ANIMATION_JUMPCUT = 2;
1466
1467 /**
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001468 * Define the exit and entry animations used on this window when the device is rotated.
1469 * This only has an affect if the incoming and outgoing topmost
Craig Mautner3c174372013-02-21 17:54:37 -08001470 * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001471 * by other windows. All other situations default to the
1472 * {@link #ROTATION_ANIMATION_ROTATE} behavior.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001473 *
Craig Mautner3c174372013-02-21 17:54:37 -08001474 * @see #ROTATION_ANIMATION_ROTATE
1475 * @see #ROTATION_ANIMATION_CROSSFADE
1476 * @see #ROTATION_ANIMATION_JUMPCUT
1477 */
1478 public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
1479
1480 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001481 * Identifier for this window. This will usually be filled in for
1482 * you.
1483 */
1484 public IBinder token = null;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001485
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001486 /**
1487 * Name of the package owning this window.
1488 */
1489 public String packageName = null;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001490
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001491 /**
1492 * Specific orientation value for a window.
1493 * May be any of the same values allowed
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001494 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1495 * If not set, a default value of
1496 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001497 * will be used.
1498 */
1499 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001500
1501 /**
Michael Wright3f145a22014-07-22 19:46:03 -07001502 * The preferred refresh rate for the window.
1503 *
1504 * This must be one of the supported refresh rates obtained for the display(s) the window
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001505 * is on. The selected refresh rate will be applied to the display's default mode.
1506 *
1507 * This value is ignored if {@link #preferredDisplayModeId} is set.
Michael Wright3f145a22014-07-22 19:46:03 -07001508 *
1509 * @see Display#getSupportedRefreshRates()
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001510 * @deprecated use {@link #preferredDisplayModeId} instead
Michael Wright3f145a22014-07-22 19:46:03 -07001511 */
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001512 @Deprecated
Michael Wright3f145a22014-07-22 19:46:03 -07001513 public float preferredRefreshRate;
1514
1515 /**
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001516 * Id of the preferred display mode for the window.
1517 * <p>
1518 * This must be one of the supported modes obtained for the display(s) the window is on.
1519 * A value of {@code 0} means no preference.
1520 *
1521 * @see Display#getSupportedModes()
1522 * @see Display.Mode#getModeId()
1523 */
1524 public int preferredDisplayModeId;
1525
1526 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001527 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001528 *
1529 * @see View#STATUS_BAR_VISIBLE
1530 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001531 */
1532 public int systemUiVisibility;
1533
1534 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001535 * @hide
1536 * The ui visibility as requested by the views in this hierarchy.
1537 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1538 */
1539 public int subtreeSystemUiVisibility;
1540
1541 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001542 * Get callbacks about the system ui visibility changing.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001543 *
Joe Onorato664644d2011-01-23 17:53:23 -08001544 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1545 *
1546 * @hide
1547 */
1548 public boolean hasSystemUiListeners;
1549
Jeff Brown474dcb52011-06-14 20:22:50 -07001550 /**
1551 * When this window has focus, disable touch pad pointer gesture processing.
1552 * The window will receive raw position updates from the touch pad instead
1553 * of pointer movements and synthetic touch events.
1554 *
1555 * @hide
1556 */
1557 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1558
1559 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001560 * Does not construct an input channel for this window. The channel will therefore
1561 * be incapable of receiving input.
1562 *
1563 * @hide
1564 */
1565 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1566
1567 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001568 * When this window has focus, does not call user activity for all input events so
1569 * the application will have to do it itself. Should only be used by
1570 * the keyguard and phone app.
1571 * <p>
1572 * Should only be used by the keyguard and phone app.
1573 * </p>
1574 *
1575 * @hide
1576 */
1577 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1578
1579 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001580 * Control special features of the input subsystem.
1581 *
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001582 * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001583 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001584 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001585 * @hide
1586 */
1587 public int inputFeatures;
1588
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001589 /**
1590 * Sets the number of milliseconds before the user activity timeout occurs
1591 * when this window has focus. A value of -1 uses the standard timeout.
1592 * A value of 0 uses the minimum support display timeout.
1593 * <p>
1594 * This property can only be used to reduce the user specified display timeout;
1595 * it can never make the timeout longer than it normally would be.
1596 * </p><p>
1597 * Should only be used by the keyguard and phone app.
1598 * </p>
1599 *
1600 * @hide
1601 */
1602 public long userActivityTimeout = -1;
1603
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001604 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001605 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001606 type = TYPE_APPLICATION;
1607 format = PixelFormat.OPAQUE;
1608 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001609
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001610 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001611 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001612 type = _type;
1613 format = PixelFormat.OPAQUE;
1614 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001615
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001616 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001617 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001618 type = _type;
1619 flags = _flags;
1620 format = PixelFormat.OPAQUE;
1621 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001622
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001623 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001624 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001625 type = _type;
1626 flags = _flags;
1627 format = _format;
1628 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001629
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001630 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1631 super(w, h);
1632 type = _type;
1633 flags = _flags;
1634 format = _format;
1635 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001636
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001637 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1638 int _flags, int _format) {
1639 super(w, h);
1640 x = xpos;
1641 y = ypos;
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 final void setTitle(CharSequence title) {
1648 if (null == title)
1649 title = "";
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001650
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001651 mTitle = TextUtils.stringOrSpannedString(title);
1652 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001653
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001654 public final CharSequence getTitle() {
1655 return mTitle;
1656 }
Bryce Lee53b9fbd2015-02-06 12:06:34 -08001657
1658 /** @hide */
1659 @SystemApi
1660 public final void setUserActivityTimeout(long timeout) {
1661 userActivityTimeout = timeout;
1662 }
1663
1664 /** @hide */
1665 @SystemApi
1666 public final long getUserActivityTimeout() {
1667 return userActivityTimeout;
1668 }
1669
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001670 public int describeContents() {
1671 return 0;
1672 }
1673
1674 public void writeToParcel(Parcel out, int parcelableFlags) {
1675 out.writeInt(width);
1676 out.writeInt(height);
1677 out.writeInt(x);
1678 out.writeInt(y);
1679 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001680 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001681 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001682 out.writeInt(softInputMode);
1683 out.writeInt(gravity);
1684 out.writeFloat(horizontalMargin);
1685 out.writeFloat(verticalMargin);
1686 out.writeInt(format);
1687 out.writeInt(windowAnimations);
1688 out.writeFloat(alpha);
1689 out.writeFloat(dimAmount);
1690 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001691 out.writeFloat(buttonBrightness);
Craig Mautner3c174372013-02-21 17:54:37 -08001692 out.writeInt(rotationAnimation);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001693 out.writeStrongBinder(token);
1694 out.writeString(packageName);
1695 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1696 out.writeInt(screenOrientation);
Michael Wright3f145a22014-07-22 19:46:03 -07001697 out.writeFloat(preferredRefreshRate);
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001698 out.writeInt(preferredDisplayModeId);
Joe Onorato664644d2011-01-23 17:53:23 -08001699 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001700 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001701 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001702 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001703 out.writeLong(userActivityTimeout);
Alan Viverette49a22e82014-07-12 20:01:27 -07001704 out.writeInt(surfaceInsets.left);
1705 out.writeInt(surfaceInsets.top);
1706 out.writeInt(surfaceInsets.right);
1707 out.writeInt(surfaceInsets.bottom);
Alan Viverette5435a302015-01-29 10:25:34 -08001708 out.writeInt(hasManualSurfaceInsets ? 1 : 0);
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001709 out.writeInt(needsMenuKey);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001710 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001711
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001712 public static final Parcelable.Creator<LayoutParams> CREATOR
1713 = new Parcelable.Creator<LayoutParams>() {
1714 public LayoutParams createFromParcel(Parcel in) {
1715 return new LayoutParams(in);
1716 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001717
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001718 public LayoutParams[] newArray(int size) {
1719 return new LayoutParams[size];
1720 }
1721 };
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001722
1723
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001724 public LayoutParams(Parcel in) {
1725 width = in.readInt();
1726 height = in.readInt();
1727 x = in.readInt();
1728 y = in.readInt();
1729 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001730 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001731 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001732 softInputMode = in.readInt();
1733 gravity = in.readInt();
1734 horizontalMargin = in.readFloat();
1735 verticalMargin = in.readFloat();
1736 format = in.readInt();
1737 windowAnimations = in.readInt();
1738 alpha = in.readFloat();
1739 dimAmount = in.readFloat();
1740 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001741 buttonBrightness = in.readFloat();
Craig Mautner3c174372013-02-21 17:54:37 -08001742 rotationAnimation = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001743 token = in.readStrongBinder();
1744 packageName = in.readString();
1745 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1746 screenOrientation = in.readInt();
Michael Wright3f145a22014-07-22 19:46:03 -07001747 preferredRefreshRate = in.readFloat();
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001748 preferredDisplayModeId = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001749 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001750 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001751 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001752 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001753 userActivityTimeout = in.readLong();
Alan Viverette49a22e82014-07-12 20:01:27 -07001754 surfaceInsets.left = in.readInt();
1755 surfaceInsets.top = in.readInt();
1756 surfaceInsets.right = in.readInt();
1757 surfaceInsets.bottom = in.readInt();
Alan Viverette5435a302015-01-29 10:25:34 -08001758 hasManualSurfaceInsets = in.readInt() != 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001759 needsMenuKey = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001760 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001761
Romain Guy72998072009-06-22 11:09:20 -07001762 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001763 public static final int LAYOUT_CHANGED = 1<<0;
1764 public static final int TYPE_CHANGED = 1<<1;
1765 public static final int FLAGS_CHANGED = 1<<2;
1766 public static final int FORMAT_CHANGED = 1<<3;
1767 public static final int ANIMATION_CHANGED = 1<<4;
1768 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1769 public static final int TITLE_CHANGED = 1<<6;
1770 public static final int ALPHA_CHANGED = 1<<7;
1771 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1772 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1773 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1774 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Craig Mautner3c174372013-02-21 17:54:37 -08001775 public static final int ROTATION_ANIMATION_CHANGED = 1<<12;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001776 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001777 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13;
Joe Onorato664644d2011-01-23 17:53:23 -08001778 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001779 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14;
Joe Onorato664644d2011-01-23 17:53:23 -08001780 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001781 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15;
Jeff Brown474dcb52011-06-14 20:22:50 -07001782 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001783 public static final int INPUT_FEATURES_CHANGED = 1<<16;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001784 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001785 public static final int PRIVATE_FLAGS_CHANGED = 1<<17;
Romain Guyf21c9b02011-09-06 16:56:54 -07001786 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001787 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18;
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001788 /** {@hide} */
John Spurlockbd957402013-10-03 11:38:39 -04001789 public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
1790 /** {@hide} */
Alan Viverette49a22e82014-07-12 20:01:27 -07001791 public static final int SURFACE_INSETS_CHANGED = 1<<20;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001792 /** {@hide} */
Michael Wright3f145a22014-07-22 19:46:03 -07001793 public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
1794 /** {@hide} */
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001795 public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22;
1796 /** {@hide} */
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001797 public static final int PREFERRED_DISPLAY_MODE_ID = 1 << 23;
1798 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001799 public static final int EVERYTHING_CHANGED = 0xffffffff;
1800
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001801 // internal buffer to backup/restore parameters under compatibility mode.
1802 private int[] mCompatibilityParamsBackup = null;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001803
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001804 public final int copyFrom(LayoutParams o) {
1805 int changes = 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001806
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001807 if (width != o.width) {
1808 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001809 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001810 }
1811 if (height != o.height) {
1812 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001813 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001814 }
1815 if (x != o.x) {
1816 x = o.x;
1817 changes |= LAYOUT_CHANGED;
1818 }
1819 if (y != o.y) {
1820 y = o.y;
1821 changes |= LAYOUT_CHANGED;
1822 }
1823 if (horizontalWeight != o.horizontalWeight) {
1824 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001825 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001826 }
1827 if (verticalWeight != o.verticalWeight) {
1828 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001829 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001830 }
1831 if (horizontalMargin != o.horizontalMargin) {
1832 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001833 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001834 }
1835 if (verticalMargin != o.verticalMargin) {
1836 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001837 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001838 }
1839 if (type != o.type) {
1840 type = o.type;
1841 changes |= TYPE_CHANGED;
1842 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001843 if (flags != o.flags) {
John Spurlockbd957402013-10-03 11:38:39 -04001844 final int diff = flags ^ o.flags;
1845 if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) {
1846 changes |= TRANSLUCENT_FLAGS_CHANGED;
1847 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001848 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001849 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001850 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001851 if (privateFlags != o.privateFlags) {
1852 privateFlags = o.privateFlags;
1853 changes |= PRIVATE_FLAGS_CHANGED;
1854 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001855 if (softInputMode != o.softInputMode) {
1856 softInputMode = o.softInputMode;
1857 changes |= SOFT_INPUT_MODE_CHANGED;
1858 }
1859 if (gravity != o.gravity) {
1860 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001861 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001862 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001863 if (format != o.format) {
1864 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001865 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001866 }
1867 if (windowAnimations != o.windowAnimations) {
1868 windowAnimations = o.windowAnimations;
1869 changes |= ANIMATION_CHANGED;
1870 }
1871 if (token == null) {
1872 // NOTE: token only copied if the recipient doesn't
1873 // already have one.
1874 token = o.token;
1875 }
1876 if (packageName == null) {
1877 // NOTE: packageName only copied if the recipient doesn't
1878 // already have one.
1879 packageName = o.packageName;
1880 }
1881 if (!mTitle.equals(o.mTitle)) {
1882 mTitle = o.mTitle;
1883 changes |= TITLE_CHANGED;
1884 }
1885 if (alpha != o.alpha) {
1886 alpha = o.alpha;
1887 changes |= ALPHA_CHANGED;
1888 }
1889 if (dimAmount != o.dimAmount) {
1890 dimAmount = o.dimAmount;
1891 changes |= DIM_AMOUNT_CHANGED;
1892 }
1893 if (screenBrightness != o.screenBrightness) {
1894 screenBrightness = o.screenBrightness;
1895 changes |= SCREEN_BRIGHTNESS_CHANGED;
1896 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001897 if (buttonBrightness != o.buttonBrightness) {
1898 buttonBrightness = o.buttonBrightness;
1899 changes |= BUTTON_BRIGHTNESS_CHANGED;
1900 }
Craig Mautner3c174372013-02-21 17:54:37 -08001901 if (rotationAnimation != o.rotationAnimation) {
1902 rotationAnimation = o.rotationAnimation;
1903 changes |= ROTATION_ANIMATION_CHANGED;
1904 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001905
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001906 if (screenOrientation != o.screenOrientation) {
1907 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07001908 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001909 }
Romain Guy529b60a2010-08-03 18:05:47 -07001910
Michael Wright3f145a22014-07-22 19:46:03 -07001911 if (preferredRefreshRate != o.preferredRefreshRate) {
1912 preferredRefreshRate = o.preferredRefreshRate;
1913 changes |= PREFERRED_REFRESH_RATE_CHANGED;
1914 }
1915
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001916 if (preferredDisplayModeId != o.preferredDisplayModeId) {
1917 preferredDisplayModeId = o.preferredDisplayModeId;
1918 changes |= PREFERRED_DISPLAY_MODE_ID;
1919 }
1920
Joe Onorato14782f72011-01-25 19:53:17 -08001921 if (systemUiVisibility != o.systemUiVisibility
1922 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08001923 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08001924 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08001925 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
1926 }
1927
1928 if (hasSystemUiListeners != o.hasSystemUiListeners) {
1929 hasSystemUiListeners = o.hasSystemUiListeners;
1930 changes |= SYSTEM_UI_LISTENER_CHANGED;
1931 }
1932
Jeff Brown474dcb52011-06-14 20:22:50 -07001933 if (inputFeatures != o.inputFeatures) {
1934 inputFeatures = o.inputFeatures;
1935 changes |= INPUT_FEATURES_CHANGED;
1936 }
1937
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001938 if (userActivityTimeout != o.userActivityTimeout) {
1939 userActivityTimeout = o.userActivityTimeout;
1940 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
1941 }
1942
Alan Viverette49a22e82014-07-12 20:01:27 -07001943 if (!surfaceInsets.equals(o.surfaceInsets)) {
1944 surfaceInsets.set(o.surfaceInsets);
1945 changes |= SURFACE_INSETS_CHANGED;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001946 }
1947
Alan Viverette5435a302015-01-29 10:25:34 -08001948 if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) {
1949 hasManualSurfaceInsets = o.hasManualSurfaceInsets;
1950 changes |= SURFACE_INSETS_CHANGED;
1951 }
1952
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001953 if (needsMenuKey != o.needsMenuKey) {
1954 needsMenuKey = o.needsMenuKey;
1955 changes |= NEEDS_MENU_KEY_CHANGED;
1956 }
1957
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001958 return changes;
1959 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001960
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001961 @Override
1962 public String debug(String output) {
1963 output += "Contents of " + this + ":";
1964 Log.d("Debug", output);
1965 output = super.debug("");
1966 Log.d("Debug", output);
1967 Log.d("Debug", "");
1968 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
1969 return "";
1970 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001971
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001972 @Override
1973 public String toString() {
1974 StringBuilder sb = new StringBuilder(256);
1975 sb.append("WM.LayoutParams{");
1976 sb.append("(");
1977 sb.append(x);
1978 sb.append(',');
1979 sb.append(y);
1980 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08001981 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001982 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08001983 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001984 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001985 if (horizontalMargin != 0) {
1986 sb.append(" hm=");
1987 sb.append(horizontalMargin);
1988 }
1989 if (verticalMargin != 0) {
1990 sb.append(" vm=");
1991 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001992 }
1993 if (gravity != 0) {
1994 sb.append(" gr=#");
1995 sb.append(Integer.toHexString(gravity));
1996 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001997 if (softInputMode != 0) {
1998 sb.append(" sim=#");
1999 sb.append(Integer.toHexString(softInputMode));
2000 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002001 sb.append(" ty=");
2002 sb.append(type);
2003 sb.append(" fl=#");
2004 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07002005 if (privateFlags != 0) {
Adam Lesinski95c42972013-10-02 10:13:27 -07002006 if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
2007 sb.append(" compatible=true");
2008 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07002009 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
2010 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002011 if (format != PixelFormat.OPAQUE) {
2012 sb.append(" fmt=");
2013 sb.append(format);
2014 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002015 if (windowAnimations != 0) {
2016 sb.append(" wanim=0x");
2017 sb.append(Integer.toHexString(windowAnimations));
2018 }
2019 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
2020 sb.append(" or=");
2021 sb.append(screenOrientation);
2022 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07002023 if (alpha != 1.0f) {
2024 sb.append(" alpha=");
2025 sb.append(alpha);
2026 }
2027 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
2028 sb.append(" sbrt=");
2029 sb.append(screenBrightness);
2030 }
2031 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
2032 sb.append(" bbrt=");
2033 sb.append(buttonBrightness);
2034 }
Craig Mautner3c174372013-02-21 17:54:37 -08002035 if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
2036 sb.append(" rotAnim=");
2037 sb.append(rotationAnimation);
2038 }
Michael Wright3f145a22014-07-22 19:46:03 -07002039 if (preferredRefreshRate != 0) {
2040 sb.append(" preferredRefreshRate=");
2041 sb.append(preferredRefreshRate);
2042 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07002043 if (preferredDisplayModeId != 0) {
2044 sb.append(" preferredDisplayMode=");
2045 sb.append(preferredDisplayModeId);
2046 }
Joe Onorato664644d2011-01-23 17:53:23 -08002047 if (systemUiVisibility != 0) {
2048 sb.append(" sysui=0x");
2049 sb.append(Integer.toHexString(systemUiVisibility));
2050 }
Joe Onorato14782f72011-01-25 19:53:17 -08002051 if (subtreeSystemUiVisibility != 0) {
2052 sb.append(" vsysui=0x");
2053 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
2054 }
Joe Onorato664644d2011-01-23 17:53:23 -08002055 if (hasSystemUiListeners) {
2056 sb.append(" sysuil=");
2057 sb.append(hasSystemUiListeners);
2058 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002059 if (inputFeatures != 0) {
2060 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
2061 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07002062 if (userActivityTimeout >= 0) {
2063 sb.append(" userActivityTimeout=").append(userActivityTimeout);
2064 }
Andreas Gampe007cfa72015-03-15 14:19:43 -07002065 if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 ||
Andreas Gampe11090062015-03-16 09:45:34 -07002066 surfaceInsets.bottom != 0 || hasManualSurfaceInsets) {
Alan Viverette49a22e82014-07-12 20:01:27 -07002067 sb.append(" surfaceInsets=").append(surfaceInsets);
Alan Viverette5435a302015-01-29 10:25:34 -08002068 if (hasManualSurfaceInsets) {
2069 sb.append(" (manual)");
2070 }
Alan Viveretteccb11e12014-07-08 16:04:02 -07002071 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002072 if (needsMenuKey != NEEDS_MENU_UNSET) {
2073 sb.append(" needsMenuKey=");
2074 sb.append(needsMenuKey);
2075 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002076 sb.append('}');
2077 return sb.toString();
2078 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002079
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002080 /**
2081 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002082 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002083 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002084 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002085 x = (int) (x * scale + 0.5f);
2086 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002087 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002088 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002089 }
2090 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002091 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002092 }
2093 }
2094
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002095 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002096 * Backup the layout parameters used in compatibility mode.
2097 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002098 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002099 void backup() {
2100 int[] backup = mCompatibilityParamsBackup;
2101 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002102 // we backup 4 elements, x, y, width, height
2103 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002104 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002105 backup[0] = x;
2106 backup[1] = y;
2107 backup[2] = width;
2108 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002109 }
2110
2111 /**
2112 * Restore the layout params' coordinates, size and gravity
2113 * @see LayoutParams#backup()
2114 */
2115 void restore() {
2116 int[] backup = mCompatibilityParamsBackup;
2117 if (backup != null) {
2118 x = backup[0];
2119 y = backup[1];
2120 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002121 height = backup[3];
2122 }
2123 }
2124
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002125 private CharSequence mTitle = "";
Siva Velusamy0d857b92015-04-22 10:23:56 -07002126
2127 /** @hide */
2128 @Override
2129 protected void encodeProperties(@NonNull ViewHierarchyEncoder encoder) {
2130 super.encodeProperties(encoder);
2131
2132 encoder.addProperty("x", x);
2133 encoder.addProperty("y", y);
2134 encoder.addProperty("horizontalWeight", horizontalWeight);
2135 encoder.addProperty("verticalWeight", verticalWeight);
2136 encoder.addProperty("type", type);
2137 encoder.addProperty("flags", flags);
2138 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002139 }
2140}