During the time downloading Android 6.0 Marshmallow upgrade, it was a surprise for me to see dozens of App also queuing up for update. After I checked out the new features of Marshmallow, I saw the point.
At last! Android has permission control, out of the box. 🙂
Basically, user can now control permission from “Settings -> Apps -> Configure Apps -> App permissions”.
For App targeting 6.0, normal permission will be granted on install. But when App need privacy related permission (which includes sensors, calendar, camera, contacts, location, microphone, phone, SMS, and storage), it must request it at run time.
For legacy App (targeting 5.1.1 or lower), user still have to grant all permissions to App on install (and previously installed App would still have all permissions granted). Afterward, user could turn off permission from Settings. If permission is turned off, Android would feed mock data to the App requesting data under that permission.
Mock data would prevent legacy App from crashing when a permission is turned off. However, legacy App would never know that the permission is turned off and data it got is fake. This could be a bit confusing for user since there might be no apparent link between loss of functionality of the App with turning off of one seemingly unrelated permission.
And for all those App upgrade? Well, App are now targeting Android 6.0 and support run time permission request. I would be expecting more App to follow suit and support the new permission system.
Currently, I see Twitter and Instagram already utilizing the new permission system, while Facebook not.
On API level, App would call “ContextCompat.checkSelfPermission()” to check whether it has the permission, if not then call “ActivityCompat.requestPermissions()” to request it. That simple.