From 1cd403eaac24e0e84619dea07e2d1d60e58e1fd2 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 14 Sep 2009 22:29:14 -0700 Subject: [PATCH] Add SurfaceView API to put surface on top of window. Change-Id: I9db84ee63a362e54ebc2f5b24a20ae5bdc3588bf --- api/current.xml | 13 ++++++++ core/java/android/view/SurfaceView.java | 44 ++++++++++++++++++++----- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/api/current.xml b/api/current.xml index 38490f3113eb5..f7df7c9b7433a 100644 --- a/api/current.xml +++ b/api/current.xml @@ -150079,6 +150079,19 @@ visibility="public" > + + + + Note that this must be set before the surface view's containing + * window is attached to the window manager. + */ + public void setOnTop(boolean onTop) { + mWindowType = onTop ? WindowManager.LayoutParams.TYPE_APPLICATION_PANEL + : WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA; + } + /** * Hack to allow special layering of windows. The type is one of the * types in WindowManager.LayoutParams. This is a hack so: @@ -345,7 +369,9 @@ public class SurfaceView extends View { } mLayout.format = mRequestedFormat; - mLayout.flags |=WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS + mLayout.flags |=WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_SCALED | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE