0

I record my android device screen by using MediaProjectionManager (since Lollipop). But i want to display this record on the same screen on a new uppermost Surface. This surface shouldn't be touched by the recording MediaProjectionManager (records a composite of all visible surfaces). Is there any system SurfaceView that would not be recognized by MediaProjectionManager to stream it onto it?

Or in other words: How can i prevent recording certain SurfaceViews, make them invisible for the recorder? Are there any flags to set?

For recording i use this code by MattSnider: http://mattsnider.com/video-recording-with-mediaprojectionmanager/

Martin
  • 80
  • 8
  • You can mark it "secure", which will cause it to appear black, but I don't think there's a way to mark it "invisible". But I haven't looked in recent Android to see if such a thing exists. Generally when you do this you get a "hall of mirrors" effect. – fadden Oct 09 '15 at 17:33
  • The flag is set on the SurfaceView -- http://developer.android.com/reference/android/view/SurfaceView.html#setSecure(boolean) – fadden Oct 13 '15 at 16:32
  • Hi @fadden, thank you for answering this question and a couple of other similar ones. Do you think it got any better after 4 years? This feature is extremely useful for applications that want to modify the standard display behavior. I also wish to know what feasible approaches can be taken to get there without rooting. – Dmitry Mikushin Sep 18 '19 at 00:51

1 Answers1

0

To answer this question.

No, it is not possible to record the screen and simultanously show the recorded screen on top of the recorded view. That would lead to the "hall of mirrors" effect.

Reason: MediaProjectionManager is a Android system class, on which there is no access from elsewere. Otherwise it would mean a significant security issue on the Android platform.

Maybe this helps anyone

Martin
  • 80
  • 8