Android 5.0 how to automatically obtain permissions when recording the screen?

813 views Asked by At
MediaProjectionManager.createScreenCaptureIntent();

When sharing the screen, a window asking for permission will pop up.

I am looking for a way to automatically obtain all content (permissions) on the screen.

I have root access to this device!

Thanks in advance!

1

There are 1 answers

3
Maurice Lam On

If this is for testing where you have ADB access to the device – the media projection checks the OP_PROJECT_MEDIA AppOps (code), and you can enable it through ADB like this:

adb shell cmd appops set <your.package.name> PROJECT_MEDIA allow