Merge "Revert "VideoPlaneView initial implementation""

This commit is contained in:
Wonsik Kim
2014-03-18 01:00:58 +00:00
committed by Android (Google) Code Review
5 changed files with 110 additions and 183 deletions

View File

@@ -166,13 +166,6 @@ public class SurfaceControl {
*/ */
public static final int FX_SURFACE_DIM = 0x00020000; public static final int FX_SURFACE_DIM = 0x00020000;
/**
* Surface creation flag: Creates a video plane Surface.
* This surface is backed by a hardware video plane. It is an error to lock
* a video plane surface, since it doesn't have a backing store.
*/
public static final int FX_SURFACE_VIDEO_PLANE = 0x00040000;
/** /**
* Mask used for FX values above. * Mask used for FX values above.
* *

View File

@@ -422,10 +422,7 @@ public class SurfaceView extends View {
mWindowType = type; mWindowType = type;
} }
/** private void updateWindow(boolean force, boolean redrawNeeded) {
* @hide
*/
protected void updateWindow(boolean force, boolean redrawNeeded) {
if (!mHaveFrame) { if (!mHaveFrame) {
return; return;
} }

View File

@@ -1,53 +0,0 @@
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.view;
import android.content.Context;
import android.util.AttributeSet;
/**
* Provides a dedicated surface embedded inside of a view hierarchy much like a
* {@link SurfaceView}, but the surface is actually backed by a hardware video
* plane.
*
* TODO: Eventually this should be separate from SurfaceView.
*
* @hide
*/
public class VideoPlaneView extends SurfaceView {
public VideoPlaneView(Context context) {
super(context);
}
public VideoPlaneView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public VideoPlaneView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public VideoPlaneView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
protected void updateWindow(boolean force, boolean redrawNeeded) {
mLayout.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_VIDEO_PLANE;
super.updateWindow(force, redrawNeeded);
}
}

View File

@@ -98,7 +98,7 @@ public interface WindowManager extends ViewManager {
* the given view hierarchy's {@link View#onDetachedFromWindow() * the given view hierarchy's {@link View#onDetachedFromWindow()
* View.onDetachedFromWindow()} methods before returning. This is not * View.onDetachedFromWindow()} methods before returning. This is not
* for normal applications; using it correctly requires great care. * for normal applications; using it correctly requires great care.
* *
* @param view The view to be removed. * @param view The view to be removed.
*/ */
public void removeViewImmediate(View view); public void removeViewImmediate(View view);
@@ -112,7 +112,7 @@ public interface WindowManager extends ViewManager {
*/ */
@ViewDebug.ExportedProperty @ViewDebug.ExportedProperty
public int x; public int x;
/** /**
* Y position for this window. With the default gravity it is ignored. * Y position for this window. With the default gravity it is ignored.
* When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides
@@ -161,7 +161,7 @@ public interface WindowManager extends ViewManager {
* be used by applications, and a special permission is required * be used by applications, and a special permission is required
* to use them. * to use them.
* </ul> * </ul>
* *
* @see #TYPE_BASE_APPLICATION * @see #TYPE_BASE_APPLICATION
* @see #TYPE_APPLICATION * @see #TYPE_APPLICATION
* @see #TYPE_APPLICATION_STARTING * @see #TYPE_APPLICATION_STARTING
@@ -223,12 +223,12 @@ public interface WindowManager extends ViewManager {
@ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION") @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION")
}) })
public int type; public int type;
/** /**
* Start of window types that represent normal application windows. * Start of window types that represent normal application windows.
*/ */
public static final int FIRST_APPLICATION_WINDOW = 1; public static final int FIRST_APPLICATION_WINDOW = 1;
/** /**
* Window type: an application window that serves as the "base" window * Window type: an application window that serves as the "base" window
* of the overall application; all other application windows will * of the overall application; all other application windows will
@@ -236,14 +236,14 @@ public interface WindowManager extends ViewManager {
* In multiuser systems shows only on the owning user's window. * In multiuser systems shows only on the owning user's window.
*/ */
public static final int TYPE_BASE_APPLICATION = 1; public static final int TYPE_BASE_APPLICATION = 1;
/** /**
* Window type: a normal application window. The {@link #token} must be * Window type: a normal application window. The {@link #token} must be
* an Activity token identifying who the window belongs to. * an Activity token identifying who the window belongs to.
* In multiuser systems shows only on the owning user's window. * In multiuser systems shows only on the owning user's window.
*/ */
public static final int TYPE_APPLICATION = 2; public static final int TYPE_APPLICATION = 2;
/** /**
* Window type: special application window that is displayed while the * Window type: special application window that is displayed while the
* application is starting. Not for use by applications themselves; * application is starting. Not for use by applications themselves;
@@ -252,12 +252,12 @@ public interface WindowManager extends ViewManager {
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_APPLICATION_STARTING = 3; public static final int TYPE_APPLICATION_STARTING = 3;
/** /**
* End of types of application windows. * End of types of application windows.
*/ */
public static final int LAST_APPLICATION_WINDOW = 99; public static final int LAST_APPLICATION_WINDOW = 99;
/** /**
* Start of types of sub-windows. The {@link #token} of these windows * Start of types of sub-windows. The {@link #token} of these windows
* must be set to the window they are attached to. These types of * must be set to the window they are attached to. These types of
@@ -265,19 +265,19 @@ public interface WindowManager extends ViewManager {
* coordinate space is relative to their attached window. * coordinate space is relative to their attached window.
*/ */
public static final int FIRST_SUB_WINDOW = 1000; public static final int FIRST_SUB_WINDOW = 1000;
/** /**
* Window type: a panel on top of an application window. These windows * Window type: a panel on top of an application window. These windows
* appear on top of their attached window. * appear on top of their attached window.
*/ */
public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW; public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
/** /**
* Window type: window for showing media (such as video). These windows * Window type: window for showing media (such as video). These windows
* are displayed behind their attached window. * are displayed behind their attached window.
*/ */
public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1; public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1;
/** /**
* Window type: a sub-panel on top of an application window. These * Window type: a sub-panel on top of an application window. These
* windows are displayed on top their attached window and any * windows are displayed on top their attached window and any
@@ -290,7 +290,7 @@ public interface WindowManager extends ViewManager {
* as a child of its container. * as a child of its container.
*/ */
public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3; public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3;
/** /**
* Window type: window for showing overlays on top of media windows. * Window type: window for showing overlays on top of media windows.
* These windows are displayed between TYPE_APPLICATION_MEDIA and the * These windows are displayed between TYPE_APPLICATION_MEDIA and the
@@ -299,18 +299,18 @@ public interface WindowManager extends ViewManager {
* @hide * @hide
*/ */
public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4; public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4;
/** /**
* End of types of sub-windows. * End of types of sub-windows.
*/ */
public static final int LAST_SUB_WINDOW = 1999; public static final int LAST_SUB_WINDOW = 1999;
/** /**
* Start of system-specific window types. These are not normally * Start of system-specific window types. These are not normally
* created by applications. * created by applications.
*/ */
public static final int FIRST_SYSTEM_WINDOW = 2000; public static final int FIRST_SYSTEM_WINDOW = 2000;
/** /**
* Window type: the status bar. There can be only one status bar * Window type: the status bar. There can be only one status bar
* window; it is placed at the top of the screen, and all other * window; it is placed at the top of the screen, and all other
@@ -318,14 +318,14 @@ public interface WindowManager extends ViewManager {
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW; public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
/** /**
* Window type: the search bar. There can be only one search bar * Window type: the search bar. There can be only one search bar
* window; it is placed at the top of the screen. * window; it is placed at the top of the screen.
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1; public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1;
/** /**
* Window type: phone. These are non-application windows providing * Window type: phone. These are non-application windows providing
* user interaction with the phone (in particular incoming calls). * user interaction with the phone (in particular incoming calls).
@@ -334,26 +334,26 @@ public interface WindowManager extends ViewManager {
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2; public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2;
/** /**
* Window type: system window, such as low power alert. These windows * Window type: system window, such as low power alert. These windows
* are always on top of application windows. * are always on top of application windows.
* In multiuser systems shows only on the owning user's window. * In multiuser systems shows only on the owning user's window.
*/ */
public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3; public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3;
/** /**
* Window type: keyguard window. * Window type: keyguard window.
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4; public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4;
/** /**
* Window type: transient notifications. * Window type: transient notifications.
* In multiuser systems shows only on the owning user's window. * In multiuser systems shows only on the owning user's window.
*/ */
public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5; public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5;
/** /**
* Window type: system overlay windows, which need to be displayed * Window type: system overlay windows, which need to be displayed
* on top of everything else. These windows must not take input * on top of everything else. These windows must not take input
@@ -361,7 +361,7 @@ public interface WindowManager extends ViewManager {
* In multiuser systems shows only on the owning user's window. * In multiuser systems shows only on the owning user's window.
*/ */
public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6; public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6;
/** /**
* Window type: priority phone UI, which needs to be displayed even if * Window type: priority phone UI, which needs to be displayed even if
* the keyguard is active. These windows must not take input * the keyguard is active. These windows must not take input
@@ -369,26 +369,26 @@ public interface WindowManager extends ViewManager {
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7; public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7;
/** /**
* Window type: panel that slides out from the status bar * Window type: panel that slides out from the status bar
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8; public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8;
/** /**
* Window type: dialogs that the keyguard shows * Window type: dialogs that the keyguard shows
* In multiuser systems shows on all users' windows. * In multiuser systems shows on all users' windows.
*/ */
public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9; public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
/** /**
* Window type: internal system error windows, appear on top of * Window type: internal system error windows, appear on top of
* everything they can. * everything they can.
* In multiuser systems shows only on the owning user's window. * In multiuser systems shows only on the owning user's window.
*/ */
public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10; public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10;
/** /**
* Window type: internal input methods windows, which appear above * Window type: internal input methods windows, which appear above
* the normal UI. Application windows may be resized or panned to keep * the normal UI. Application windows may be resized or panned to keep
@@ -559,16 +559,16 @@ public interface WindowManager extends ViewManager {
/** @deprecated this is ignored, this value is set automatically when needed. */ /** @deprecated this is ignored, this value is set automatically when needed. */
@Deprecated @Deprecated
public static final int MEMORY_TYPE_PUSH_BUFFERS = 3; public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;
/** /**
* @deprecated this is ignored * @deprecated this is ignored
*/ */
@Deprecated @Deprecated
public int memoryType; public int memoryType;
/** Window flag: as long as this window is visible to the user, allow /** Window flag: as long as this window is visible to the user, allow
* the lock screen to activate while the screen is on. * the lock screen to activate while the screen is on.
* This can be used independently, or in combination with * This can be used independently, or in combination with
* {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */ * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */
public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001; public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
@@ -586,47 +586,47 @@ public interface WindowManager extends ViewManager {
* instead go to whatever focusable window is behind it. This flag * instead go to whatever focusable window is behind it. This flag
* will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that
* is explicitly set. * is explicitly set.
* *
* <p>Setting this flag also implies that the window will not need to * <p>Setting this flag also implies that the window will not need to
* interact with * interact with
* a soft input method, so it will be Z-ordered and positioned * a soft input method, so it will be Z-ordered and positioned
* independently of any active input method (typically this means it * independently of any active input method (typically this means it
* gets Z-ordered on top of the input method, so it can use the full * gets Z-ordered on top of the input method, so it can use the full
* screen for its content and cover the input method if needed. You * screen for its content and cover the input method if needed. You
* can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */ * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */
public static final int FLAG_NOT_FOCUSABLE = 0x00000008; public static final int FLAG_NOT_FOCUSABLE = 0x00000008;
/** Window flag: this window can never receive touch events. */ /** Window flag: this window can never receive touch events. */
public static final int FLAG_NOT_TOUCHABLE = 0x00000010; public static final int FLAG_NOT_TOUCHABLE = 0x00000010;
/** Window flag: even when this window is focusable (its /** Window flag: even when this window is focusable (its
* {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events
* outside of the window to be sent to the windows behind it. Otherwise * outside of the window to be sent to the windows behind it. Otherwise
* it will consume all pointer events itself, regardless of whether they * it will consume all pointer events itself, regardless of whether they
* are inside of the window. */ * are inside of the window. */
public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020; public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020;
/** Window flag: when set, if the device is asleep when the touch /** Window flag: when set, if the device is asleep when the touch
* screen is pressed, you will receive this first touch event. Usually * screen is pressed, you will receive this first touch event. Usually
* the first touch event is consumed by the system since the user can * the first touch event is consumed by the system since the user can
* not see what they are pressing on. * not see what they are pressing on.
*/ */
public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040; public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
/** Window flag: as long as this window is visible to the user, keep /** Window flag: as long as this window is visible to the user, keep
* the device's screen turned on and bright. */ * the device's screen turned on and bright. */
public static final int FLAG_KEEP_SCREEN_ON = 0x00000080; public static final int FLAG_KEEP_SCREEN_ON = 0x00000080;
/** Window flag: place the window within the entire screen, ignoring /** Window flag: place the window within the entire screen, ignoring
* decorations around the border (such as the status bar). The * decorations around the border (such as the status bar). The
* window must correctly position its contents to take the screen * window must correctly position its contents to take the screen
* decoration into account. This flag is normally set for you * decoration into account. This flag is normally set for you
* by Window as described in {@link Window#setFlags}. */ * by Window as described in {@link Window#setFlags}. */
public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100; public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
/** Window flag: allow window to extend outside of the screen. */ /** Window flag: allow window to extend outside of the screen. */
public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200; public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
/** /**
* Window flag: hide all screen decorations (such as the status bar) while * Window flag: hide all screen decorations (such as the status bar) while
* this window is displayed. This allows the window to use the entire * this window is displayed. This allows the window to use the entire
@@ -648,17 +648,17 @@ public interface WindowManager extends ViewManager {
* {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p> * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p>
*/ */
public static final int FLAG_FULLSCREEN = 0x00000400; public static final int FLAG_FULLSCREEN = 0x00000400;
/** Window flag: override {@link #FLAG_FULLSCREEN} and force the /** Window flag: override {@link #FLAG_FULLSCREEN} and force the
* screen decorations (such as the status bar) to be shown. */ * screen decorations (such as the status bar) to be shown. */
public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800; public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
/** Window flag: turn on dithering when compositing this window to /** Window flag: turn on dithering when compositing this window to
* the screen. * the screen.
* @deprecated This flag is no longer used. */ * @deprecated This flag is no longer used. */
@Deprecated @Deprecated
public static final int FLAG_DITHER = 0x00001000; public static final int FLAG_DITHER = 0x00001000;
/** Window flag: treat the content of the window as secure, preventing /** Window flag: treat the content of the window as secure, preventing
* it from appearing in screenshots or from being viewed on non-secure * it from appearing in screenshots or from being viewed on non-secure
* displays. * displays.
@@ -667,21 +667,21 @@ public interface WindowManager extends ViewManager {
* secure surfaces and secure displays. * secure surfaces and secure displays.
*/ */
public static final int FLAG_SECURE = 0x00002000; public static final int FLAG_SECURE = 0x00002000;
/** Window flag: a special mode where the layout parameters are used /** Window flag: a special mode where the layout parameters are used
* to perform scaling of the surface when it is composited to the * to perform scaling of the surface when it is composited to the
* screen. */ * screen. */
public static final int FLAG_SCALED = 0x00004000; public static final int FLAG_SCALED = 0x00004000;
/** Window flag: intended for windows that will often be used when the user is /** Window flag: intended for windows that will often be used when the user is
* holding the screen against their face, it will aggressively filter the event * holding the screen against their face, it will aggressively filter the event
* stream to prevent unintended presses in this situation that may not be * stream to prevent unintended presses in this situation that may not be
* desired for a particular window, when such an event stream is detected, the * desired for a particular window, when such an event stream is detected, the
* application will receive a CANCEL motion event to indicate this so applications * application will receive a CANCEL motion event to indicate this so applications
* can handle this accordingly by taking no action on the event * can handle this accordingly by taking no action on the event
* until the finger is released. */ * until the finger is released. */
public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000; public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
/** Window flag: a special option only for use in combination with /** Window flag: a special option only for use in combination with
* {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the
* screen your window may appear on top of or behind screen decorations * screen your window may appear on top of or behind screen decorations
@@ -690,7 +690,7 @@ public interface WindowManager extends ViewManager {
* content is not covered by screen decorations. This flag is normally * content is not covered by screen decorations. This flag is normally
* set for you by Window as described in {@link Window#setFlags}.*/ * set for you by Window as described in {@link Window#setFlags}.*/
public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000; public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
/** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
* respect to how this window interacts with the current method. That * respect to how this window interacts with the current method. That
* is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
@@ -701,7 +701,7 @@ public interface WindowManager extends ViewManager {
* to use more space and cover the input method. * to use more space and cover the input method.
*/ */
public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000; public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
/** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you
* can set this flag to receive a single special MotionEvent with * can set this flag to receive a single special MotionEvent with
* the action * the action
@@ -711,7 +711,7 @@ public interface WindowManager extends ViewManager {
* first down as an ACTION_OUTSIDE. * first down as an ACTION_OUTSIDE.
*/ */
public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000; public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
/** Window flag: special flag to let windows be shown when the screen /** Window flag: special flag to let windows be shown when the screen
* is locked. This will let application windows take precedence over * is locked. This will let application windows take precedence over
* key guard or any other lock screens. Can be used with * key guard or any other lock screens. Can be used with
@@ -741,13 +741,13 @@ public interface WindowManager extends ViewManager {
* {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p> * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p>
*/ */
public static final int FLAG_SHOW_WALLPAPER = 0x00100000; public static final int FLAG_SHOW_WALLPAPER = 0x00100000;
/** Window flag: when set as a window is being added or made /** Window flag: when set as a window is being added or made
* visible, once the window has been shown then the system will * visible, once the window has been shown then the system will
* poke the power manager's user activity (as if the user had woken * poke the power manager's user activity (as if the user had woken
* up the device) to turn the screen on. */ * up the device) to turn the screen on. */
public static final int FLAG_TURN_SCREEN_ON = 0x00200000; public static final int FLAG_TURN_SCREEN_ON = 0x00200000;
/** Window flag: when set the window will cause the keyguard to /** Window flag: when set the window will cause the keyguard to
* be dismissed, only if it is not a secure lock keyguard. Because such * be dismissed, only if it is not a secure lock keyguard. Because such
* a keyguard is not needed for security, it will never re-appear if * a keyguard is not needed for security, it will never re-appear if
@@ -761,7 +761,7 @@ public interface WindowManager extends ViewManager {
* also been set. * also been set.
*/ */
public static final int FLAG_DISMISS_KEYGUARD = 0x00400000; public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
/** Window flag: when set the window will accept for touch events /** Window flag: when set the window will accept for touch events
* outside of its bounds to be sent to other windows that also * outside of its bounds to be sent to other windows that also
* support split touch. When this flag is not set, the first pointer * support split touch. When this flag is not set, the first pointer
@@ -773,7 +773,7 @@ public interface WindowManager extends ViewManager {
* to be split across multiple windows. * to be split across multiple windows.
*/ */
public static final int FLAG_SPLIT_TOUCH = 0x00800000; public static final int FLAG_SPLIT_TOUCH = 0x00800000;
/** /**
* <p>Indicates whether this window should be hardware accelerated. * <p>Indicates whether this window should be hardware accelerated.
* Requesting hardware acceleration does not guarantee it will happen.</p> * Requesting hardware acceleration does not guarantee it will happen.</p>
@@ -916,7 +916,7 @@ public interface WindowManager extends ViewManager {
/** /**
* Various behavioral options/flags. Default is none. * Various behavioral options/flags. Default is none.
* *
* @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
* @see #FLAG_DIM_BEHIND * @see #FLAG_DIM_BEHIND
* @see #FLAG_NOT_FOCUSABLE * @see #FLAG_NOT_FOCUSABLE
@@ -1014,10 +1014,10 @@ public interface WindowManager extends ViewManager {
* as if it was. * as if it was.
* Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows
* that need hardware acceleration (e.g. LockScreen), where hardware acceleration * that need hardware acceleration (e.g. LockScreen), where hardware acceleration
* is generally disabled. This flag must be specified in addition to * is generally disabled. This flag must be specified in addition to
* {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system
* windows. * windows.
* *
* @hide * @hide
*/ */
public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001; public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001;
@@ -1028,7 +1028,7 @@ public interface WindowManager extends ViewManager {
* If certain parts of the UI that really do want to use hardware * If certain parts of the UI that really do want to use hardware
* acceleration, this flag can be set to force it. This is basically * acceleration, this flag can be set to force it. This is basically
* for the lock screen. Anyone else using it, you are probably wrong. * for the lock screen. Anyone else using it, you are probably wrong.
* *
* @hide * @hide
*/ */
public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002; public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
@@ -1086,11 +1086,6 @@ public interface WindowManager extends ViewManager {
* {@hide} */ * {@hide} */
public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200; public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200;
/** Window flag: the window is backed by a video plane, instead of a
* regular surface.
* {@hide} */
public static final int PRIVATE_FLAG_VIDEO_PLANE = 0x00000400;
/** /**
* Control flags that are private to the platform. * Control flags that are private to the platform.
* @hide * @hide
@@ -1105,9 +1100,9 @@ public interface WindowManager extends ViewManager {
* flags and returns true if the combination of the two corresponds * flags and returns true if the combination of the two corresponds
* to a window that needs to be behind the input method so that the * to a window that needs to be behind the input method so that the
* user can type into it. * user can type into it.
* *
* @param flags The current window manager flags. * @param flags The current window manager flags.
* *
* @return Returns true if such a window should be behind/interact * @return Returns true if such a window should be behind/interact
* with an input method, false if not. * with an input method, false if not.
*/ */
@@ -1119,63 +1114,63 @@ public interface WindowManager extends ViewManager {
} }
return false; return false;
} }
/** /**
* Mask for {@link #softInputMode} of the bits that determine the * Mask for {@link #softInputMode} of the bits that determine the
* desired visibility state of the soft input area for this window. * desired visibility state of the soft input area for this window.
*/ */
public static final int SOFT_INPUT_MASK_STATE = 0x0f; public static final int SOFT_INPUT_MASK_STATE = 0x0f;
/** /**
* Visibility state for {@link #softInputMode}: no state has been specified. * Visibility state for {@link #softInputMode}: no state has been specified.
*/ */
public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0; public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0;
/** /**
* Visibility state for {@link #softInputMode}: please don't change the state of * Visibility state for {@link #softInputMode}: please don't change the state of
* the soft input area. * the soft input area.
*/ */
public static final int SOFT_INPUT_STATE_UNCHANGED = 1; public static final int SOFT_INPUT_STATE_UNCHANGED = 1;
/** /**
* Visibility state for {@link #softInputMode}: please hide any soft input * Visibility state for {@link #softInputMode}: please hide any soft input
* area when normally appropriate (when the user is navigating * area when normally appropriate (when the user is navigating
* forward to your window). * forward to your window).
*/ */
public static final int SOFT_INPUT_STATE_HIDDEN = 2; public static final int SOFT_INPUT_STATE_HIDDEN = 2;
/** /**
* Visibility state for {@link #softInputMode}: please always hide any * Visibility state for {@link #softInputMode}: please always hide any
* soft input area when this window receives focus. * soft input area when this window receives focus.
*/ */
public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3; public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3;
/** /**
* Visibility state for {@link #softInputMode}: please show the soft * Visibility state for {@link #softInputMode}: please show the soft
* input area when normally appropriate (when the user is navigating * input area when normally appropriate (when the user is navigating
* forward to your window). * forward to your window).
*/ */
public static final int SOFT_INPUT_STATE_VISIBLE = 4; public static final int SOFT_INPUT_STATE_VISIBLE = 4;
/** /**
* Visibility state for {@link #softInputMode}: please always make the * Visibility state for {@link #softInputMode}: please always make the
* soft input area visible when this window receives input focus. * soft input area visible when this window receives input focus.
*/ */
public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5; public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5;
/** /**
* Mask for {@link #softInputMode} of the bits that determine the * Mask for {@link #softInputMode} of the bits that determine the
* way that the window should be adjusted to accommodate the soft * way that the window should be adjusted to accommodate the soft
* input window. * input window.
*/ */
public static final int SOFT_INPUT_MASK_ADJUST = 0xf0; public static final int SOFT_INPUT_MASK_ADJUST = 0xf0;
/** Adjustment option for {@link #softInputMode}: nothing specified. /** Adjustment option for {@link #softInputMode}: nothing specified.
* The system will try to pick one or * The system will try to pick one or
* the other depending on the contents of the window. * the other depending on the contents of the window.
*/ */
public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00; public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00;
/** Adjustment option for {@link #softInputMode}: set to allow the /** Adjustment option for {@link #softInputMode}: set to allow the
* window to be resized when an input * window to be resized when an input
* method is shown, so that its contents are not covered by the input * method is shown, so that its contents are not covered by the input
@@ -1188,7 +1183,7 @@ public interface WindowManager extends ViewManager {
* not resize, but will stay fullscreen. * not resize, but will stay fullscreen.
*/ */
public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10; public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10;
/** Adjustment option for {@link #softInputMode}: set to have a window /** Adjustment option for {@link #softInputMode}: set to have a window
* pan when an input method is * pan when an input method is
* shown, so it doesn't need to deal with resizing but just panned * shown, so it doesn't need to deal with resizing but just panned
@@ -1198,7 +1193,7 @@ public interface WindowManager extends ViewManager {
* the other depending on the contents of the window. * the other depending on the contents of the window.
*/ */
public static final int SOFT_INPUT_ADJUST_PAN = 0x20; public static final int SOFT_INPUT_ADJUST_PAN = 0x20;
/** Adjustment option for {@link #softInputMode}: set to have a window /** Adjustment option for {@link #softInputMode}: set to have a window
* not adjust for a shown input method. The window will not be resized, * not adjust for a shown input method. The window will not be resized,
* and it will not be panned to make its focus visible. * and it will not be panned to make its focus visible.
@@ -1217,7 +1212,7 @@ public interface WindowManager extends ViewManager {
/** /**
* Desired operating mode for any soft input area. May be any combination * Desired operating mode for any soft input area. May be any combination
* of: * of:
* *
* <ul> * <ul>
* <li> One of the visibility states * <li> One of the visibility states
* {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED}, * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED},
@@ -1234,7 +1229,7 @@ public interface WindowManager extends ViewManager {
* {@link android.R.attr#windowSoftInputMode} attribute.</p> * {@link android.R.attr#windowSoftInputMode} attribute.</p>
*/ */
public int softInputMode; public int softInputMode;
/** /**
* Placement of window within the screen as per {@link Gravity}. Both * Placement of window within the screen as per {@link Gravity}. Both
* {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int,
@@ -1251,7 +1246,7 @@ public interface WindowManager extends ViewManager {
* @see Gravity * @see Gravity
*/ */
public int gravity; public int gravity;
/** /**
* The horizontal margin, as a percentage of the container's width, * The horizontal margin, as a percentage of the container's width,
* between the container and the widget. See * between the container and the widget. See
@@ -1260,7 +1255,7 @@ public interface WindowManager extends ViewManager {
* field is added with {@link #x} to supply the <var>xAdj</var> parameter. * field is added with {@link #x} to supply the <var>xAdj</var> parameter.
*/ */
public float horizontalMargin; public float horizontalMargin;
/** /**
* The vertical margin, as a percentage of the container's height, * The vertical margin, as a percentage of the container's height,
* between the container and the widget. See * between the container and the widget. See
@@ -1269,26 +1264,26 @@ public interface WindowManager extends ViewManager {
* field is added with {@link #y} to supply the <var>yAdj</var> parameter. * field is added with {@link #y} to supply the <var>yAdj</var> parameter.
*/ */
public float verticalMargin; public float verticalMargin;
/** /**
* The desired bitmap format. May be one of the constants in * The desired bitmap format. May be one of the constants in
* {@link android.graphics.PixelFormat}. Default is OPAQUE. * {@link android.graphics.PixelFormat}. Default is OPAQUE.
*/ */
public int format; public int format;
/** /**
* A style resource defining the animations to use for this window. * A style resource defining the animations to use for this window.
* This must be a system resource; it can not be an application resource * This must be a system resource; it can not be an application resource
* because the window manager does not have access to applications. * because the window manager does not have access to applications.
*/ */
public int windowAnimations; public int windowAnimations;
/** /**
* An alpha value to apply to this entire window. * An alpha value to apply to this entire window.
* An alpha of 1.0 means fully opaque and 0.0 means fully transparent * An alpha of 1.0 means fully opaque and 0.0 means fully transparent
*/ */
public float alpha = 1.0f; public float alpha = 1.0f;
/** /**
* When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming
* to apply. Range is from 1.0 for completely opaque to 0.0 for no * to apply. Range is from 1.0 for completely opaque to 0.0 for no
@@ -1316,7 +1311,7 @@ public interface WindowManager extends ViewManager {
* to the hightest value when this window is in front. * to the hightest value when this window is in front.
*/ */
public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f; public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f;
/** /**
* This can be used to override the user's preferred brightness of * This can be used to override the user's preferred brightness of
* the screen. A value of less than 0, the default, means to use the * the screen. A value of less than 0, the default, means to use the
@@ -1324,7 +1319,7 @@ public interface WindowManager extends ViewManager {
* dark to full bright. * dark to full bright.
*/ */
public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE; public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE;
/** /**
* This can be used to override the standard behavior of the button and * This can be used to override the standard behavior of the button and
* keyboard backlights. A value of less than 0, the default, means to * keyboard backlights. A value of less than 0, the default, means to
@@ -1358,7 +1353,7 @@ public interface WindowManager extends ViewManager {
* opaque windows have the #FLAG_FULLSCREEN bit set and are not covered * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered
* by other windows. All other situations default to the * by other windows. All other situations default to the
* {@link #ROTATION_ANIMATION_ROTATE} behavior. * {@link #ROTATION_ANIMATION_ROTATE} behavior.
* *
* @see #ROTATION_ANIMATION_ROTATE * @see #ROTATION_ANIMATION_ROTATE
* @see #ROTATION_ANIMATION_CROSSFADE * @see #ROTATION_ANIMATION_CROSSFADE
* @see #ROTATION_ANIMATION_JUMPCUT * @see #ROTATION_ANIMATION_JUMPCUT
@@ -1370,18 +1365,18 @@ public interface WindowManager extends ViewManager {
* you. * you.
*/ */
public IBinder token = null; public IBinder token = null;
/** /**
* Name of the package owning this window. * Name of the package owning this window.
*/ */
public String packageName = null; public String packageName = null;
/** /**
* Specific orientation value for a window. * Specific orientation value for a window.
* May be any of the same values allowed * May be any of the same values allowed
* for {@link android.content.pm.ActivityInfo#screenOrientation}. * for {@link android.content.pm.ActivityInfo#screenOrientation}.
* If not set, a default value of * If not set, a default value of
* {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED} * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED}
* will be used. * will be used.
*/ */
public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
@@ -1403,7 +1398,7 @@ public interface WindowManager extends ViewManager {
/** /**
* Get callbacks about the system ui visibility changing. * Get callbacks about the system ui visibility changing.
* *
* TODO: Maybe there should be a bitfield of optional callbacks that we need. * TODO: Maybe there should be a bitfield of optional callbacks that we need.
* *
* @hide * @hide
@@ -1469,34 +1464,34 @@ public interface WindowManager extends ViewManager {
type = TYPE_APPLICATION; type = TYPE_APPLICATION;
format = PixelFormat.OPAQUE; format = PixelFormat.OPAQUE;
} }
public LayoutParams(int _type) { public LayoutParams(int _type) {
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
type = _type; type = _type;
format = PixelFormat.OPAQUE; format = PixelFormat.OPAQUE;
} }
public LayoutParams(int _type, int _flags) { public LayoutParams(int _type, int _flags) {
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
type = _type; type = _type;
flags = _flags; flags = _flags;
format = PixelFormat.OPAQUE; format = PixelFormat.OPAQUE;
} }
public LayoutParams(int _type, int _flags, int _format) { public LayoutParams(int _type, int _flags, int _format) {
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
type = _type; type = _type;
flags = _flags; flags = _flags;
format = _format; format = _format;
} }
public LayoutParams(int w, int h, int _type, int _flags, int _format) { public LayoutParams(int w, int h, int _type, int _flags, int _format) {
super(w, h); super(w, h);
type = _type; type = _type;
flags = _flags; flags = _flags;
format = _format; format = _format;
} }
public LayoutParams(int w, int h, int xpos, int ypos, int _type, public LayoutParams(int w, int h, int xpos, int ypos, int _type,
int _flags, int _format) { int _flags, int _format) {
super(w, h); super(w, h);
@@ -1506,18 +1501,18 @@ public interface WindowManager extends ViewManager {
flags = _flags; flags = _flags;
format = _format; format = _format;
} }
public final void setTitle(CharSequence title) { public final void setTitle(CharSequence title) {
if (null == title) if (null == title)
title = ""; title = "";
mTitle = TextUtils.stringOrSpannedString(title); mTitle = TextUtils.stringOrSpannedString(title);
} }
public final CharSequence getTitle() { public final CharSequence getTitle() {
return mTitle; return mTitle;
} }
public int describeContents() { public int describeContents() {
return 0; return 0;
} }
@@ -1551,19 +1546,19 @@ public interface WindowManager extends ViewManager {
out.writeInt(inputFeatures); out.writeInt(inputFeatures);
out.writeLong(userActivityTimeout); out.writeLong(userActivityTimeout);
} }
public static final Parcelable.Creator<LayoutParams> CREATOR public static final Parcelable.Creator<LayoutParams> CREATOR
= new Parcelable.Creator<LayoutParams>() { = new Parcelable.Creator<LayoutParams>() {
public LayoutParams createFromParcel(Parcel in) { public LayoutParams createFromParcel(Parcel in) {
return new LayoutParams(in); return new LayoutParams(in);
} }
public LayoutParams[] newArray(int size) { public LayoutParams[] newArray(int size) {
return new LayoutParams[size]; return new LayoutParams[size];
} }
}; };
public LayoutParams(Parcel in) { public LayoutParams(Parcel in) {
width = in.readInt(); width = in.readInt();
height = in.readInt(); height = in.readInt();
@@ -1593,7 +1588,7 @@ public interface WindowManager extends ViewManager {
inputFeatures = in.readInt(); inputFeatures = in.readInt();
userActivityTimeout = in.readLong(); userActivityTimeout = in.readLong();
} }
@SuppressWarnings({"PointlessBitwiseExpression"}) @SuppressWarnings({"PointlessBitwiseExpression"})
public static final int LAYOUT_CHANGED = 1<<0; public static final int LAYOUT_CHANGED = 1<<0;
public static final int TYPE_CHANGED = 1<<1; public static final int TYPE_CHANGED = 1<<1;
@@ -1627,10 +1622,10 @@ public interface WindowManager extends ViewManager {
// internal buffer to backup/restore parameters under compatibility mode. // internal buffer to backup/restore parameters under compatibility mode.
private int[] mCompatibilityParamsBackup = null; private int[] mCompatibilityParamsBackup = null;
public final int copyFrom(LayoutParams o) { public final int copyFrom(LayoutParams o) {
int changes = 0; int changes = 0;
if (width != o.width) { if (width != o.width) {
width = o.width; width = o.width;
changes |= LAYOUT_CHANGED; changes |= LAYOUT_CHANGED;
@@ -1729,7 +1724,7 @@ public interface WindowManager extends ViewManager {
rotationAnimation = o.rotationAnimation; rotationAnimation = o.rotationAnimation;
changes |= ROTATION_ANIMATION_CHANGED; changes |= ROTATION_ANIMATION_CHANGED;
} }
if (screenOrientation != o.screenOrientation) { if (screenOrientation != o.screenOrientation) {
screenOrientation = o.screenOrientation; screenOrientation = o.screenOrientation;
changes |= SCREEN_ORIENTATION_CHANGED; changes |= SCREEN_ORIENTATION_CHANGED;
@@ -1759,7 +1754,7 @@ public interface WindowManager extends ViewManager {
return changes; return changes;
} }
@Override @Override
public String debug(String output) { public String debug(String output) {
output += "Contents of " + this + ":"; output += "Contents of " + this + ":";
@@ -1770,7 +1765,7 @@ public interface WindowManager extends ViewManager {
Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}"); Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}");
return ""; return "";
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(256); StringBuilder sb = new StringBuilder(256);

View File

@@ -669,15 +669,10 @@ class WindowStateAnimator {
int flags = SurfaceControl.HIDDEN; int flags = SurfaceControl.HIDDEN;
final WindowManager.LayoutParams attrs = mWin.mAttrs; final WindowManager.LayoutParams attrs = mWin.mAttrs;
final boolean isVideoPlane =
(attrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_VIDEO_PLANE) != 0;
if ((attrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) { if ((attrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
flags |= SurfaceControl.SECURE; flags |= SurfaceControl.SECURE;
} }
if (isVideoPlane) {
flags |= SurfaceControl.FX_SURFACE_VIDEO_PLANE;
}
if (DEBUG_VISIBILITY) Slog.v( if (DEBUG_VISIBILITY) Slog.v(
TAG, "Creating surface in session " TAG, "Creating surface in session "
+ mSession.mSurfaceSession + " window " + this + mSession.mSurfaceSession + " window " + this