Home » Android » android – Why do you need to re-request Media Projection permission on Phone Restart-Exceptionshub

android – Why do you need to re-request Media Projection permission on Phone Restart-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

I am using the Media Projection API for a pet project and one thing I have noticed is that when the phone is restarted, the intent which is redelivered to my broadcast receiver (on boot completed) does not contain the permission to record the user’s screen even though I accepted the permissions before I rebooted the device.

Does anyone know if this is standard and if this is documented anywhere or is their a way to maintain the permissions granted by the user across device reboots?

How to&Answers:

Does anyone know if this is standard

Yes. That permission is on a per-process basis. This is in contrast to classic runtime permissions, which are persistent.

if this is documented anywhere

I doubt it.

is their a way to maintain the permissions granted by the user across device reboots?

Not without modifying the OS, or maybe with root privileges.