blob: 17f19912d31b01f78438ed2cc18632e09eb8d73c [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.view;
18
Siva Velusamy0d857b92015-04-22 10:23:56 -070019import android.annotation.NonNull;
Bryce Lee53b9fbd2015-02-06 12:06:34 -080020import android.annotation.SystemApi;
Jeff Browna492c3a2012-08-23 19:48:44 -070021import android.app.Presentation;
22import android.content.Context;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.pm.ActivityInfo;
24import android.graphics.PixelFormat;
Alan Viveretteccb11e12014-07-08 16:04:02 -070025import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.os.IBinder;
27import android.os.Parcel;
28import android.os.Parcelable;
29import android.text.TextUtils;
30import android.util.Log;
31
Clara Bayarri75e09792015-07-29 16:20:40 +010032import java.util.List;
Wale Ogunwale1f240c92016-02-22 18:04:58 -080033import java.util.Objects;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034
35/**
36 * The interface that apps use to talk to the window manager.
37 * <p>
38 * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these.
Jeff Browna492c3a2012-08-23 19:48:44 -070039 * </p><p>
40 * Each window manager instance is bound to a particular {@link Display}.
41 * To obtain a {@link WindowManager} for a different display, use
42 * {@link Context#createDisplayContext} to obtain a {@link Context} for that
43 * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code>
44 * to get the WindowManager.
45 * </p><p>
46 * The simplest way to show a window on another display is to create a
47 * {@link Presentation}. The presentation will automatically obtain a
48 * {@link WindowManager} and {@link Context} for that display.
49 * </p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050 *
51 * @see android.content.Context#getSystemService
52 * @see android.content.Context#WINDOW_SERVICE
53 */
54public interface WindowManager extends ViewManager {
Jorim Jaggi61f39a72015-10-29 16:54:18 +010055
56 /** @hide */
57 int DOCKED_INVALID = -1;
58 /** @hide */
59 int DOCKED_LEFT = 1;
60 /** @hide */
61 int DOCKED_TOP = 2;
62 /** @hide */
63 int DOCKED_RIGHT = 3;
64 /** @hide */
65 int DOCKED_BOTTOM = 4;
66
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067 /**
68 * Exception that is thrown when trying to add view whose
Jorim Jaggi380ecb82014-03-14 17:25:20 +010069 * {@link LayoutParams} {@link LayoutParams#token}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 * is invalid.
71 */
72 public static class BadTokenException extends RuntimeException {
73 public BadTokenException() {
74 }
75
76 public BadTokenException(String name) {
77 super(name);
78 }
79 }
80
81 /**
Craig Mautner6018aee2012-10-23 14:27:49 -070082 * Exception that is thrown when calling {@link #addView} to a secondary display that cannot
83 * be found. See {@link android.app.Presentation} for more information on secondary displays.
84 */
85 public static class InvalidDisplayException extends RuntimeException {
86 public InvalidDisplayException() {
87 }
88
89 public InvalidDisplayException(String name) {
90 super(name);
91 }
92 }
93
94 /**
Jeff Browna492c3a2012-08-23 19:48:44 -070095 * Returns the {@link Display} upon which this {@link WindowManager} instance
96 * will create new windows.
97 * <p>
98 * Despite the name of this method, the display that is returned is not
99 * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}).
100 * The returned display could instead be a secondary display that this
101 * window manager instance is managing. Think of it as the display that
102 * this {@link WindowManager} instance uses by default.
103 * </p><p>
104 * To create windows on a different display, you need to obtain a
105 * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager}
106 * class documentation for more information.)
107 * </p>
108 *
109 * @return The display that this window manager is managing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 */
111 public Display getDefaultDisplay();
Jeff Browna492c3a2012-08-23 19:48:44 -0700112
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800113 /**
114 * Special variation of {@link #removeView} that immediately invokes
115 * the given view hierarchy's {@link View#onDetachedFromWindow()
116 * View.onDetachedFromWindow()} methods before returning. This is not
117 * for normal applications; using it correctly requires great care.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700118 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800119 * @param view The view to be removed.
120 */
121 public void removeViewImmediate(View view);
Jeff Brownd32460c2012-07-20 16:15:36 -0700122
Clara Bayarri75e09792015-07-29 16:20:40 +0100123 /**
124 * Used to asynchronously request Keyboard Shortcuts from the focused window.
125 *
126 * @hide
127 */
128 public interface KeyboardShortcutsReceiver {
129 /**
130 * Callback used when the focused window keyboard shortcuts are ready to be displayed.
131 *
132 * @param result The keyboard shortcuts to be displayed.
133 */
134 void onKeyboardShortcutsReceived(List<KeyboardShortcutGroup> result);
135 }
136
137 /**
Muyuan Li6ca619f2016-03-08 13:30:42 -0800138 * Message for taking fullscreen screenshot
139 * @hide
140 */
141 final int TAKE_SCREENSHOT_FULLSCREEN = 1;
142
143 /**
144 * Message for taking screenshot of selected region.
145 * @hide
146 */
147 final int TAKE_SCREENSHOT_SELECTED_REGION = 2;
148
149 /**
Clara Bayarri75e09792015-07-29 16:20:40 +0100150 * @hide
151 */
152 public static final String PARCEL_KEY_SHORTCUTS_ARRAY = "shortcuts_array";
153
154 /**
155 * Request for keyboard shortcuts to be retrieved asynchronously.
156 *
157 * @param receiver The callback to be triggered when the result is ready.
158 *
159 * @hide
160 */
161 public void requestAppKeyboardShortcuts(final KeyboardShortcutsReceiver receiver);
162
Filip Gruszczynski1a4dfe52015-11-15 10:58:57 -0800163 public static class LayoutParams extends ViewGroup.LayoutParams implements Parcelable {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800164 /**
165 * X position for this window. With the default gravity it is ignored.
Fabrice Di Meglio9e3b0022011-06-06 16:30:29 -0700166 * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or
167 * {@link Gravity#END} it provides an offset from the given edge.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800168 */
Romain Guy529b60a2010-08-03 18:05:47 -0700169 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800170 public int x;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700171
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800172 /**
173 * Y position for this window. With the default gravity it is ignored.
174 * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
175 * an offset from the given edge.
176 */
Romain Guy529b60a2010-08-03 18:05:47 -0700177 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800178 public int y;
179
180 /**
181 * Indicates how much of the extra space will be allocated horizontally
182 * to the view associated with these LayoutParams. Specify 0 if the view
183 * should not be stretched. Otherwise the extra pixels will be pro-rated
184 * among all views whose weight is greater than 0.
185 */
Romain Guy529b60a2010-08-03 18:05:47 -0700186 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800187 public float horizontalWeight;
188
189 /**
190 * Indicates how much of the extra space will be allocated vertically
191 * to the view associated with these LayoutParams. Specify 0 if the view
192 * should not be stretched. Otherwise the extra pixels will be pro-rated
193 * among all views whose weight is greater than 0.
194 */
Romain Guy529b60a2010-08-03 18:05:47 -0700195 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800196 public float verticalWeight;
Romain Guy529b60a2010-08-03 18:05:47 -0700197
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800198 /**
199 * The general type of window. There are three main classes of
200 * window types:
201 * <ul>
202 * <li> <strong>Application windows</strong> (ranging from
203 * {@link #FIRST_APPLICATION_WINDOW} to
204 * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
205 * windows. For these types of windows, the {@link #token} must be
206 * set to the token of the activity they are a part of (this will
207 * normally be done for you if {@link #token} is null).
208 * <li> <strong>Sub-windows</strong> (ranging from
209 * {@link #FIRST_SUB_WINDOW} to
210 * {@link #LAST_SUB_WINDOW}) are associated with another top-level
211 * window. For these types of windows, the {@link #token} must be
212 * the token of the window it is attached to.
213 * <li> <strong>System windows</strong> (ranging from
214 * {@link #FIRST_SYSTEM_WINDOW} to
215 * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
216 * use by the system for specific purposes. They should not normally
217 * be used by applications, and a special permission is required
218 * to use them.
219 * </ul>
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700220 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800221 * @see #TYPE_BASE_APPLICATION
222 * @see #TYPE_APPLICATION
223 * @see #TYPE_APPLICATION_STARTING
224 * @see #TYPE_APPLICATION_PANEL
225 * @see #TYPE_APPLICATION_MEDIA
226 * @see #TYPE_APPLICATION_SUB_PANEL
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700227 * @see #TYPE_APPLICATION_ABOVE_SUB_PANEL
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800228 * @see #TYPE_APPLICATION_ATTACHED_DIALOG
229 * @see #TYPE_STATUS_BAR
230 * @see #TYPE_SEARCH_BAR
231 * @see #TYPE_PHONE
232 * @see #TYPE_SYSTEM_ALERT
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800233 * @see #TYPE_TOAST
234 * @see #TYPE_SYSTEM_OVERLAY
235 * @see #TYPE_PRIORITY_PHONE
236 * @see #TYPE_STATUS_BAR_PANEL
237 * @see #TYPE_SYSTEM_DIALOG
238 * @see #TYPE_KEYGUARD_DIALOG
239 * @see #TYPE_SYSTEM_ERROR
240 * @see #TYPE_INPUT_METHOD
241 * @see #TYPE_INPUT_METHOD_DIALOG
242 */
Joe Onorato8f2bd432010-03-25 11:45:28 -0700243 @ViewDebug.ExportedProperty(mapping = {
244 @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
245 @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
246 @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
247 @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
248 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
249 @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700250 @ViewDebug.IntToString(from = TYPE_APPLICATION_ABOVE_SUB_PANEL, to = "TYPE_APPLICATION_ABOVE_SUB_PANEL"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700251 @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700252 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700253 @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"),
254 @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"),
255 @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"),
256 @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700257 @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"),
258 @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"),
259 @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700260 @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"),
261 @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"),
262 @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
263 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
Jeff Brown3b2b3542010-10-15 00:54:27 -0700264 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700265 @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
266 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700267 @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700268 @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
269 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
270 @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
271 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
272 @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700273 @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"),
Selim Cinekf83e8242015-05-19 18:08:14 -0700274 @ViewDebug.IntToString(from = TYPE_INPUT_CONSUMER, to = "TYPE_INPUT_CONSUMER"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700275 @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"),
Jeff Brownbd6e1502012-08-28 03:27:37 -0700276 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"),
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700277 @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"),
keunyounga446bf02013-06-21 19:07:57 -0700278 @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"),
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700279 @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"),
280 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"),
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700281 @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION_STARTING, to = "TYPE_VOICE_INTERACTION_STARTING"),
Filip Gruszczynski466f3212015-09-21 17:57:57 -0700282 @ViewDebug.IntToString(from = TYPE_DOCK_DIVIDER, to = "TYPE_DOCK_DIVIDER"),
Jason Monk8f7f3182015-11-18 16:35:14 -0500283 @ViewDebug.IntToString(from = TYPE_QS_DIALOG, to = "TYPE_QS_DIALOG"),
Muyuan Li6ca619f2016-03-08 13:30:42 -0800284 @ViewDebug.IntToString(from = TYPE_SCREENSHOT, to = "TYPE_SCREENSHOT")
Joe Onorato8f2bd432010-03-25 11:45:28 -0700285 })
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800286 public int type;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700287
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800288 /**
289 * Start of window types that represent normal application windows.
290 */
291 public static final int FIRST_APPLICATION_WINDOW = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700292
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800293 /**
294 * Window type: an application window that serves as the "base" window
295 * of the overall application; all other application windows will
296 * appear on top of it.
Craig Mautner5962b122012-10-05 14:45:52 -0700297 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800298 */
299 public static final int TYPE_BASE_APPLICATION = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700300
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800301 /**
302 * Window type: a normal application window. The {@link #token} must be
303 * an Activity token identifying who the window belongs to.
Craig Mautner5962b122012-10-05 14:45:52 -0700304 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800305 */
306 public static final int TYPE_APPLICATION = 2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700307
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800308 /**
309 * Window type: special application window that is displayed while the
310 * application is starting. Not for use by applications themselves;
311 * this is used by the system to display something until the
312 * application can show its own windows.
Craig Mautner5962b122012-10-05 14:45:52 -0700313 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800314 */
315 public static final int TYPE_APPLICATION_STARTING = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800317 /**
318 * End of types of application windows.
319 */
320 public static final int LAST_APPLICATION_WINDOW = 99;
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700321
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800322 /**
323 * Start of types of sub-windows. The {@link #token} of these windows
324 * must be set to the window they are attached to. These types of
325 * windows are kept next to their attached window in Z-order, and their
326 * coordinate space is relative to their attached window.
327 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700328 public static final int FIRST_SUB_WINDOW = 1000;
329
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 /**
331 * Window type: a panel on top of an application window. These windows
332 * appear on top of their attached window.
333 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700334 public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
335
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800336 /**
John Spurlock33291d82013-03-13 14:45:14 -0400337 * Window type: window for showing media (such as video). These windows
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800338 * are displayed behind their attached window.
339 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700340 public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1;
341
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800342 /**
343 * Window type: a sub-panel on top of an application window. These
344 * windows are displayed on top their attached window and any
345 * {@link #TYPE_APPLICATION_PANEL} panels.
346 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700347 public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800348
349 /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
350 * of the window happens as that of a top-level window, <em>not</em>
351 * as a child of its container.
352 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700353 public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3;
354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800355 /**
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700356 * Window type: window for showing overlays on top of media windows.
357 * These windows are displayed between TYPE_APPLICATION_MEDIA and the
358 * application window. They should be translucent to be useful. This
359 * is a big ugly hack so:
360 * @hide
361 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700362 public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW + 4;
363
364 /**
365 * Window type: a above sub-panel on top of an application window and it's
366 * sub-panel windows. These windows are displayed on top of their attached window
367 * and any {@link #TYPE_APPLICATION_SUB_PANEL} panels.
Wale Ogunwale3540f932015-06-02 11:07:07 -0700368 * @hide
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700369 */
370 public static final int TYPE_APPLICATION_ABOVE_SUB_PANEL = FIRST_SUB_WINDOW + 5;
371
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700372 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373 * End of types of sub-windows.
374 */
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700375 public static final int LAST_SUB_WINDOW = 1999;
376
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800377 /**
378 * Start of system-specific window types. These are not normally
379 * created by applications.
380 */
381 public static final int FIRST_SYSTEM_WINDOW = 2000;
Wale Ogunwale0a4dc222015-04-14 12:58:42 -0700382
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800383 /**
384 * Window type: the status bar. There can be only one status bar
385 * window; it is placed at the top of the screen, and all other
386 * windows are shifted down so they are below it.
Craig Mautner88400d32012-09-30 12:35:45 -0700387 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800388 */
389 public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700390
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 /**
392 * Window type: the search bar. There can be only one search bar
393 * window; it is placed at the top of the screen.
Craig Mautner88400d32012-09-30 12:35:45 -0700394 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800395 */
396 public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700397
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 /**
399 * Window type: phone. These are non-application windows providing
400 * user interaction with the phone (in particular incoming calls).
401 * These windows are normally placed above all applications, but behind
402 * the status bar.
Craig Mautner88400d32012-09-30 12:35:45 -0700403 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800404 */
405 public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700406
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800407 /**
408 * Window type: system window, such as low power alert. These windows
409 * are always on top of application windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700410 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800411 */
412 public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100413
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800414 /**
415 * Window type: keyguard window.
Craig Mautner88400d32012-09-30 12:35:45 -0700416 * In multiuser systems shows on all users' windows.
Jorim Jaggie411fdf2014-07-28 23:00:44 +0200417 * @removed
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800418 */
419 public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100420
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800421 /**
422 * Window type: transient notifications.
Craig Mautner88400d32012-09-30 12:35:45 -0700423 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800424 */
425 public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700426
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 /**
428 * Window type: system overlay windows, which need to be displayed
429 * on top of everything else. These windows must not take input
430 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700431 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800432 */
433 public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700434
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800435 /**
436 * Window type: priority phone UI, which needs to be displayed even if
437 * the keyguard is active. These windows must not take input
438 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700439 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800440 */
441 public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700442
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800443 /**
444 * Window type: panel that slides out from the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700445 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800446 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800447 public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700448
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800449 /**
450 * Window type: dialogs that the keyguard shows
Craig Mautner88400d32012-09-30 12:35:45 -0700451 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800452 */
453 public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700454
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800455 /**
456 * Window type: internal system error windows, appear on top of
457 * everything they can.
Craig Mautner88400d32012-09-30 12:35:45 -0700458 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800459 */
460 public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700461
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800462 /**
463 * Window type: internal input methods windows, which appear above
464 * the normal UI. Application windows may be resized or panned to keep
465 * the input focus visible while this window is displayed.
Craig Mautner88400d32012-09-30 12:35:45 -0700466 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800467 */
468 public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11;
469
470 /**
471 * Window type: internal input methods dialog windows, which appear above
472 * the current input method window.
Craig Mautner88400d32012-09-30 12:35:45 -0700473 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800474 */
475 public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
476
477 /**
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700478 * Window type: wallpaper window, placed behind any window that wants
479 * to sit on top of the wallpaper.
Craig Mautner88400d32012-09-30 12:35:45 -0700480 * In multiuser systems shows only on the owning user's window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700481 */
482 public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13;
483
484 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800485 * Window type: panel that slides out from over the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700486 * In multiuser systems shows on all users' windows.
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800487 */
488 public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14;
Jeff Brown3b2b3542010-10-15 00:54:27 -0700489
490 /**
491 * Window type: secure system overlay windows, which need to be displayed
492 * on top of everything else. These windows must not take input
493 * focus, or they will interfere with the keyguard.
494 *
495 * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
496 * system itself is allowed to create these overlays. Applications cannot
497 * obtain permission to create secure system overlays.
Craig Mautner88400d32012-09-30 12:35:45 -0700498 *
499 * In multiuser systems shows only on the owning user's window.
Jeff Brown3b2b3542010-10-15 00:54:27 -0700500 * @hide
501 */
502 public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
503
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800504 /**
Christopher Tatea53146c2010-09-07 11:57:52 -0700505 * Window type: the drag-and-drop pseudowindow. There is only one
506 * drag layer (at most), and it is placed on top of all other windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700507 * In multiuser systems shows only on the owning user's window.
Christopher Tatea53146c2010-09-07 11:57:52 -0700508 * @hide
509 */
Jeff Brown3b2b3542010-10-15 00:54:27 -0700510 public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16;
Christopher Tatea53146c2010-09-07 11:57:52 -0700511
512 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800513 * Window type: panel that slides out from under the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700514 * In multiuser systems shows on all users' windows.
Joe Onoratoa89e9032010-11-24 11:13:44 -0800515 * @hide
Joe Onorato29fc2c92010-11-24 10:26:50 -0800516 */
517 public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
518
Jeff Brown83c09682010-12-23 17:50:18 -0800519 /**
520 * Window type: (mouse) pointer
Craig Mautner88400d32012-09-30 12:35:45 -0700521 * In multiuser systems shows on all users' windows.
Jeff Brown83c09682010-12-23 17:50:18 -0800522 * @hide
523 */
524 public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
Joe Onorato29fc2c92010-11-24 10:26:50 -0800525
526 /**
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400527 * Window type: Navigation bar (when distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700528 * In multiuser systems shows on all users' windows.
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400529 * @hide
530 */
531 public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
532
533 /**
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700534 * Window type: The volume level overlay/dialog shown when the user
535 * changes the system volume.
Craig Mautner88400d32012-09-30 12:35:45 -0700536 * In multiuser systems shows on all users' windows.
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700537 * @hide
538 */
539 public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
540
541 /**
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700542 * Window type: The boot progress dialog, goes on top of everything
543 * in the world.
Craig Mautner88400d32012-09-30 12:35:45 -0700544 * In multiuser systems shows on all users' windows.
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700545 * @hide
546 */
547 public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
548
549 /**
Selim Cinekf83e8242015-05-19 18:08:14 -0700550 * Window type to consume input events when the systemUI bars are hidden.
Craig Mautner88400d32012-09-30 12:35:45 -0700551 * In multiuser systems shows on all users' windows.
Dianne Hackborndf89e652011-10-06 22:35:11 -0700552 * @hide
553 */
Selim Cinekf83e8242015-05-19 18:08:14 -0700554 public static final int TYPE_INPUT_CONSUMER = FIRST_SYSTEM_WINDOW+22;
Dianne Hackborndf89e652011-10-06 22:35:11 -0700555
556 /**
Daniel Sandler7d276c32012-01-30 14:33:52 -0500557 * Window type: Dreams (screen saver) window, just above keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700558 * In multiuser systems shows only on the owning user's window.
Daniel Sandler7d276c32012-01-30 14:33:52 -0500559 * @hide
560 */
561 public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
562
563 /**
Jim Millere898ac52012-04-06 17:10:57 -0700564 * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700565 * In multiuser systems shows on all users' windows.
Jim Millere898ac52012-04-06 17:10:57 -0700566 * @hide
567 */
568 public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
569
570 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -0700571 * Window type: Display overlay window. Used to simulate secondary display devices.
Craig Mautner88400d32012-09-30 12:35:45 -0700572 * In multiuser systems shows on all users' windows.
Jeff Brownbd6e1502012-08-28 03:27:37 -0700573 * @hide
574 */
575 public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
576
577 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700578 * Window type: Magnification overlay window. Used to highlight the magnified
579 * portion of a display when accessibility magnification is enabled.
Craig Mautner88400d32012-09-30 12:35:45 -0700580 * In multiuser systems shows on all users' windows.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700581 * @hide
582 */
583 public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
584
585 /**
Jim Miller5ecd8112013-01-09 18:50:26 -0800586 * Window type: keyguard scrim window. Shows if keyguard needs to be restarted.
587 * In multiuser systems shows on all users' windows.
588 * @hide
589 */
590 public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29;
591
Craig Mautner88400d32012-09-30 12:35:45 -0700592 /**
keunyounga446bf02013-06-21 19:07:57 -0700593 * Window type: Window for Presentation on top of private
594 * virtual display.
595 */
596 public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30;
597
598 /**
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700599 * Window type: Windows in the voice interaction layer.
600 * @hide
601 */
602 public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31;
603
604 /**
Phil Weaver40ded282016-01-25 15:49:02 -0800605 * Window type: Windows that are overlaid <em>only</em> by a connected {@link
Svetoslav3a5c7212014-10-14 09:54:26 -0700606 * android.accessibilityservice.AccessibilityService} for interception of
607 * user interactions without changing the windows an accessibility service
608 * can introspect. In particular, an accessibility service can introspect
609 * only windows that a sighted user can interact with which is they can touch
610 * these windows or can type into these windows. For example, if there
611 * is a full screen accessibility overlay that is touchable, the windows
Phil Weaver40ded282016-01-25 15:49:02 -0800612 * below it will be introspectable by an accessibility service even though
Svetoslav3a5c7212014-10-14 09:54:26 -0700613 * they are covered by a touchable window.
614 */
615 public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32;
616
617 /**
Jorim Jaggi225d3b52015-04-01 11:18:57 -0700618 * Window type: Starting window for voice interaction layer.
619 * @hide
620 */
621 public static final int TYPE_VOICE_INTERACTION_STARTING = FIRST_SYSTEM_WINDOW+33;
622
623 /**
Filip Gruszczynski466f3212015-09-21 17:57:57 -0700624 * Window for displaying a handle used for resizing docked stacks. This window is owned
625 * by the system process.
626 * @hide
627 */
628 public static final int TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW+34;
629
630 /**
Jason Monk8f7f3182015-11-18 16:35:14 -0500631 * Window type: like {@link #TYPE_APPLICATION_ATTACHED_DIALOG}, but used
632 * by Quick Settings Tiles.
633 * @hide
634 */
635 public static final int TYPE_QS_DIALOG = FIRST_SYSTEM_WINDOW+35;
636
637 /**
Muyuan Li6ca619f2016-03-08 13:30:42 -0800638 * Window type: shares similar characteristics with {@link #TYPE_DREAM}. The layer is
639 * reserved for screenshot region selection.
640 * @hide
641 */
642 public static final int TYPE_SCREENSHOT = FIRST_SYSTEM_WINDOW + 36;
643
644 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800645 * End of types of system windows.
646 */
647 public static final int LAST_SYSTEM_WINDOW = 2999;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800648
Mathias Agopiand2112302010-12-07 19:38:17 -0800649 /** @deprecated this is ignored, this value is set automatically when needed. */
650 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800651 public static final int MEMORY_TYPE_NORMAL = 0;
Mathias Agopiand2112302010-12-07 19:38:17 -0800652 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700653 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800654 public static final int MEMORY_TYPE_HARDWARE = 1;
Mathias Agopiand2112302010-12-07 19:38:17 -0800655 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700656 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800657 public static final int MEMORY_TYPE_GPU = 2;
Mathias Agopiand2112302010-12-07 19:38:17 -0800658 /** @deprecated this is ignored, this value is set automatically when needed. */
659 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800660 public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700661
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800662 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700663 * @deprecated this is ignored
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800664 */
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700665 @Deprecated
666 public int memoryType;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700667
Mike Lockwoodef731622010-01-27 17:51:34 -0500668 /** Window flag: as long as this window is visible to the user, allow
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700669 * the lock screen to activate while the screen is on.
670 * This can be used independently, or in combination with
Christopher Tate95f78502010-01-29 15:57:34 -0800671 * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
Mike Lockwoodef731622010-01-27 17:51:34 -0500672 public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
673
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800674 /** Window flag: everything behind this window will be dimmed.
675 * Use {@link #dimAmount} to control the amount of dim. */
676 public static final int FLAG_DIM_BEHIND = 0x00000002;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700677
678 /** Window flag: blur everything behind this window.
679 * @deprecated Blurring is no longer supported. */
680 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800681 public static final int FLAG_BLUR_BEHIND = 0x00000004;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700682
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800683 /** Window flag: this window won't ever get key input focus, so the
684 * user can not send key or other button events to it. Those will
685 * instead go to whatever focusable window is behind it. This flag
686 * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
687 * is explicitly set.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700688 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800689 * <p>Setting this flag also implies that the window will not need to
690 * interact with
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700691 * a soft input method, so it will be Z-ordered and positioned
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800692 * independently of any active input method (typically this means it
693 * gets Z-ordered on top of the input method, so it can use the full
694 * screen for its content and cover the input method if needed. You
695 * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
696 public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700697
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800698 /** Window flag: this window can never receive touch events. */
699 public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700700
John Spurlock33291d82013-03-13 14:45:14 -0400701 /** Window flag: even when this window is focusable (its
702 * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800703 * outside of the window to be sent to the windows behind it. Otherwise
704 * it will consume all pointer events itself, regardless of whether they
705 * are inside of the window. */
706 public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700707
John Spurlock33291d82013-03-13 14:45:14 -0400708 /** Window flag: when set, if the device is asleep when the touch
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 * screen is pressed, you will receive this first touch event. Usually
710 * the first touch event is consumed by the system since the user can
711 * not see what they are pressing on.
Jeff Brown037c33e2014-04-09 00:31:55 -0700712 *
713 * @deprecated This flag has no effect.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800714 */
Jeff Brown037c33e2014-04-09 00:31:55 -0700715 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800716 public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700717
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800718 /** Window flag: as long as this window is visible to the user, keep
719 * the device's screen turned on and bright. */
720 public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700721
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800722 /** Window flag: place the window within the entire screen, ignoring
John Spurlock33291d82013-03-13 14:45:14 -0400723 * decorations around the border (such as the status bar). The
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800724 * window must correctly position its contents to take the screen
725 * decoration into account. This flag is normally set for you
726 * by Window as described in {@link Window#setFlags}. */
727 public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700728
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800729 /** Window flag: allow window to extend outside of the screen. */
730 public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700731
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800732 /**
John Spurlock33291d82013-03-13 14:45:14 -0400733 * Window flag: hide all screen decorations (such as the status bar) while
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800734 * this window is displayed. This allows the window to use the entire
735 * display space for itself -- the status bar will be hidden when
Chet Haase45c89c22013-04-29 16:04:40 -0700736 * an app window with this flag set is on the top layer. A fullscreen window
737 * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's
738 * {@link #softInputMode} field; the window will stay fullscreen
739 * and will not resize.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800740 *
741 * <p>This flag can be controlled in your theme through the
742 * {@link android.R.attr#windowFullscreen} attribute; this attribute
743 * is automatically set for you in the standard fullscreen themes
744 * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen},
745 * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen},
746 * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen},
747 * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen},
748 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen},
749 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and
750 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p>
751 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800752 public static final int FLAG_FULLSCREEN = 0x00000400;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700753
John Spurlock33291d82013-03-13 14:45:14 -0400754 /** Window flag: override {@link #FLAG_FULLSCREEN} and force the
755 * screen decorations (such as the status bar) to be shown. */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800756 public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700757
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800758 /** Window flag: turn on dithering when compositing this window to
Jeff Brown3cc321e2012-07-16 16:04:23 -0700759 * the screen.
760 * @deprecated This flag is no longer used. */
761 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800762 public static final int FLAG_DITHER = 0x00001000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700763
John Spurlock33291d82013-03-13 14:45:14 -0400764 /** Window flag: treat the content of the window as secure, preventing
Jeff Brownf0681b32012-10-23 17:35:57 -0700765 * it from appearing in screenshots or from being viewed on non-secure
766 * displays.
767 *
768 * <p>See {@link android.view.Display#FLAG_SECURE} for more details about
769 * secure surfaces and secure displays.
770 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800771 public static final int FLAG_SECURE = 0x00002000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700772
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800773 /** Window flag: a special mode where the layout parameters are used
774 * to perform scaling of the surface when it is composited to the
775 * screen. */
776 public static final int FLAG_SCALED = 0x00004000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700777
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800778 /** Window flag: intended for windows that will often be used when the user is
779 * holding the screen against their face, it will aggressively filter the event
780 * stream to prevent unintended presses in this situation that may not be
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700781 * desired for a particular window, when such an event stream is detected, the
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800782 * application will receive a CANCEL motion event to indicate this so applications
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700783 * can handle this accordingly by taking no action on the event
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800784 * until the finger is released. */
785 public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700786
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800787 /** Window flag: a special option only for use in combination with
788 * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
789 * screen your window may appear on top of or behind screen decorations
790 * such as the status bar. By also including this flag, the window
791 * manager will report the inset rectangle needed to ensure your
792 * content is not covered by screen decorations. This flag is normally
793 * set for you by Window as described in {@link Window#setFlags}.*/
794 public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700795
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800796 /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
797 * respect to how this window interacts with the current method. That
798 * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
799 * window will behave as if it needs to interact with the input method
800 * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
801 * not set and this flag is set, then the window will behave as if it
802 * doesn't need to interact with the input method and can be placed
803 * to use more space and cover the input method.
804 */
805 public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700806
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800807 /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
808 * can set this flag to receive a single special MotionEvent with
809 * the action
810 * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
811 * touches that occur outside of your window. Note that you will not
812 * receive the full down/move/up gesture, only the location of the
813 * first down as an ACTION_OUTSIDE.
814 */
815 public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700816
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700817 /** Window flag: special flag to let windows be shown when the screen
818 * is locked. This will let application windows take precedence over
819 * key guard or any other lock screens. Can be used with
820 * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700821 * directly before showing the key guard window. Can be used with
822 * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
823 * non-secure keyguards. This flag only applies to the top-most
824 * full-screen window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700825 */
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700826 public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
827
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700828 /** Window flag: ask that the system wallpaper be shown behind
829 * your window. The window surface must be translucent to be able
830 * to actually see the wallpaper behind it; this flag just ensures
831 * that the wallpaper surface will be there if this window actually
832 * has translucent regions.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800833 *
834 * <p>This flag can be controlled in your theme through the
835 * {@link android.R.attr#windowShowWallpaper} attribute; this attribute
836 * is automatically set for you in the standard wallpaper themes
837 * such as {@link android.R.style#Theme_Wallpaper},
838 * {@link android.R.style#Theme_Wallpaper_NoTitleBar},
839 * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen},
840 * {@link android.R.style#Theme_Holo_Wallpaper},
841 * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar},
842 * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and
843 * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p>
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700844 */
845 public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700846
Dianne Hackborn93e462b2009-09-15 22:50:40 -0700847 /** Window flag: when set as a window is being added or made
848 * visible, once the window has been shown then the system will
849 * poke the power manager's user activity (as if the user had woken
850 * up the device) to turn the screen on. */
851 public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700852
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700853 /** Window flag: when set the window will cause the keyguard to
854 * be dismissed, only if it is not a secure lock keyguard. Because such
855 * a keyguard is not needed for security, it will never re-appear if
856 * the user navigates to another window (in contrast to
857 * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
858 * hide both secure and non-secure keyguards but ensure they reappear
859 * when the user moves to another UI that doesn't hide them).
860 * If the keyguard is currently active and is secure (requires an
861 * unlock pattern) than the user will still need to confirm it before
862 * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
Daniel Sandlerae069f72010-06-17 21:56:26 -0400863 * also been set.
864 */
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700865 public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700866
Jeff Brown01ce2e92010-09-26 22:20:12 -0700867 /** Window flag: when set the window will accept for touch events
868 * outside of its bounds to be sent to other windows that also
869 * support split touch. When this flag is not set, the first pointer
870 * that goes down determines the window to which all subsequent touches
871 * go until all pointers go up. When this flag is set, each pointer
872 * (not necessarily the first) that goes down determines the window
873 * to which all subsequent touches of that pointer will go until that
874 * pointer goes up thereby enabling touches with multiple pointers
875 * to be split across multiple windows.
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800876 */
Jeff Brown01ce2e92010-09-26 22:20:12 -0700877 public static final int FLAG_SPLIT_TOUCH = 0x00800000;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -0700878
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800879 /**
Romain Guy72f0a272011-01-09 16:01:46 -0800880 * <p>Indicates whether this window should be hardware accelerated.
881 * Requesting hardware acceleration does not guarantee it will happen.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800882 *
Romain Guy72f0a272011-01-09 16:01:46 -0800883 * <p>This flag can be controlled programmatically <em>only</em> to enable
884 * hardware acceleration. To enable hardware acceleration for a given
885 * window programmatically, do the following:</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800886 *
Romain Guy72f0a272011-01-09 16:01:46 -0800887 * <pre>
888 * Window w = activity.getWindow(); // in Activity's onCreate() for instance
889 * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
890 * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
891 * </pre>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800892 *
Romain Guy72f0a272011-01-09 16:01:46 -0800893 * <p>It is important to remember that this flag <strong>must</strong>
894 * be set before setting the content view of your activity or dialog.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800895 *
Romain Guy72f0a272011-01-09 16:01:46 -0800896 * <p>This flag cannot be used to disable hardware acceleration after it
897 * was enabled in your manifest using
898 * {@link android.R.attr#hardwareAccelerated}. If you need to selectively
899 * and programmatically disable hardware acceleration (for automated testing
900 * for instance), make sure it is turned off in your manifest and enable it
901 * on your activity or dialog when you need it instead, using the method
902 * described above.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800903 *
Romain Guy72f0a272011-01-09 16:01:46 -0800904 * <p>This flag is automatically set by the system if the
905 * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
906 * XML attribute is set to true on an activity or on the application.</p>
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800907 */
908 public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000;
Daniel Sandler611fae42010-06-17 10:45:00 -0400909
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800910 /**
911 * Window flag: allow window contents to extend in to the screen's
Dianne Hackbornc652de82013-02-15 16:32:56 -0800912 * overscan area, if there is one. The window should still correctly
913 * position its contents to take the overscan area into account.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800914 *
915 * <p>This flag can be controlled in your theme through the
916 * {@link android.R.attr#windowOverscan} attribute; this attribute
917 * is automatically set for you in the standard overscan themes
Ying Wang4e0eb222013-04-18 20:39:48 -0700918 * such as
Dianne Hackborn1bf1af62013-02-25 16:48:53 -0800919 * {@link android.R.style#Theme_Holo_NoActionBar_Overscan},
920 * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan},
921 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and
922 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p>
923 *
924 * <p>When this flag is enabled for a window, its normal content may be obscured
925 * to some degree by the overscan region of the display. To ensure key parts of
926 * that content are visible to the user, you can use
927 * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)}
928 * to set the point in the view hierarchy where the appropriate offsets should
929 * be applied. (This can be done either by directly calling this function, using
930 * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy,
931 * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect)
932 * View.fitSystemWindows(Rect)} method).</p>
933 *
934 * <p>This mechanism for positioning content elements is identical to its equivalent
935 * use with layout and {@link View#setSystemUiVisibility(int)
936 * View.setSystemUiVisibility(int)}; here is an example layout that will correctly
937 * position its UI elements with this overscan flag is set:</p>
938 *
939 * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete}
Dianne Hackbornc652de82013-02-15 16:32:56 -0800940 */
941 public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
942
John Spurlockbd957402013-10-03 11:38:39 -0400943 /**
944 * Window flag: request a translucent status bar with minimal system-provided
945 * background protection.
946 *
947 * <p>This flag can be controlled in your theme through the
948 * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute
949 * is automatically set for you in the standard translucent decor themes
950 * such as
951 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
952 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
953 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
954 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
955 *
956 * <p>When this flag is enabled for a window, it automatically sets
957 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
958 * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p>
959 */
960 public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000;
961
962 /**
963 * Window flag: request a translucent navigation bar with minimal system-provided
964 * background protection.
965 *
966 * <p>This flag can be controlled in your theme through the
967 * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute
968 * is automatically set for you in the standard translucent decor themes
969 * such as
970 * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor},
971 * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor},
972 * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and
973 * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p>
974 *
975 * <p>When this flag is enabled for a window, it automatically sets
976 * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
977 * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p>
978 */
979 public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000;
980
Adam Lesinski6a591f52013-10-01 18:11:17 -0700981 /**
982 * Flag for a window in local focus mode.
983 * Window in local focus mode can control focus independent of window manager using
984 * {@link Window#setLocalFocus(boolean, boolean)}.
985 * Usually window in this mode will not get touch/key events from window manager, but will
986 * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}.
987 */
988 public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000;
989
Jeff Brown98db5fa2011-06-08 15:37:10 -0700990 /** Window flag: Enable touches to slide out of a window into neighboring
991 * windows in mid-gesture instead of being captured for the duration of
992 * the gesture.
993 *
994 * This flag changes the behavior of touch focus for this window only.
995 * Touches can slide out of the window but they cannot necessarily slide
996 * back in (unless the other window with touch focus permits it).
997 *
998 * {@hide}
999 */
Adam Lesinski6a591f52013-10-01 18:11:17 -07001000 public static final int FLAG_SLIPPERY = 0x20000000;
Jeff Brown98db5fa2011-06-08 15:37:10 -07001001
Daniel Sandlere02d8082010-10-08 15:13:22 -04001002 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001003 * Window flag: When requesting layout with an attached window, the attached window may
1004 * overlap with the screen decorations of the parent window such as the navigation bar. By
1005 * including this flag, the window manager will layout the attached window within the decor
1006 * frame of the parent window such that it doesn't overlap with screen decorations.
Daniel Sandlere02d8082010-10-08 15:13:22 -04001007 */
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001008 public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000;
Daniel Sandlere02d8082010-10-08 15:13:22 -04001009
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001010 /**
Adrian Roos217ccd22014-05-09 14:29:04 +02001011 * Flag indicating that this Window is responsible for drawing the background for the
1012 * system bars. If set, the system bars are drawn with a transparent background and the
1013 * corresponding areas in this window are filled with the colors specified in
1014 * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}.
1015 */
1016 public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000;
1017
1018 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001019 * Various behavioral options/flags. Default is none.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001020 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001021 * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
1022 * @see #FLAG_DIM_BEHIND
1023 * @see #FLAG_NOT_FOCUSABLE
1024 * @see #FLAG_NOT_TOUCHABLE
1025 * @see #FLAG_NOT_TOUCH_MODAL
1026 * @see #FLAG_TOUCHABLE_WHEN_WAKING
1027 * @see #FLAG_KEEP_SCREEN_ON
1028 * @see #FLAG_LAYOUT_IN_SCREEN
1029 * @see #FLAG_LAYOUT_NO_LIMITS
1030 * @see #FLAG_FULLSCREEN
1031 * @see #FLAG_FORCE_NOT_FULLSCREEN
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001032 * @see #FLAG_SECURE
1033 * @see #FLAG_SCALED
1034 * @see #FLAG_IGNORE_CHEEK_PRESSES
1035 * @see #FLAG_LAYOUT_INSET_DECOR
1036 * @see #FLAG_ALT_FOCUSABLE_IM
1037 * @see #FLAG_WATCH_OUTSIDE_TOUCH
1038 * @see #FLAG_SHOW_WHEN_LOCKED
1039 * @see #FLAG_SHOW_WALLPAPER
1040 * @see #FLAG_TURN_SCREEN_ON
1041 * @see #FLAG_DISMISS_KEYGUARD
1042 * @see #FLAG_SPLIT_TOUCH
1043 * @see #FLAG_HARDWARE_ACCELERATED
keunyoung30f420f2013-08-02 14:23:10 -07001044 * @see #FLAG_LOCAL_FOCUS_MODE
Adrian Roos217ccd22014-05-09 14:29:04 +02001045 * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001046 */
1047 @ViewDebug.ExportedProperty(flagMapping = {
1048 @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON,
1049 name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"),
1050 @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND,
1051 name = "FLAG_DIM_BEHIND"),
1052 @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND,
1053 name = "FLAG_BLUR_BEHIND"),
1054 @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE,
1055 name = "FLAG_NOT_FOCUSABLE"),
1056 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE,
1057 name = "FLAG_NOT_TOUCHABLE"),
1058 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL,
1059 name = "FLAG_NOT_TOUCH_MODAL"),
1060 @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING,
1061 name = "FLAG_TOUCHABLE_WHEN_WAKING"),
1062 @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON,
1063 name = "FLAG_KEEP_SCREEN_ON"),
1064 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN,
1065 name = "FLAG_LAYOUT_IN_SCREEN"),
1066 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS,
1067 name = "FLAG_LAYOUT_NO_LIMITS"),
1068 @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN,
1069 name = "FLAG_FULLSCREEN"),
1070 @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN,
1071 name = "FLAG_FORCE_NOT_FULLSCREEN"),
1072 @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER,
1073 name = "FLAG_DITHER"),
1074 @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE,
1075 name = "FLAG_SECURE"),
1076 @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED,
1077 name = "FLAG_SCALED"),
1078 @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES,
1079 name = "FLAG_IGNORE_CHEEK_PRESSES"),
1080 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR,
1081 name = "FLAG_LAYOUT_INSET_DECOR"),
1082 @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM,
1083 name = "FLAG_ALT_FOCUSABLE_IM"),
1084 @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH,
1085 name = "FLAG_WATCH_OUTSIDE_TOUCH"),
1086 @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED,
1087 name = "FLAG_SHOW_WHEN_LOCKED"),
1088 @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER,
1089 name = "FLAG_SHOW_WALLPAPER"),
1090 @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON,
1091 name = "FLAG_TURN_SCREEN_ON"),
1092 @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD,
1093 name = "FLAG_DISMISS_KEYGUARD"),
1094 @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH,
1095 name = "FLAG_SPLIT_TOUCH"),
1096 @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED,
keunyoung30f420f2013-08-02 14:23:10 -07001097 name = "FLAG_HARDWARE_ACCELERATED"),
1098 @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE,
John Spurlockbd957402013-10-03 11:38:39 -04001099 name = "FLAG_LOCAL_FOCUS_MODE"),
1100 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS,
1101 name = "FLAG_TRANSLUCENT_STATUS"),
1102 @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION,
Adrian Roos217ccd22014-05-09 14:29:04 +02001103 name = "FLAG_TRANSLUCENT_NAVIGATION"),
1104 @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
1105 name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS")
Jon Miranda4597e982014-07-29 07:25:49 -07001106 }, formatToHexString = true)
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001107 public int flags;
1108
1109 /**
John Reck61375a82014-09-18 19:27:48 +00001110 * If the window has requested hardware acceleration, but this is not
1111 * allowed in the process it is in, then still render it as if it is
1112 * hardware accelerated. This is used for the starting preview windows
1113 * in the system process, which don't need to have the overhead of
1114 * hardware acceleration (they are just a static rendering), but should
1115 * be rendered as such to match the actual window of the app even if it
1116 * is hardware accelerated.
1117 * Even if the window isn't hardware accelerated, still do its rendering
1118 * as if it was.
1119 * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
1120 * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001121 * is generally disabled. This flag must be specified in addition to
John Reck61375a82014-09-18 19:27:48 +00001122 * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
1123 * windows.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001124 *
John Reck61375a82014-09-18 19:27:48 +00001125 * @hide
1126 */
1127 public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
1128
1129 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001130 * In the system process, we globally do not use hardware acceleration
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001131 * because there are many threads doing UI there and they conflict.
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001132 * If certain parts of the UI that really do want to use hardware
1133 * acceleration, this flag can be set to force it. This is basically
1134 * for the lock screen. Anyone else using it, you are probably wrong.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001135 *
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001136 * @hide
1137 */
1138 public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
1139
1140 /**
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001141 * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
Ken Wakasaf76a50c2012-03-09 19:56:35 +09001142 * may elect to skip these notifications if they are not doing anything productive with
Chet Haasea8e5a2b2011-10-28 13:18:16 -07001143 * them (they do not affect the wallpaper scrolling operation) by calling
1144 * {@link
1145 * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}.
1146 *
1147 * @hide
1148 */
1149 public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
1150
Craig Mautner88400d32012-09-30 12:35:45 -07001151 /** In a multiuser system if this flag is set and the owner is a system process then this
1152 * window will appear on all user screens. This overrides the default behavior of window
1153 * types that normally only appear on the owning user's screen. Refer to each window type
1154 * to determine its default behavior.
1155 *
1156 * {@hide} */
1157 public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
1158
Dianne Hackborn73ab6a42011-12-13 11:16:23 -08001159 /**
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001160 * Never animate position changes of the window.
1161 *
1162 * {@hide} */
1163 public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040;
1164
Adam Lesinski6a591f52013-10-01 18:11:17 -07001165 /** Window flag: special flag to limit the size of the window to be
1166 * original size ([320x480] x density). Used to create window for applications
1167 * running under compatibility mode.
1168 *
1169 * {@hide} */
1170 public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080;
1171
1172 /** Window flag: a special option intended for system dialogs. When
1173 * this flag is set, the window will demand focus unconditionally when
1174 * it is created.
1175 * {@hide} */
1176 public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;
1177
John Spurlock3f7cd512013-10-07 12:25:09 -04001178 /** Window flag: maintain the previous translucent decor state when this window
John Spurlockbd957402013-10-03 11:38:39 -04001179 * becomes top-most.
1180 * {@hide} */
1181 public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200;
1182
Dianne Hackborn1c5383c2013-04-15 15:07:21 -07001183 /**
Jorim Jaggi380ecb82014-03-14 17:25:20 +01001184 * Flag whether the current window is a keyguard window, meaning that it will hide all other
1185 * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set.
1186 * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1187 * {@hide}
1188 */
1189 public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400;
1190
1191 /**
Filip Gruszczynskib8c06942014-12-04 15:02:18 -08001192 * Flag that prevents the wallpaper behind the current window from receiving touch events.
1193 *
1194 * {@hide}
1195 */
1196 public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800;
1197
1198 /**
Selim Cinek4a4a2bddc2015-05-07 12:50:19 -07001199 * Flag to force the status bar window to be visible all the time. If the bar is hidden when
1200 * this flag is set it will be shown again and the bar will have a transparent background.
1201 * This can only be set by {@link LayoutParams#TYPE_STATUS_BAR}.
1202 *
1203 * {@hide}
1204 */
1205 public static final int PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT = 0x00001000;
1206
1207 /**
Robert Carr64aadd02015-11-06 13:54:20 -08001208 * Flag indicating that the x, y, width, and height members should be
Filip Gruszczynski1a4dfe52015-11-15 10:58:57 -08001209 * ignored (and thus their previous value preserved). For example
Robert Carr64aadd02015-11-06 13:54:20 -08001210 * because they are being managed externally through repositionChild.
1211 *
1212 * {@hide}
1213 */
1214 public static final int PRIVATE_FLAG_PRESERVE_GEOMETRY = 0x00002000;
1215
Filip Gruszczynski1a4dfe52015-11-15 10:58:57 -08001216 /**
1217 * Flag that will make window ignore app visibility and instead depend purely on the decor
1218 * view visibility for determining window visibility. This is used by recents to keep
1219 * drawing after it launches an app.
1220 * @hide
1221 */
1222 public static final int PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY = 0x00004000;
1223
Robert Carra1eb4392015-12-10 12:43:51 -08001224 /**
1225 * Flag to indicate that this window is not expected to be replaced across
1226 * configuration change triggered activity relaunches. In general the WindowManager
1227 * expects Windows to be replaced after relaunch, and thus it will preserve their surfaces
1228 * until the replacement is ready to show in order to prevent visual glitch. However
1229 * some windows, such as PopupWindows expect to be cleared across configuration change,
1230 * and thus should hint to the WindowManager that it should not wait for a replacement.
1231 * @hide
1232 */
1233 public static final int PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH = 0x00008000;
Robert Carr64aadd02015-11-06 13:54:20 -08001234
1235 /**
Wale Ogunwale8216eb22015-12-18 10:42:42 -08001236 * Flag to indicate that this child window should always be laid-out in the parent
1237 * frame regardless of the current windowing mode configuration.
1238 * @hide
1239 */
1240 public static final int PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME = 0x00010000;
1241
1242 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001243 * Control flags that are private to the platform.
1244 * @hide
1245 */
1246 public int privateFlags;
1247
1248 /**
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001249 * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it
1250 * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu
1251 * key. For this case, we should look at windows behind it to determine the appropriate
1252 * value.
1253 *
1254 * @hide
1255 */
1256 public static final int NEEDS_MENU_UNSET = 0;
1257
1258 /**
1259 * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a
1260 * menu key.
1261 *
1262 * @hide
1263 */
1264 public static final int NEEDS_MENU_SET_TRUE = 1;
1265
1266 /**
1267 * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't
1268 * needs a menu key.
1269 *
1270 * @hide
1271 */
1272 public static final int NEEDS_MENU_SET_FALSE = 2;
1273
1274 /**
1275 * State variable for a window belonging to an activity that responds to
1276 * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a
1277 * physical button this variable is ignored, but on devices where the Menu key is drawn in
1278 * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}.
1279 *
1280 * (Note that Action Bars, when available, are the preferred way to offer additional
1281 * functions otherwise accessed via an options menu.)
1282 *
1283 * {@hide}
1284 */
1285 public int needsMenuKey = NEEDS_MENU_UNSET;
1286
1287 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001288 * Given a particular set of window manager flags, determine whether
1289 * such a window may be a target for an input method when it has
1290 * focus. In particular, this checks the
1291 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
1292 * flags and returns true if the combination of the two corresponds
1293 * to a window that needs to be behind the input method so that the
1294 * user can type into it.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001295 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001296 * @param flags The current window manager flags.
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001297 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001298 * @return Returns true if such a window should be behind/interact
1299 * with an input method, false if not.
1300 */
1301 public static boolean mayUseInputMethod(int flags) {
1302 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
1303 case 0:
1304 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
1305 return true;
1306 }
1307 return false;
1308 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001309
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001310 /**
1311 * Mask for {@link #softInputMode} of the bits that determine the
1312 * desired visibility state of the soft input area for this window.
1313 */
1314 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001315
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001316 /**
1317 * Visibility state for {@link #softInputMode}: no state has been specified.
1318 */
1319 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001320
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001321 /**
1322 * Visibility state for {@link #softInputMode}: please don't change the state of
1323 * the soft input area.
1324 */
1325 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001326
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001327 /**
1328 * Visibility state for {@link #softInputMode}: please hide any soft input
1329 * area when normally appropriate (when the user is navigating
1330 * forward to your window).
1331 */
1332 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001333
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001334 /**
1335 * Visibility state for {@link #softInputMode}: please always hide any
1336 * soft input area when this window receives focus.
1337 */
1338 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001339
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001340 /**
1341 * Visibility state for {@link #softInputMode}: please show the soft
1342 * input area when normally appropriate (when the user is navigating
1343 * forward to your window).
1344 */
1345 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001346
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001347 /**
1348 * Visibility state for {@link #softInputMode}: please always make the
1349 * soft input area visible when this window receives input focus.
1350 */
1351 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001352
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001353 /**
1354 * Mask for {@link #softInputMode} of the bits that determine the
1355 * way that the window should be adjusted to accommodate the soft
1356 * input window.
1357 */
1358 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 /** Adjustment option for {@link #softInputMode}: nothing specified.
1361 * The system will try to pick one or
1362 * the other depending on the contents of the window.
1363 */
1364 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001365
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001366 /** Adjustment option for {@link #softInputMode}: set to allow the
1367 * window to be resized when an input
1368 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001369 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001370 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1371 * neither of these are set, then the system will try to pick one or
Chet Haase45c89c22013-04-29 16:04:40 -07001372 * the other depending on the contents of the window. If the window's
1373 * layout parameter flags include {@link #FLAG_FULLSCREEN}, this
1374 * value for {@link #softInputMode} will be ignored; the window will
1375 * not resize, but will stay fullscreen.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001376 */
1377 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001378
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001379 /** Adjustment option for {@link #softInputMode}: set to have a window
1380 * pan when an input method is
1381 * shown, so it doesn't need to deal with resizing but just panned
1382 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001383 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001384 * neither of these are set, then the system will try to pick one or
1385 * the other depending on the contents of the window.
1386 */
1387 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001388
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001389 /** Adjustment option for {@link #softInputMode}: set to have a window
1390 * not adjust for a shown input method. The window will not be resized,
1391 * and it will not be panned to make its focus visible.
1392 */
1393 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1394
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001395 /**
1396 * Bit for {@link #softInputMode}: set when the user has navigated
1397 * forward to the window. This is normally set automatically for
1398 * you by the system, though you may want to set it in certain cases
1399 * when you are displaying a window yourself. This flag will always
1400 * be cleared automatically after the window is displayed.
1401 */
1402 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001403
1404 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001405 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001406 * of:
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001407 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001408 * <ul>
1409 * <li> One of the visibility states
1410 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1411 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1412 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1413 * <li> One of the adjustment options
1414 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1415 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1416 * {@link #SOFT_INPUT_ADJUST_PAN}.
Dianne Hackborn1bf1af62013-02-25 16:48:53 -08001417 * </ul>
1418 *
1419 *
1420 * <p>This flag can be controlled in your theme through the
1421 * {@link android.R.attr#windowSoftInputMode} attribute.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001422 */
1423 public int softInputMode;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001424
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001425 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001426 * Placement of window within the screen as per {@link Gravity}. Both
1427 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1428 * android.graphics.Rect) Gravity.apply} and
1429 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1430 * Gravity.applyDisplay} are used during window layout, with this value
1431 * given as the desired gravity. For example you can specify
1432 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1433 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1434 * to control the behavior of
1435 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1436 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001437 *
1438 * @see Gravity
1439 */
1440 public int gravity;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001441
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001442 /**
1443 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001444 * between the container and the widget. See
1445 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1446 * android.graphics.Rect) Gravity.apply} for how this is used. This
1447 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001448 */
1449 public float horizontalMargin;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001450
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001451 /**
1452 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001453 * between the container and the widget. See
1454 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1455 * android.graphics.Rect) Gravity.apply} for how this is used. This
1456 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001457 */
1458 public float verticalMargin;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001459
1460 /**
1461 * Positive insets between the drawing surface and window content.
1462 *
1463 * @hide
1464 */
Alan Viverette3aa1ffb2014-10-30 12:22:08 -07001465 public final Rect surfaceInsets = new Rect();
Alan Viverette5435a302015-01-29 10:25:34 -08001466
1467 /**
1468 * Whether the surface insets have been manually set. When set to
1469 * {@code false}, the view root will automatically determine the
1470 * appropriate surface insets.
1471 *
1472 * @see #surfaceInsets
1473 * @hide
1474 */
1475 public boolean hasManualSurfaceInsets;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001476
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001477 /**
1478 * The desired bitmap format. May be one of the constants in
1479 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1480 */
1481 public int format;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001482
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001483 /**
1484 * A style resource defining the animations to use for this window.
1485 * This must be a system resource; it can not be an application resource
1486 * because the window manager does not have access to applications.
1487 */
1488 public int windowAnimations;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001489
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001490 /**
1491 * An alpha value to apply to this entire window.
1492 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1493 */
1494 public float alpha = 1.0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001495
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001496 /**
1497 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1498 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1499 * dim.
1500 */
1501 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001502
1503 /**
1504 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1505 * indicating that the brightness value is not overridden for this window
1506 * and normal brightness policy should be used.
1507 */
1508 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1509
1510 /**
1511 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1512 * indicating that the screen or button backlight brightness should be set
1513 * to the lowest value when this window is in front.
1514 */
1515 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1516
1517 /**
1518 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1519 * indicating that the screen or button backlight brightness should be set
1520 * to the hightest value when this window is in front.
1521 */
1522 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001523
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001524 /**
1525 * This can be used to override the user's preferred brightness of
1526 * the screen. A value of less than 0, the default, means to use the
1527 * preferred screen brightness. 0 to 1 adjusts the brightness from
1528 * dark to full bright.
1529 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001530 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001531
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001532 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001533 * This can be used to override the standard behavior of the button and
1534 * keyboard backlights. A value of less than 0, the default, means to
1535 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1536 * from dark to full bright.
1537 */
1538 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1539
1540 /**
Craig Mautner3c174372013-02-21 17:54:37 -08001541 * Value for {@link #rotationAnimation} to define the animation used to
1542 * specify that this window will rotate in or out following a rotation.
1543 */
1544 public static final int ROTATION_ANIMATION_ROTATE = 0;
1545
1546 /**
1547 * Value for {@link #rotationAnimation} to define the animation used to
1548 * specify that this window will fade in or out following a rotation.
1549 */
1550 public static final int ROTATION_ANIMATION_CROSSFADE = 1;
1551
1552 /**
1553 * Value for {@link #rotationAnimation} to define the animation used to
1554 * specify that this window will immediately disappear or appear following
1555 * a rotation.
1556 */
1557 public static final int ROTATION_ANIMATION_JUMPCUT = 2;
1558
1559 /**
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001560 * Define the exit and entry animations used on this window when the device is rotated.
1561 * This only has an affect if the incoming and outgoing topmost
Craig Mautner3c174372013-02-21 17:54:37 -08001562 * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001563 * by other windows. All other situations default to the
1564 * {@link #ROTATION_ANIMATION_ROTATE} behavior.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001565 *
Craig Mautner3c174372013-02-21 17:54:37 -08001566 * @see #ROTATION_ANIMATION_ROTATE
1567 * @see #ROTATION_ANIMATION_CROSSFADE
1568 * @see #ROTATION_ANIMATION_JUMPCUT
1569 */
1570 public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
1571
1572 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001573 * Identifier for this window. This will usually be filled in for
1574 * you.
1575 */
1576 public IBinder token = null;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001577
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001578 /**
1579 * Name of the package owning this window.
1580 */
1581 public String packageName = null;
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001582
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001583 /**
1584 * Specific orientation value for a window.
1585 * May be any of the same values allowed
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001586 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1587 * If not set, a default value of
1588 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001589 * will be used.
1590 */
1591 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001592
1593 /**
Michael Wright3f145a22014-07-22 19:46:03 -07001594 * The preferred refresh rate for the window.
1595 *
1596 * This must be one of the supported refresh rates obtained for the display(s) the window
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001597 * is on. The selected refresh rate will be applied to the display's default mode.
1598 *
1599 * This value is ignored if {@link #preferredDisplayModeId} is set.
Michael Wright3f145a22014-07-22 19:46:03 -07001600 *
1601 * @see Display#getSupportedRefreshRates()
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001602 * @deprecated use {@link #preferredDisplayModeId} instead
Michael Wright3f145a22014-07-22 19:46:03 -07001603 */
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001604 @Deprecated
Michael Wright3f145a22014-07-22 19:46:03 -07001605 public float preferredRefreshRate;
1606
1607 /**
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001608 * Id of the preferred display mode for the window.
1609 * <p>
1610 * This must be one of the supported modes obtained for the display(s) the window is on.
1611 * A value of {@code 0} means no preference.
1612 *
1613 * @see Display#getSupportedModes()
1614 * @see Display.Mode#getModeId()
1615 */
1616 public int preferredDisplayModeId;
1617
1618 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001619 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001620 *
1621 * @see View#STATUS_BAR_VISIBLE
1622 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001623 */
1624 public int systemUiVisibility;
1625
1626 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001627 * @hide
1628 * The ui visibility as requested by the views in this hierarchy.
1629 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1630 */
1631 public int subtreeSystemUiVisibility;
1632
1633 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001634 * Get callbacks about the system ui visibility changing.
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001635 *
Joe Onorato664644d2011-01-23 17:53:23 -08001636 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1637 *
1638 * @hide
1639 */
1640 public boolean hasSystemUiListeners;
1641
Jeff Brown474dcb52011-06-14 20:22:50 -07001642 /**
1643 * When this window has focus, disable touch pad pointer gesture processing.
1644 * The window will receive raw position updates from the touch pad instead
1645 * of pointer movements and synthetic touch events.
1646 *
1647 * @hide
1648 */
1649 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1650
1651 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001652 * Does not construct an input channel for this window. The channel will therefore
1653 * be incapable of receiving input.
1654 *
1655 * @hide
1656 */
1657 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1658
1659 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001660 * When this window has focus, does not call user activity for all input events so
1661 * the application will have to do it itself. Should only be used by
1662 * the keyguard and phone app.
1663 * <p>
1664 * Should only be used by the keyguard and phone app.
1665 * </p>
1666 *
1667 * @hide
1668 */
1669 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1670
1671 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001672 * Control special features of the input subsystem.
1673 *
Craig Mautnerbdcc9a52013-04-19 13:06:53 -07001674 * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001675 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001676 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001677 * @hide
1678 */
1679 public int inputFeatures;
1680
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001681 /**
1682 * Sets the number of milliseconds before the user activity timeout occurs
1683 * when this window has focus. A value of -1 uses the standard timeout.
1684 * A value of 0 uses the minimum support display timeout.
1685 * <p>
1686 * This property can only be used to reduce the user specified display timeout;
1687 * it can never make the timeout longer than it normally would be.
1688 * </p><p>
1689 * Should only be used by the keyguard and phone app.
1690 * </p>
1691 *
1692 * @hide
1693 */
1694 public long userActivityTimeout = -1;
1695
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001696 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001697 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001698 type = TYPE_APPLICATION;
1699 format = PixelFormat.OPAQUE;
1700 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001701
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001702 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001703 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001704 type = _type;
1705 format = PixelFormat.OPAQUE;
1706 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001707
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001708 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001709 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001710 type = _type;
1711 flags = _flags;
1712 format = PixelFormat.OPAQUE;
1713 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001715 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001716 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001717 type = _type;
1718 flags = _flags;
1719 format = _format;
1720 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001721
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001722 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1723 super(w, h);
1724 type = _type;
1725 flags = _flags;
1726 format = _format;
1727 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001728
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001729 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1730 int _flags, int _format) {
1731 super(w, h);
1732 x = xpos;
1733 y = ypos;
1734 type = _type;
1735 flags = _flags;
1736 format = _format;
1737 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001738
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001739 public final void setTitle(CharSequence title) {
1740 if (null == title)
1741 title = "";
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001742
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001743 mTitle = TextUtils.stringOrSpannedString(title);
1744 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001745
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001746 public final CharSequence getTitle() {
Wale Ogunwaleb6e2ead2016-02-15 08:28:47 -08001747 return mTitle != null ? mTitle : "";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001748 }
Bryce Lee53b9fbd2015-02-06 12:06:34 -08001749
1750 /** @hide */
1751 @SystemApi
1752 public final void setUserActivityTimeout(long timeout) {
1753 userActivityTimeout = timeout;
1754 }
1755
1756 /** @hide */
1757 @SystemApi
1758 public final long getUserActivityTimeout() {
1759 return userActivityTimeout;
1760 }
1761
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001762 public int describeContents() {
1763 return 0;
1764 }
1765
1766 public void writeToParcel(Parcel out, int parcelableFlags) {
1767 out.writeInt(width);
1768 out.writeInt(height);
1769 out.writeInt(x);
1770 out.writeInt(y);
1771 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001772 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001773 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001774 out.writeInt(softInputMode);
1775 out.writeInt(gravity);
1776 out.writeFloat(horizontalMargin);
1777 out.writeFloat(verticalMargin);
1778 out.writeInt(format);
1779 out.writeInt(windowAnimations);
1780 out.writeFloat(alpha);
1781 out.writeFloat(dimAmount);
1782 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001783 out.writeFloat(buttonBrightness);
Craig Mautner3c174372013-02-21 17:54:37 -08001784 out.writeInt(rotationAnimation);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001785 out.writeStrongBinder(token);
1786 out.writeString(packageName);
1787 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1788 out.writeInt(screenOrientation);
Michael Wright3f145a22014-07-22 19:46:03 -07001789 out.writeFloat(preferredRefreshRate);
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001790 out.writeInt(preferredDisplayModeId);
Joe Onorato664644d2011-01-23 17:53:23 -08001791 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001792 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001793 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001794 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001795 out.writeLong(userActivityTimeout);
Alan Viverette49a22e82014-07-12 20:01:27 -07001796 out.writeInt(surfaceInsets.left);
1797 out.writeInt(surfaceInsets.top);
1798 out.writeInt(surfaceInsets.right);
1799 out.writeInt(surfaceInsets.bottom);
Alan Viverette5435a302015-01-29 10:25:34 -08001800 out.writeInt(hasManualSurfaceInsets ? 1 : 0);
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001801 out.writeInt(needsMenuKey);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001802 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001803
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001804 public static final Parcelable.Creator<LayoutParams> CREATOR
1805 = new Parcelable.Creator<LayoutParams>() {
1806 public LayoutParams createFromParcel(Parcel in) {
1807 return new LayoutParams(in);
1808 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001809
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001810 public LayoutParams[] newArray(int size) {
1811 return new LayoutParams[size];
1812 }
1813 };
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001814
1815
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001816 public LayoutParams(Parcel in) {
1817 width = in.readInt();
1818 height = in.readInt();
1819 x = in.readInt();
1820 y = in.readInt();
1821 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001822 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001823 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001824 softInputMode = in.readInt();
1825 gravity = in.readInt();
1826 horizontalMargin = in.readFloat();
1827 verticalMargin = in.readFloat();
1828 format = in.readInt();
1829 windowAnimations = in.readInt();
1830 alpha = in.readFloat();
1831 dimAmount = in.readFloat();
1832 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001833 buttonBrightness = in.readFloat();
Craig Mautner3c174372013-02-21 17:54:37 -08001834 rotationAnimation = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001835 token = in.readStrongBinder();
1836 packageName = in.readString();
1837 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1838 screenOrientation = in.readInt();
Michael Wright3f145a22014-07-22 19:46:03 -07001839 preferredRefreshRate = in.readFloat();
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001840 preferredDisplayModeId = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001841 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001842 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001843 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001844 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001845 userActivityTimeout = in.readLong();
Alan Viverette49a22e82014-07-12 20:01:27 -07001846 surfaceInsets.left = in.readInt();
1847 surfaceInsets.top = in.readInt();
1848 surfaceInsets.right = in.readInt();
1849 surfaceInsets.bottom = in.readInt();
Alan Viverette5435a302015-01-29 10:25:34 -08001850 hasManualSurfaceInsets = in.readInt() != 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001851 needsMenuKey = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001852 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001853
Romain Guy72998072009-06-22 11:09:20 -07001854 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001855 public static final int LAYOUT_CHANGED = 1<<0;
1856 public static final int TYPE_CHANGED = 1<<1;
1857 public static final int FLAGS_CHANGED = 1<<2;
1858 public static final int FORMAT_CHANGED = 1<<3;
1859 public static final int ANIMATION_CHANGED = 1<<4;
1860 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1861 public static final int TITLE_CHANGED = 1<<6;
1862 public static final int ALPHA_CHANGED = 1<<7;
1863 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1864 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1865 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1866 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Craig Mautner3c174372013-02-21 17:54:37 -08001867 public static final int ROTATION_ANIMATION_CHANGED = 1<<12;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001868 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001869 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13;
Joe Onorato664644d2011-01-23 17:53:23 -08001870 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001871 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14;
Joe Onorato664644d2011-01-23 17:53:23 -08001872 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001873 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15;
Jeff Brown474dcb52011-06-14 20:22:50 -07001874 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001875 public static final int INPUT_FEATURES_CHANGED = 1<<16;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001876 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001877 public static final int PRIVATE_FLAGS_CHANGED = 1<<17;
Romain Guyf21c9b02011-09-06 16:56:54 -07001878 /** {@hide} */
Craig Mautner3c174372013-02-21 17:54:37 -08001879 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18;
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001880 /** {@hide} */
John Spurlockbd957402013-10-03 11:38:39 -04001881 public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
1882 /** {@hide} */
Alan Viverette49a22e82014-07-12 20:01:27 -07001883 public static final int SURFACE_INSETS_CHANGED = 1<<20;
Alan Viveretteccb11e12014-07-08 16:04:02 -07001884 /** {@hide} */
Michael Wright3f145a22014-07-22 19:46:03 -07001885 public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
1886 /** {@hide} */
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001887 public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22;
1888 /** {@hide} */
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001889 public static final int PREFERRED_DISPLAY_MODE_ID = 1 << 23;
1890 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001891 public static final int EVERYTHING_CHANGED = 0xffffffff;
1892
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001893 // internal buffer to backup/restore parameters under compatibility mode.
1894 private int[] mCompatibilityParamsBackup = null;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001895
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001896 public final int copyFrom(LayoutParams o) {
1897 int changes = 0;
Wale Ogunwale393b1c12014-10-18 16:22:01 -07001898
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001899 if (width != o.width) {
1900 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001901 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001902 }
1903 if (height != o.height) {
1904 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001905 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001906 }
1907 if (x != o.x) {
1908 x = o.x;
1909 changes |= LAYOUT_CHANGED;
1910 }
1911 if (y != o.y) {
1912 y = o.y;
1913 changes |= LAYOUT_CHANGED;
1914 }
1915 if (horizontalWeight != o.horizontalWeight) {
1916 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001917 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001918 }
1919 if (verticalWeight != o.verticalWeight) {
1920 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001921 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001922 }
1923 if (horizontalMargin != o.horizontalMargin) {
1924 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001925 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001926 }
1927 if (verticalMargin != o.verticalMargin) {
1928 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001929 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001930 }
1931 if (type != o.type) {
1932 type = o.type;
1933 changes |= TYPE_CHANGED;
1934 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001935 if (flags != o.flags) {
John Spurlockbd957402013-10-03 11:38:39 -04001936 final int diff = flags ^ o.flags;
1937 if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) {
1938 changes |= TRANSLUCENT_FLAGS_CHANGED;
1939 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001940 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001941 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001942 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001943 if (privateFlags != o.privateFlags) {
1944 privateFlags = o.privateFlags;
1945 changes |= PRIVATE_FLAGS_CHANGED;
1946 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001947 if (softInputMode != o.softInputMode) {
1948 softInputMode = o.softInputMode;
1949 changes |= SOFT_INPUT_MODE_CHANGED;
1950 }
1951 if (gravity != o.gravity) {
1952 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001953 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001954 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001955 if (format != o.format) {
1956 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001957 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001958 }
1959 if (windowAnimations != o.windowAnimations) {
1960 windowAnimations = o.windowAnimations;
1961 changes |= ANIMATION_CHANGED;
1962 }
1963 if (token == null) {
1964 // NOTE: token only copied if the recipient doesn't
1965 // already have one.
1966 token = o.token;
1967 }
1968 if (packageName == null) {
1969 // NOTE: packageName only copied if the recipient doesn't
1970 // already have one.
1971 packageName = o.packageName;
1972 }
Wale Ogunwale1f240c92016-02-22 18:04:58 -08001973 if (!Objects.equals(mTitle, o.mTitle) && o.mTitle != null) {
Wale Ogunwaleb6e2ead2016-02-15 08:28:47 -08001974 // NOTE: mTitle only copied if the originator set one.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001975 mTitle = o.mTitle;
1976 changes |= TITLE_CHANGED;
1977 }
1978 if (alpha != o.alpha) {
1979 alpha = o.alpha;
1980 changes |= ALPHA_CHANGED;
1981 }
1982 if (dimAmount != o.dimAmount) {
1983 dimAmount = o.dimAmount;
1984 changes |= DIM_AMOUNT_CHANGED;
1985 }
1986 if (screenBrightness != o.screenBrightness) {
1987 screenBrightness = o.screenBrightness;
1988 changes |= SCREEN_BRIGHTNESS_CHANGED;
1989 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001990 if (buttonBrightness != o.buttonBrightness) {
1991 buttonBrightness = o.buttonBrightness;
1992 changes |= BUTTON_BRIGHTNESS_CHANGED;
1993 }
Craig Mautner3c174372013-02-21 17:54:37 -08001994 if (rotationAnimation != o.rotationAnimation) {
1995 rotationAnimation = o.rotationAnimation;
1996 changes |= ROTATION_ANIMATION_CHANGED;
1997 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07001998
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001999 if (screenOrientation != o.screenOrientation) {
2000 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07002001 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002002 }
Romain Guy529b60a2010-08-03 18:05:47 -07002003
Michael Wright3f145a22014-07-22 19:46:03 -07002004 if (preferredRefreshRate != o.preferredRefreshRate) {
2005 preferredRefreshRate = o.preferredRefreshRate;
2006 changes |= PREFERRED_REFRESH_RATE_CHANGED;
2007 }
2008
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07002009 if (preferredDisplayModeId != o.preferredDisplayModeId) {
2010 preferredDisplayModeId = o.preferredDisplayModeId;
2011 changes |= PREFERRED_DISPLAY_MODE_ID;
2012 }
2013
Joe Onorato14782f72011-01-25 19:53:17 -08002014 if (systemUiVisibility != o.systemUiVisibility
2015 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08002016 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08002017 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08002018 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
2019 }
2020
2021 if (hasSystemUiListeners != o.hasSystemUiListeners) {
2022 hasSystemUiListeners = o.hasSystemUiListeners;
2023 changes |= SYSTEM_UI_LISTENER_CHANGED;
2024 }
2025
Jeff Brown474dcb52011-06-14 20:22:50 -07002026 if (inputFeatures != o.inputFeatures) {
2027 inputFeatures = o.inputFeatures;
2028 changes |= INPUT_FEATURES_CHANGED;
2029 }
2030
Jeff Brown1e3b98d2012-09-30 18:58:59 -07002031 if (userActivityTimeout != o.userActivityTimeout) {
2032 userActivityTimeout = o.userActivityTimeout;
2033 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
2034 }
2035
Alan Viverette49a22e82014-07-12 20:01:27 -07002036 if (!surfaceInsets.equals(o.surfaceInsets)) {
2037 surfaceInsets.set(o.surfaceInsets);
2038 changes |= SURFACE_INSETS_CHANGED;
Alan Viveretteccb11e12014-07-08 16:04:02 -07002039 }
2040
Alan Viverette5435a302015-01-29 10:25:34 -08002041 if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) {
2042 hasManualSurfaceInsets = o.hasManualSurfaceInsets;
2043 changes |= SURFACE_INSETS_CHANGED;
2044 }
2045
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002046 if (needsMenuKey != o.needsMenuKey) {
2047 needsMenuKey = o.needsMenuKey;
2048 changes |= NEEDS_MENU_KEY_CHANGED;
2049 }
2050
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002051 return changes;
2052 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002053
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002054 @Override
2055 public String debug(String output) {
2056 output += "Contents of " + this + ":";
2057 Log.d("Debug", output);
2058 output = super.debug("");
2059 Log.d("Debug", output);
2060 Log.d("Debug", "");
2061 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
2062 return "";
2063 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07002064
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002065 @Override
2066 public String toString() {
2067 StringBuilder sb = new StringBuilder(256);
2068 sb.append("WM.LayoutParams{");
2069 sb.append("(");
2070 sb.append(x);
2071 sb.append(',');
2072 sb.append(y);
2073 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08002074 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002075 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08002076 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002077 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07002078 if (horizontalMargin != 0) {
2079 sb.append(" hm=");
2080 sb.append(horizontalMargin);
2081 }
2082 if (verticalMargin != 0) {
2083 sb.append(" vm=");
2084 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002085 }
2086 if (gravity != 0) {
2087 sb.append(" gr=#");
2088 sb.append(Integer.toHexString(gravity));
2089 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07002090 if (softInputMode != 0) {
2091 sb.append(" sim=#");
2092 sb.append(Integer.toHexString(softInputMode));
2093 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002094 sb.append(" ty=");
2095 sb.append(type);
2096 sb.append(" fl=#");
2097 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07002098 if (privateFlags != 0) {
Adam Lesinski95c42972013-10-02 10:13:27 -07002099 if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
2100 sb.append(" compatible=true");
2101 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07002102 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
2103 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002104 if (format != PixelFormat.OPAQUE) {
2105 sb.append(" fmt=");
2106 sb.append(format);
2107 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002108 if (windowAnimations != 0) {
2109 sb.append(" wanim=0x");
2110 sb.append(Integer.toHexString(windowAnimations));
2111 }
2112 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
2113 sb.append(" or=");
2114 sb.append(screenOrientation);
2115 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07002116 if (alpha != 1.0f) {
2117 sb.append(" alpha=");
2118 sb.append(alpha);
2119 }
2120 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
2121 sb.append(" sbrt=");
2122 sb.append(screenBrightness);
2123 }
2124 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
2125 sb.append(" bbrt=");
2126 sb.append(buttonBrightness);
2127 }
Craig Mautner3c174372013-02-21 17:54:37 -08002128 if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
2129 sb.append(" rotAnim=");
2130 sb.append(rotationAnimation);
2131 }
Michael Wright3f145a22014-07-22 19:46:03 -07002132 if (preferredRefreshRate != 0) {
2133 sb.append(" preferredRefreshRate=");
2134 sb.append(preferredRefreshRate);
2135 }
P.Y. Laligandb3b9eb32015-05-11 15:02:07 -07002136 if (preferredDisplayModeId != 0) {
2137 sb.append(" preferredDisplayMode=");
2138 sb.append(preferredDisplayModeId);
2139 }
Joe Onorato664644d2011-01-23 17:53:23 -08002140 if (systemUiVisibility != 0) {
2141 sb.append(" sysui=0x");
2142 sb.append(Integer.toHexString(systemUiVisibility));
2143 }
Joe Onorato14782f72011-01-25 19:53:17 -08002144 if (subtreeSystemUiVisibility != 0) {
2145 sb.append(" vsysui=0x");
2146 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
2147 }
Joe Onorato664644d2011-01-23 17:53:23 -08002148 if (hasSystemUiListeners) {
2149 sb.append(" sysuil=");
2150 sb.append(hasSystemUiListeners);
2151 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07002152 if (inputFeatures != 0) {
2153 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
2154 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07002155 if (userActivityTimeout >= 0) {
2156 sb.append(" userActivityTimeout=").append(userActivityTimeout);
2157 }
Andreas Gampe007cfa72015-03-15 14:19:43 -07002158 if (surfaceInsets.left != 0 || surfaceInsets.top != 0 || surfaceInsets.right != 0 ||
Andreas Gampe11090062015-03-16 09:45:34 -07002159 surfaceInsets.bottom != 0 || hasManualSurfaceInsets) {
Alan Viverette49a22e82014-07-12 20:01:27 -07002160 sb.append(" surfaceInsets=").append(surfaceInsets);
Alan Viverette5435a302015-01-29 10:25:34 -08002161 if (hasManualSurfaceInsets) {
2162 sb.append(" (manual)");
2163 }
Alan Viveretteccb11e12014-07-08 16:04:02 -07002164 }
Wale Ogunwale393b1c12014-10-18 16:22:01 -07002165 if (needsMenuKey != NEEDS_MENU_UNSET) {
2166 sb.append(" needsMenuKey=");
2167 sb.append(needsMenuKey);
2168 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002169 sb.append('}');
2170 return sb.toString();
2171 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002172
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002173 /**
2174 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002175 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002176 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002177 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002178 x = (int) (x * scale + 0.5f);
2179 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002180 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002181 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002182 }
2183 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07002184 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07002185 }
2186 }
2187
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002188 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002189 * Backup the layout parameters used in compatibility mode.
2190 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002191 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002192 void backup() {
2193 int[] backup = mCompatibilityParamsBackup;
2194 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07002195 // we backup 4 elements, x, y, width, height
2196 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002197 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002198 backup[0] = x;
2199 backup[1] = y;
2200 backup[2] = width;
2201 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07002202 }
2203
2204 /**
2205 * Restore the layout params' coordinates, size and gravity
2206 * @see LayoutParams#backup()
2207 */
2208 void restore() {
2209 int[] backup = mCompatibilityParamsBackup;
2210 if (backup != null) {
2211 x = backup[0];
2212 y = backup[1];
2213 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07002214 height = backup[3];
2215 }
2216 }
2217
Wale Ogunwaleb6e2ead2016-02-15 08:28:47 -08002218 private CharSequence mTitle = null;
Siva Velusamy0d857b92015-04-22 10:23:56 -07002219
2220 /** @hide */
2221 @Override
2222 protected void encodeProperties(@NonNull ViewHierarchyEncoder encoder) {
2223 super.encodeProperties(encoder);
2224
2225 encoder.addProperty("x", x);
2226 encoder.addProperty("y", y);
2227 encoder.addProperty("horizontalWeight", horizontalWeight);
2228 encoder.addProperty("verticalWeight", verticalWeight);
2229 encoder.addProperty("type", type);
2230 encoder.addProperty("flags", flags);
2231 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002232 }
2233}