The Permission Hierarchy
Android categorizes permissions into different types based on the level of risk they pose to user privacy. As an Architect, your goal is to follow the 'Principle of Least Privilege'—only requesting what is strictly necessary for Revochamp to function. In 2026, the system is more aggressive about revoking unused permissions for apps that haven't been opened in months.
- Normal Permissions: Lower risk to privacy (e.g., INTERNET). These are granted automatically by the OS at install time if declared in the Manifest.
- Signature Permissions: Granted only if the requesting app is signed with the same certificate as the app that declared the permission.
- Dangerous (Runtime) Permissions: High risk to privacy (e.g., CAMERA, LOCATION, FILES). The user must explicitly grant these while the app is running.
- Declaration in the Manifest
All permissions must first be declared in the AndroidManifest.xml. This informs the Google Play Store and the OS about the app's requirements. For your project, this is where you enable your AI backend communication and camera access.
- The Runtime Request Flow
For dangerous permissions, simply declaring them isn't enough. In 2026, we use the ActivityResultLauncher for a type-safe, lifecycle-aware way to request permissions. You must check if the permission is already granted, show a rationale if the user previously denied it, and then request it.
- Scoped Storage and Media Access
In recent Android versions, global 'Read/Write External Storage' is deprecated. If Revochamp needs to save a generated code file or read an image for UI analysis, you should use Scoped Storage. This allows your app to access its own folders without any permission, or use the 'Photo Picker' to let the user select a specific file without granting full storage access.
Permission Comparison
| Feature | Android Native | Flutter (permission_handler) |
|---|---|---|
| Manifest Entry | Required (XML) | Required (XML) |
| Request Logic | registerForActivityResult | permission.request() |
| Status Check | checkSelfPermission | permission.status |
| Rationale | shouldShowRequestPermissionRationale | shouldShowRequestRationale |
| Storage Access | Scoped Storage / Media API | Platform-specific implementation |
| Security Level | OS-enforced sandbox | Wrapper around native APIs |