I have a floating window that has a flag FLAG_SECURE. It is successfully hidden from screencaptures and a MediaProjection that I have set up. It is shown as black rectangular object when I record through a MediaProjection. Everything from my floating window is blacked out.
WindowManager windowManager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
params.type = WindowManager.LayoutParams.TYPE_PHONE;
params.format = PixelFormat.TRANSPARENT;
params.flags = WindowManager.LayoutParams.FLAG_SECURE;
windowManager.addView(floatingView, params);
My question is, is it possible to hide this floating window? I mean to not show it as a black object but instead capture content under the floating window so that it is completely hidden from MediaProjection?