How to programmatically determine if any screen recorder process / application is running in Android?

I don't want users to take screenshot or recording screen of my application. I added a safe flag to the window. This prevents the user from taking screenshots and screen recordings.

If screen recording is enabled, my app prevents content from being recorded, but audio is recorded.

On some truncated devices, safe flags may not work as expected. So I just want to detect if any app / process of screen recording is running in the background so that I can hide sensitive data and prevent it from being recorded.

Is there a way to detect if screen recording is enabled?

+3


source to share


1 answer


Is there a way to detect if screen recording is enabled?

Not.

So I just want to detect if any app / process of screen recording is running in the background so that I can hide sensitive data and prevent it from being recorded.



Since screen recording does not require a recording-specific application or process (for example adb shell screenrecord

), and since you have no way of knowing about specific applications or processes using the media projection API, this seems impractical. And, in modern versions of Android, you in no way know what other processes are running. In addition, nothing prevents the user from pointing another camera on the device screen and recording its contents in this way.

I don't want users to take a screenshot or recording screen of my application.

Then don't write an application. The idea FLAG_SECURE

is to help protect the user from third parties, not protect the developer from the user.

+4


source







All Articles