blob: 54d78f3369a7fd71cde9cff5fb07a36a17cab5c4 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.view;
18
Bryce Lee53b9fbd2015-02-06 12:06:34 -080019import android.annotation.SystemApi;
Jeff Browna492c3a2012-08-23 19:48:44 -070020import android.app.Presentation;
21import android.content.Context;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.pm.ActivityInfo;
Alan Viveretteccb11e12014-07-08 16:04:02 -070023import android.graphics.Insets;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import 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 {
53 /**
54 * Exception that is thrown when trying to add view whose
Jorim Jaggi380ecb82014-03-14 17:25:20 +010055 * {@link LayoutParams} {@link LayoutParams#token}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056 * is invalid.
57 */
58 public static class BadTokenException extends RuntimeException {
59 public BadTokenException() {
60 }
61
62 public BadTokenException(String name) {
63 super(name);
64 }
65 }
66
67 /**
Craig Mautner6018aee2012-10-23 14:27:49 -070068 * Exception that is thrown when calling {@link #addView} to a secondary display that cannot
69 * be found. See {@link android.app.Presentation} for more information on secondary displays.
70 */
71 public static class InvalidDisplayException extends RuntimeException {
72 public InvalidDisplayException() {
73 }
74
75 public InvalidDisplayException(String name) {
76 super(name);
77 }
78 }
79
80 /**
Jeff Browna492c3a2012-08-23 19:48:44 -070081 * Returns the {@link Display} upon which this {@link WindowManager} instance
82 * will create new windows.
83 * <p>
84 * Despite the name of this method, the display that is returned is not
85 * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}).
86 * The returned display could instead be a secondary display that this
87 * window manager instance is managing. Think of it as the display that
88 * this {@link WindowManager} instance uses by default.
89 * </p><p>
90 * To create windows on a different display, you need to obtain a
91 * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager}
92 * class documentation for more information.)
93 * </p>
94 *
95 * @return The display that this window manager is managing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 */
97 public Display getDefaultDisplay();
Jeff Browna492c3a2012-08-23 19:48:44 -070098
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 /**
100 * Special variation of {@link #removeView} that immediately invokes
101 * the given view hierarchy's {@link View#onDetachedFromWindow()
102 * View.onDetachedFromWindow()} methods before returning. This is not
103 * for normal applications; using it correctly requires great care.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000104 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 * @param view The view to be removed.
106 */
107 public void removeViewImmediate(View view);
Jeff Brownd32460c2012-07-20 16:15:36 -0700108
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800109 public static class LayoutParams extends ViewGroup.LayoutParams
110 implements Parcelable {
111 /**
112 * X position for this window. With the default gravity it is ignored.
Fabrice Di Meglio9e3b0022011-06-06 16:30:29 -0700113 * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or
114 * {@link Gravity#END} it provides an offset from the given edge.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800115 */
Romain Guy529b60a2010-08-03 18:05:47 -0700116 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800117 public int x;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000118
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800119 /**
120 * Y position for this window. With the default gravity it is ignored.
121 * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
122 * an offset from the given edge.
123 */
Romain Guy529b60a2010-08-03 18:05:47 -0700124 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 public int y;
126
127 /**
128 * Indicates how much of the extra space will be allocated horizontally
129 * to the view associated with these LayoutParams. Specify 0 if the view
130 * should not be stretched. Otherwise the extra pixels will be pro-rated
131 * among all views whose weight is greater than 0.
132 */
Romain Guy529b60a2010-08-03 18:05:47 -0700133 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 public float horizontalWeight;
135
136 /**
137 * Indicates how much of the extra space will be allocated vertically
138 * to the view associated with these LayoutParams. Specify 0 if the view
139 * should not be stretched. Otherwise the extra pixels will be pro-rated
140 * among all views whose weight is greater than 0.
141 */
Romain Guy529b60a2010-08-03 18:05:47 -0700142 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143 public float verticalWeight;
Romain Guy529b60a2010-08-03 18:05:47 -0700144
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145 /**
146 * The general type of window. There are three main classes of
147 * window types:
148 * <ul>
149 * <li> <strong>Application windows</strong> (ranging from
150 * {@link #FIRST_APPLICATION_WINDOW} to
151 * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
152 * windows. For these types of windows, the {@link #token} must be
153 * set to the token of the activity they are a part of (this will
154 * normally be done for you if {@link #token} is null).
155 * <li> <strong>Sub-windows</strong> (ranging from
156 * {@link #FIRST_SUB_WINDOW} to
157 * {@link #LAST_SUB_WINDOW}) are associated with another top-level
158 * window. For these types of windows, the {@link #token} must be
159 * the token of the window it is attached to.
160 * <li> <strong>System windows</strong> (ranging from
161 * {@link #FIRST_SYSTEM_WINDOW} to
162 * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
163 * use by the system for specific purposes. They should not normally
164 * be used by applications, and a special permission is required
165 * to use them.
166 * </ul>
Wonsik Kim475e3f02014-03-17 11:17:47 +0000167 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800168 * @see #TYPE_BASE_APPLICATION
169 * @see #TYPE_APPLICATION
170 * @see #TYPE_APPLICATION_STARTING
171 * @see #TYPE_APPLICATION_PANEL
172 * @see #TYPE_APPLICATION_MEDIA
173 * @see #TYPE_APPLICATION_SUB_PANEL
174 * @see #TYPE_APPLICATION_ATTACHED_DIALOG
175 * @see #TYPE_STATUS_BAR
176 * @see #TYPE_SEARCH_BAR
177 * @see #TYPE_PHONE
178 * @see #TYPE_SYSTEM_ALERT
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800179 * @see #TYPE_TOAST
180 * @see #TYPE_SYSTEM_OVERLAY
181 * @see #TYPE_PRIORITY_PHONE
182 * @see #TYPE_STATUS_BAR_PANEL
183 * @see #TYPE_SYSTEM_DIALOG
184 * @see #TYPE_KEYGUARD_DIALOG
185 * @see #TYPE_SYSTEM_ERROR
186 * @see #TYPE_INPUT_METHOD
187 * @see #TYPE_INPUT_METHOD_DIALOG
188 */
Joe Onorato8f2bd432010-03-25 11:45:28 -0700189 @ViewDebug.ExportedProperty(mapping = {
190 @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
191 @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
192 @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
193 @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
194 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
195 @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
196 @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700197 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700198 @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"),
199 @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"),
200 @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"),
201 @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700202 @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"),
203 @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"),
204 @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700205 @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"),
206 @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"),
207 @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
208 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
Jeff Brown3b2b3542010-10-15 00:54:27 -0700209 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700210 @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
211 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700212 @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700213 @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
214 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
215 @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
216 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
217 @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700218 @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"),
219 @ViewDebug.IntToString(from = TYPE_HIDDEN_NAV_CONSUMER, to = "TYPE_HIDDEN_NAV_CONSUMER"),
220 @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"),
Jeff Brownbd6e1502012-08-28 03:27:37 -0700221 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"),
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700222 @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"),
keunyounga446bf02013-06-21 19:07:57 -0700223 @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"),
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700224 @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"),
225 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"),
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700226 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION_STARTING, to = "TYPE_VOICE_INTERACTION_STARTING"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700227 })
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800228 public int type;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000229
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800230 /**
231 * Start of window types that represent normal application windows.
232 */
233 public static final int FIRST_APPLICATION_WINDOW = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000234
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800235 /**
236 * Window type: an application window that serves as the "base" window
237 * of the overall application; all other application windows will
238 * appear on top of it.
Craig Mautner5962b122012-10-05 14:45:52 -0700239 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800240 */
241 public static final int TYPE_BASE_APPLICATION = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000242
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800243 /**
244 * Window type: a normal application window. The {@link #token} must be
245 * an Activity token identifying who the window belongs to.
Craig Mautner5962b122012-10-05 14:45:52 -0700246 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800247 */
248 public static final int TYPE_APPLICATION = 2;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000249
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800250 /**
251 * Window type: special application window that is displayed while the
252 * application is starting. Not for use by applications themselves;
253 * this is used by the system to display something until the
254 * application can show its own windows.
Craig Mautner5962b122012-10-05 14:45:52 -0700255 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800256 */
257 public static final int TYPE_APPLICATION_STARTING = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000258
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800259 /**
260 * End of types of application windows.
261 */
262 public static final int LAST_APPLICATION_WINDOW = 99;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000263
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800264 /**
265 * Start of types of sub-windows. The {@link #token} of these windows
266 * must be set to the window they are attached to. These types of
267 * windows are kept next to their attached window in Z-order, and their
268 * coordinate space is relative to their attached window.
269 */
270 public static final int FIRST_SUB_WINDOW = 1000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000271
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800272 /**
273 * Window type: a panel on top of an application window. These windows
274 * appear on top of their attached window.
275 */
276 public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000277
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800278 /**
John Spurlock33291d82013-03-13 14:45:14 -0400279 * Window type: window for showing media (such as video). These windows
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800280 * are displayed behind their attached window.
281 */
282 public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000283
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800284 /**
285 * Window type: a sub-panel on top of an application window. These
286 * windows are displayed on top their attached window and any
287 * {@link #TYPE_APPLICATION_PANEL} panels.
288 */
289 public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW+2;
290
291 /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
292 * of the window happens as that of a top-level window, <em>not</em>
293 * as a child of its container.
294 */
295 public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000296
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800297 /**
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700298 * Window type: window for showing overlays on top of media windows.
299 * These windows are displayed between TYPE_APPLICATION_MEDIA and the
300 * application window. They should be translucent to be useful. This
301 * is a big ugly hack so:
302 * @hide
303 */
304 public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000305
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700306 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800307 * End of types of sub-windows.
308 */
309 public static final int LAST_SUB_WINDOW = 1999;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000310
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800311 /**
312 * Start of system-specific window types. These are not normally
313 * created by applications.
314 */
315 public static final int FIRST_SYSTEM_WINDOW = 2000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800317 /**
318 * Window type: the status bar. There can be only one status bar
319 * window; it is placed at the top of the screen, and all other
320 * windows are shifted down so they are below it.
Craig Mautner88400d32012-09-30 12:35:45 -0700321 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800322 */
323 public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000324
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800325 /**
326 * Window type: the search bar. There can be only one search bar
327 * window; it is placed at the top of the screen.
Craig Mautner88400d32012-09-30 12:35:45 -0700328 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800329 */
330 public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000331
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800332 /**
333 * Window type: phone. These are non-application windows providing
334 * user interaction with the phone (in particular incoming calls).
335 * These windows are normally placed above all applications, but behind
336 * the status bar.
Craig Mautner88400d32012-09-30 12:35:45 -0700337 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800338 */
339 public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000340
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 /**
342 * Window type: system window, such as low power alert. These windows
343 * are always on top of application windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700344 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800345 */
346 public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100347
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800348 /**
349 * Window type: keyguard window.
Craig Mautner88400d32012-09-30 12:35:45 -0700350 * In multiuser systems shows on all users' windows.
Jorim Jaggie411fdf2014-07-28 23:00:44 +0200351 * @removed
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800352 */
353 public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800355 /**
356 * Window type: transient notifications.
Craig Mautner88400d32012-09-30 12:35:45 -0700357 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800358 */
359 public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000360
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800361 /**
362 * Window type: system overlay windows, which need to be displayed
363 * on top of everything else. These windows must not take input
364 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700365 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800366 */
367 public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000368
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800369 /**
370 * Window type: priority phone UI, which needs to be displayed even if
371 * the keyguard is active. These windows must not take input
372 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700373 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800374 */
375 public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000376
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800377 /**
378 * Window type: panel that slides out from the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700379 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800380 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000382
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800383 /**
384 * Window type: dialogs that the keyguard shows
Craig Mautner88400d32012-09-30 12:35:45 -0700385 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 */
387 public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000388
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800389 /**
390 * Window type: internal system error windows, appear on top of
391 * everything they can.
Craig Mautner88400d32012-09-30 12:35:45 -0700392 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800393 */
394 public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000395
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800396 /**
397 * Window type: internal input methods windows, which appear above
398 * the normal UI. Application windows may be resized or panned to keep
399 * the input focus visible while this window is displayed.
Craig Mautner88400d32012-09-30 12:35:45 -0700400 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800401 */
402 public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11;
403
404 /**
405 * Window type: internal input methods dialog windows, which appear above
406 * the current input method window.
Craig Mautner88400d32012-09-30 12:35:45 -0700407 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800408 */
409 public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
410
411 /**
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700412 * Window type: wallpaper window, placed behind any window that wants
413 * to sit on top of the wallpaper.
Craig Mautner88400d32012-09-30 12:35:45 -0700414 * In multiuser systems shows only on the owning user's window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700415 */
416 public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13;
417
418 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800419 * Window type: panel that slides out from over the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700420 * In multiuser systems shows on all users' windows.
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800421 */
422 public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14;
Jeff Brown3b2b3542010-10-15 00:54:27 -0700423
424 /**
425 * Window type: secure system overlay windows, which need to be displayed
426 * on top of everything else. These windows must not take input
427 * focus, or they will interfere with the keyguard.
428 *
429 * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
430 * system itself is allowed to create these overlays. Applications cannot
431 * obtain permission to create secure system overlays.
Craig Mautner88400d32012-09-30 12:35:45 -0700432 *
433 * In multiuser systems shows only on the owning user's window.
Jeff Brown3b2b3542010-10-15 00:54:27 -0700434 * @hide
435 */
436 public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
437
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800438 /**
Christopher Tatea53146c2010-09-07 11:57:52 -0700439 * Window type: the drag-and-drop pseudowindow. There is only one
440 * drag layer (at most), and it is placed on top of all other windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700441 * In multiuser systems shows only on the owning user's window.
Christopher Tatea53146c2010-09-07 11:57:52 -0700442 * @hide
443 */
Jeff Brown3b2b3542010-10-15 00:54:27 -0700444 public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16;
Christopher Tatea53146c2010-09-07 11:57:52 -0700445
446 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800447 * Window type: panel that slides out from under the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700448 * In multiuser systems shows on all users' windows.
Joe Onoratoa89e9032010-11-24 11:13:44 -0800449 * @hide
Joe Onorato29fc2c92010-11-24 10:26:50 -0800450 */
451 public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
452
Jeff Brown83c09682010-12-23 17:50:18 -0800453 /**
454 * Window type: (mouse) pointer
Craig Mautner88400d32012-09-30 12:35:45 -0700455 * In multiuser systems shows on all users' windows.
Jeff Brown83c09682010-12-23 17:50:18 -0800456 * @hide
457 */
458 public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
Joe Onorato29fc2c92010-11-24 10:26:50 -0800459
460 /**
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400461 * Window type: Navigation bar (when distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700462 * In multiuser systems shows on all users' windows.
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400463 * @hide
464 */
465 public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
466
467 /**
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700468 * Window type: The volume level overlay/dialog shown when the user
469 * changes the system volume.
Craig Mautner88400d32012-09-30 12:35:45 -0700470 * In multiuser systems shows on all users' windows.
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700471 * @hide
472 */
473 public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
474
475 /**
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700476 * Window type: The boot progress dialog, goes on top of everything
477 * in the world.
Craig Mautner88400d32012-09-30 12:35:45 -0700478 * In multiuser systems shows on all users' windows.
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700479 * @hide
480 */
481 public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
482
483 /**
Dianne Hackborndf89e652011-10-06 22:35:11 -0700484 * Window type: Fake window to consume touch events when the navigation
485 * bar is hidden.
Craig Mautner88400d32012-09-30 12:35:45 -0700486 * In multiuser systems shows on all users' windows.
Dianne Hackborndf89e652011-10-06 22:35:11 -0700487 * @hide
488 */
489 public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22;
490
491 /**
Daniel Sandler7d276c32012-01-30 14:33:52 -0500492 * Window type: Dreams (screen saver) window, just above keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700493 * In multiuser systems shows only on the owning user's window.
Daniel Sandler7d276c32012-01-30 14:33:52 -0500494 * @hide
495 */
496 public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
497
498 /**
Jim Millere898ac52012-04-06 17:10:57 -0700499 * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700500 * In multiuser systems shows on all users' windows.
Jim Millere898ac52012-04-06 17:10:57 -0700501 * @hide
502 */
503 public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
504
505 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -0700506 * Window type: Display overlay window. Used to simulate secondary display devices.
Craig Mautner88400d32012-09-30 12:35:45 -0700507 * In multiuser systems shows on all users' windows.
Jeff Brownbd6e1502012-08-28 03:27:37 -0700508 * @hide
509 */
510 public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
511
512 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700513 * Window type: Magnification overlay window. Used to highlight the magnified
514 * portion of a display when accessibility magnification is enabled.
Craig Mautner88400d32012-09-30 12:35:45 -0700515 * In multiuser systems shows on all users' windows.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700516 * @hide
517 */
518 public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
519
520 /**
Jim Miller5ecd8112013-01-09 18:50:26 -0800521 * Window type: keyguard scrim window. Shows if keyguard needs to be restarted.
522 * In multiuser systems shows on all users' windows.
523 * @hide
524 */
525 public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29;
526
Craig Mautner88400d32012-09-30 12:35:45 -0700527 /**
keunyounga446bf02013-06-21 19:07:57 -0700528 * Window type: Window for Presentation on top of private
529 * virtual display.
530 */
531 public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30;
532
533 /**
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700534 * Window type: Windows in the voice interaction layer.
535 * @hide
536 */
537 public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31;
538
539 /**
Svetoslav3a5c7212014-10-14 09:54:26 -0700540 * Window type: Windows that are overlaid <em>only</em> by an {@link
541 * android.accessibilityservice.AccessibilityService} for interception of
542 * user interactions without changing the windows an accessibility service
543 * can introspect. In particular, an accessibility service can introspect
544 * only windows that a sighted user can interact with which is they can touch
545 * these windows or can type into these windows. For example, if there
546 * is a full screen accessibility overlay that is touchable, the windows
547 * below it will be introspectable by an accessibility service regardless
548 * they are covered by a touchable window.
549 */
550 public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32;
551
552 /**
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700553 * Window type: Starting window for voice interaction layer.
554 * @hide
555 */
556 public static final int TYPE_VOICE_INTERACTION_STARTING = FIRST_SYSTEM_WINDOW+33;
557
558 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800559 * End of types of system windows.
560 */
561 public static final int LAST_SYSTEM_WINDOW = 2999;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800562
Mathias Agopiand2112302010-12-07 19:38:17 -0800563 /** @deprecated this is ignored, this value is set automatically when needed. */
564 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800565 public static final int MEMORY_TYPE_NORMAL = 0;
Mathias Agopiand2112302010-12-07 19:38:17 -0800566 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700567 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800568 public static final int MEMORY_TYPE_HARDWARE = 1;
Mathias Agopiand2112302010-12-07 19:38:17 -0800569 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700570 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800571 public static final int MEMORY_TYPE_GPU = 2;
Mathias Agopiand2112302010-12-07 19:38:17 -0800572 /** @deprecated this is ignored, this value is set automatically when needed. */
573 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800574 public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000575
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800576 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700577 * @deprecated this is ignored
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800578 */
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700579 @Deprecated
580 public int memoryType;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000581
Mike Lockwoodef731622010-01-27 17:51:34 -0500582 /** Window flag: as long as this window is visible to the user, allow
Wonsik Kim475e3f02014-03-17 11:17:47 +0000583 * the lock screen to activate while the screen is on.
584 * This can be used independently, or in combination with
Christopher Tate95f78502010-01-29 15:57:34 -0800585 * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
Mike Lockwoodef731622010-01-27 17:51:34 -0500586 public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
587
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800588 /** Window flag: everything behind this window will be dimmed.
589 * Use {@link #dimAmount} to control the amount of dim. */
590 public static final int FLAG_DIM_BEHIND = 0x00000002;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700591
592 /** Window flag: blur everything behind this window.
593 * @deprecated Blurring is no longer supported. */
594 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800595 public static final int FLAG_BLUR_BEHIND = 0x00000004;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700596
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800597 /** Window flag: this window won't ever get key input focus, so the
598 * user can not send key or other button events to it. Those will
599 * instead go to whatever focusable window is behind it. This flag
600 * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
601 * is explicitly set.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000602 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800603 * <p>Setting this flag also implies that the window will not need to
604 * interact with
Wonsik Kim475e3f02014-03-17 11:17:47 +0000605 * a soft input method, so it will be Z-ordered and positioned
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800606 * independently of any active input method (typically this means it
607 * gets Z-ordered on top of the input method, so it can use the full
608 * screen for its content and cover the input method if needed. You
609 * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
610 public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800612 /** Window flag: this window can never receive touch events. */
613 public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000614
John Spurlock33291d82013-03-13 14:45:14 -0400615 /** Window flag: even when this window is focusable (its
616 * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800617 * outside of the window to be sent to the windows behind it. Otherwise
618 * it will consume all pointer events itself, regardless of whether they
619 * are inside of the window. */
620 public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000621
John Spurlock33291d82013-03-13 14:45:14 -0400622 /** Window flag: when set, if the device is asleep when the touch
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800623 * screen is pressed, you will receive this first touch event. Usually
624 * the first touch event is consumed by the system since the user can
625 * not see what they are pressing on.
Jeff Brown037c33e2014-04-09 00:31:55 -0700626 *
627 * @deprecated This flag has no effect.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800628 */
Jeff Brown037c33e2014-04-09 00:31:55 -0700629 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800630 public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000631
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800632 /** Window flag: as long as this window is visible to the user, keep
633 * the device's screen turned on and bright. */
634 public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000635
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800636 /** Window flag: place the window within the entire screen, ignoring
John Spurlock33291d82013-03-13 14:45:14 -0400637 * decorations around the border (such as the status bar). The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800638 * window must correctly position its contents to take the screen
639 * decoration into account. This flag is normally set for you
640 * by Window as described in {@link Window#setFlags}. */
641 public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000642
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 /** Window flag: allow window to extend outside of the screen. */
644 public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000645
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800646 /**
John Spurlock33291d82013-03-13 14:45:14 -0400647 * Window flag: hide all screen decorations (such as the status bar) while
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800648 * this window is displayed. This allows the window to use the entire
649 * display space for itself -- the status bar will be hidden when
Chet Haase45c89c22013-04-29 16:04:40 -0700650 * an app window with this flag set is on the top layer. A fullscreen window
651 * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's
652 * {@link #softInputMode} field; the window will stay fullscreen
653 * and will not resize.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800654 *
655 * <p>This flag can be controlled in your theme through the
656 * {@link android.R.attr#windowFullscreen} attribute; this attribute
657 * is automatically set for you in the standard fullscreen themes
658 * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen},
659 * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen},
660 * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen},
661 * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen},
662 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen},
663 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and
664 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p>
665 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800666 public static final int FLAG_FULLSCREEN = 0x00000400;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000667
John Spurlock33291d82013-03-13 14:45:14 -0400668 /** Window flag: override {@link #FLAG_FULLSCREEN} and force the
669 * screen decorations (such as the status bar) to be shown. */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800670 public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000671
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 /** Window flag: turn on dithering when compositing this window to
Jeff Brown3cc321e2012-07-16 16:04:23 -0700673 * the screen.
674 * @deprecated This flag is no longer used. */
675 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800676 public static final int FLAG_DITHER = 0x00001000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000677
John Spurlock33291d82013-03-13 14:45:14 -0400678 /** Window flag: treat the content of the window as secure, preventing
Jeff Brownf0681b32012-10-23 17:35:57 -0700679 * it from appearing in screenshots or from being viewed on non-secure
680 * displays.
681 *
682 * <p>See {@link android.view.Display#FLAG_SECURE} for more details about
683 * secure surfaces and secure displays.
684 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800685 public static final int FLAG_SECURE = 0x00002000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000686
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800687 /** Window flag: a special mode where the layout parameters are used
688 * to perform scaling of the surface when it is composited to the
689 * screen. */
690 public static final int FLAG_SCALED = 0x00004000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000691
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800692 /** Window flag: intended for windows that will often be used when the user is
693 * holding the screen against their face, it will aggressively filter the event
694 * stream to prevent unintended presses in this situation that may not be
Wonsik Kim475e3f02014-03-17 11:17:47 +0000695 * desired for a particular window, when such an event stream is detected, the
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800696 * application will receive a CANCEL motion event to indicate this so applications
Wonsik Kim475e3f02014-03-17 11:17:47 +0000697 * can handle this accordingly by taking no action on the event
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800698 * until the finger is released. */
699 public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000700
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800701 /** Window flag: a special option only for use in combination with
702 * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
703 * screen your window may appear on top of or behind screen decorations
704 * such as the status bar. By also including this flag, the window
705 * manager will report the inset rectangle needed to ensure your
706 * content is not covered by screen decorations. This flag is normally
707 * set for you by Window as described in {@link Window#setFlags}.*/
708 public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000709
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800710 /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
711 * respect to how this window interacts with the current method. That
712 * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
713 * window will behave as if it needs to interact with the input method
714 * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
715 * not set and this flag is set, then the window will behave as if it
716 * doesn't need to interact with the input method and can be placed
717 * to use more space and cover the input method.
718 */
719 public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721 /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
722 * can set this flag to receive a single special MotionEvent with
723 * the action
724 * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
725 * touches that occur outside of your window. Note that you will not
726 * receive the full down/move/up gesture, only the location of the
727 * first down as an ACTION_OUTSIDE.
728 */
729 public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000730
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700731 /** Window flag: special flag to let windows be shown when the screen
732 * is locked. This will let application windows take precedence over
733 * key guard or any other lock screens. Can be used with
734 * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700735 * directly before showing the key guard window. Can be used with
736 * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
737 * non-secure keyguards. This flag only applies to the top-most
738 * full-screen window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700739 */
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700740 public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
741
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700742 /** Window flag: ask that the system wallpaper be shown behind
743 * your window. The window surface must be translucent to be able
744 * to actually see the wallpaper behind it; this flag just ensures
745 * that the wallpaper surface will be there if this window actually
746 * has translucent regions.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800747 *
748 * <p>This flag can be controlled in your theme through the
749 * {@link android.R.attr#windowShowWallpaper} attribute; this attribute
750 * is automatically set for you in the standard wallpaper themes
751 * such as {@link android.R.style#Theme_Wallpaper},
752 * {@link android.R.style#Theme_Wallpaper_NoTitleBar},
753 * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen},
754 * {@link android.R.style#Theme_Holo_Wallpaper},
755 * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar},
756 * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and
757 * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p>
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700758 */
759 public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000760
Dianne Hackborn93e462b2009-09-15 22:50:40 -0700761 /** Window flag: when set as a window is being added or made
762 * visible, once the window has been shown then the system will
763 * poke the power manager's user activity (as if the user had woken
764 * up the device) to turn the screen on. */
765 public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000766
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700767 /** Window flag: when set the window will cause the keyguard to
768 * be dismissed, only if it is not a secure lock keyguard. Because such
769 * a keyguard is not needed for security, it will never re-appear if
770 * the user navigates to another window (in contrast to
771 * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
772 * hide both secure and non-secure keyguards but ensure they reappear
773 * when the user moves to another UI that doesn't hide them).
774 * If the keyguard is currently active and is secure (requires an
775 * unlock pattern) than the user will still need to confirm it before
776 * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
Daniel Sandlerae069f72010-06-17 21:56:26 -0400777 * also been set.
778 */
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700779 public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000780
Jeff Brown01ce2e92010-09-26 22:20:12 -0700781 /** Window flag: when set the window will accept for touch events
782 * outside of its bounds to be sent to other windows that also
783 * support split touch. When this flag is not set, the first pointer
784 * that goes down determines the window to which all subsequent touches
785 * go until all pointers go up. When this flag is set, each pointer
786 * (not necessarily the first) that goes down determines the window
787 * to which all subsequent touches of that pointer will go until that
788 * pointer goes up thereby enabling touches with multiple pointers
789 * to be split across multiple windows.
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800790 */
Jeff Brown01ce2e92010-09-26 22:20:12 -0700791 public static final int FLAG_SPLIT_TOUCH = 0x00800000;
Wonsik Kim475e3f02014-03-17 11:17:47 +0000792
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800793 /**
Romain Guy72f0a272011-01-09 16:01:46 -0800794 * <p>Indicates whether this window should be hardware accelerated.
795 * Requesting hardware acceleration does not guarantee it will happen.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800796 *
Romain Guy72f0a272011-01-09 16:01:46 -0800797 * <p>This flag can be controlled programmatically <em>only</em> to enable
798 * hardware acceleration. To enable hardware acceleration for a given
799 * window programmatically, do the following:</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800800 *
Romain Guy72f0a272011-01-09 16:01:46 -0800801 * <pre>
802 * Window w = activity.getWindow(); // in Activity's onCreate() for instance
803 * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
804 * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
805 * </pre>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800806 *
Romain Guy72f0a272011-01-09 16:01:46 -0800807 * <p>It is important to remember that this flag <strong>must</strong>
808 * be set before setting the content view of your activity or dialog.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800809 *
Romain Guy72f0a272011-01-09 16:01:46 -0800810 * <p>This flag cannot be used to disable hardware acceleration after it
811 * was enabled in your manifest using
812 * {@link android.R.attr#hardwareAccelerated}. If you need to selectively
813 * and programmatically disable hardware acceleration (for automated testing
814 * for instance), make sure it is turned off in your manifest and enable it
815 * on your activity or dialog when you need it instead, using the method
816 * described above.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800817 *
Romain Guy72f0a272011-01-09 16:01:46 -0800818 * <p>This flag is automatically set by the system if the
819 * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
820 * XML attribute is set to true on an activity or on the application.</p>
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800821 */
822 public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000;
Daniel Sandler611fae42010-06-17 10:45:00 -0400823
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800824 /**
825 * Window flag: allow window contents to extend in to the screen's
Dianne Hackbornc652de82013-02-15 16:32:56 -0800826 * overscan area, if there is one. The window should still correctly
827 * position its contents to take the overscan area into account.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800828 *
829 * <p>This flag can be controlled in your theme through the
830 * {@link android.R.attr#windowOverscan} attribute; this attribute
831 * is automatically set for you in the standard overscan themes
Ying Wang4e0eb222013-04-18 20:39:48 -0700832 * such as
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800833 * {@link android.R.style#Theme_Holo_NoActionBar_Overscan},
834 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan},
835 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and
836 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p>
837 *
838 * <p>When this flag is enabled for a window, its normal content may be obscured
839 * to some degree by the overscan region of the display. To ensure key parts of
840 * that content are visible to the user, you can use
841 * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)}
842 * to set the point in the view hierarchy where the appropriate offsets should
843 * be applied. (This can be done either by directly calling this function, using
844 * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy,
845 * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect)
846 * View.fitSystemWindows(Rect)} method).</p>
847 *
848 * <p>This mechanism for positioning content elements is identical to its equivalent
849 * use with layout and {@link View#setSystemUiVisibility(int)
850 * View.setSystemUiVisibility(int)}; here is an example layout that will correctly
851 * position its UI elements with this overscan flag is set:</p>
852 *
853 * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete}
Dianne Hackbornc652de82013-02-15 16:32:56 -0800854 */
855 public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
856
John Spurlockbd957402013-10-03 11:38:39 -0400857 /**
858 * Window flag: request a translucent status bar with minimal system-provided
859 * background protection.
860 *
861 * <p>This flag can be controlled in your theme through the
862 * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute
863 * is automatically set for you in the standard translucent decor themes
864 * such as
865 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
866 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
867 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
868 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
869 *
870 * <p>When this flag is enabled for a window, it automatically sets
871 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
872 * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p>
873 */
874 public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000;
875
876 /**
877 * Window flag: request a translucent navigation bar with minimal system-provided
878 * background protection.
879 *
880 * <p>This flag can be controlled in your theme through the
881 * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute
882 * is automatically set for you in the standard translucent decor themes
883 * such as
884 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
885 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
886 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
887 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
888 *
889 * <p>When this flag is enabled for a window, it automatically sets
890 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
891 * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p>
892 */
893 public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000;
894
Adam Lesinski6a591f52013-10-01 18:11:17 -0700895 /**
896 * Flag for a window in local focus mode.
897 * Window in local focus mode can control focus independent of window manager using
898 * {@link Window#setLocalFocus(boolean, boolean)}.
899 * Usually window in this mode will not get touch/key events from window manager, but will
900 * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}.
901 */
902 public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000;
903
Jeff Brown98db5fa2011-06-08 15:37:10 -0700904 /** Window flag: Enable touches to slide out of a window into neighboring
905 * windows in mid-gesture instead of being captured for the duration of
906 * the gesture.
907 *
908 * This flag changes the behavior of touch focus for this window only.
909 * Touches can slide out of the window but they cannot necessarily slide
910 * back in (unless the other window with touch focus permits it).
911 *
912 * {@hide}
913 */
Adam Lesinski6a591f52013-10-01 18:11:17 -0700914 public static final int FLAG_SLIPPERY = 0x20000000;
Jeff Brown98db5fa2011-06-08 15:37:10 -0700915
Daniel Sandlere02d8082010-10-08 15:13:22 -0400916 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -0700917 * Window flag: When requesting layout with an attached window, the attached window may
918 * overlap with the screen decorations of the parent window such as the navigation bar. By
919 * including this flag, the window manager will layout the attached window within the decor
920 * frame of the parent window such that it doesn't overlap with screen decorations.
Daniel Sandlere02d8082010-10-08 15:13:22 -0400921 */
Wale Ogunwale393b1c12014-10-18 16:22:01 -0700922 public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000;
Daniel Sandlere02d8082010-10-08 15:13:22 -0400923
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800924 /**
Adrian Roos217ccd22014-05-09 14:29:04 +0200925 * Flag indicating that this Window is responsible for drawing the background for the
926 * system bars. If set, the system bars are drawn with a transparent background and the
927 * corresponding areas in this window are filled with the colors specified in
928 * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}.
929 */
930 public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000;
931
932 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700933 * Various behavioral options/flags. Default is none.
Wonsik Kim475e3f02014-03-17 11:17:47 +0000934 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700935 * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
936 * @see #FLAG_DIM_BEHIND
937 * @see #FLAG_NOT_FOCUSABLE
938 * @see #FLAG_NOT_TOUCHABLE
939 * @see #FLAG_NOT_TOUCH_MODAL
940 * @see #FLAG_TOUCHABLE_WHEN_WAKING
941 * @see #FLAG_KEEP_SCREEN_ON
942 * @see #FLAG_LAYOUT_IN_SCREEN
943 * @see #FLAG_LAYOUT_NO_LIMITS
944 * @see #FLAG_FULLSCREEN
945 * @see #FLAG_FORCE_NOT_FULLSCREEN
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700946 * @see #FLAG_SECURE
947 * @see #FLAG_SCALED
948 * @see #FLAG_IGNORE_CHEEK_PRESSES
949 * @see #FLAG_LAYOUT_INSET_DECOR
950 * @see #FLAG_ALT_FOCUSABLE_IM
951 * @see #FLAG_WATCH_OUTSIDE_TOUCH
952 * @see #FLAG_SHOW_WHEN_LOCKED
953 * @see #FLAG_SHOW_WALLPAPER
954 * @see #FLAG_TURN_SCREEN_ON
955 * @see #FLAG_DISMISS_KEYGUARD
956 * @see #FLAG_SPLIT_TOUCH
957 * @see #FLAG_HARDWARE_ACCELERATED
keunyoung30f420f2013-08-02 14:23:10 -0700958 * @see #FLAG_LOCAL_FOCUS_MODE
Adrian Roos217ccd22014-05-09 14:29:04 +0200959 * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700960 */
961 @ViewDebug.ExportedProperty(flagMapping = {
962 @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON,
963 name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"),
964 @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND,
965 name = "FLAG_DIM_BEHIND"),
966 @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND,
967 name = "FLAG_BLUR_BEHIND"),
968 @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE,
969 name = "FLAG_NOT_FOCUSABLE"),
970 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE,
971 name = "FLAG_NOT_TOUCHABLE"),
972 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL,
973 name = "FLAG_NOT_TOUCH_MODAL"),
974 @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING,
975 name = "FLAG_TOUCHABLE_WHEN_WAKING"),
976 @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON,
977 name = "FLAG_KEEP_SCREEN_ON"),
978 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN,
979 name = "FLAG_LAYOUT_IN_SCREEN"),
980 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS,
981 name = "FLAG_LAYOUT_NO_LIMITS"),
982 @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN,
983 name = "FLAG_FULLSCREEN"),
984 @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN,
985 name = "FLAG_FORCE_NOT_FULLSCREEN"),
986 @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER,
987 name = "FLAG_DITHER"),
988 @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE,
989 name = "FLAG_SECURE"),
990 @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED,
991 name = "FLAG_SCALED"),
992 @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES,
993 name = "FLAG_IGNORE_CHEEK_PRESSES"),
994 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR,
995 name = "FLAG_LAYOUT_INSET_DECOR"),
996 @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM,
997 name = "FLAG_ALT_FOCUSABLE_IM"),
998 @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH,
999 name = "FLAG_WATCH_OUTSIDE_TOUCH"),
1000 @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED,
1001 name = "FLAG_SHOW_WHEN_LOCKED"),
1002 @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER,
1003 name = "FLAG_SHOW_WALLPAPER"),
1004 @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON,
1005 name = "FLAG_TURN_SCREEN_ON"),
1006 @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD,
1007 name = "FLAG_DISMISS_KEYGUARD"),
1008 @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH,
1009 name = "FLAG_SPLIT_TOUCH"),
1010 @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED,
keunyoung30f420f2013-08-02 14:23:10 -07001011 name = "FLAG_HARDWARE_ACCELERATED"),
1012 @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE,
John Spurlockbd957402013-10-03 11:38:39 -04001013 name = "FLAG_LOCAL_FOCUS_MODE"),
1014 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS,
1015 name = "FLAG_TRANSLUCENT_STATUS"),
1016 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION,
Adrian Roos217ccd22014-05-09 14:29:04 +02001017 name = "FLAG_TRANSLUCENT_NAVIGATION"),
1018 @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
1019 name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS")
Jon Miranda4597e982014-07-29 07:25:49 -07001020 }, formatToHexString = true)
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001021 public int flags;
1022
1023 /**
John Reck61375a82014-09-18 19:27:48 +00001024 * If the window has requested hardware acceleration, but this is not
1025 * allowed in the process it is in, then still render it as if it is
1026 * hardware accelerated. This is used for the starting preview windows
1027 * in the system process, which don't need to have the overhead of
1028 * hardware acceleration (they are just a static rendering), but should
1029 * be rendered as such to match the actual window of the app even if it
1030 * is hardware accelerated.
1031 * Even if the window isn't hardware accelerated, still do its rendering
1032 * as if it was.
1033 * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
1034 * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
1035 * is generally disabled. This flag must be specified in addition to
1036 * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
1037 * windows.
1038 *
1039 * @hide
1040 */
1041 public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
1042
1043 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001044 * In the system process, we globally do not use hardware acceleration
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001045 * because there are many threads doing UI there and they conflict.
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001046 * If certain parts of the UI that really do want to use hardware
1047 * acceleration, this flag can be set to force it. This is basically
1048 * for the lock screen. Anyone else using it, you are probably wrong.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001049 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001050 * @hide
1051 */
1052 public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
1053
1054 /**
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001055 * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001056 * may elect to skip these notifications if they are not doing anything productive with
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001057 * them (they do not affect the wallpaper scrolling operation) by calling
1058 * {@link
1059 * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}.
1060 *
1061 * @hide
1062 */
1063 public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
1064
Craig Mautner88400d32012-09-30 12:35:45 -07001065 /** In a multiuser system if this flag is set and the owner is a system process then this
1066 * window will appear on all user screens. This overrides the default behavior of window
1067 * types that normally only appear on the owning user's screen. Refer to each window type
1068 * to determine its default behavior.
1069 *
1070 * {@hide} */
1071 public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
1072
Dianne Hackborn73ab6a42011-12-13 11:16:23 -08001073 /**
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001074 * Never animate position changes of the window.
1075 *
1076 * {@hide} */
1077 public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040;
1078
Adam Lesinski6a591f52013-10-01 18:11:17 -07001079 /** Window flag: special flag to limit the size of the window to be
1080 * original size ([320x480] x density). Used to create window for applications
1081 * running under compatibility mode.
1082 *
1083 * {@hide} */
1084 public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080;
1085
1086 /** Window flag: a special option intended for system dialogs. When
1087 * this flag is set, the window will demand focus unconditionally when
1088 * it is created.
1089 * {@hide} */
1090 public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;
1091
John Spurlock3f7cd512013-10-07 12:25:09 -04001092 /** Window flag: maintain the previous translucent decor state when this window
John Spurlockbd957402013-10-03 11:38:39 -04001093 * becomes top-most.
1094 * {@hide} */
1095 public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200;
1096
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001097 /**
Jorim Jaggi380ecb82014-03-14 17:25:20 +01001098 * Flag whether the current window is a keyguard window, meaning that it will hide all other
1099 * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set.
1100 * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1101 * {@hide}
1102 */
1103 public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400;
1104
1105 /**
Filip Gruszczynskib8c06942014-12-04 15:02:18 -08001106 * Flag that prevents the wallpaper behind the current window from receiving touch events.
1107 *
1108 * {@hide}
1109 */
1110 public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800;
1111
1112 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001113 * Control flags that are private to the platform.
1114 * @hide
1115 */
1116 public int privateFlags;
1117
1118 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001119 * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it
1120 * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu
1121 * key. For this case, we should look at windows behind it to determine the appropriate
1122 * value.
1123 *
1124 * @hide
1125 */
1126 public static final int NEEDS_MENU_UNSET = 0;
1127
1128 /**
1129 * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a
1130 * menu key.
1131 *
1132 * @hide
1133 */
1134 public static final int NEEDS_MENU_SET_TRUE = 1;
1135
1136 /**
1137 * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't
1138 * needs a menu key.
1139 *
1140 * @hide
1141 */
1142 public static final int NEEDS_MENU_SET_FALSE = 2;
1143
1144 /**
1145 * State variable for a window belonging to an activity that responds to
1146 * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a
1147 * physical button this variable is ignored, but on devices where the Menu key is drawn in
1148 * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}.
1149 *
1150 * (Note that Action Bars, when available, are the preferred way to offer additional
1151 * functions otherwise accessed via an options menu.)
1152 *
1153 * {@hide}
1154 */
1155 public int needsMenuKey = NEEDS_MENU_UNSET;
1156
1157 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001158 * Given a particular set of window manager flags, determine whether
1159 * such a window may be a target for an input method when it has
1160 * focus. In particular, this checks the
1161 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
1162 * flags and returns true if the combination of the two corresponds
1163 * to a window that needs to be behind the input method so that the
1164 * user can type into it.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001165 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001166 * @param flags The current window manager flags.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001167 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001168 * @return Returns true if such a window should be behind/interact
1169 * with an input method, false if not.
1170 */
1171 public static boolean mayUseInputMethod(int flags) {
1172 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
1173 case 0:
1174 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
1175 return true;
1176 }
1177 return false;
1178 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001179
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180 /**
1181 * Mask for {@link #softInputMode} of the bits that determine the
1182 * desired visibility state of the soft input area for this window.
1183 */
1184 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001185
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001186 /**
1187 * Visibility state for {@link #softInputMode}: no state has been specified.
1188 */
1189 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001190
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001191 /**
1192 * Visibility state for {@link #softInputMode}: please don't change the state of
1193 * the soft input area.
1194 */
1195 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001196
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001197 /**
1198 * Visibility state for {@link #softInputMode}: please hide any soft input
1199 * area when normally appropriate (when the user is navigating
1200 * forward to your window).
1201 */
1202 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001203
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204 /**
1205 * Visibility state for {@link #softInputMode}: please always hide any
1206 * soft input area when this window receives focus.
1207 */
1208 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001209
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001210 /**
1211 * Visibility state for {@link #softInputMode}: please show the soft
1212 * input area when normally appropriate (when the user is navigating
1213 * forward to your window).
1214 */
1215 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001216
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001217 /**
1218 * Visibility state for {@link #softInputMode}: please always make the
1219 * soft input area visible when this window receives input focus.
1220 */
1221 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001222
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001223 /**
1224 * Mask for {@link #softInputMode} of the bits that determine the
1225 * way that the window should be adjusted to accommodate the soft
1226 * input window.
1227 */
1228 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001229
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001230 /** Adjustment option for {@link #softInputMode}: nothing specified.
1231 * The system will try to pick one or
1232 * the other depending on the contents of the window.
1233 */
1234 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001235
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001236 /** Adjustment option for {@link #softInputMode}: set to allow the
1237 * window to be resized when an input
1238 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001239 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001240 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1241 * neither of these are set, then the system will try to pick one or
Chet Haase45c89c22013-04-29 16:04:40 -07001242 * the other depending on the contents of the window. If the window's
1243 * layout parameter flags include {@link #FLAG_FULLSCREEN}, this
1244 * value for {@link #softInputMode} will be ignored; the window will
1245 * not resize, but will stay fullscreen.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001246 */
1247 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001248
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001249 /** Adjustment option for {@link #softInputMode}: set to have a window
1250 * pan when an input method is
1251 * shown, so it doesn't need to deal with resizing but just panned
1252 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001253 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001254 * neither of these are set, then the system will try to pick one or
1255 * the other depending on the contents of the window.
1256 */
1257 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001258
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001259 /** Adjustment option for {@link #softInputMode}: set to have a window
1260 * not adjust for a shown input method. The window will not be resized,
1261 * and it will not be panned to make its focus visible.
1262 */
1263 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001265 /**
1266 * Bit for {@link #softInputMode}: set when the user has navigated
1267 * forward to the window. This is normally set automatically for
1268 * you by the system, though you may want to set it in certain cases
1269 * when you are displaying a window yourself. This flag will always
1270 * be cleared automatically after the window is displayed.
1271 */
1272 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001273
1274 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001275 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001276 * of:
Wonsik Kim475e3f02014-03-17 11:17:47 +00001277 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 * <ul>
1279 * <li> One of the visibility states
1280 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1281 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1282 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1283 * <li> One of the adjustment options
1284 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1285 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1286 * {@link #SOFT_INPUT_ADJUST_PAN}.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -08001287 * </ul>
1288 *
1289 *
1290 * <p>This flag can be controlled in your theme through the
1291 * {@link android.R.attr#windowSoftInputMode} attribute.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001292 */
1293 public int softInputMode;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001294
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001295 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001296 * Placement of window within the screen as per {@link Gravity}. Both
1297 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1298 * android.graphics.Rect) Gravity.apply} and
1299 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1300 * Gravity.applyDisplay} are used during window layout, with this value
1301 * given as the desired gravity. For example you can specify
1302 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1303 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1304 * to control the behavior of
1305 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1306 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001307 *
1308 * @see Gravity
1309 */
1310 public int gravity;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001311
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001312 /**
1313 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001314 * between the container and the widget. See
1315 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1316 * android.graphics.Rect) Gravity.apply} for how this is used. This
1317 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001318 */
1319 public float horizontalMargin;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001320
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001321 /**
1322 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001323 * between the container and the widget. See
1324 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1325 * android.graphics.Rect) Gravity.apply} for how this is used. This
1326 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001327 */
1328 public float verticalMargin;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001329
1330 /**
1331 * Positive insets between the drawing surface and window content.
1332 *
1333 * @hide
1334 */
Alan Viverette3aa1ffb2014-10-30 12:22:08 -07001335 public final Rect surfaceInsets = new Rect();
Alan Viverette5435a302015-01-29 10:25:34 -08001336
1337 /**
1338 * Whether the surface insets have been manually set. When set to
1339 * {@code false}, the view root will automatically determine the
1340 * appropriate surface insets.
1341 *
1342 * @see #surfaceInsets
1343 * @hide
1344 */
1345 public boolean hasManualSurfaceInsets;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001346
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001347 /**
1348 * The desired bitmap format. May be one of the constants in
1349 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1350 */
1351 public int format;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001352
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001353 /**
1354 * A style resource defining the animations to use for this window.
1355 * This must be a system resource; it can not be an application resource
1356 * because the window manager does not have access to applications.
1357 */
1358 public int windowAnimations;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 /**
1361 * An alpha value to apply to this entire window.
1362 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1363 */
1364 public float alpha = 1.0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001365
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001366 /**
1367 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1368 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1369 * dim.
1370 */
1371 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001372
1373 /**
1374 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1375 * indicating that the brightness value is not overridden for this window
1376 * and normal brightness policy should be used.
1377 */
1378 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1379
1380 /**
1381 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1382 * indicating that the screen or button backlight brightness should be set
1383 * to the lowest value when this window is in front.
1384 */
1385 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1386
1387 /**
1388 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1389 * indicating that the screen or button backlight brightness should be set
1390 * to the hightest value when this window is in front.
1391 */
1392 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001393
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001394 /**
1395 * This can be used to override the user's preferred brightness of
1396 * the screen. A value of less than 0, the default, means to use the
1397 * preferred screen brightness. 0 to 1 adjusts the brightness from
1398 * dark to full bright.
1399 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001400 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001401
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001402 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001403 * This can be used to override the standard behavior of the button and
1404 * keyboard backlights. A value of less than 0, the default, means to
1405 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1406 * from dark to full bright.
1407 */
1408 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1409
1410 /**
Craig Mautner3c174372013-02-21 17:54:37 -08001411 * Value for {@link #rotationAnimation} to define the animation used to
1412 * specify that this window will rotate in or out following a rotation.
1413 */
1414 public static final int ROTATION_ANIMATION_ROTATE = 0;
1415
1416 /**
1417 * Value for {@link #rotationAnimation} to define the animation used to
1418 * specify that this window will fade in or out following a rotation.
1419 */
1420 public static final int ROTATION_ANIMATION_CROSSFADE = 1;
1421
1422 /**
1423 * Value for {@link #rotationAnimation} to define the animation used to
1424 * specify that this window will immediately disappear or appear following
1425 * a rotation.
1426 */
1427 public static final int ROTATION_ANIMATION_JUMPCUT = 2;
1428
1429 /**
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001430 * Define the exit and entry animations used on this window when the device is rotated.
1431 * This only has an affect if the incoming and outgoing topmost
Craig Mautner3c174372013-02-21 17:54:37 -08001432 * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001433 * by other windows. All other situations default to the
1434 * {@link #ROTATION_ANIMATION_ROTATE} behavior.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001435 *
Craig Mautner3c174372013-02-21 17:54:37 -08001436 * @see #ROTATION_ANIMATION_ROTATE
1437 * @see #ROTATION_ANIMATION_CROSSFADE
1438 * @see #ROTATION_ANIMATION_JUMPCUT
1439 */
1440 public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
1441
1442 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001443 * Identifier for this window. This will usually be filled in for
1444 * you.
1445 */
1446 public IBinder token = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001447
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001448 /**
1449 * Name of the package owning this window.
1450 */
1451 public String packageName = null;
Wonsik Kim475e3f02014-03-17 11:17:47 +00001452
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001453 /**
1454 * Specific orientation value for a window.
1455 * May be any of the same values allowed
Wonsik Kim475e3f02014-03-17 11:17:47 +00001456 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1457 * If not set, a default value of
1458 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001459 * will be used.
1460 */
1461 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001462
1463 /**
Michael Wright3f145a22014-07-22 19:46:03 -07001464 * The preferred refresh rate for the window.
1465 *
1466 * This must be one of the supported refresh rates obtained for the display(s) the window
1467 * is on.
1468 *
1469 * @see Display#getSupportedRefreshRates()
1470 */
1471 public float preferredRefreshRate;
1472
1473 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001474 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001475 *
1476 * @see View#STATUS_BAR_VISIBLE
1477 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001478 */
1479 public int systemUiVisibility;
1480
1481 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001482 * @hide
1483 * The ui visibility as requested by the views in this hierarchy.
1484 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1485 */
1486 public int subtreeSystemUiVisibility;
1487
1488 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001489 * Get callbacks about the system ui visibility changing.
Wonsik Kim475e3f02014-03-17 11:17:47 +00001490 *
Joe Onorato664644d2011-01-23 17:53:23 -08001491 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1492 *
1493 * @hide
1494 */
1495 public boolean hasSystemUiListeners;
1496
Jeff Brown474dcb52011-06-14 20:22:50 -07001497 /**
1498 * When this window has focus, disable touch pad pointer gesture processing.
1499 * The window will receive raw position updates from the touch pad instead
1500 * of pointer movements and synthetic touch events.
1501 *
1502 * @hide
1503 */
1504 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1505
1506 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001507 * Does not construct an input channel for this window. The channel will therefore
1508 * be incapable of receiving input.
1509 *
1510 * @hide
1511 */
1512 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1513
1514 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001515 * When this window has focus, does not call user activity for all input events so
1516 * the application will have to do it itself. Should only be used by
1517 * the keyguard and phone app.
1518 * <p>
1519 * Should only be used by the keyguard and phone app.
1520 * </p>
1521 *
1522 * @hide
1523 */
1524 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1525
1526 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001527 * Control special features of the input subsystem.
1528 *
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001529 * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001530 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001531 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001532 * @hide
1533 */
1534 public int inputFeatures;
1535
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001536 /**
1537 * Sets the number of milliseconds before the user activity timeout occurs
1538 * when this window has focus. A value of -1 uses the standard timeout.
1539 * A value of 0 uses the minimum support display timeout.
1540 * <p>
1541 * This property can only be used to reduce the user specified display timeout;
1542 * it can never make the timeout longer than it normally would be.
1543 * </p><p>
1544 * Should only be used by the keyguard and phone app.
1545 * </p>
1546 *
1547 * @hide
1548 */
1549 public long userActivityTimeout = -1;
1550
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001551 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001552 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001553 type = TYPE_APPLICATION;
1554 format = PixelFormat.OPAQUE;
1555 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001556
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001557 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001558 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001559 type = _type;
1560 format = PixelFormat.OPAQUE;
1561 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001562
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001563 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001564 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001565 type = _type;
1566 flags = _flags;
1567 format = PixelFormat.OPAQUE;
1568 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001569
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001570 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001571 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001572 type = _type;
1573 flags = _flags;
1574 format = _format;
1575 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001576
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001577 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1578 super(w, h);
1579 type = _type;
1580 flags = _flags;
1581 format = _format;
1582 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001583
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001584 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1585 int _flags, int _format) {
1586 super(w, h);
1587 x = xpos;
1588 y = ypos;
1589 type = _type;
1590 flags = _flags;
1591 format = _format;
1592 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001593
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001594 public final void setTitle(CharSequence title) {
1595 if (null == title)
1596 title = "";
Wonsik Kim475e3f02014-03-17 11:17:47 +00001597
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001598 mTitle = TextUtils.stringOrSpannedString(title);
1599 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001600
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001601 public final CharSequence getTitle() {
1602 return mTitle;
1603 }
Bryce Lee53b9fbd2015-02-06 12:06:34 -08001604
1605 /** @hide */
1606 @SystemApi
1607 public final void setUserActivityTimeout(long timeout) {
1608 userActivityTimeout = timeout;
1609 }
1610
1611 /** @hide */
1612 @SystemApi
1613 public final long getUserActivityTimeout() {
1614 return userActivityTimeout;
1615 }
1616
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 public int describeContents() {
1618 return 0;
1619 }
1620
1621 public void writeToParcel(Parcel out, int parcelableFlags) {
1622 out.writeInt(width);
1623 out.writeInt(height);
1624 out.writeInt(x);
1625 out.writeInt(y);
1626 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001627 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001628 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001629 out.writeInt(softInputMode);
1630 out.writeInt(gravity);
1631 out.writeFloat(horizontalMargin);
1632 out.writeFloat(verticalMargin);
1633 out.writeInt(format);
1634 out.writeInt(windowAnimations);
1635 out.writeFloat(alpha);
1636 out.writeFloat(dimAmount);
1637 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001638 out.writeFloat(buttonBrightness);
Craig Mautner3c174372013-02-21 17:54:37 -08001639 out.writeInt(rotationAnimation);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001640 out.writeStrongBinder(token);
1641 out.writeString(packageName);
1642 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1643 out.writeInt(screenOrientation);
Michael Wright3f145a22014-07-22 19:46:03 -07001644 out.writeFloat(preferredRefreshRate);
Joe Onorato664644d2011-01-23 17:53:23 -08001645 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001646 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001647 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001648 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001649 out.writeLong(userActivityTimeout);
Alan Viverette49a22e82014-07-12 20:01:27 -07001650 out.writeInt(surfaceInsets.left);
1651 out.writeInt(surfaceInsets.top);
1652 out.writeInt(surfaceInsets.right);
1653 out.writeInt(surfaceInsets.bottom);
Alan Viverette5435a302015-01-29 10:25:34 -08001654 out.writeInt(hasManualSurfaceInsets ? 1 : 0);
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001655 out.writeInt(needsMenuKey);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001656 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001657
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001658 public static final Parcelable.Creator<LayoutParams> CREATOR
1659 = new Parcelable.Creator<LayoutParams>() {
1660 public LayoutParams createFromParcel(Parcel in) {
1661 return new LayoutParams(in);
1662 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001663
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001664 public LayoutParams[] newArray(int size) {
1665 return new LayoutParams[size];
1666 }
1667 };
Wonsik Kim475e3f02014-03-17 11:17:47 +00001668
1669
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001670 public LayoutParams(Parcel in) {
1671 width = in.readInt();
1672 height = in.readInt();
1673 x = in.readInt();
1674 y = in.readInt();
1675 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001676 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001677 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001678 softInputMode = in.readInt();
1679 gravity = in.readInt();
1680 horizontalMargin = in.readFloat();
1681 verticalMargin = in.readFloat();
1682 format = in.readInt();
1683 windowAnimations = in.readInt();
1684 alpha = in.readFloat();
1685 dimAmount = in.readFloat();
1686 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001687 buttonBrightness = in.readFloat();
Craig Mautner3c174372013-02-21 17:54:37 -08001688 rotationAnimation = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001689 token = in.readStrongBinder();
1690 packageName = in.readString();
1691 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1692 screenOrientation = in.readInt();
Michael Wright3f145a22014-07-22 19:46:03 -07001693 preferredRefreshRate = in.readFloat();
Joe Onorato664644d2011-01-23 17:53:23 -08001694 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001695 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001696 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001697 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001698 userActivityTimeout = in.readLong();
Alan Viverette49a22e82014-07-12 20:01:27 -07001699 surfaceInsets.left = in.readInt();
1700 surfaceInsets.top = in.readInt();
1701 surfaceInsets.right = in.readInt();
1702 surfaceInsets.bottom = in.readInt();
Alan Viverette5435a302015-01-29 10:25:34 -08001703 hasManualSurfaceInsets = in.readInt() != 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001704 needsMenuKey = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001705 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001706
Romain Guy72998072009-06-22 11:09:20 -07001707 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001708 public static final int LAYOUT_CHANGED = 1<<0;
1709 public static final int TYPE_CHANGED = 1<<1;
1710 public static final int FLAGS_CHANGED = 1<<2;
1711 public static final int FORMAT_CHANGED = 1<<3;
1712 public static final int ANIMATION_CHANGED = 1<<4;
1713 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1714 public static final int TITLE_CHANGED = 1<<6;
1715 public static final int ALPHA_CHANGED = 1<<7;
1716 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1717 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1718 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1719 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Craig Mautner3c174372013-02-21 17:54:37 -08001720 public static final int ROTATION_ANIMATION_CHANGED = 1<<12;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001721 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001722 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13;
Joe Onorato664644d2011-01-23 17:53:23 -08001723 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001724 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14;
Joe Onorato664644d2011-01-23 17:53:23 -08001725 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001726 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15;
Jeff Brown474dcb52011-06-14 20:22:50 -07001727 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001728 public static final int INPUT_FEATURES_CHANGED = 1<<16;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001729 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001730 public static final int PRIVATE_FLAGS_CHANGED = 1<<17;
Romain Guyf21c9b02011-09-06 16:56:54 -07001731 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001732 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18;
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001733 /** {@hide} */
John Spurlockbd957402013-10-03 11:38:39 -04001734 public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
1735 /** {@hide} */
Alan Viverette49a22e82014-07-12 20:01:27 -07001736 public static final int SURFACE_INSETS_CHANGED = 1<<20;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001737 /** {@hide} */
Michael Wright3f145a22014-07-22 19:46:03 -07001738 public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
1739 /** {@hide} */
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001740 public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22;
1741 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001742 public static final int EVERYTHING_CHANGED = 0xffffffff;
1743
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001744 // internal buffer to backup/restore parameters under compatibility mode.
1745 private int[] mCompatibilityParamsBackup = null;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001746
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001747 public final int copyFrom(LayoutParams o) {
1748 int changes = 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001749
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001750 if (width != o.width) {
1751 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001752 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001753 }
1754 if (height != o.height) {
1755 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001756 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001757 }
1758 if (x != o.x) {
1759 x = o.x;
1760 changes |= LAYOUT_CHANGED;
1761 }
1762 if (y != o.y) {
1763 y = o.y;
1764 changes |= LAYOUT_CHANGED;
1765 }
1766 if (horizontalWeight != o.horizontalWeight) {
1767 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001768 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001769 }
1770 if (verticalWeight != o.verticalWeight) {
1771 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001772 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001773 }
1774 if (horizontalMargin != o.horizontalMargin) {
1775 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001776 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001777 }
1778 if (verticalMargin != o.verticalMargin) {
1779 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001780 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001781 }
1782 if (type != o.type) {
1783 type = o.type;
1784 changes |= TYPE_CHANGED;
1785 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001786 if (flags != o.flags) {
John Spurlockbd957402013-10-03 11:38:39 -04001787 final int diff = flags ^ o.flags;
1788 if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) {
1789 changes |= TRANSLUCENT_FLAGS_CHANGED;
1790 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001791 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001792 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001793 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001794 if (privateFlags != o.privateFlags) {
1795 privateFlags = o.privateFlags;
1796 changes |= PRIVATE_FLAGS_CHANGED;
1797 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001798 if (softInputMode != o.softInputMode) {
1799 softInputMode = o.softInputMode;
1800 changes |= SOFT_INPUT_MODE_CHANGED;
1801 }
1802 if (gravity != o.gravity) {
1803 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001804 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001805 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001806 if (format != o.format) {
1807 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001808 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001809 }
1810 if (windowAnimations != o.windowAnimations) {
1811 windowAnimations = o.windowAnimations;
1812 changes |= ANIMATION_CHANGED;
1813 }
1814 if (token == null) {
1815 // NOTE: token only copied if the recipient doesn't
1816 // already have one.
1817 token = o.token;
1818 }
1819 if (packageName == null) {
1820 // NOTE: packageName only copied if the recipient doesn't
1821 // already have one.
1822 packageName = o.packageName;
1823 }
1824 if (!mTitle.equals(o.mTitle)) {
1825 mTitle = o.mTitle;
1826 changes |= TITLE_CHANGED;
1827 }
1828 if (alpha != o.alpha) {
1829 alpha = o.alpha;
1830 changes |= ALPHA_CHANGED;
1831 }
1832 if (dimAmount != o.dimAmount) {
1833 dimAmount = o.dimAmount;
1834 changes |= DIM_AMOUNT_CHANGED;
1835 }
1836 if (screenBrightness != o.screenBrightness) {
1837 screenBrightness = o.screenBrightness;
1838 changes |= SCREEN_BRIGHTNESS_CHANGED;
1839 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001840 if (buttonBrightness != o.buttonBrightness) {
1841 buttonBrightness = o.buttonBrightness;
1842 changes |= BUTTON_BRIGHTNESS_CHANGED;
1843 }
Craig Mautner3c174372013-02-21 17:54:37 -08001844 if (rotationAnimation != o.rotationAnimation) {
1845 rotationAnimation = o.rotationAnimation;
1846 changes |= ROTATION_ANIMATION_CHANGED;
1847 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001848
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001849 if (screenOrientation != o.screenOrientation) {
1850 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07001851 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001852 }
Romain Guy529b60a2010-08-03 18:05:47 -07001853
Michael Wright3f145a22014-07-22 19:46:03 -07001854 if (preferredRefreshRate != o.preferredRefreshRate) {
1855 preferredRefreshRate = o.preferredRefreshRate;
1856 changes |= PREFERRED_REFRESH_RATE_CHANGED;
1857 }
1858
Joe Onorato14782f72011-01-25 19:53:17 -08001859 if (systemUiVisibility != o.systemUiVisibility
1860 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08001861 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08001862 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08001863 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
1864 }
1865
1866 if (hasSystemUiListeners != o.hasSystemUiListeners) {
1867 hasSystemUiListeners = o.hasSystemUiListeners;
1868 changes |= SYSTEM_UI_LISTENER_CHANGED;
1869 }
1870
Jeff Brown474dcb52011-06-14 20:22:50 -07001871 if (inputFeatures != o.inputFeatures) {
1872 inputFeatures = o.inputFeatures;
1873 changes |= INPUT_FEATURES_CHANGED;
1874 }
1875
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001876 if (userActivityTimeout != o.userActivityTimeout) {
1877 userActivityTimeout = o.userActivityTimeout;
1878 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
1879 }
1880
Alan Viverette49a22e82014-07-12 20:01:27 -07001881 if (!surfaceInsets.equals(o.surfaceInsets)) {
1882 surfaceInsets.set(o.surfaceInsets);
1883 changes |= SURFACE_INSETS_CHANGED;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001884 }
1885
Alan Viverette5435a302015-01-29 10:25:34 -08001886 if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) {
1887 hasManualSurfaceInsets = o.hasManualSurfaceInsets;
1888 changes |= SURFACE_INSETS_CHANGED;
1889 }
1890
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001891 if (needsMenuKey != o.needsMenuKey) {
1892 needsMenuKey = o.needsMenuKey;
1893 changes |= NEEDS_MENU_KEY_CHANGED;
1894 }
1895
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001896 return changes;
1897 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001898
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001899 @Override
1900 public String debug(String output) {
1901 output += "Contents of " + this + ":";
1902 Log.d("Debug", output);
1903 output = super.debug("");
1904 Log.d("Debug", output);
1905 Log.d("Debug", "");
1906 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
1907 return "";
1908 }
Wonsik Kim475e3f02014-03-17 11:17:47 +00001909
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001910 @Override
1911 public String toString() {
1912 StringBuilder sb = new StringBuilder(256);
1913 sb.append("WM.LayoutParams{");
1914 sb.append("(");
1915 sb.append(x);
1916 sb.append(',');
1917 sb.append(y);
1918 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08001919 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001920 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08001921 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001922 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001923 if (horizontalMargin != 0) {
1924 sb.append(" hm=");
1925 sb.append(horizontalMargin);
1926 }
1927 if (verticalMargin != 0) {
1928 sb.append(" vm=");
1929 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001930 }
1931 if (gravity != 0) {
1932 sb.append(" gr=#");
1933 sb.append(Integer.toHexString(gravity));
1934 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001935 if (softInputMode != 0) {
1936 sb.append(" sim=#");
1937 sb.append(Integer.toHexString(softInputMode));
1938 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001939 sb.append(" ty=");
1940 sb.append(type);
1941 sb.append(" fl=#");
1942 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001943 if (privateFlags != 0) {
Adam Lesinski95c42972013-10-02 10:13:27 -07001944 if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
1945 sb.append(" compatible=true");
1946 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001947 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
1948 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001949 if (format != PixelFormat.OPAQUE) {
1950 sb.append(" fmt=");
1951 sb.append(format);
1952 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001953 if (windowAnimations != 0) {
1954 sb.append(" wanim=0x");
1955 sb.append(Integer.toHexString(windowAnimations));
1956 }
1957 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
1958 sb.append(" or=");
1959 sb.append(screenOrientation);
1960 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001961 if (alpha != 1.0f) {
1962 sb.append(" alpha=");
1963 sb.append(alpha);
1964 }
1965 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1966 sb.append(" sbrt=");
1967 sb.append(screenBrightness);
1968 }
1969 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1970 sb.append(" bbrt=");
1971 sb.append(buttonBrightness);
1972 }
Craig Mautner3c174372013-02-21 17:54:37 -08001973 if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
1974 sb.append(" rotAnim=");
1975 sb.append(rotationAnimation);
1976 }
Michael Wright3f145a22014-07-22 19:46:03 -07001977 if (preferredRefreshRate != 0) {
1978 sb.append(" preferredRefreshRate=");
1979 sb.append(preferredRefreshRate);
1980 }
Joe Onorato664644d2011-01-23 17:53:23 -08001981 if (systemUiVisibility != 0) {
1982 sb.append(" sysui=0x");
1983 sb.append(Integer.toHexString(systemUiVisibility));
1984 }
Joe Onorato14782f72011-01-25 19:53:17 -08001985 if (subtreeSystemUiVisibility != 0) {
1986 sb.append(" vsysui=0x");
1987 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
1988 }
Joe Onorato664644d2011-01-23 17:53:23 -08001989 if (hasSystemUiListeners) {
1990 sb.append(" sysuil=");
1991 sb.append(hasSystemUiListeners);
1992 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001993 if (inputFeatures != 0) {
1994 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
1995 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001996 if (userActivityTimeout >= 0) {
1997 sb.append(" userActivityTimeout=").append(userActivityTimeout);
1998 }
Andreas Gampe007cfa72015-03-15 14:19:43 -07001999 if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 ||
Andreas Gampe11090062015-03-16 09:45:34 -07002000 surfaceInsets.bottom != 0 || hasManualSurfaceInsets) {
Alan Viverette49a22e82014-07-12 20:01:27 -07002001 sb.append(" surfaceInsets=").append(surfaceInsets);
Alan Viverette5435a302015-01-29 10:25:34 -08002002 if (hasManualSurfaceInsets) {
2003 sb.append(" (manual)");
2004 }
Alan Viveretteccb11e12014-07-08 16:04:02 -07002005 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002006 if (needsMenuKey != NEEDS_MENU_UNSET) {
2007 sb.append(" needsMenuKey=");
2008 sb.append(needsMenuKey);
2009 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002010 sb.append('}');
2011 return sb.toString();
2012 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002013
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002014 /**
2015 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002016 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002017 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002018 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002019 x = (int) (x * scale + 0.5f);
2020 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002021 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002022 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002023 }
2024 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002025 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002026 }
2027 }
2028
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002029 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002030 * Backup the layout parameters used in compatibility mode.
2031 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002032 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002033 void backup() {
2034 int[] backup = mCompatibilityParamsBackup;
2035 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002036 // we backup 4 elements, x, y, width, height
2037 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002038 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002039 backup[0] = x;
2040 backup[1] = y;
2041 backup[2] = width;
2042 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002043 }
2044
2045 /**
2046 * Restore the layout params' coordinates, size and gravity
2047 * @see LayoutParams#backup()
2048 */
2049 void restore() {
2050 int[] backup = mCompatibilityParamsBackup;
2051 if (backup != null) {
2052 x = backup[0];
2053 y = backup[1];
2054 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002055 height = backup[3];
2056 }
2057 }
2058
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002059 private CharSequence mTitle = "";
2060 }
2061}