Sorry for the long title. I would basically like to add a SurfaceView as a window that appears above all windows but not above the notification bar (even when dragged down). The code I currently have is:
WindowManager.LayoutParams params = new WindowManager.LayoutParams(WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSLUCENT);
This works perfectly except it places the view above the notification bar. If I instead use TYPE_SYSTEM_ALERT, I can achieve the desired Z-order, but then my application will not respond to user input. I then added flag FLAG_NOT_TOUCHABLE, which then allows the user to interact with application components as desired. However, then the back button and the task manager button on the phone do not respond.
Is there anyway to achieve the behavior I'm looking for? I hope I made it clear enough, it's a bit difficult to describe in words what I would like. Thanks!