Runtime Permissions Quiz

ANDROID › System

Which API pair is the recommended modern way to request a single runtime permission?

Answer: registerForActivityResult(RequestPermission()) paired with launcher.launch()

The AndroidX Activity Result APIs (RequestPermission contract registered via registerForActivityResult) are the recommended approach; they auto-manage request codes and survive recreation. The requestPermissions/onRequestPermissionsResult flow is deprecated.

A user denied your camera permission once (without 'don't ask again'). What does shouldShowRequestPermissionRationale() now return?

Answer: true, indicating you should show a rationale to the user before asking again

After a single non-permanent denial the method returns true, signaling that the user has seen the dialog before and you should explain why the permission is needed before asking again.

How can your app distinguish a permanently denied permission from one that has never been requested?

Answer: Both look denied with rationale false, so persist your own "already asked" flag

shouldShowRequestPermissionRationale returns false both before the first request and after permanent denial, so the app must persist a flag (e.g., in SharedPreferences) recording that it already prompted to tell the two states apart.

On Android 12+, you request ACCESS_FINE_LOCATION. What can the user choose to grant?

Answer: Approximate only, using the Precise/Approximate toggle in the dialog

Since Android 12 the location dialog includes a precise/approximate toggle, so even when you request FINE the user can grant only COARSE; you should request both and handle a coarse-only result.

What is the correct way to handle a permission the user has permanently denied?

Answer: Send the user to the app's Settings page via ACTION_APPLICATION_DETAILS_SETTINGS

Once permanently denied the system will not show the dialog again, so the only path is to send the user to the app's Settings page; meanwhile the app should keep working with reduced functionality and not nag.

Under scoped storage, which approach lets an app let the user pick a photo with NO storage permission at all?

Answer: The Android Photo Picker (ACTION_PICK_IMAGES / PickVisualMedia)

The Photo Picker (PickVisualMedia / ACTION_PICK_IMAGES) returns user-selected media through a system UI and requires no permission, which is why broad storage permissions are now discouraged under scoped storage.

What happens with a one-time ('Only this time') permission granted on Android 11+ when the app stays in the background?

Answer: The grant is revoked after a while in the background, so the next use re-prompts

One-time grants last only while the app is in active use; after the app spends time in the background the permission is auto-revoked and re-launching the feature triggers a fresh prompt. Explicit user revocation also kills the process.

Which statement about the POST_NOTIFICATIONS permission is correct?

Answer: A runtime permission added in Android 13 that API 33+ apps must hold to post notifications

POST_NOTIFICATIONS is a runtime (dangerous) permission added in Android 13; apps targeting API 33+ must be granted it before any notification is displayed, otherwise the system silently drops their notifications.

How must an app obtain ACCESS_BACKGROUND_LOCATION on Android 11+?

Answer: Request foreground first, then request background separately in Settings.

From Android 11 you must request location incrementally: foreground first, then background as a separate request, and that background request takes the user to the Settings page to choose 'Allow all the time' rather than showing an in-app dialog.

On Android 11+, what happens to an app's granted runtime permissions if the user does not use the app for a few months?

Answer: The system auto-resets runtime permissions and hibernates the app.

Permission auto-reset (and app hibernation) revokes the runtime permissions of apps that go unused for an extended period, so you must always re-check with checkSelfPermission on launch and be ready to request again.

Which of the following is a normal (install-time) permission that requires no runtime prompt?

Answer: android.permission.INTERNET

INTERNET has the normal protection level and is granted automatically at install without any user prompt, whereas CAMERA, READ_CONTACTS, and RECORD_AUDIO are dangerous permissions that must be requested at runtime.

When you launch an ActivityResultContracts.RequestMultiplePermissions() contract, what does the result callback receive?

Answer: A Map<String, Boolean> mapping each requested permission to its granted result

RequestMultiplePermissions delivers a Map<String, Boolean> keyed by each permission string, letting you inspect partial outcomes such as coarse-granted-but-fine-denied individually.

How does an app obtain a special app-access permission such as SYSTEM_ALERT_WINDOW (draw over other apps) or MANAGE_EXTERNAL_STORAGE?

Answer: By opening the matching Settings page with a special intent, then checking the grant afterward

Special permissions are not granted through the runtime permission dialog; the app must route the user to a specific Settings page via an intent like ACTION_MANAGE_OVERLAY_PERMISSION (or ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION) and verify the result afterward.

On Android 14, when an app requests READ_MEDIA_IMAGES, what new choice can the user make in the dialog?

Answer: Pick only specific photos, granting READ_MEDIA_VISUAL_USER_SELECTED

Android 14 added partial (selected) photo and video access: the user can pick specific items, in which case READ_MEDIA_VISUAL_USER_SELECTED is granted instead of full READ_MEDIA_IMAGES/VIDEO, and the app sees only the chosen media.

Back to Runtime Permissions