I was checking Android runtime permissions and was very curious about how Android runtime permissions work. Like if some application is asking for access to external storage, it will ask for permission, user will be presented with a dialog, and after pressing allow
button, app will be granted read/write external storage. I just want to know what happens internally when user presses allow
button on the dialog, what are the changes internally occur in Android.
I know permissions are stored in different files like /data/system/packages.list
, /data/system/packages.xml
and /data/system/users/0/runtime-permissions.xml
but changing them manually does not effect app's permission preference. So what actually happens when user give permission to certain app, what corresponding file gets updated?
flags
do in this line<item name="android.permission.RECORD_AUDIO" granted="true" flags="300" />
– Hammad Farooq Mar 29 '21 at 11:52USER_FIXED
flag to that permissions so that when the app asks again for the same permission, Android won't show the user the request dialog.300
is binary number100101100
. Every1
bit denotes a set flag. – Irfan Latif Mar 29 '21 at 12:09