# Google Play Foreground Service (FGS) Permissions & Video Proof Declaration Guide

> Android apps targeting Android 14 (API 34) or higher that declare `FOREGROUND_SERVICE_*` permissions must justify each service type (`location`, `mediaPlayback`, `microphone`, `camera`, `health`, `connectedDevice`) inside Google Play Console with a public screen-recording video proving user-initiated activation, a visible persistent notification, and why standard deferrable `WorkManager` background APIs cannot replace it.

- **Canonical URL**: https://staging.gootester.com/declarations/foreground-service-permissions
- **Play Console Location**: `Monitor & improve -> Policy -> App content -> Foreground service permissions`
- **Mandatory For**: Conditional (Apps Targeting API 34+ with FOREGROUND_SERVICE_* Permissions)
- **Account Requirement**: Personal or Organization

## Step-by-Step Walkthrough
1. **Audit every `FOREGROUND_SERVICE_*` permission and `<service>` tag in your merged manifest**: Run `bundletool dump manifest --bundle=app-release.aab | grep -i foreground` to list every foreground service permission injected by first-party code or cross-platform background plugins.
2. **Delete `dataSync` or unused FGS permissions replaceable by `WorkManager` or `DownloadManager`**: Google Play routinely rejects `FOREGROUND_SERVICE_DATA_SYNC` for routine REST API calls or cloud backups (and Android 15+ enforces strict 6-hour timeouts on `dataSync`). Migrate deferrable sync to `WorkManager` and strip unused FGS permissions.
3. **Record an unedited 30-to-60-second screen-capture video for each retained FGS type**: Capture a real Android screen recording showing the user tapping an explicit start action (e.g. 'Start Run' or 'Play Episode'), locking/backgrounding the app, pulling down the notification shade to show the persistent FGS notification, and stopping the task.
4. **Paste an unlisted/public HTTPS video link into `App content -> Foreground service permissions`**: Host the MP4 or unlisted YouTube link so anyone with the link can view it without login gates, write a concise task justification per FGS type, and submit via `Publishing overview`.

## Common Rejection Traps
- **Submitting a Google Drive video link set to 'Restricted — Request Access'**: If Google Play's reviewer opens your FGS demonstration URL and hits a Google Drive permission-request screen, your release is rejected immediately without follow-up.
- **Declaring `FOREGROUND_SERVICE_SPECIAL_USE` as a lazy catch-all for periodic polling**: `specialUse` undergoes strict manual inspection and is rejected whenever standard `WorkManager` jobs, FCM high-priority push messages, or user-initiated transfer APIs cover the use case.
- **Leaving transitive FGS permissions from unused Flutter/Expo audio or location plugins**: Installing `flutter_background_service` or `expo-task-manager` for an experiment and leaving its manifest permissions behind forces the FGS video form to appear even when no UI starts a service.

## Android 14–16 FGS Rules: Why Google Scrutinizes Background Execution

Abusive background services historically caused runaway battery drain and covert location tracking on Android. Starting with Android 14 (`API 34`) and tightened further in Android 15 (`API 35`) and Android 16 (`API 36`), Google coupled OS-level `SecurityException` runtime checks with Play Console's mandatory **Foreground service permissions** gate. Every `<service>` invoking `ServiceCompat.startForeground()` must specify an exact `android:foregroundServiceType` matching both its runtime capabilities and a core user-perceivable feature.
Before spending hours filming justification videos, ask a blunt architectural question: *Would the user immediately notice perceptible breakage right now if Android deferred this work by three minutes?* For music playback, active VoIP calls, BLE sensor streaming, or live workout GPS, the answer is clearly yes. For syncing notes, uploading analytics, or refreshing feed caches, the answer is no — migrate to `WorkManager` and remove `FOREGROUND_SERVICE_*` completely.

## Filming a First-Pass-Approved FGS Demonstration Video & Testing on ARM64

When your app genuinely requires a foreground service, film a crystal-clear demonstration video on a physical Android device (`adb shell screenrecord /sdcard/fgs-demo.mp4`). Enable Android Developer Options `Show taps` so the reviewer sees the exact user tap initiating the feature, pull down the system notification drawer clearly displaying the ongoing notification with a working `Stop` / `Pause` control, and demonstrate perceptible impact (such as live audio playing or live GPS pace updating while the app is backgrounded).
Also test your foreground service lifecycle on Android 15/16 hardware during your 14-day closed test on GOOtester ($6/$12/$20 one-time): Android 15+ throws `ForegroundServiceStartNotAllowedException` when `BOOT_COMPLETED` receivers or background broadcasts attempt to launch restricted FGS types without visible user interaction!
