Permissions Flashcards
(9 cards)
Why require permissions in Android?
To support user privacy by informing users about app capabilities and giving them control to restrict capabilities.
What are install-time permissions?
Permissions granted at the time of app installation, allowing access to less sensitive data outside the app’s sandbox, e.g., internet access.
What are runtime permissions?
Permissions requested while the app is running, controlling access to restricted/private data, e.g., camera access.
What are dangerous permissions?
Permissions related to user privacy, such as access to microphone, contacts, and external storage.
What is an example of a dangerous permission?
Access to the microphone or contacts.
Examples include access to WIFI, Bluetooth, and NFC operations.
How to request special permissions?
By using an intent to direct the user to the corresponding settings page, requiring user action to grant permission.
What are best practices for requesting permissions?
Require minimal permissions, use coarse location instead of fine location, and implement alternative behavior if permission is not granted.
What happens during app hibernation?
All runtime permissions are reset to DENY, and background jobs, alerts, and push notifications are disabled on Android 12.
How to deal with permissions in tests?
Permission dialogs can’t be scripted with Espresso; use androidx.test.GrantPermissionRule and grantRuntimePermission for newer Androids.