WindowManager.java revision 9066cfe9886ac131c34d59ed0e2d287b0e3c0087
161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten/*
261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * Copyright (C) 2006 The Android Open Source Project
361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten *
461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * Licensed under the Apache License, Version 2.0 (the "License");
561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * you may not use this file except in compliance with the License.
661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * You may obtain a copy of the License at
761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten *
861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten *      http://www.apache.org/licenses/LICENSE-2.0
961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten *
1061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * Unless required by applicable law or agreed to in writing, software
1161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * distributed under the License is distributed on an "AS IS" BASIS,
1261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * See the License for the specific language governing permissions and
1461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten * limitations under the License.
1561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten */
1661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
1761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kastenpackage android.view;
1861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
1961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kastenimport android.content.pm.ActivityInfo;
2061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kastenimport android.graphics.PixelFormat;
21ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kastenimport android.os.IBinder;
22510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kastenimport android.os.Parcel;
23510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kastenimport android.os.Parcelable;
24d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kastenimport android.text.TextUtils;
25cf3a6383a9bc9a94ca5b424ea97313293ee0dcb0Glenn Kastenimport android.util.Log;
2661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
27510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
28510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten/**
29bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten * The interface that apps use to talk to the window manager.
30bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten * <p>
31bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these.
32bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten *
33bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten * @see android.content.Context#getSystemService
343a413f1863daa026ed2b9fc9eac01e1341116cdbGlenn Kasten * @see android.content.Context#WINDOW_SERVICE
35276cab2d983b892d1b634474b6249f6bec400c76Glenn Kasten */
36510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kastenpublic interface WindowManager extends ViewManager {
37510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    /**
38bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten     * Exception that is thrown when trying to add view whose
39bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten     * {@link WindowManager.LayoutParams} {@link WindowManager.LayoutParams#token}
40510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * is invalid.
41510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     */
42510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    public static class BadTokenException extends RuntimeException {
43510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public BadTokenException() {
44bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        }
454260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten
464260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten        public BadTokenException(String name) {
47bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            super(name);
48bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        }
49510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    }
50510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
51510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    /**
52510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * Use this method to get the default Display object.
53510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     *
54510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * @return default Display object
55510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     */
56510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    public Display getDefaultDisplay();
57510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
58510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    /**
59510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * Special variation of {@link #removeView} that immediately invokes
60510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * the given view hierarchy's {@link View#onDetachedFromWindow()
61510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * View.onDetachedFromWindow()} methods before returning.  This is not
62510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * for normal applications; using it correctly requires great care.
63510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     *
64510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     * @param view The view to be removed.
65510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten     */
66510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    public void removeViewImmediate(View view);
6761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
68510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten    public static class LayoutParams extends ViewGroup.LayoutParams
69510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten            implements Parcelable {
70bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
71510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * X position for this window.  With the default gravity it is ignored.
72d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         * When using {@link Gravity#LEFT} or {@link Gravity#RIGHT} it provides
73bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * an offset from the given edge.
74bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
75bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public int x;
76510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
77d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten        /**
788c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * Y position for this window.  With the default gravity it is ignored.
79bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
808c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * an offset from the given edge.
81d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         */
82d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten        public int y;
83ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
84d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten        /**
85d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         * Indicates how much of the extra space will be allocated horizontally
86ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * to the view associated with these LayoutParams. Specify 0 if the view
87ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * should not be stretched. Otherwise the extra pixels will be pro-rated
88bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * among all views whose weight is greater than 0.
89276cab2d983b892d1b634474b6249f6bec400c76Glenn Kasten         */
90bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public float horizontalWeight;
911d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten
92bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
931d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * Indicates how much of the extra space will be allocated vertically
94bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * to the view associated with these LayoutParams. Specify 0 if the view
951d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * should not be stretched. Otherwise the extra pixels will be pro-rated
961d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * among all views whose weight is greater than 0.
971d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         */
981d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten        public float verticalWeight;
991d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten
1001d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten        /**
1011d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * The general type of window.  There are three main classes of
102bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * window types:
1031d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * <ul>
104d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         * <li> <strong>Application windows</strong> (ranging from
105bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * {@link #FIRST_APPLICATION_WINDOW} to
1061d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
1071d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * windows.  For these types of windows, the {@link #token} must be
1081d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * set to the token of the activity they are a part of (this will
1091d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * normally be done for you if {@link #token} is null).
1101d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * <li> <strong>Sub-windows</strong> (ranging from
1111d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * {@link #FIRST_SUB_WINDOW} to
112d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         * {@link #LAST_SUB_WINDOW}) are associated with another top-level
113ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * window.  For these types of windows, the {@link #token} must be
114bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * the token of the window it is attached to.
115ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * <li> <strong>System windows</strong> (ranging from
116ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * {@link #FIRST_SYSTEM_WINDOW} to
117ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
118ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * use by the system for specific purposes.  They should not normally
119d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         * be used by applications, and a special permission is required
120bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * to use them.
121ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * </ul>
122ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         *
1234260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         * @see #TYPE_BASE_APPLICATION
124ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_APPLICATION
125cf3a6383a9bc9a94ca5b424ea97313293ee0dcb0Glenn Kasten         * @see #TYPE_APPLICATION_STARTING
126ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_APPLICATION_PANEL
127ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_APPLICATION_MEDIA
128bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_APPLICATION_SUB_PANEL
129bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_APPLICATION_ATTACHED_DIALOG
130bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_STATUS_BAR
131ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_SEARCH_BAR
132ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_PHONE
133ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_SYSTEM_ALERT
134ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_KEYGUARD
135bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_TOAST
1364260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         * @see #TYPE_SYSTEM_OVERLAY
1374260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         * @see #TYPE_PRIORITY_PHONE
138bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_STATUS_BAR_PANEL
139bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_SYSTEM_DIALOG
140ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_KEYGUARD_DIALOG
141ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #TYPE_SYSTEM_ERROR
142bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_INPUT_METHOD
143bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #TYPE_INPUT_METHOD_DIALOG
144bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
145bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public int type;
146ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
147ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
1488c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * Start of window types that represent normal application windows.
149bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
150ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int FIRST_APPLICATION_WINDOW = 1;
151ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
1528c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten        /**
153ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: an application window that serves as the "base" window
154ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * of the overall application; all other application windows will
1554260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         * appear on top of it.
156ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
157ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_BASE_APPLICATION   = 1;
158d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten
159d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten        /**
160ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: a normal application window.  The {@link #token} must be
161ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * an Activity token identifying who the window belongs to.
16261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
16361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public static final int TYPE_APPLICATION        = 2;
164ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
165510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
166510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * Window type: special application window that is displayed while the
167510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * application is starting.  Not for use by applications themselves;
168cf3a6383a9bc9a94ca5b424ea97313293ee0dcb0Glenn Kasten         * this is used by the system to display something until the
16961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * application can show its own windows.
170510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
171510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int TYPE_APPLICATION_STARTING = 3;
172bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
173bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
174bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * End of types of application windows.
175bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
176bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int LAST_APPLICATION_WINDOW = 99;
1773a413f1863daa026ed2b9fc9eac01e1341116cdbGlenn Kasten
178276cab2d983b892d1b634474b6249f6bec400c76Glenn Kasten        /**
179510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * Start of types of sub-windows.  The {@link #token} of these windows
180510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * must be set to the window they are attached to.  These types of
181bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * windows are kept next to their attached window in Z-order, and their
182bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * coordinate space is relative to their attached window.
183510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
184510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FIRST_SUB_WINDOW        = 1000;
185510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
186510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
187bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * Window type: a panel on top of an application window.  These windows
1884260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         * appear on top of their attached window.
1894260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         */
190bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int TYPE_APPLICATION_PANEL  = FIRST_SUB_WINDOW;
191bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
192510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
193510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * Window type: window for showing media (e.g. video).  These windows
194510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * are displayed behind their attached window.
195510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
196510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int TYPE_APPLICATION_MEDIA  = FIRST_SUB_WINDOW+1;
1973a413f1863daa026ed2b9fc9eac01e1341116cdbGlenn Kasten
198510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
199510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * Window type: a sub-panel on top of an application window.  These
200510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * windows are displayed on top their attached window and any
201510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * {@link #TYPE_APPLICATION_PANEL} panels.
202510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
203510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW+2;
204510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
205510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
206510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * of the window happens as that of a top-level window, <em>not</em>
207510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * as a child of its container.
208510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
209510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3;
21061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
211510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
212510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * End of types of sub-windows.
213bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
214510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int LAST_SUB_WINDOW         = 1999;
215510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
216bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
217bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * Start of system-specific window types.  These are not normally
218bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * created by applications.
219510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
220510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FIRST_SYSTEM_WINDOW     = 2000;
2218c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten
222bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
2238c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * Window type: the status bar.  There can be only one status bar
224510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * window; it is placed at the top of the screen, and all other
225510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * windows are shifted down so they are below it.
226ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
227510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int TYPE_STATUS_BAR         = FIRST_SYSTEM_WINDOW;
228510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
229ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
230ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: the search bar.  There can be only one search bar
231bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * window; it is placed at the top of the screen.
232bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
233276cab2d983b892d1b634474b6249f6bec400c76Glenn Kasten        public static final int TYPE_SEARCH_BAR         = FIRST_SYSTEM_WINDOW+1;
234bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
235bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
236510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * Window type: phone.  These are non-application windows providing
237510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * user interaction with the phone (in particular incoming calls).
238bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * These windows are normally placed above all applications, but behind
239ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * the status bar.
240510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
241ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_PHONE              = FIRST_SYSTEM_WINDOW+2;
242ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
243ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
244ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: system window, such as low power alert. These windows
245ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * are always on top of application windows.
246ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
247510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int TYPE_SYSTEM_ALERT       = FIRST_SYSTEM_WINDOW+3;
248bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
249ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
250ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: keyguard window.
2514260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         */
252ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_KEYGUARD           = FIRST_SYSTEM_WINDOW+4;
253cf3a6383a9bc9a94ca5b424ea97313293ee0dcb0Glenn Kasten
254ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
255ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: transient notifications.
256bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
257bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int TYPE_TOAST              = FIRST_SYSTEM_WINDOW+5;
258bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
259ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
260ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: system overlay windows, which need to be displayed
261ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * on top of everything else.  These windows must not take input
262ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * focus, or they will interfere with the keyguard.
263bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
2644260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten        public static final int TYPE_SYSTEM_OVERLAY     = FIRST_SYSTEM_WINDOW+6;
2654260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten
266bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
267bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * Window type: priority phone UI, which needs to be displayed even if
268bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * the keyguard is active.  These windows must not take input
269ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * focus, or they will interfere with the keyguard.
270bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
271ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_PRIORITY_PHONE     = FIRST_SYSTEM_WINDOW+7;
272ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
273ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
2744260ff7b8f65fdfe8d0176cdce66faf0a10c4b10Glenn Kasten         * Window type: panel that slides out from the status bar
275ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
276ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_STATUS_BAR_PANEL   = FIRST_SYSTEM_WINDOW+8;
277510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
278510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
279ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: panel that slides out from the status bar
280ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
28161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public static final int TYPE_SYSTEM_DIALOG      = FIRST_SYSTEM_WINDOW+8;
28261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
283ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
28461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * Window type: dialogs that the keyguard shows
28561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
286ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_KEYGUARD_DIALOG    = FIRST_SYSTEM_WINDOW+9;
287ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
288ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
289ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: internal system error windows, appear on top of
290ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * everything they can.
291bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
292b566926611b2105a46c4ff98238ad06aca54104dGlenn Kasten        public static final int TYPE_SYSTEM_ERROR       = FIRST_SYSTEM_WINDOW+10;
293bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
294b566926611b2105a46c4ff98238ad06aca54104dGlenn Kasten        /**
295ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: internal input methods windows, which appear above
296ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * the normal UI.  Application windows may be resized or panned to keep
297ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * the input focus visible while this window is displayed.
298ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
299ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_INPUT_METHOD       = FIRST_SYSTEM_WINDOW+11;
300928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
301ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
302ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Window type: internal input methods dialog windows, which appear above
303ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * the current input method window.
304ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
305ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
306ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
307ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
308ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * End of types of system windows.
309ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
310ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int LAST_SYSTEM_WINDOW      = 2999;
311ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
312ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
313ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Specifies what type of memory buffers should be used by this window.
314ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Default is normal.
315ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         *
316ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #MEMORY_TYPE_NORMAL
317ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #MEMORY_TYPE_HARDWARE
318ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #MEMORY_TYPE_GPU
319ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #MEMORY_TYPE_PUSH_BUFFERS
320d2a7f0d6883a6d3835642e7b282f05ed1c54fe63Glenn Kasten         */
321ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public int memoryType;
322ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
32361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        /** Memory type: The window's surface is allocated in main memory. */
32461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public static final int MEMORY_TYPE_NORMAL = 0;
3253a413f1863daa026ed2b9fc9eac01e1341116cdbGlenn Kasten        /** Memory type: The window's surface is configured to be accessible
32661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * by DMA engines and hardware accelerators. */
327ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int MEMORY_TYPE_HARDWARE = 1;
328ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /** Memory type: The window's surface is configured to be accessible
329ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * by graphics accelerators. */
33061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public static final int MEMORY_TYPE_GPU = 2;
331ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /** Memory type: The window's surface doesn't own its buffers and
332ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * therefore cannot be locked. Instead the buffers are pushed to
333ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * it through native binder calls. */
334ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
335510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
336bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
337bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * Various behavioral options/flags.  Default is none.
338ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         *
339a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten         * @see #FLAG_BLUR_BEHIND
340a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten         * @see #FLAG_DIM_BEHIND
341a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten         * @see #FLAG_NOT_FOCUSABLE
342bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #FLAG_NOT_TOUCHABLE
343ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #FLAG_NOT_TOUCH_MODAL
344510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * @see #FLAG_LAYOUT_IN_SCREEN
345ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * @see #FLAG_DITHER
346bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #FLAG_KEEP_SCREEN_ON
347bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #FLAG_FULLSCREEN
348bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @see #FLAG_FORCE_NOT_FULLSCREEN
349104c000a6f36b871ca11e0394db1e5217f374cafGlenn Kasten         * @see #FLAG_IGNORE_CHEEK_PRESSES
350ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
3518b8875067dd02b79361abb00c5d65b02a8ae72b0Glenn Kasten        public int flags;
352bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
353f6f5ceb363286d5ebef2c2e70c8a5aa135d5d1eeGlenn Kasten        /** Window flag: everything behind this window will be dimmed.
354f6f5ceb363286d5ebef2c2e70c8a5aa135d5d1eeGlenn Kasten         *  Use {@link #dimAmount} to control the amount of dim. */
355f6f5ceb363286d5ebef2c2e70c8a5aa135d5d1eeGlenn Kasten        public static final int FLAG_DIM_BEHIND        = 0x00000002;
356ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
357bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: blur everything behind this window. */
358ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int FLAG_BLUR_BEHIND        = 0x00000004;
359ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
360bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: this window won't ever get key input focus, so the
361ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * user can not send key or other button events to it.  Those will
362ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * instead go to whatever focusable window is behind it.  This flag
363bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
364bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * is explicitly set.
365711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         *
366e5d006b298ce7683d66f7ec86136403cf5fb20d6Glenn Kasten         * <p>Setting this flag also implies that the window will not need to
367e5d006b298ce7683d66f7ec86136403cf5fb20d6Glenn Kasten         * interact with
368ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * a soft input method, so it will be Z-ordered and positioned
369ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * independently of any active input method (typically this means it
370a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten         * gets Z-ordered on top of the input method, so it can use the full
371a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten         * screen for its content and cover the input method if needed.  You
372ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
373ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int FLAG_NOT_FOCUSABLE      = 0x00000008;
374ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
375ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /** Window flag: this window can never receive touch events. */
376510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FLAG_NOT_TOUCHABLE      = 0x00000010;
377bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
37861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        /** Window flag: Even when this window is focusable (its
37961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * {@link #FLAG_NOT_FOCUSABLE is not set), allow any pointer events
380ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * outside of the window to be sent to the windows behind it.  Otherwise
38161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * it will consume all pointer events itself, regardless of whether they
382ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * are inside of the window. */
383ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int FLAG_NOT_TOUCH_MODAL    = 0x00000020;
38461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
38561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        /** Window flag: When set, if the device is asleep when the touch
386ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * screen is pressed, you will receive this first touch event.  Usually
38761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * the first touch event is consumed by the system since the user can
38861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * not see what they are pressing on.
38961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
390ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
391ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
392bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: as long as this window is visible to the user, keep
393bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         *  the device's screen turned on and bright. */
394bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int FLAG_KEEP_SCREEN_ON     = 0x00000080;
395bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
396bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: place the window within the entire screen, ignoring
397ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         *  decorations around the border (a.k.a. the status bar).  The
398ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         *  window must correctly position its contents to take the screen
399ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         *  decoration into account.  This flag is normally set for you
40061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         *  by Window as described in {@link Window#setFlags}. */
40161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public static final int FLAG_LAYOUT_IN_SCREEN   = 0x00000100;
402ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
403928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /** Window flag: allow window to extend outside of the screen. */
404928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int FLAG_LAYOUT_NO_LIMITS   = 0x00000200;
405928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
406510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /** Window flag: Hide all screen decorations (e.g. status bar) while
407bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * this window is displayed.  This allows the window to use the entire
408510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * display space for itself -- the status bar will be hidden when
409bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * an app window with this flag set is on the top layer. */
410928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int FLAG_FULLSCREEN      = 0x00000400;
411bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
412928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /** Window flag: Override {@link #FLAG_FULLSCREEN and force the
413510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         *  screen decorations (such as status bar) to be shown. */
414bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int FLAG_FORCE_NOT_FULLSCREEN   = 0x00000800;
415510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
416bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: turn on dithering when compositing this window to
417928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         *  the screen. */
418510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FLAG_DITHER             = 0x00001000;
419510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
420bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: don't allow screen shots while this window is
421928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * displayed. */
422928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int FLAG_SECURE             = 0x00002000;
423928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
424928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /** Window flag: a special mode where the layout parameters are used
425928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * to perform scaling of the surface when it is composited to the
426928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * screen. */
427928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int FLAG_SCALED             = 0x00004000;
428928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
429928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /** Window flag: intended for windows that will often be used when the user is
430928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * holding the screen against their face, it will aggressively filter the event
431510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * stream to prevent unintended presses in this situation that may not be
432510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * desired for a particular window, when such an event stream is detected, the
433510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * application will receive a CANCEL motion event to indicate this so applications
434510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * can handle this accordingly by taking no action on the event
435928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * until the finger is released. */
436510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FLAG_IGNORE_CHEEK_PRESSES    = 0x00008000;
437bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
438510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /** Window flag: a special option only for use in combination with
439bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * {@link #FLAG_LAYOUT_IN_SCREEN}.  When requesting layout in the
440510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * screen your window may appear on top of or behind screen decorations
441510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * such as the status bar.  By also including this flag, the window
442510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * manager will report the inset rectangle needed to ensure your
443928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * content is not covered by screen decorations.  This flag is normally
444510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * set for you by Window as described in {@link Window#setFlags}.*/
445510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
446510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
447928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
448928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * respect to how this window interacts with the current method.  That
449928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
450928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * window will behave as if it needs to interact with the input method
451928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
452928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * not set and this flag is set, then the window will behave as if it
453711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         * doesn't need to interact with the input method and can be placed
454928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * to use more space and cover the input method.
455510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
456510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
457510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
458510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
459510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * can set this flag to receive a single special MotionEvent with
460928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * the action
461928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for
462928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * touches that occur outside of your window.  Note that you will not
463bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * receive the full down/move/up gesture, only the location of the
464928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * first down as an ACTION_OUTSIDE.
465928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         */
466928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
467bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
468bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /** Window flag: a special option intended for system dialogs.  When
469928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * this flag is set, the window will demand focus unconditionally when
470928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * it is created.
471928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * {@hide} */
472928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int FLAG_SYSTEM_ERROR = 0x40000000;
473928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
474928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /**
475928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * Given a particular set of window manager flags, determine whether
476928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * such a window may be a target for an input method when it has
477928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * focus.  In particular, this checks the
478928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
479928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * flags and returns true if the combination of the two corresponds
480928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * to a window that needs to be behind the input method so that the
481928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * user can type into it.
482928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         *
483bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * @param flags The current window manager flags.
484bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         *
485928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * @return Returns true if such a window should be behind/interact
486928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * with an input method, false if not.
487928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         */
488928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static boolean mayUseInputMethod(int flags) {
489928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten            switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) {
490928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten                case 0:
491928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten                case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM:
492928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten                    return true;
493928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten            }
494928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten            return false;
495928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        }
496928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
497928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /**
498928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * Mask for {@link #softInputMode} of the bits that determine the
499928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * desired visibility state of the soft input area for this window.
500928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         */
501928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        public static final int SOFT_INPUT_MASK_STATE = 0x0f;
502510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
503510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
504ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Visibility state for {@link #softInputMode}: no state has been specified.
50561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
50661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
507ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
508ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
509bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * Visibility state for {@link #softInputMode}: please don't change the state of
510bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * the soft input area.
511bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
512ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
513ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
51461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        /**
51561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * Visibility state for {@link #softInputMode}: please hide any soft input
516ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * area when normally appropriate (when the user is navigating
517f51dba65751107c930759938775b75531ec1f330Glenn Kasten         * forward to your window).
51861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
519ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public static final int SOFT_INPUT_STATE_HIDDEN = 2;
520ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
521bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
522928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * Visibility state for {@link #softInputMode}: please always hide any
523bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * soft input area when this window receives focus.
524928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         */
525bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
526bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
527928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /**
528928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * Visibility state for {@link #softInputMode}: please show the soft
529928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * input area when normally appropriate (when the user is navigating
530928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * forward to your window).
531bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
5321d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten        public static final int SOFT_INPUT_STATE_VISIBLE = 4;
5331d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten
5341d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten        /**
5351d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * Visibility state for {@link #softInputMode}: please always make the
536bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * soft input area visible when this window receives input focus.
5371d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         */
5381d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten        public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
539bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
540928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /**
541928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * Mask for {@link #softInputMode} of the bits that determine the
5421d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * way that the window should be adjusted to accommodate the soft
5431d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         * input window.
5441d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten         */
5451d081e49a10543018e1ae33792bd3d30504719baGlenn Kasten        public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
546928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
547928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /** Adjustment option for {@link #softInputMode}: nothing specified.
548bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * The system will try to pick one or
549bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * the other depending on the contents of the window.
550ccdf07b17f23b4c040dd3f62478d0965eba804e3Glenn Kasten         */
551bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
552bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
553f51dba65751107c930759938775b75531ec1f330Glenn Kasten        /** Adjustment option for {@link #softInputMode}: set to allow the
554928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * window to be resized when an input
555bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * method is shown, so that its contents are not covered by the input
556928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * method.  This can <em>not<em> be combined with
557928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         * {@link #SOFT_INPUT_ADJUST_PAN}; if
558f51dba65751107c930759938775b75531ec1f330Glenn Kasten         * neither of these are set, then the system will try to pick one or
559ccdf07b17f23b4c040dd3f62478d0965eba804e3Glenn Kasten         * the other depending on the contents of the window.
560ccdf07b17f23b4c040dd3f62478d0965eba804e3Glenn Kasten         */
561f51dba65751107c930759938775b75531ec1f330Glenn Kasten        public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
562f51dba65751107c930759938775b75531ec1f330Glenn Kasten
563f51dba65751107c930759938775b75531ec1f330Glenn Kasten        /** Adjustment option for {@link #softInputMode}: set to have a window
564104c000a6f36b871ca11e0394db1e5217f374cafGlenn Kasten         * pan when an input method is
565104c000a6f36b871ca11e0394db1e5217f374cafGlenn Kasten         * shown, so it doesn't need to deal with resizing but just panned
566104c000a6f36b871ca11e0394db1e5217f374cafGlenn Kasten         * by the framework to ensure the current input focus is visible.  This
567bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * can <em>not<em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if
568f51dba65751107c930759938775b75531ec1f330Glenn Kasten         * neither of these are set, then the system will try to pick one or
56900d2d554e04ac369367c903dbf53b975355d1bcdGlenn Kasten         * the other depending on the contents of the window.
570928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten         */
571bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
572928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
573928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten        /**
574d48ff338b8338c1e3e54e0f9dcd03567a0aa9de4Glenn Kasten         * Bit for {@link #softInputMode}: set when the user has navigated
5758c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * forward to the window.  This is normally set automatically for
576bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * you by the system, though you may want to set it in certain cases
5778c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * when you are displaying a window yourself.  This flag will always
578a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten         * be cleared automatically after the window is displayed.
57961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
5804597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100;
5814597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten
582bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
583bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * Desired operating mode for any soft input area.  May any combination
584bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * of:
5854597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten         *
5864597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten         * <ul>
587711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         * <li> One of the visibility states
588bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
5894597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten         * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or
590510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * {@link #SOFT_INPUT_STATE_VISIBLE}.
591510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * <li> One of the adjustment options
592510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED},
593510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * {@link #SOFT_INPUT_ADJUST_RESIZE}, or
594510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * {@link #SOFT_INPUT_ADJUST_PAN}.
595510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
596711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten        public int softInputMode;
597711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten
598711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten        /**
599711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         * Placement of window within the screen as per {@link Gravity}
600711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         *
601711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         * @see Gravity
602711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         */
603711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten        public int gravity;
604a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten
605a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten        /**
606510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * The horizontal margin, as a percentage of the container's width,
60761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * between the container and the widget.
6088c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         */
609a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten        public float horizontalMargin;
610510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
611a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten        /**
6128c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten         * The vertical margin, as a percentage of the container's height,
613510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * between the container and the widget.
614510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
615510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public float verticalMargin;
616510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten
617510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
618510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * The desired bitmap format.  May be one of the constants in
619510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * {@link android.graphics.PixelFormat}.  Default is OPAQUE.
620510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         */
621510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        public int format;
622bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
623510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten        /**
624510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * A style resource defining the animations to use for this window.
625510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * This must be a system resource; it can not be an application resource
626510f3671f716f6835282e4b0fd0275c20e9dadd8Glenn Kasten         * because the window manager does not have access to applications.
62761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
62861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        public int windowAnimations;
6294597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten
630bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
631711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         * An alpha value to apply to this entire window.
632bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
633ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         */
634bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public float alpha = 1.0f;
635bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
636711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten        /**
637711332800108ad6e0e594796e5f8db0da3eff402Glenn Kasten         * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
638ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * to apply.  Range is from 1.0 for completely opaque to 0.0 for no
63961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * dim.
64061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
641ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public float dimAmount = 1.0f;
6423a413f1863daa026ed2b9fc9eac01e1341116cdbGlenn Kasten
64361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        /**
644ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * This can be used to override the user's preferred brightness of
645ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * the screen.  A value of less than 0, the default, means to use the
646a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten         * preferred screen brightness.  0 to 1 adjusts the brightness from
647bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         * dark to full bright.
648bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
649bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public float screenBrightness = -1.0f;
650bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
651bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        /**
652ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Identifier for this window.  This will usually be filled in for
6537a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten         * you.
6547a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten         */
6557a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten        public IBinder token = null;
656ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
657ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        /**
65861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         * Name of the package owning this window.
65961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten         */
660ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public String packageName = null;
6613a413f1863daa026ed2b9fc9eac01e1341116cdbGlenn Kasten
66261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        /**
663ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * Specific orientation value for a window.
664ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * May be any of the same values allowed
665a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten         * for {@link android.content.pm.ActivityInfo#screenOrientation}.
666ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * If not set, a default value of
667ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
668ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten         * will be used.
669bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten         */
670bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
671bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
672bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
673bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public LayoutParams() {
674ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            super(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
675ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            type = TYPE_APPLICATION;
676ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            format = PixelFormat.OPAQUE;
677ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        }
6787a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten
6797a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten        public LayoutParams(int _type) {
6807a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten            super(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
681ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            type = _type;
682ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            format = PixelFormat.OPAQUE;
68361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        }
68461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten
685ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public LayoutParams(int _type, int _flags) {
68661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            super(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
68761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            type = _type;
68861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            flags = _flags;
689ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            format = PixelFormat.OPAQUE;
690ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        }
691a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten
692ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public LayoutParams(int _type, int _flags, int _format) {
69361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            super(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
69461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            type = _type;
695ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            flags = _flags;
696ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            format = _format;
697ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        }
698bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
699bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public LayoutParams(int w, int h, int _type, int _flags, int _format) {
700ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            super(w, h);
7017a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten            type = _type;
702ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            flags = _flags;
703ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            format = _format;
704ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        }
705ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
706ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public LayoutParams(int w, int h, int xpos, int ypos, int _type,
707ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten                int _flags, int _format) {
708ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            super(w, h);
7097a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten            x = xpos;
710a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten            y = ypos;
711a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten            type = _type;
712a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten            flags = _flags;
713bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            format = _format;
714ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        }
715928ea4ffff40c82987cfb1ac9e3095fdc6968709Glenn Kasten
716ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public final void setTitle(CharSequence title) {
717bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            if (null == title)
7188c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten                title = "";
719bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
7208c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten            mTitle = TextUtils.stringOrSpannedString(title);
721bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        }
7228c065779232fdd89abace68d2fc7bea786a010d7Glenn Kasten
723bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public final CharSequence getTitle() {
72461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            return mTitle;
72561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        }
726ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
7277a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten        public int describeContents() {
7287a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten            return 0;
7297a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten        }
730ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten
731ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten        public void writeToParcel(Parcel out, int parcelableFlags) {
73261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(width);
73361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(height);
734ed46c29d6a09112dbbf584c82953f63289596fd6Glenn Kasten            out.writeInt(x);
73561ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(y);
73661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(type);
73761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(memoryType);
73861ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(flags);
73961ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(softInputMode);
74061ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(gravity);
74161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeFloat(horizontalMargin);
74261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeFloat(verticalMargin);
74361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(format);
74461ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(windowAnimations);
745a361b51914aeb5f8f65c7ecad719d1e01f90913bGlenn Kasten            out.writeFloat(alpha);
74661ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeFloat(dimAmount);
74761ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeFloat(screenBrightness);
7484597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            out.writeStrongBinder(token);
7494597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            out.writeString(packageName);
7504597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            TextUtils.writeToParcel(mTitle, out, parcelableFlags);
75161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            out.writeInt(screenOrientation);
75261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten        }
753bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
754bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final Parcelable.Creator<LayoutParams> CREATOR
7550b167267bda99b68346045ccab14e810121d5de4Glenn Kasten                    = new Parcelable.Creator<LayoutParams>() {
7560b167267bda99b68346045ccab14e810121d5de4Glenn Kasten            public LayoutParams createFromParcel(Parcel in) {
757ccdf07b17f23b4c040dd3f62478d0965eba804e3Glenn Kasten                return new LayoutParams(in);
7580b167267bda99b68346045ccab14e810121d5de4Glenn Kasten            }
759ccdf07b17f23b4c040dd3f62478d0965eba804e3Glenn Kasten
760a9a70a4451545034c9263dd55b181f2912534c37Glenn Kasten            public LayoutParams[] newArray(int size) {
761bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten                return new LayoutParams[size];
762bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            }
763bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        };
764bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
765bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
766a3080daa505f91df51a808c85ddb37c48745bf7cGlenn Kasten        public LayoutParams(Parcel in) {
767bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            width = in.readInt();
768bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            height = in.readInt();
7697a79f519d89eb0e1a5b3f4005484b16d6854d7e2Glenn Kasten            x = in.readInt();
770bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            y = in.readInt();
77161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            type = in.readInt();
772bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            memoryType = in.readInt();
77361ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            flags = in.readInt();
774fe96fa06360516c60490c7a697e1148017b4c1b2Glenn Kasten            softInputMode = in.readInt();
775bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            gravity = in.readInt();
776bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            horizontalMargin = in.readFloat();
777bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            verticalMargin = in.readFloat();
7784ce38604afa7e4f629d568f400b0634504e60a2eGlenn Kasten            format = in.readInt();
779fe96fa06360516c60490c7a697e1148017b4c1b2Glenn Kasten            windowAnimations = in.readInt();
780bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            alpha = in.readFloat();
78161ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            dimAmount = in.readFloat();
78261ac0ade16f84d877dfd8d0e984eb203d4a2901dGlenn Kasten            screenBrightness = in.readFloat();
7834597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            token = in.readStrongBinder();
7844597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            packageName = in.readString();
7854597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
7864597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten            screenOrientation = in.readInt();
7874597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        }
7884597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten
789bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int LAYOUT_CHANGED = 1<<0;
7904597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int TYPE_CHANGED = 1<<1;
791bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int FLAGS_CHANGED = 1<<2;
7924597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int FORMAT_CHANGED = 1<<3;
7934597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int ANIMATION_CHANGED = 1<<4;
794bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int DIM_AMOUNT_CHANGED = 1<<5;
7954597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int TITLE_CHANGED = 1<<6;
7964597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int ALPHA_CHANGED = 1<<7;
797bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int MEMORY_TYPE_CHANGED = 1<<8;
7984597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int SOFT_INPUT_MODE_CHANGED = 1<<9;
799bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten        public static final int SCREEN_ORIENTATION_CHANGED = 1<<10;
8004597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11;
801bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten
8024597a7427b697df31d0bbf4c2040806d0c27b6e0Glenn Kasten        public final int copyFrom(LayoutParams o) {
803f51dba65751107c930759938775b75531ec1f330Glenn Kasten            int changes = 0;
804f51dba65751107c930759938775b75531ec1f330Glenn Kasten
805f51dba65751107c930759938775b75531ec1f330Glenn Kasten            if (width != o.width) {
806f51dba65751107c930759938775b75531ec1f330Glenn Kasten                width = o.width;
807f51dba65751107c930759938775b75531ec1f330Glenn Kasten                changes |= LAYOUT_CHANGED;
808f51dba65751107c930759938775b75531ec1f330Glenn Kasten            }
809f51dba65751107c930759938775b75531ec1f330Glenn Kasten            if (height != o.height) {
810bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten                height = o.height;
811f51dba65751107c930759938775b75531ec1f330Glenn Kasten                changes |= LAYOUT_CHANGED;
812bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            }
813f51dba65751107c930759938775b75531ec1f330Glenn Kasten            if (x != o.x) {
814f51dba65751107c930759938775b75531ec1f330Glenn Kasten                x = o.x;
815f51dba65751107c930759938775b75531ec1f330Glenn Kasten                changes |= LAYOUT_CHANGED;
816f51dba65751107c930759938775b75531ec1f330Glenn Kasten            }
817f51dba65751107c930759938775b75531ec1f330Glenn Kasten            if (y != o.y) {
818f51dba65751107c930759938775b75531ec1f330Glenn Kasten                y = o.y;
819f51dba65751107c930759938775b75531ec1f330Glenn Kasten                changes |= LAYOUT_CHANGED;
820bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten            }
821f51dba65751107c930759938775b75531ec1f330Glenn Kasten            if (horizontalWeight != o.horizontalWeight) {
822f51dba65751107c930759938775b75531ec1f330Glenn Kasten                horizontalWeight = o.horizontalWeight;
823bcc5c7225e3b7a1dbf2e9e830987f69167acf06fGlenn Kasten                changes |= LAYOUT_CHANGED;
824f51dba65751107c930759938775b75531ec1f330Glenn Kasten            }
825f51dba65751107c930759938775b75531ec1f330Glenn Kasten            if (verticalWeight != o.verticalWeight) {
826                verticalWeight = o.verticalWeight;
827                changes |= LAYOUT_CHANGED;
828            }
829            if (horizontalMargin != o.horizontalMargin) {
830                horizontalMargin = o.horizontalMargin;
831                changes |= LAYOUT_CHANGED;
832            }
833            if (verticalMargin != o.verticalMargin) {
834                verticalMargin = o.verticalMargin;
835                changes |= LAYOUT_CHANGED;
836            }
837            if (type != o.type) {
838                type = o.type;
839                changes |= TYPE_CHANGED;
840            }
841            if (memoryType != o.memoryType) {
842                memoryType = o.memoryType;
843                changes |= MEMORY_TYPE_CHANGED;
844            }
845            if (flags != o.flags) {
846                flags = o.flags;
847                changes |= FLAGS_CHANGED;
848            }
849            if (softInputMode != o.softInputMode) {
850                softInputMode = o.softInputMode;
851                changes |= SOFT_INPUT_MODE_CHANGED;
852            }
853            if (gravity != o.gravity) {
854                gravity = o.gravity;
855                changes |= LAYOUT_CHANGED;
856            }
857            if (horizontalMargin != o.horizontalMargin) {
858                horizontalMargin = o.horizontalMargin;
859                changes |= LAYOUT_CHANGED;
860            }
861            if (verticalMargin != o.verticalMargin) {
862                verticalMargin = o.verticalMargin;
863                changes |= LAYOUT_CHANGED;
864            }
865            if (format != o.format) {
866                format = o.format;
867                changes |= FORMAT_CHANGED;
868            }
869            if (windowAnimations != o.windowAnimations) {
870                windowAnimations = o.windowAnimations;
871                changes |= ANIMATION_CHANGED;
872            }
873            if (token == null) {
874                // NOTE: token only copied if the recipient doesn't
875                // already have one.
876                token = o.token;
877            }
878            if (packageName == null) {
879                // NOTE: packageName only copied if the recipient doesn't
880                // already have one.
881                packageName = o.packageName;
882            }
883            if (!mTitle.equals(o.mTitle)) {
884                mTitle = o.mTitle;
885                changes |= TITLE_CHANGED;
886            }
887            if (alpha != o.alpha) {
888                alpha = o.alpha;
889                changes |= ALPHA_CHANGED;
890            }
891            if (dimAmount != o.dimAmount) {
892                dimAmount = o.dimAmount;
893                changes |= DIM_AMOUNT_CHANGED;
894            }
895            if (screenBrightness != o.screenBrightness) {
896                screenBrightness = o.screenBrightness;
897                changes |= SCREEN_BRIGHTNESS_CHANGED;
898            }
899
900            if (screenOrientation != o.screenOrientation) {
901                screenOrientation = o.screenOrientation;
902                changes |= SCREEN_ORIENTATION_CHANGED;
903            }
904            return changes;
905        }
906
907        @Override
908        public String debug(String output) {
909            output += "Contents of " + this + ":";
910            Log.d("Debug", output);
911            output = super.debug("");
912            Log.d("Debug", output);
913            Log.d("Debug", "");
914            Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
915            return "";
916        }
917
918        @Override
919        public String toString() {
920            StringBuilder sb = new StringBuilder(256);
921            sb.append("WM.LayoutParams{");
922            sb.append("(");
923            sb.append(x);
924            sb.append(',');
925            sb.append(y);
926            sb.append(")(");
927            sb.append((width==FILL_PARENT?"fill":(width==WRAP_CONTENT?"wrap":width)));
928            sb.append('x');
929            sb.append((height==FILL_PARENT?"fill":(height==WRAP_CONTENT?"wrap":height)));
930            sb.append(")");
931            if (softInputMode != 0) {
932                sb.append(" sim=#");
933                sb.append(Integer.toHexString(softInputMode));
934            }
935            if (gravity != 0) {
936                sb.append(" gr=#");
937                sb.append(Integer.toHexString(gravity));
938            }
939            sb.append(" ty=");
940            sb.append(type);
941            sb.append(" fl=#");
942            sb.append(Integer.toHexString(flags));
943            sb.append(" fmt=");
944            sb.append(format);
945            if (windowAnimations != 0) {
946                sb.append(" wanim=0x");
947                sb.append(Integer.toHexString(windowAnimations));
948            }
949            if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
950                sb.append(" or=");
951                sb.append(screenOrientation);
952            }
953            sb.append('}');
954            return sb.toString();
955        }
956
957        private CharSequence mTitle = "";
958    }
959}
960