Android permissions: remove unnecessary access and test denial
An app asks for contacts when the user only opens a schedule. Investigate which feature needs that access, how it entered the build and what happens if the user declines. Before release, connect every permission to a clear product task and test behavior on your own development devices.
Distinguish declarations from current access
Android distinguishes install-time, runtime and special permissions. A uses-permission declaration therefore does not always produce a dialog. Establish the permission type and protected feature from the documentation, then test the relevant mechanism.
A declaration shows access the app may request. The current permission state establishes whether that access is available now. The presence of a permission alone does not demonstrate data collection, transmission to a server or a malicious library. Such conclusions require observing specific behavior.
Inspect the merged release manifest
Android documentation describes merging the main manifest, build variant and library declarations. Reviewing only AndroidManifest.xml in the editor may miss a permission introduced by a dependency. Inspect the merged manifest and trace the disputed declaration for the release variant you intend to ship.
In your authorized review inventory, record the permission, feature, declaration source and team decision. If a library adds contacts access, examine its requirements and configuration. A tools:node=remove rule can remove an unwanted element, but check the dependency first: removing a declaration must not silently break startup or an intended feature.
Request access in context and handle refusal
Android recommends checking runtime permissions before an operation that needs them, and requesting access when the user starts that task. After denial or revocation, preserve unrelated functionality. Do not assume one permission automatically grants another in the same group.
Explain which data the feature needs and how that benefits the user. Cancellation must remain a normal outcome. Check again after returning from settings: access may have changed while the app was not visible. Give an unavailable feature a clear state instead of repeatedly demanding consent.
Choose access that is sufficient for the task
If an avatar only needs one image, consider the system Photo picker. It grants access to selected images or videos instead of the entire media library. Verify support in your configuration and handling of the returned URI, including cancellation and the required access lifetime.
It is not a universal replacement for file or camera workflows. Clarify the feature first. The maxSdkVersion attribute on uses-permission specifies the highest API level at which that permission is granted; choose it based on feature compatibility. It does not define business-role permissions or replace server-side data authorization.
Map features in a fictional example
An educational class booking app shows a schedule, selects an avatar and offers an optional voice note. All accounts and media are fictional. The team plans no contacts access for the schedule, needs only a selected image for the avatar, and needs the appropriate microphone access for recording a note.
An SDK introduced a contacts permission. The team checks whether the library feature is used, whether its settings can change or whether another integration is suitable. The declaration source is known, but reading the address book has not been demonstrated. With microphone access denied, the voice note is unavailable and the schedule still opens. This is an educational expectation, not a customer finding.
Test granting, denying and revoking access on one build
Record the package, version, build variant, targetSdk and test device OS. Use synthetic media and a clean installation of your own build. Begin with a successful control: the feature works when access is granted. Then compare the planned negative scenarios.
Look beyond the absence of an exception: does the app show the correct state, preserve unrelated features and avoid requesting another unnecessary permission? Behavior may differ across supported system versions. None of these checks requires inspecting somebody else’s contacts or media library.
- The user grants access: the intended test feature actually works.
- The user declines: the app shows a clear state and supports other tasks.
- The user cancels the system picker: the app ends that flow correctly.
- Access is revoked in settings: the app checks the current state after returning.
Document the change and verify its outcome
For an unnecessary permission, record its declaration source, the reason for removal or replacement, and retest scenarios. After changing it, recheck the merged manifest and build behavior. A missing declaration does not establish that every data transmission stopped: examine SDK activity and server operations separately.
System permissions govern access to device capabilities; data-use policies and server authorization remain product responsibilities. If your app has a website or web component, request a free CheckMyApp audit of that part. Continue reviewing the mobile build and its permissions on your team’s controlled test devices.