blob: d2365614a738f24f18d37bcb88d2934f79c02a92 [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
Jeff Browna492c3a2012-08-23 19:48:44 -070019import android.app.Presentation;
20import android.content.Context;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import android.content.pm.ActivityInfo;
22import android.graphics.PixelFormat;
23import android.os.IBinder;
24import android.os.Parcel;
25import android.os.Parcelable;
26import android.text.TextUtils;
27import android.util.Log;
28
29
30/**
31 * The interface that apps use to talk to the window manager.
32 * <p>
33 * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these.
Jeff Browna492c3a2012-08-23 19:48:44 -070034 * </p><p>
35 * Each window manager instance is bound to a particular {@link Display}.
36 * To obtain a {@link WindowManager} for a different display, use
37 * {@link Context#createDisplayContext} to obtain a {@link Context} for that
38 * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code>
39 * to get the WindowManager.
40 * </p><p>
41 * The simplest way to show a window on another display is to create a
42 * {@link Presentation}. The presentation will automatically obtain a
43 * {@link WindowManager} and {@link Context} for that display.
44 * </p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045 *
46 * @see android.content.Context#getSystemService
47 * @see android.content.Context#WINDOW_SERVICE
48 */
49public interface WindowManager extends ViewManager {
50 /**
51 * Exception that is thrown when trying to add view whose
52 * {@link WindowManager.LayoutParams} {@link WindowManager.LayoutParams#token}
53 * is invalid.
54 */
55 public static class BadTokenException extends RuntimeException {
56 public BadTokenException() {
57 }
58
59 public BadTokenException(String name) {
60 super(name);
61 }
62 }
63
64 /**
Craig Mautner6018aee2012-10-23 14:27:49 -070065 * Exception that is thrown when calling {@link #addView} to a secondary display that cannot
66 * be found. See {@link android.app.Presentation} for more information on secondary displays.
67 */
68 public static class InvalidDisplayException extends RuntimeException {
69 public InvalidDisplayException() {
70 }
71
72 public InvalidDisplayException(String name) {
73 super(name);
74 }
75 }
76
77 /**
Jeff Browna492c3a2012-08-23 19:48:44 -070078 * Returns the {@link Display} upon which this {@link WindowManager} instance
79 * will create new windows.
80 * <p>
81 * Despite the name of this method, the display that is returned is not
82 * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}).
83 * The returned display could instead be a secondary display that this
84 * window manager instance is managing. Think of it as the display that
85 * this {@link WindowManager} instance uses by default.
86 * </p><p>
87 * To create windows on a different display, you need to obtain a
88 * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager}
89 * class documentation for more information.)
90 * </p>
91 *
92 * @return The display that this window manager is managing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 */
94 public Display getDefaultDisplay();
Jeff Browna492c3a2012-08-23 19:48:44 -070095
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 /**
97 * Special variation of {@link #removeView} that immediately invokes
98 * the given view hierarchy's {@link View#onDetachedFromWindow()
99 * View.onDetachedFromWindow()} methods before returning. This is not
100 * for normal applications; using it correctly requires great care.
101 *
102 * @param view The view to be removed.
103 */
104 public void removeViewImmediate(View view);
Jeff Brownd32460c2012-07-20 16:15:36 -0700105
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800106 public static class LayoutParams extends ViewGroup.LayoutParams
107 implements Parcelable {
108 /**
109 * X position for this window. With the default gravity it is ignored.
Fabrice Di Meglio9e3b0022011-06-06 16:30:29 -0700110 * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or
111 * {@link Gravity#END} it provides an offset from the given edge.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 */
Romain Guy529b60a2010-08-03 18:05:47 -0700113 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114 public int x;
115
116 /**
117 * Y position for this window. With the default gravity it is ignored.
118 * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
119 * an offset from the given edge.
120 */
Romain Guy529b60a2010-08-03 18:05:47 -0700121 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800122 public int y;
123
124 /**
125 * Indicates how much of the extra space will be allocated horizontally
126 * to the view associated with these LayoutParams. Specify 0 if the view
127 * should not be stretched. Otherwise the extra pixels will be pro-rated
128 * among all views whose weight is greater than 0.
129 */
Romain Guy529b60a2010-08-03 18:05:47 -0700130 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 public float horizontalWeight;
132
133 /**
134 * Indicates how much of the extra space will be allocated vertically
135 * to the view associated with these LayoutParams. Specify 0 if the view
136 * should not be stretched. Otherwise the extra pixels will be pro-rated
137 * among all views whose weight is greater than 0.
138 */
Romain Guy529b60a2010-08-03 18:05:47 -0700139 @ViewDebug.ExportedProperty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800140 public float verticalWeight;
Romain Guy529b60a2010-08-03 18:05:47 -0700141
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 /**
143 * The general type of window. There are three main classes of
144 * window types:
145 * <ul>
146 * <li> <strong>Application windows</strong> (ranging from
147 * {@link #FIRST_APPLICATION_WINDOW} to
148 * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
149 * windows. For these types of windows, the {@link #token} must be
150 * set to the token of the activity they are a part of (this will
151 * normally be done for you if {@link #token} is null).
152 * <li> <strong>Sub-windows</strong> (ranging from
153 * {@link #FIRST_SUB_WINDOW} to
154 * {@link #LAST_SUB_WINDOW}) are associated with another top-level
155 * window. For these types of windows, the {@link #token} must be
156 * the token of the window it is attached to.
157 * <li> <strong>System windows</strong> (ranging from
158 * {@link #FIRST_SYSTEM_WINDOW} to
159 * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
160 * use by the system for specific purposes. They should not normally
161 * be used by applications, and a special permission is required
162 * to use them.
163 * </ul>
164 *
165 * @see #TYPE_BASE_APPLICATION
166 * @see #TYPE_APPLICATION
167 * @see #TYPE_APPLICATION_STARTING
168 * @see #TYPE_APPLICATION_PANEL
169 * @see #TYPE_APPLICATION_MEDIA
170 * @see #TYPE_APPLICATION_SUB_PANEL
171 * @see #TYPE_APPLICATION_ATTACHED_DIALOG
172 * @see #TYPE_STATUS_BAR
173 * @see #TYPE_SEARCH_BAR
174 * @see #TYPE_PHONE
175 * @see #TYPE_SYSTEM_ALERT
176 * @see #TYPE_KEYGUARD
177 * @see #TYPE_TOAST
178 * @see #TYPE_SYSTEM_OVERLAY
179 * @see #TYPE_PRIORITY_PHONE
180 * @see #TYPE_STATUS_BAR_PANEL
181 * @see #TYPE_SYSTEM_DIALOG
182 * @see #TYPE_KEYGUARD_DIALOG
183 * @see #TYPE_SYSTEM_ERROR
184 * @see #TYPE_INPUT_METHOD
185 * @see #TYPE_INPUT_METHOD_DIALOG
186 */
Joe Onorato8f2bd432010-03-25 11:45:28 -0700187 @ViewDebug.ExportedProperty(mapping = {
188 @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
189 @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
190 @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
191 @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
192 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
193 @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
194 @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700195 @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700196 @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"),
197 @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"),
198 @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"),
199 @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"),
200 @ViewDebug.IntToString(from = TYPE_KEYGUARD, to = "TYPE_KEYGUARD"),
201 @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"),
202 @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"),
203 @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"),
Joe Onorato8f2bd432010-03-25 11:45:28 -0700204 @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"),
205 @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"),
206 @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
207 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
Jeff Brown3b2b3542010-10-15 00:54:27 -0700208 @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700209 @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
210 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700211 @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
Jeff Brownbfcb60a2011-09-08 18:51:14 -0700212 @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
213 @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
214 @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
215 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
216 @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
Scott Andersonaeb77232012-05-31 18:55:54 -0700217 @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"),
218 @ViewDebug.IntToString(from = TYPE_HIDDEN_NAV_CONSUMER, to = "TYPE_HIDDEN_NAV_CONSUMER"),
219 @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"),
Jeff Brownbd6e1502012-08-28 03:27:37 -0700220 @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"),
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700221 @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"),
222 @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY")
Joe Onorato8f2bd432010-03-25 11:45:28 -0700223 })
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800224 public int type;
225
226 /**
227 * Start of window types that represent normal application windows.
228 */
229 public static final int FIRST_APPLICATION_WINDOW = 1;
230
231 /**
232 * Window type: an application window that serves as the "base" window
233 * of the overall application; all other application windows will
234 * appear on top of it.
Craig Mautner5962b122012-10-05 14:45:52 -0700235 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800236 */
237 public static final int TYPE_BASE_APPLICATION = 1;
238
239 /**
240 * Window type: a normal application window. The {@link #token} must be
241 * an Activity token identifying who the window belongs to.
Craig Mautner5962b122012-10-05 14:45:52 -0700242 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800243 */
244 public static final int TYPE_APPLICATION = 2;
245
246 /**
247 * Window type: special application window that is displayed while the
248 * application is starting. Not for use by applications themselves;
249 * this is used by the system to display something until the
250 * application can show its own windows.
Craig Mautner5962b122012-10-05 14:45:52 -0700251 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800252 */
253 public static final int TYPE_APPLICATION_STARTING = 3;
254
255 /**
256 * End of types of application windows.
257 */
258 public static final int LAST_APPLICATION_WINDOW = 99;
259
260 /**
261 * Start of types of sub-windows. The {@link #token} of these windows
262 * must be set to the window they are attached to. These types of
263 * windows are kept next to their attached window in Z-order, and their
264 * coordinate space is relative to their attached window.
265 */
266 public static final int FIRST_SUB_WINDOW = 1000;
267
268 /**
269 * Window type: a panel on top of an application window. These windows
270 * appear on top of their attached window.
271 */
272 public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
273
274 /**
275 * Window type: window for showing media (e.g. video). These windows
276 * are displayed behind their attached window.
277 */
278 public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1;
279
280 /**
281 * Window type: a sub-panel on top of an application window. These
282 * windows are displayed on top their attached window and any
283 * {@link #TYPE_APPLICATION_PANEL} panels.
284 */
285 public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW+2;
286
287 /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
288 * of the window happens as that of a top-level window, <em>not</em>
289 * as a child of its container.
290 */
291 public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3;
292
293 /**
Dianne Hackbornc4d5d022009-05-21 17:32:42 -0700294 * Window type: window for showing overlays on top of media windows.
295 * These windows are displayed between TYPE_APPLICATION_MEDIA and the
296 * application window. They should be translucent to be useful. This
297 * is a big ugly hack so:
298 * @hide
299 */
300 public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4;
301
302 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800303 * End of types of sub-windows.
304 */
305 public static final int LAST_SUB_WINDOW = 1999;
306
307 /**
308 * Start of system-specific window types. These are not normally
309 * created by applications.
310 */
311 public static final int FIRST_SYSTEM_WINDOW = 2000;
312
313 /**
314 * Window type: the status bar. There can be only one status bar
315 * window; it is placed at the top of the screen, and all other
316 * windows are shifted down so they are below it.
Craig Mautner88400d32012-09-30 12:35:45 -0700317 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800318 */
319 public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
320
321 /**
322 * Window type: the search bar. There can be only one search bar
323 * window; it is placed at the top of the screen.
Craig Mautner88400d32012-09-30 12:35:45 -0700324 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800325 */
326 public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
327
328 /**
329 * Window type: phone. These are non-application windows providing
330 * user interaction with the phone (in particular incoming calls).
331 * These windows are normally placed above all applications, but behind
332 * the status bar.
Craig Mautner88400d32012-09-30 12:35:45 -0700333 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800334 */
335 public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
336
337 /**
338 * Window type: system window, such as low power alert. These windows
339 * are always on top of application windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700340 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 */
342 public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
343
344 /**
345 * Window type: keyguard window.
Craig Mautner88400d32012-09-30 12:35:45 -0700346 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800347 */
348 public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
349
350 /**
351 * Window type: transient notifications.
Craig Mautner88400d32012-09-30 12:35:45 -0700352 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800353 */
354 public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
355
356 /**
357 * Window type: system overlay windows, which need to be displayed
358 * on top of everything else. These windows must not take input
359 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700360 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800361 */
362 public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
363
364 /**
365 * Window type: priority phone UI, which needs to be displayed even if
366 * the keyguard is active. These windows must not take input
367 * focus, or they will interfere with the keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700368 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800369 */
370 public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
371
372 /**
373 * Window type: panel that slides out from the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700374 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800375 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800376 public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
377
378 /**
379 * Window type: dialogs that the keyguard shows
Craig Mautner88400d32012-09-30 12:35:45 -0700380 * In multiuser systems shows on all users' windows.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 */
382 public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
383
384 /**
385 * Window type: internal system error windows, appear on top of
386 * everything they can.
Craig Mautner88400d32012-09-30 12:35:45 -0700387 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800388 */
389 public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
390
391 /**
392 * Window type: internal input methods windows, which appear above
393 * the normal UI. Application windows may be resized or panned to keep
394 * the input focus visible while this window is displayed.
Craig Mautner88400d32012-09-30 12:35:45 -0700395 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800396 */
397 public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11;
398
399 /**
400 * Window type: internal input methods dialog windows, which appear above
401 * the current input method window.
Craig Mautner88400d32012-09-30 12:35:45 -0700402 * In multiuser systems shows only on the owning user's window.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800403 */
404 public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
405
406 /**
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700407 * Window type: wallpaper window, placed behind any window that wants
408 * to sit on top of the wallpaper.
Craig Mautner88400d32012-09-30 12:35:45 -0700409 * In multiuser systems shows only on the owning user's window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700410 */
411 public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13;
412
413 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800414 * Window type: panel that slides out from over the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700415 * In multiuser systems shows on all users' windows.
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800416 */
417 public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14;
Jeff Brown3b2b3542010-10-15 00:54:27 -0700418
419 /**
420 * Window type: secure system overlay windows, which need to be displayed
421 * on top of everything else. These windows must not take input
422 * focus, or they will interfere with the keyguard.
423 *
424 * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
425 * system itself is allowed to create these overlays. Applications cannot
426 * obtain permission to create secure system overlays.
Craig Mautner88400d32012-09-30 12:35:45 -0700427 *
428 * In multiuser systems shows only on the owning user's window.
Jeff Brown3b2b3542010-10-15 00:54:27 -0700429 * @hide
430 */
431 public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
432
Dianne Hackbornbadc47e2009-11-08 17:37:07 -0800433 /**
Christopher Tatea53146c2010-09-07 11:57:52 -0700434 * Window type: the drag-and-drop pseudowindow. There is only one
435 * drag layer (at most), and it is placed on top of all other windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700436 * In multiuser systems shows only on the owning user's window.
Christopher Tatea53146c2010-09-07 11:57:52 -0700437 * @hide
438 */
Jeff Brown3b2b3542010-10-15 00:54:27 -0700439 public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16;
Christopher Tatea53146c2010-09-07 11:57:52 -0700440
441 /**
Joe Onorato29fc2c92010-11-24 10:26:50 -0800442 * Window type: panel that slides out from under the status bar
Craig Mautner88400d32012-09-30 12:35:45 -0700443 * In multiuser systems shows on all users' windows.
Joe Onoratoa89e9032010-11-24 11:13:44 -0800444 * @hide
Joe Onorato29fc2c92010-11-24 10:26:50 -0800445 */
446 public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
447
Jeff Brown83c09682010-12-23 17:50:18 -0800448 /**
449 * Window type: (mouse) pointer
Craig Mautner88400d32012-09-30 12:35:45 -0700450 * In multiuser systems shows on all users' windows.
Jeff Brown83c09682010-12-23 17:50:18 -0800451 * @hide
452 */
453 public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
Joe Onorato29fc2c92010-11-24 10:26:50 -0800454
455 /**
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400456 * Window type: Navigation bar (when distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700457 * In multiuser systems shows on all users' windows.
Daniel Sandler8956dbb2011-04-22 07:55:02 -0400458 * @hide
459 */
460 public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
461
462 /**
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700463 * Window type: The volume level overlay/dialog shown when the user
464 * changes the system volume.
Craig Mautner88400d32012-09-30 12:35:45 -0700465 * In multiuser systems shows on all users' windows.
Dianne Hackborne8ecde12011-08-03 18:55:19 -0700466 * @hide
467 */
468 public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
469
470 /**
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700471 * Window type: The boot progress dialog, goes on top of everything
472 * in the world.
Craig Mautner88400d32012-09-30 12:35:45 -0700473 * In multiuser systems shows on all users' windows.
Dianne Hackborn29aae6f2011-08-18 18:30:09 -0700474 * @hide
475 */
476 public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
477
478 /**
Dianne Hackborndf89e652011-10-06 22:35:11 -0700479 * Window type: Fake window to consume touch events when the navigation
480 * bar is hidden.
Craig Mautner88400d32012-09-30 12:35:45 -0700481 * In multiuser systems shows on all users' windows.
Dianne Hackborndf89e652011-10-06 22:35:11 -0700482 * @hide
483 */
484 public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22;
485
486 /**
Daniel Sandler7d276c32012-01-30 14:33:52 -0500487 * Window type: Dreams (screen saver) window, just above keyguard.
Craig Mautner88400d32012-09-30 12:35:45 -0700488 * In multiuser systems shows only on the owning user's window.
Daniel Sandler7d276c32012-01-30 14:33:52 -0500489 * @hide
490 */
491 public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
492
493 /**
Jim Millere898ac52012-04-06 17:10:57 -0700494 * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
Craig Mautner88400d32012-09-30 12:35:45 -0700495 * In multiuser systems shows on all users' windows.
Jim Millere898ac52012-04-06 17:10:57 -0700496 * @hide
497 */
498 public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
499
500 /**
Dianne Hackborna4b7f2f2012-05-21 11:28:41 -0700501 * Window type: Behind the universe of the real windows.
Craig Mautner88400d32012-09-30 12:35:45 -0700502 * In multiuser systems shows on all users' windows.
Dianne Hackborna4b7f2f2012-05-21 11:28:41 -0700503 * @hide
504 */
505 public static final int TYPE_UNIVERSE_BACKGROUND = FIRST_SYSTEM_WINDOW+25;
506
507 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -0700508 * Window type: Display overlay window. Used to simulate secondary display devices.
Craig Mautner88400d32012-09-30 12:35:45 -0700509 * In multiuser systems shows on all users' windows.
Jeff Brownbd6e1502012-08-28 03:27:37 -0700510 * @hide
511 */
512 public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
513
514 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700515 * Window type: Magnification overlay window. Used to highlight the magnified
516 * portion of a display when accessibility magnification is enabled.
Craig Mautner88400d32012-09-30 12:35:45 -0700517 * In multiuser systems shows on all users' windows.
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -0700518 * @hide
519 */
520 public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
521
522 /**
Craig Mautner88400d32012-09-30 12:35:45 -0700523 * Window type: Recents. Same layer as {@link #TYPE_SYSTEM_DIALOG} but only appears on
524 * one user's screen.
525 * In multiuser systems shows on all users' windows.
526 * @hide
527 */
528 public static final int TYPE_RECENTS_OVERLAY = FIRST_SYSTEM_WINDOW+28;
529
530 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800531 * End of types of system windows.
532 */
533 public static final int LAST_SYSTEM_WINDOW = 2999;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534
Mathias Agopiand2112302010-12-07 19:38:17 -0800535 /** @deprecated this is ignored, this value is set automatically when needed. */
536 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800537 public static final int MEMORY_TYPE_NORMAL = 0;
Mathias Agopiand2112302010-12-07 19:38:17 -0800538 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700539 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800540 public static final int MEMORY_TYPE_HARDWARE = 1;
Mathias Agopiand2112302010-12-07 19:38:17 -0800541 /** @deprecated this is ignored, this value is set automatically when needed. */
Mathias Agopian317a6282009-08-13 17:29:02 -0700542 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800543 public static final int MEMORY_TYPE_GPU = 2;
Mathias Agopiand2112302010-12-07 19:38:17 -0800544 /** @deprecated this is ignored, this value is set automatically when needed. */
545 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700547
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800548 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700549 * @deprecated this is ignored
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800550 */
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700551 @Deprecated
552 public int memoryType;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800553
Mike Lockwoodef731622010-01-27 17:51:34 -0500554 /** Window flag: as long as this window is visible to the user, allow
555 * the lock screen to activate while the screen is on.
556 * This can be used independently, or in combination with
Christopher Tate95f78502010-01-29 15:57:34 -0800557 * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
Mike Lockwoodef731622010-01-27 17:51:34 -0500558 public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
559
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800560 /** Window flag: everything behind this window will be dimmed.
561 * Use {@link #dimAmount} to control the amount of dim. */
562 public static final int FLAG_DIM_BEHIND = 0x00000002;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700563
564 /** Window flag: blur everything behind this window.
565 * @deprecated Blurring is no longer supported. */
566 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800567 public static final int FLAG_BLUR_BEHIND = 0x00000004;
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700568
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800569 /** Window flag: this window won't ever get key input focus, so the
570 * user can not send key or other button events to it. Those will
571 * instead go to whatever focusable window is behind it. This flag
572 * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
573 * is explicitly set.
574 *
575 * <p>Setting this flag also implies that the window will not need to
576 * interact with
577 * a soft input method, so it will be Z-ordered and positioned
578 * independently of any active input method (typically this means it
579 * gets Z-ordered on top of the input method, so it can use the full
580 * screen for its content and cover the input method if needed. You
581 * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
582 public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
583
584 /** Window flag: this window can never receive touch events. */
585 public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
586
587 /** Window flag: Even when this window is focusable (its
588 * {@link #FLAG_NOT_FOCUSABLE is not set), allow any pointer events
589 * outside of the window to be sent to the windows behind it. Otherwise
590 * it will consume all pointer events itself, regardless of whether they
591 * are inside of the window. */
592 public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
593
594 /** Window flag: When set, if the device is asleep when the touch
595 * screen is pressed, you will receive this first touch event. Usually
596 * the first touch event is consumed by the system since the user can
597 * not see what they are pressing on.
598 */
599 public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
600
601 /** Window flag: as long as this window is visible to the user, keep
602 * the device's screen turned on and bright. */
603 public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
604
605 /** Window flag: place the window within the entire screen, ignoring
606 * decorations around the border (a.k.a. the status bar). The
607 * window must correctly position its contents to take the screen
608 * decoration into account. This flag is normally set for you
609 * by Window as described in {@link Window#setFlags}. */
610 public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
611
612 /** Window flag: allow window to extend outside of the screen. */
613 public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
614
615 /** Window flag: Hide all screen decorations (e.g. status bar) while
616 * this window is displayed. This allows the window to use the entire
617 * display space for itself -- the status bar will be hidden when
618 * an app window with this flag set is on the top layer. */
619 public static final int FLAG_FULLSCREEN = 0x00000400;
620
621 /** Window flag: Override {@link #FLAG_FULLSCREEN and force the
622 * screen decorations (such as status bar) to be shown. */
623 public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
624
625 /** Window flag: turn on dithering when compositing this window to
Jeff Brown3cc321e2012-07-16 16:04:23 -0700626 * the screen.
627 * @deprecated This flag is no longer used. */
628 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800629 public static final int FLAG_DITHER = 0x00001000;
630
Jeff Brownf0681b32012-10-23 17:35:57 -0700631 /** Window flag: Treat the content of the window as secure, preventing
632 * it from appearing in screenshots or from being viewed on non-secure
633 * displays.
634 *
635 * <p>See {@link android.view.Display#FLAG_SECURE} for more details about
636 * secure surfaces and secure displays.
637 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800638 public static final int FLAG_SECURE = 0x00002000;
639
640 /** Window flag: a special mode where the layout parameters are used
641 * to perform scaling of the surface when it is composited to the
642 * screen. */
643 public static final int FLAG_SCALED = 0x00004000;
644
645 /** Window flag: intended for windows that will often be used when the user is
646 * holding the screen against their face, it will aggressively filter the event
647 * stream to prevent unintended presses in this situation that may not be
648 * desired for a particular window, when such an event stream is detected, the
649 * application will receive a CANCEL motion event to indicate this so applications
650 * can handle this accordingly by taking no action on the event
651 * until the finger is released. */
652 public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
653
654 /** Window flag: a special option only for use in combination with
655 * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
656 * screen your window may appear on top of or behind screen decorations
657 * such as the status bar. By also including this flag, the window
658 * manager will report the inset rectangle needed to ensure your
659 * content is not covered by screen decorations. This flag is normally
660 * set for you by Window as described in {@link Window#setFlags}.*/
661 public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
662
663 /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
664 * respect to how this window interacts with the current method. That
665 * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
666 * window will behave as if it needs to interact with the input method
667 * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
668 * not set and this flag is set, then the window will behave as if it
669 * doesn't need to interact with the input method and can be placed
670 * to use more space and cover the input method.
671 */
672 public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
673
674 /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
675 * can set this flag to receive a single special MotionEvent with
676 * the action
677 * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
678 * touches that occur outside of your window. Note that you will not
679 * receive the full down/move/up gesture, only the location of the
680 * first down as an ACTION_OUTSIDE.
681 */
682 public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
683
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700684 /** Window flag: special flag to let windows be shown when the screen
685 * is locked. This will let application windows take precedence over
686 * key guard or any other lock screens. Can be used with
687 * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700688 * directly before showing the key guard window. Can be used with
689 * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss
690 * non-secure keyguards. This flag only applies to the top-most
691 * full-screen window.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700692 */
Suchi Amalapurapud1a93372009-05-14 17:54:31 -0700693 public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
694
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700695 /** Window flag: ask that the system wallpaper be shown behind
696 * your window. The window surface must be translucent to be able
697 * to actually see the wallpaper behind it; this flag just ensures
698 * that the wallpaper surface will be there if this window actually
699 * has translucent regions.
700 */
701 public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
702
Dianne Hackborn93e462b2009-09-15 22:50:40 -0700703 /** Window flag: when set as a window is being added or made
704 * visible, once the window has been shown then the system will
705 * poke the power manager's user activity (as if the user had woken
706 * up the device) to turn the screen on. */
707 public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
708
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700709 /** Window flag: when set the window will cause the keyguard to
710 * be dismissed, only if it is not a secure lock keyguard. Because such
711 * a keyguard is not needed for security, it will never re-appear if
712 * the user navigates to another window (in contrast to
713 * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
714 * hide both secure and non-secure keyguards but ensure they reappear
715 * when the user moves to another UI that doesn't hide them).
716 * If the keyguard is currently active and is secure (requires an
717 * unlock pattern) than the user will still need to confirm it before
718 * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
Daniel Sandlerae069f72010-06-17 21:56:26 -0400719 * also been set.
720 */
Dianne Hackborn9bfb7072009-09-22 11:37:40 -0700721 public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
Jeff Brown01ce2e92010-09-26 22:20:12 -0700722
723 /** Window flag: when set the window will accept for touch events
724 * outside of its bounds to be sent to other windows that also
725 * support split touch. When this flag is not set, the first pointer
726 * that goes down determines the window to which all subsequent touches
727 * go until all pointers go up. When this flag is set, each pointer
728 * (not necessarily the first) that goes down determines the window
729 * to which all subsequent touches of that pointer will go until that
730 * pointer goes up thereby enabling touches with multiple pointers
731 * to be split across multiple windows.
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800732 */
Jeff Brown01ce2e92010-09-26 22:20:12 -0700733 public static final int FLAG_SPLIT_TOUCH = 0x00800000;
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800734
735 /**
Romain Guy72f0a272011-01-09 16:01:46 -0800736 * <p>Indicates whether this window should be hardware accelerated.
737 * Requesting hardware acceleration does not guarantee it will happen.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800738 *
Romain Guy72f0a272011-01-09 16:01:46 -0800739 * <p>This flag can be controlled programmatically <em>only</em> to enable
740 * hardware acceleration. To enable hardware acceleration for a given
741 * window programmatically, do the following:</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800742 *
Romain Guy72f0a272011-01-09 16:01:46 -0800743 * <pre>
744 * Window w = activity.getWindow(); // in Activity's onCreate() for instance
745 * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
746 * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
747 * </pre>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800748 *
Romain Guy72f0a272011-01-09 16:01:46 -0800749 * <p>It is important to remember that this flag <strong>must</strong>
750 * be set before setting the content view of your activity or dialog.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800751 *
Romain Guy72f0a272011-01-09 16:01:46 -0800752 * <p>This flag cannot be used to disable hardware acceleration after it
753 * was enabled in your manifest using
754 * {@link android.R.attr#hardwareAccelerated}. If you need to selectively
755 * and programmatically disable hardware acceleration (for automated testing
756 * for instance), make sure it is turned off in your manifest and enable it
757 * on your activity or dialog when you need it instead, using the method
758 * described above.</p>
Dianne Hackbornc652de82013-02-15 16:32:56 -0800759 *
Romain Guy72f0a272011-01-09 16:01:46 -0800760 * <p>This flag is automatically set by the system if the
761 * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated}
762 * XML attribute is set to true on an activity or on the application.</p>
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800763 */
764 public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000;
Daniel Sandler611fae42010-06-17 10:45:00 -0400765
Dianne Hackbornc652de82013-02-15 16:32:56 -0800766 /** Window flag: allow window contents to extend in to the screen's
767 * overscan area, if there is one. The window should still correctly
768 * position its contents to take the overscan area into account.
769 */
770 public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
771
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800772 // ----- HIDDEN FLAGS.
773 // These start at the high bit and go down.
Jeff Brown98db5fa2011-06-08 15:37:10 -0700774
775 /** Window flag: Enable touches to slide out of a window into neighboring
776 * windows in mid-gesture instead of being captured for the duration of
777 * the gesture.
778 *
779 * This flag changes the behavior of touch focus for this window only.
780 * Touches can slide out of the window but they cannot necessarily slide
781 * back in (unless the other window with touch focus permits it).
782 *
783 * {@hide}
784 */
785 public static final int FLAG_SLIPPERY = 0x04000000;
786
Daniel Sandlere02d8082010-10-08 15:13:22 -0400787 /**
788 * Flag for a window belonging to an activity that responds to {@link KeyEvent#KEYCODE_MENU}
789 * and therefore needs a Menu key. For devices where Menu is a physical button this flag is
790 * ignored, but on devices where the Menu key is drawn in software it may be hidden unless
791 * this flag is set.
792 *
793 * (Note that Action Bars, when available, are the preferred way to offer additional
794 * functions otherwise accessed via an options menu.)
795 *
796 * {@hide}
797 */
Dianne Hackbornd9b3b7e2010-11-16 18:22:49 -0800798 public static final int FLAG_NEEDS_MENU_KEY = 0x08000000;
Daniel Sandlere02d8082010-10-08 15:13:22 -0400799
Mitsuru Oshima1ecf5d22009-07-06 17:20:38 -0700800 /** Window flag: special flag to limit the size of the window to be
801 * original size ([320x480] x density). Used to create window for applications
802 * running under compatibility mode.
803 *
804 * {@hide} */
Dianne Hackborn4c62fc02009-08-08 20:40:27 -0700805 public static final int FLAG_COMPATIBLE_WINDOW = 0x20000000;
Mitsuru Oshima1ecf5d22009-07-06 17:20:38 -0700806
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800807 /** Window flag: a special option intended for system dialogs. When
808 * this flag is set, the window will demand focus unconditionally when
809 * it is created.
810 * {@hide} */
811 public static final int FLAG_SYSTEM_ERROR = 0x40000000;
812
813 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700814 * Various behavioral options/flags. Default is none.
815 *
816 * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
817 * @see #FLAG_DIM_BEHIND
818 * @see #FLAG_NOT_FOCUSABLE
819 * @see #FLAG_NOT_TOUCHABLE
820 * @see #FLAG_NOT_TOUCH_MODAL
821 * @see #FLAG_TOUCHABLE_WHEN_WAKING
822 * @see #FLAG_KEEP_SCREEN_ON
823 * @see #FLAG_LAYOUT_IN_SCREEN
824 * @see #FLAG_LAYOUT_NO_LIMITS
825 * @see #FLAG_FULLSCREEN
826 * @see #FLAG_FORCE_NOT_FULLSCREEN
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700827 * @see #FLAG_SECURE
828 * @see #FLAG_SCALED
829 * @see #FLAG_IGNORE_CHEEK_PRESSES
830 * @see #FLAG_LAYOUT_INSET_DECOR
831 * @see #FLAG_ALT_FOCUSABLE_IM
832 * @see #FLAG_WATCH_OUTSIDE_TOUCH
833 * @see #FLAG_SHOW_WHEN_LOCKED
834 * @see #FLAG_SHOW_WALLPAPER
835 * @see #FLAG_TURN_SCREEN_ON
836 * @see #FLAG_DISMISS_KEYGUARD
837 * @see #FLAG_SPLIT_TOUCH
838 * @see #FLAG_HARDWARE_ACCELERATED
839 */
840 @ViewDebug.ExportedProperty(flagMapping = {
841 @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON,
842 name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"),
843 @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND,
844 name = "FLAG_DIM_BEHIND"),
845 @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND,
846 name = "FLAG_BLUR_BEHIND"),
847 @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE,
848 name = "FLAG_NOT_FOCUSABLE"),
849 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE,
850 name = "FLAG_NOT_TOUCHABLE"),
851 @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL,
852 name = "FLAG_NOT_TOUCH_MODAL"),
853 @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING,
854 name = "FLAG_TOUCHABLE_WHEN_WAKING"),
855 @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON,
856 name = "FLAG_KEEP_SCREEN_ON"),
857 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN,
858 name = "FLAG_LAYOUT_IN_SCREEN"),
859 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS,
860 name = "FLAG_LAYOUT_NO_LIMITS"),
861 @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN,
862 name = "FLAG_FULLSCREEN"),
863 @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN,
864 name = "FLAG_FORCE_NOT_FULLSCREEN"),
865 @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER,
866 name = "FLAG_DITHER"),
867 @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE,
868 name = "FLAG_SECURE"),
869 @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED,
870 name = "FLAG_SCALED"),
871 @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES,
872 name = "FLAG_IGNORE_CHEEK_PRESSES"),
873 @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR,
874 name = "FLAG_LAYOUT_INSET_DECOR"),
875 @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM,
876 name = "FLAG_ALT_FOCUSABLE_IM"),
877 @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH,
878 name = "FLAG_WATCH_OUTSIDE_TOUCH"),
879 @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED,
880 name = "FLAG_SHOW_WHEN_LOCKED"),
881 @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER,
882 name = "FLAG_SHOW_WALLPAPER"),
883 @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON,
884 name = "FLAG_TURN_SCREEN_ON"),
885 @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD,
886 name = "FLAG_DISMISS_KEYGUARD"),
887 @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH,
888 name = "FLAG_SPLIT_TOUCH"),
889 @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED,
890 name = "FLAG_HARDWARE_ACCELERATED")
891 })
892 public int flags;
893
894 /**
895 * If the window has requested hardware acceleration, but this is not
896 * allowed in the process it is in, then still render it as if it is
897 * hardware accelerated. This is used for the starting preview windows
898 * in the system process, which don't need to have the overhead of
899 * hardware acceleration (they are just a static rendering), but should
Ken Wakasaf76a50c2012-03-09 19:56:35 +0900900 * be rendered as such to match the actual window of the app even if it
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700901 * is hardware accelerated.
902 * Even if the window isn't hardware accelerated, still do its rendering
Ken Wakasaf76a50c2012-03-09 19:56:35 +0900903 * as if it was.
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700904 * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
905 * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
906 * is generally disabled. This flag must be specified in addition to
907 * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
908 * windows.
909 *
910 * @hide
911 */
912 public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
913
914 /**
915 * In the system process, we globally do not use hardware acceleration
Ken Wakasaf76a50c2012-03-09 19:56:35 +0900916 * because there are many threads doing UI there and they conflict.
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700917 * If certain parts of the UI that really do want to use hardware
918 * acceleration, this flag can be set to force it. This is basically
919 * for the lock screen. Anyone else using it, you are probably wrong.
920 *
921 * @hide
922 */
923 public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
924
925 /**
Chet Haasea8e5a2b2011-10-28 13:18:16 -0700926 * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
Ken Wakasaf76a50c2012-03-09 19:56:35 +0900927 * may elect to skip these notifications if they are not doing anything productive with
Chet Haasea8e5a2b2011-10-28 13:18:16 -0700928 * them (they do not affect the wallpaper scrolling operation) by calling
929 * {@link
930 * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}.
931 *
932 * @hide
933 */
934 public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
935
936 /**
Dianne Hackborn73ab6a42011-12-13 11:16:23 -0800937 * This is set for a window that has explicitly specified its
938 * FLAG_NEEDS_MENU_KEY, so we know the value on this window is the
939 * appropriate one to use. If this is not set, we should look at
940 * windows behind it to determine the appropriate value.
941 *
942 * @hide
943 */
944 public static final int PRIVATE_FLAG_SET_NEEDS_MENU_KEY = 0x00000008;
945
Craig Mautner88400d32012-09-30 12:35:45 -0700946 /** In a multiuser system if this flag is set and the owner is a system process then this
947 * window will appear on all user screens. This overrides the default behavior of window
948 * types that normally only appear on the owning user's screen. Refer to each window type
949 * to determine its default behavior.
950 *
951 * {@hide} */
952 public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
953
Dianne Hackborn73ab6a42011-12-13 11:16:23 -0800954 /**
Dianne Hackborn891d3fb2013-01-09 18:31:37 -0800955 * Special flag for the volume overlay: force the window manager out of "hide nav bar"
956 * mode while the window is on screen.
957 *
958 * {@hide} */
959 public static final int PRIVATE_FLAG_FORCE_SHOW_NAV_BAR = 0x00000020;
960
961 /**
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700962 * Control flags that are private to the platform.
963 * @hide
964 */
965 public int privateFlags;
966
967 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800968 * Given a particular set of window manager flags, determine whether
969 * such a window may be a target for an input method when it has
970 * focus. In particular, this checks the
971 * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
972 * flags and returns true if the combination of the two corresponds
973 * to a window that needs to be behind the input method so that the
974 * user can type into it.
975 *
976 * @param flags The current window manager flags.
977 *
978 * @return Returns true if such a window should be behind/interact
979 * with an input method, false if not.
980 */
981 public static boolean mayUseInputMethod(int flags) {
982 switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
983 case 0:
984 case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
985 return true;
986 }
987 return false;
988 }
989
990 /**
991 * Mask for {@link #softInputMode} of the bits that determine the
992 * desired visibility state of the soft input area for this window.
993 */
994 public static final int SOFT_INPUT_MASK_STATE = 0x0f;
995
996 /**
997 * Visibility state for {@link #softInputMode}: no state has been specified.
998 */
999 public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
1000
1001 /**
1002 * Visibility state for {@link #softInputMode}: please don't change the state of
1003 * the soft input area.
1004 */
1005 public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
1006
1007 /**
1008 * Visibility state for {@link #softInputMode}: please hide any soft input
1009 * area when normally appropriate (when the user is navigating
1010 * forward to your window).
1011 */
1012 public static final int SOFT_INPUT_STATE_HIDDEN = 2;
1013
1014 /**
1015 * Visibility state for {@link #softInputMode}: please always hide any
1016 * soft input area when this window receives focus.
1017 */
1018 public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
1019
1020 /**
1021 * Visibility state for {@link #softInputMode}: please show the soft
1022 * input area when normally appropriate (when the user is navigating
1023 * forward to your window).
1024 */
1025 public static final int SOFT_INPUT_STATE_VISIBLE = 4;
1026
1027 /**
1028 * Visibility state for {@link #softInputMode}: please always make the
1029 * soft input area visible when this window receives input focus.
1030 */
1031 public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
1032
1033 /**
1034 * Mask for {@link #softInputMode} of the bits that determine the
1035 * way that the window should be adjusted to accommodate the soft
1036 * input window.
1037 */
1038 public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
1039
1040 /** Adjustment option for {@link #softInputMode}: nothing specified.
1041 * The system will try to pick one or
1042 * the other depending on the contents of the window.
1043 */
1044 public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
1045
1046 /** Adjustment option for {@link #softInputMode}: set to allow the
1047 * window to be resized when an input
1048 * method is shown, so that its contents are not covered by the input
Scott Mainf10e6332010-06-11 09:03:22 -07001049 * method. This can <em>not</em> be combined with
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001050 * {@link #SOFT_INPUT_ADJUST_PAN}; if
1051 * neither of these are set, then the system will try to pick one or
1052 * the other depending on the contents of the window.
1053 */
1054 public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
1055
1056 /** Adjustment option for {@link #softInputMode}: set to have a window
1057 * pan when an input method is
1058 * shown, so it doesn't need to deal with resizing but just panned
1059 * by the framework to ensure the current input focus is visible. This
Scott Mainf10e6332010-06-11 09:03:22 -07001060 * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001061 * neither of these are set, then the system will try to pick one or
1062 * the other depending on the contents of the window.
1063 */
1064 public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
1065
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001066 /** Adjustment option for {@link #softInputMode}: set to have a window
1067 * not adjust for a shown input method. The window will not be resized,
1068 * and it will not be panned to make its focus visible.
1069 */
1070 public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30;
1071
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001072 /**
1073 * Bit for {@link #softInputMode}: set when the user has navigated
1074 * forward to the window. This is normally set automatically for
1075 * you by the system, though you may want to set it in certain cases
1076 * when you are displaying a window yourself. This flag will always
1077 * be cleared automatically after the window is displayed.
1078 */
1079 public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001080
1081 /**
Gilles Debunnebe2c4f92011-01-17 15:14:32 -08001082 * Desired operating mode for any soft input area. May be any combination
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001083 * of:
1084 *
1085 * <ul>
1086 * <li> One of the visibility states
1087 * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
1088 * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
1089 * {@link #SOFT_INPUT_STATE_VISIBLE}.
1090 * <li> One of the adjustment options
1091 * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
1092 * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
1093 * {@link #SOFT_INPUT_ADJUST_PAN}.
1094 */
1095 public int softInputMode;
1096
1097 /**
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001098 * Placement of window within the screen as per {@link Gravity}. Both
1099 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1100 * android.graphics.Rect) Gravity.apply} and
1101 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1102 * Gravity.applyDisplay} are used during window layout, with this value
1103 * given as the desired gravity. For example you can specify
1104 * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and
1105 * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here
1106 * to control the behavior of
1107 * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect)
1108 * Gravity.applyDisplay}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001109 *
1110 * @see Gravity
1111 */
1112 public int gravity;
1113
1114 /**
1115 * The horizontal margin, as a percentage of the container's width,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001116 * between the container and the widget. See
1117 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1118 * android.graphics.Rect) Gravity.apply} for how this is used. This
1119 * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001120 */
1121 public float horizontalMargin;
1122
1123 /**
1124 * The vertical margin, as a percentage of the container's height,
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001125 * between the container and the widget. See
1126 * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
1127 * android.graphics.Rect) Gravity.apply} for how this is used. This
1128 * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001129 */
1130 public float verticalMargin;
1131
1132 /**
1133 * The desired bitmap format. May be one of the constants in
1134 * {@link android.graphics.PixelFormat}. Default is OPAQUE.
1135 */
1136 public int format;
1137
1138 /**
1139 * A style resource defining the animations to use for this window.
1140 * This must be a system resource; it can not be an application resource
1141 * because the window manager does not have access to applications.
1142 */
1143 public int windowAnimations;
1144
1145 /**
1146 * An alpha value to apply to this entire window.
1147 * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
1148 */
1149 public float alpha = 1.0f;
1150
1151 /**
1152 * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
1153 * to apply. Range is from 1.0 for completely opaque to 0.0 for no
1154 * dim.
1155 */
1156 public float dimAmount = 1.0f;
Dianne Hackborndea3ef72010-10-28 14:24:22 -07001157
1158 /**
1159 * Default value for {@link #screenBrightness} and {@link #buttonBrightness}
1160 * indicating that the brightness value is not overridden for this window
1161 * and normal brightness policy should be used.
1162 */
1163 public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f;
1164
1165 /**
1166 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1167 * indicating that the screen or button backlight brightness should be set
1168 * to the lowest value when this window is in front.
1169 */
1170 public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f;
1171
1172 /**
1173 * Value for {@link #screenBrightness} and {@link #buttonBrightness}
1174 * indicating that the screen or button backlight brightness should be set
1175 * to the hightest value when this window is in front.
1176 */
1177 public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001178
1179 /**
1180 * This can be used to override the user's preferred brightness of
1181 * the screen. A value of less than 0, the default, means to use the
1182 * preferred screen brightness. 0 to 1 adjusts the brightness from
1183 * dark to full bright.
1184 */
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001185 public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001186
1187 /**
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001188 * This can be used to override the standard behavior of the button and
1189 * keyboard backlights. A value of less than 0, the default, means to
1190 * use the standard backlight behavior. 0 to 1 adjusts the brightness
1191 * from dark to full bright.
1192 */
1193 public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE;
1194
1195 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001196 * Identifier for this window. This will usually be filled in for
1197 * you.
1198 */
1199 public IBinder token = null;
1200
1201 /**
1202 * Name of the package owning this window.
1203 */
1204 public String packageName = null;
1205
1206 /**
1207 * Specific orientation value for a window.
1208 * May be any of the same values allowed
1209 * for {@link android.content.pm.ActivityInfo#screenOrientation}.
1210 * If not set, a default value of
1211 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
1212 * will be used.
1213 */
1214 public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Joe Onorato664644d2011-01-23 17:53:23 -08001215
1216 /**
1217 * Control the visibility of the status bar.
Joe Onorato14782f72011-01-25 19:53:17 -08001218 *
1219 * @see View#STATUS_BAR_VISIBLE
1220 * @see View#STATUS_BAR_HIDDEN
Joe Onorato664644d2011-01-23 17:53:23 -08001221 */
1222 public int systemUiVisibility;
1223
1224 /**
Joe Onorato14782f72011-01-25 19:53:17 -08001225 * @hide
1226 * The ui visibility as requested by the views in this hierarchy.
1227 * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
1228 */
1229 public int subtreeSystemUiVisibility;
1230
1231 /**
Joe Onorato664644d2011-01-23 17:53:23 -08001232 * Get callbacks about the system ui visibility changing.
1233 *
1234 * TODO: Maybe there should be a bitfield of optional callbacks that we need.
1235 *
1236 * @hide
1237 */
1238 public boolean hasSystemUiListeners;
1239
Jeff Brown474dcb52011-06-14 20:22:50 -07001240 /**
1241 * When this window has focus, disable touch pad pointer gesture processing.
1242 * The window will receive raw position updates from the touch pad instead
1243 * of pointer movements and synthetic touch events.
1244 *
1245 * @hide
1246 */
1247 public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;
1248
1249 /**
Jeff Browncc4f7db2011-08-30 20:34:48 -07001250 * Does not construct an input channel for this window. The channel will therefore
1251 * be incapable of receiving input.
1252 *
1253 * @hide
1254 */
1255 public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
1256
1257 /**
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001258 * When this window has focus, does not call user activity for all input events so
1259 * the application will have to do it itself. Should only be used by
1260 * the keyguard and phone app.
1261 * <p>
1262 * Should only be used by the keyguard and phone app.
1263 * </p>
1264 *
1265 * @hide
1266 */
1267 public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
1268
1269 /**
Jeff Brown474dcb52011-06-14 20:22:50 -07001270 * Control special features of the input subsystem.
1271 *
1272 * @see #INPUT_FEATURE_DISABLE_TOUCH_PAD_GESTURES
Jeff Browncc4f7db2011-08-30 20:34:48 -07001273 * @see #INPUT_FEATURE_NO_INPUT_CHANNEL
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001274 * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
Jeff Brown474dcb52011-06-14 20:22:50 -07001275 * @hide
1276 */
1277 public int inputFeatures;
1278
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001279 /**
1280 * Sets the number of milliseconds before the user activity timeout occurs
1281 * when this window has focus. A value of -1 uses the standard timeout.
1282 * A value of 0 uses the minimum support display timeout.
1283 * <p>
1284 * This property can only be used to reduce the user specified display timeout;
1285 * it can never make the timeout longer than it normally would be.
1286 * </p><p>
1287 * Should only be used by the keyguard and phone app.
1288 * </p>
1289 *
1290 * @hide
1291 */
1292 public long userActivityTimeout = -1;
1293
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001294 public LayoutParams() {
Romain Guy980a9382010-01-08 15:06:28 -08001295 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001296 type = TYPE_APPLICATION;
1297 format = PixelFormat.OPAQUE;
1298 }
1299
1300 public LayoutParams(int _type) {
Romain Guy980a9382010-01-08 15:06:28 -08001301 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001302 type = _type;
1303 format = PixelFormat.OPAQUE;
1304 }
1305
1306 public LayoutParams(int _type, int _flags) {
Romain Guy980a9382010-01-08 15:06:28 -08001307 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001308 type = _type;
1309 flags = _flags;
1310 format = PixelFormat.OPAQUE;
1311 }
1312
1313 public LayoutParams(int _type, int _flags, int _format) {
Romain Guy980a9382010-01-08 15:06:28 -08001314 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001315 type = _type;
1316 flags = _flags;
1317 format = _format;
1318 }
1319
1320 public LayoutParams(int w, int h, int _type, int _flags, int _format) {
1321 super(w, h);
1322 type = _type;
1323 flags = _flags;
1324 format = _format;
1325 }
1326
1327 public LayoutParams(int w, int h, int xpos, int ypos, int _type,
1328 int _flags, int _format) {
1329 super(w, h);
1330 x = xpos;
1331 y = ypos;
1332 type = _type;
1333 flags = _flags;
1334 format = _format;
1335 }
1336
1337 public final void setTitle(CharSequence title) {
1338 if (null == title)
1339 title = "";
1340
1341 mTitle = TextUtils.stringOrSpannedString(title);
1342 }
1343
1344 public final CharSequence getTitle() {
1345 return mTitle;
1346 }
1347
1348 public int describeContents() {
1349 return 0;
1350 }
1351
1352 public void writeToParcel(Parcel out, int parcelableFlags) {
1353 out.writeInt(width);
1354 out.writeInt(height);
1355 out.writeInt(x);
1356 out.writeInt(y);
1357 out.writeInt(type);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001358 out.writeInt(flags);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001359 out.writeInt(privateFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 out.writeInt(softInputMode);
1361 out.writeInt(gravity);
1362 out.writeFloat(horizontalMargin);
1363 out.writeFloat(verticalMargin);
1364 out.writeInt(format);
1365 out.writeInt(windowAnimations);
1366 out.writeFloat(alpha);
1367 out.writeFloat(dimAmount);
1368 out.writeFloat(screenBrightness);
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001369 out.writeFloat(buttonBrightness);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001370 out.writeStrongBinder(token);
1371 out.writeString(packageName);
1372 TextUtils.writeToParcel(mTitle, out, parcelableFlags);
1373 out.writeInt(screenOrientation);
Joe Onorato664644d2011-01-23 17:53:23 -08001374 out.writeInt(systemUiVisibility);
Joe Onorato14782f72011-01-25 19:53:17 -08001375 out.writeInt(subtreeSystemUiVisibility);
Joe Onorato664644d2011-01-23 17:53:23 -08001376 out.writeInt(hasSystemUiListeners ? 1 : 0);
Jeff Brown474dcb52011-06-14 20:22:50 -07001377 out.writeInt(inputFeatures);
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001378 out.writeLong(userActivityTimeout);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001379 }
1380
1381 public static final Parcelable.Creator<LayoutParams> CREATOR
1382 = new Parcelable.Creator<LayoutParams>() {
1383 public LayoutParams createFromParcel(Parcel in) {
1384 return new LayoutParams(in);
1385 }
1386
1387 public LayoutParams[] newArray(int size) {
1388 return new LayoutParams[size];
1389 }
1390 };
1391
1392
1393 public LayoutParams(Parcel in) {
1394 width = in.readInt();
1395 height = in.readInt();
1396 x = in.readInt();
1397 y = in.readInt();
1398 type = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001399 flags = in.readInt();
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001400 privateFlags = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001401 softInputMode = in.readInt();
1402 gravity = in.readInt();
1403 horizontalMargin = in.readFloat();
1404 verticalMargin = in.readFloat();
1405 format = in.readInt();
1406 windowAnimations = in.readInt();
1407 alpha = in.readFloat();
1408 dimAmount = in.readFloat();
1409 screenBrightness = in.readFloat();
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001410 buttonBrightness = in.readFloat();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001411 token = in.readStrongBinder();
1412 packageName = in.readString();
1413 mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
1414 screenOrientation = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001415 systemUiVisibility = in.readInt();
Joe Onorato14782f72011-01-25 19:53:17 -08001416 subtreeSystemUiVisibility = in.readInt();
Joe Onorato664644d2011-01-23 17:53:23 -08001417 hasSystemUiListeners = in.readInt() != 0;
Jeff Brown474dcb52011-06-14 20:22:50 -07001418 inputFeatures = in.readInt();
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001419 userActivityTimeout = in.readLong();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001420 }
1421
Romain Guy72998072009-06-22 11:09:20 -07001422 @SuppressWarnings({"PointlessBitwiseExpression"})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001423 public static final int LAYOUT_CHANGED = 1<<0;
1424 public static final int TYPE_CHANGED = 1<<1;
1425 public static final int FLAGS_CHANGED = 1<<2;
1426 public static final int FORMAT_CHANGED = 1<<3;
1427 public static final int ANIMATION_CHANGED = 1<<4;
1428 public static final int DIM_AMOUNT_CHANGED = 1<<5;
1429 public static final int TITLE_CHANGED = 1<<6;
1430 public static final int ALPHA_CHANGED = 1<<7;
1431 public static final int MEMORY_TYPE_CHANGED = 1<<8;
1432 public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
1433 public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
1434 public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001435 /** {@hide} */
1436 public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<12;
Joe Onorato664644d2011-01-23 17:53:23 -08001437 /** {@hide} */
1438 public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<13;
1439 /** {@hide} */
1440 public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<14;
Jeff Brown474dcb52011-06-14 20:22:50 -07001441 /** {@hide} */
1442 public static final int INPUT_FEATURES_CHANGED = 1<<15;
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001443 /** {@hide} */
1444 public static final int PRIVATE_FLAGS_CHANGED = 1<<16;
Romain Guyf21c9b02011-09-06 16:56:54 -07001445 /** {@hide} */
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001446 public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<17;
1447 /** {@hide} */
Romain Guyf21c9b02011-09-06 16:56:54 -07001448 public static final int EVERYTHING_CHANGED = 0xffffffff;
1449
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001450 // internal buffer to backup/restore parameters under compatibility mode.
1451 private int[] mCompatibilityParamsBackup = null;
1452
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001453 public final int copyFrom(LayoutParams o) {
1454 int changes = 0;
1455
1456 if (width != o.width) {
1457 width = o.width;
Chet Haase40e03832011-10-06 08:34:13 -07001458 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001459 }
1460 if (height != o.height) {
1461 height = o.height;
Chet Haase40e03832011-10-06 08:34:13 -07001462 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001463 }
1464 if (x != o.x) {
1465 x = o.x;
1466 changes |= LAYOUT_CHANGED;
1467 }
1468 if (y != o.y) {
1469 y = o.y;
1470 changes |= LAYOUT_CHANGED;
1471 }
1472 if (horizontalWeight != o.horizontalWeight) {
1473 horizontalWeight = o.horizontalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001474 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001475 }
1476 if (verticalWeight != o.verticalWeight) {
1477 verticalWeight = o.verticalWeight;
Chet Haase40e03832011-10-06 08:34:13 -07001478 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001479 }
1480 if (horizontalMargin != o.horizontalMargin) {
1481 horizontalMargin = o.horizontalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001482 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001483 }
1484 if (verticalMargin != o.verticalMargin) {
1485 verticalMargin = o.verticalMargin;
Chet Haase40e03832011-10-06 08:34:13 -07001486 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001487 }
1488 if (type != o.type) {
1489 type = o.type;
1490 changes |= TYPE_CHANGED;
1491 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001492 if (flags != o.flags) {
1493 flags = o.flags;
Chet Haase40e03832011-10-06 08:34:13 -07001494 changes |= FLAGS_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001495 }
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001496 if (privateFlags != o.privateFlags) {
1497 privateFlags = o.privateFlags;
1498 changes |= PRIVATE_FLAGS_CHANGED;
1499 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001500 if (softInputMode != o.softInputMode) {
1501 softInputMode = o.softInputMode;
1502 changes |= SOFT_INPUT_MODE_CHANGED;
1503 }
1504 if (gravity != o.gravity) {
1505 gravity = o.gravity;
Chet Haase40e03832011-10-06 08:34:13 -07001506 changes |= LAYOUT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001507 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508 if (format != o.format) {
1509 format = o.format;
Chet Haase40e03832011-10-06 08:34:13 -07001510 changes |= FORMAT_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001511 }
1512 if (windowAnimations != o.windowAnimations) {
1513 windowAnimations = o.windowAnimations;
1514 changes |= ANIMATION_CHANGED;
1515 }
1516 if (token == null) {
1517 // NOTE: token only copied if the recipient doesn't
1518 // already have one.
1519 token = o.token;
1520 }
1521 if (packageName == null) {
1522 // NOTE: packageName only copied if the recipient doesn't
1523 // already have one.
1524 packageName = o.packageName;
1525 }
1526 if (!mTitle.equals(o.mTitle)) {
1527 mTitle = o.mTitle;
1528 changes |= TITLE_CHANGED;
1529 }
1530 if (alpha != o.alpha) {
1531 alpha = o.alpha;
1532 changes |= ALPHA_CHANGED;
1533 }
1534 if (dimAmount != o.dimAmount) {
1535 dimAmount = o.dimAmount;
1536 changes |= DIM_AMOUNT_CHANGED;
1537 }
1538 if (screenBrightness != o.screenBrightness) {
1539 screenBrightness = o.screenBrightness;
1540 changes |= SCREEN_BRIGHTNESS_CHANGED;
1541 }
Mike Lockwoodfb73f792009-11-20 11:31:18 -05001542 if (buttonBrightness != o.buttonBrightness) {
1543 buttonBrightness = o.buttonBrightness;
1544 changes |= BUTTON_BRIGHTNESS_CHANGED;
1545 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001546
1547 if (screenOrientation != o.screenOrientation) {
1548 screenOrientation = o.screenOrientation;
Chet Haase40e03832011-10-06 08:34:13 -07001549 changes |= SCREEN_ORIENTATION_CHANGED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001550 }
Romain Guy529b60a2010-08-03 18:05:47 -07001551
Joe Onorato14782f72011-01-25 19:53:17 -08001552 if (systemUiVisibility != o.systemUiVisibility
1553 || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) {
Joe Onorato664644d2011-01-23 17:53:23 -08001554 systemUiVisibility = o.systemUiVisibility;
Joe Onorato14782f72011-01-25 19:53:17 -08001555 subtreeSystemUiVisibility = o.subtreeSystemUiVisibility;
Joe Onorato664644d2011-01-23 17:53:23 -08001556 changes |= SYSTEM_UI_VISIBILITY_CHANGED;
1557 }
1558
1559 if (hasSystemUiListeners != o.hasSystemUiListeners) {
1560 hasSystemUiListeners = o.hasSystemUiListeners;
1561 changes |= SYSTEM_UI_LISTENER_CHANGED;
1562 }
1563
Jeff Brown474dcb52011-06-14 20:22:50 -07001564 if (inputFeatures != o.inputFeatures) {
1565 inputFeatures = o.inputFeatures;
1566 changes |= INPUT_FEATURES_CHANGED;
1567 }
1568
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001569 if (userActivityTimeout != o.userActivityTimeout) {
1570 userActivityTimeout = o.userActivityTimeout;
1571 changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
1572 }
1573
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001574 return changes;
1575 }
1576
1577 @Override
1578 public String debug(String output) {
1579 output += "Contents of " + this + ":";
1580 Log.d("Debug", output);
1581 output = super.debug("");
1582 Log.d("Debug", output);
1583 Log.d("Debug", "");
1584 Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
1585 return "";
1586 }
1587
1588 @Override
1589 public String toString() {
1590 StringBuilder sb = new StringBuilder(256);
1591 sb.append("WM.LayoutParams{");
1592 sb.append("(");
1593 sb.append(x);
1594 sb.append(',');
1595 sb.append(y);
1596 sb.append(")(");
Romain Guy980a9382010-01-08 15:06:28 -08001597 sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001598 sb.append('x');
Romain Guy980a9382010-01-08 15:06:28 -08001599 sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height)));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001600 sb.append(")");
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001601 if (horizontalMargin != 0) {
1602 sb.append(" hm=");
1603 sb.append(horizontalMargin);
1604 }
1605 if (verticalMargin != 0) {
1606 sb.append(" vm=");
1607 sb.append(verticalMargin);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001608 }
1609 if (gravity != 0) {
1610 sb.append(" gr=#");
1611 sb.append(Integer.toHexString(gravity));
1612 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001613 if (softInputMode != 0) {
1614 sb.append(" sim=#");
1615 sb.append(Integer.toHexString(softInputMode));
1616 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 sb.append(" ty=");
1618 sb.append(type);
1619 sb.append(" fl=#");
1620 sb.append(Integer.toHexString(flags));
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001621 if (privateFlags != 0) {
1622 sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
1623 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001624 if (format != PixelFormat.OPAQUE) {
1625 sb.append(" fmt=");
1626 sb.append(format);
1627 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001628 if (windowAnimations != 0) {
1629 sb.append(" wanim=0x");
1630 sb.append(Integer.toHexString(windowAnimations));
1631 }
1632 if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
1633 sb.append(" or=");
1634 sb.append(screenOrientation);
1635 }
Dianne Hackborn8eb2e242010-11-01 12:31:24 -07001636 if (alpha != 1.0f) {
1637 sb.append(" alpha=");
1638 sb.append(alpha);
1639 }
1640 if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1641 sb.append(" sbrt=");
1642 sb.append(screenBrightness);
1643 }
1644 if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
1645 sb.append(" bbrt=");
1646 sb.append(buttonBrightness);
1647 }
Mitsuru Oshima5a2b91d2009-07-16 16:30:02 -07001648 if ((flags & FLAG_COMPATIBLE_WINDOW) != 0) {
1649 sb.append(" compatible=true");
1650 }
Joe Onorato664644d2011-01-23 17:53:23 -08001651 if (systemUiVisibility != 0) {
1652 sb.append(" sysui=0x");
1653 sb.append(Integer.toHexString(systemUiVisibility));
1654 }
Joe Onorato14782f72011-01-25 19:53:17 -08001655 if (subtreeSystemUiVisibility != 0) {
1656 sb.append(" vsysui=0x");
1657 sb.append(Integer.toHexString(subtreeSystemUiVisibility));
1658 }
Joe Onorato664644d2011-01-23 17:53:23 -08001659 if (hasSystemUiListeners) {
1660 sb.append(" sysuil=");
1661 sb.append(hasSystemUiListeners);
1662 }
Dianne Hackborna44abeb2011-08-08 19:24:01 -07001663 if (inputFeatures != 0) {
1664 sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
1665 }
Jeff Brown1e3b98d2012-09-30 18:58:59 -07001666 if (userActivityTimeout >= 0) {
1667 sb.append(" userActivityTimeout=").append(userActivityTimeout);
1668 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001669 sb.append('}');
1670 return sb.toString();
1671 }
Mitsuru Oshima8d112672009-04-27 12:01:23 -07001672
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001673 /**
1674 * Scale the layout params' coordinates and size.
Mitsuru Oshima64f59342009-06-21 00:03:11 -07001675 * @hide
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001676 */
Mitsuru Oshima64f59342009-06-21 00:03:11 -07001677 public void scale(float scale) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07001678 x = (int) (x * scale + 0.5f);
1679 y = (int) (y * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001680 if (width > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07001681 width = (int) (width * scale + 0.5f);
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001682 }
1683 if (height > 0) {
Mitsuru Oshima61324e52009-07-21 15:40:36 -07001684 height = (int) (height * scale + 0.5f);
Mitsuru Oshima8d112672009-04-27 12:01:23 -07001685 }
1686 }
1687
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001688 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001689 * Backup the layout parameters used in compatibility mode.
1690 * @see LayoutParams#restore()
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001691 */
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001692 void backup() {
1693 int[] backup = mCompatibilityParamsBackup;
1694 if (backup == null) {
Mitsuru Oshima64f59342009-06-21 00:03:11 -07001695 // we backup 4 elements, x, y, width, height
1696 backup = mCompatibilityParamsBackup = new int[4];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001697 }
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001698 backup[0] = x;
1699 backup[1] = y;
1700 backup[2] = width;
1701 backup[3] = height;
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001702 }
1703
1704 /**
1705 * Restore the layout params' coordinates, size and gravity
1706 * @see LayoutParams#backup()
1707 */
1708 void restore() {
1709 int[] backup = mCompatibilityParamsBackup;
1710 if (backup != null) {
1711 x = backup[0];
1712 y = backup[1];
1713 width = backup[2];
Mitsuru Oshima3d914922009-05-13 22:29:15 -07001714 height = backup[3];
1715 }
1716 }
1717
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001718 private CharSequence mTitle = "";
1719 }
1720}