0
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!

拉拉姬
  • 140
  • 1
  • 8

1 Answers1

1

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

MJM
  • 5,119
  • 5
  • 27
  • 53
Maurice Lam
  • 1,577
  • 9
  • 14