I am making an MDM application in which I have to block the screenshot on all applications on the device. I know using
getWindow().setFlags(LayoutParams.FLAG_SECURE,LayoutParams.FLAG_SECURE)
I can disable screen capture in my applications, but I want to disable screen capture in all applications installed on the device. previously I used File observer to lock the screen capture, it found that any image was added to the Screenshot folder, it deletes this image. But with Android M, they do not allow you to monitor files. I have searched a lot, but have not received any solution. But many Android apps like quick cure seqrite MDM prevents screen capture in Android M too, it should be.
I found the setScreenCaptureDisabled api in the DevicePolicyManger class, which can disable screen capture, but it can only be called by the device owner’s applications.
Please help me if anyone knows how to lock screen capture.
source
share