From 92f04cf9f67ffb5988178a8a18ffd4a815dc62bf Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 12 Jul 2026 22:43:33 +0000 Subject: [PATCH 1/3] fix: remove FOREGROUND_SERVICE_DATA_SYNC permission + service type Sync is disabled by default (#184) and not yet demonstrable, so the Google Play Console FOREGROUND_SERVICE_DATA_SYNC declaration (which requires a video demo) was blocking the v0.14.0 Play Store upload. Remove: - FOREGROUND_SERVICE_DATA_SYNC uses-permission from AndroidManifest.xml - android:foregroundServiceType="dataSync" from BackgroundService declaration - ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC from startForeground() call The base FOREGROUND_SERVICE permission is preserved for the monitoring service. Re-add the data_sync type and permission when sync is actually implemented and demonstrable. Closes ActivityWatch/aw-android#189 (item 1) Unblocks v0.14.0 Play Store production upload --- mobile/src/main/AndroidManifest.xml | 4 +--- .../java/net/activitywatch/android/BackgroundService.kt | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index 1b8d3e6a..fb88e342 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -15,7 +15,6 @@ android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions" /> - @@ -79,8 +78,7 @@ + android:exported="false" /> = Build.VERSION_CODES.Q) - ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC - else - 0 + 0 ) rustInterface = RustInterface(this) syncScheduler = SyncScheduler(this) From c265467cfb7d8fb9b2b98c41d08094082d41d566 Mon Sep 17 00:00:00 2001 From: TimeToBuildBob Date: Mon, 13 Jul 2026 19:43:36 +0000 Subject: [PATCH 2/3] fix: use FOREGROUND_SERVICE_TYPE_SPECIAL_USE on Android 14+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Android 14+ (API 34+) with targetSdk 35, startForeground() requires a valid foreground service type declared in the manifest. Passing type 0 with no foregroundServiceType attribute throws MissingForegroundServiceTypeException at runtime, crashing BackgroundService on any Android 14+ device. FOREGROUND_SERVICE_TYPE_SPECIAL_USE is the correct type for ActivityWatch's local HTTP server use case — it doesn't fit the 2024/2025 taxonomy (camera, microphone, location, health, etc.) and Google added specialUse specifically for this situation. The Play Store form for specialUse requires a text description (no demo video), so this unblocks the v0.14.0 upload. Changes: - Add FOREGROUND_SERVICE_SPECIAL_USE permission - Declare foregroundServiceType='specialUse' on BackgroundService - Pass ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE on API 34+, 0 otherwise --- mobile/src/main/AndroidManifest.xml | 4 +++- .../java/net/activitywatch/android/BackgroundService.kt | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index fb88e342..5badcd7d 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions" /> + @@ -78,7 +79,8 @@ + android:exported="false" + android:foregroundServiceType="specialUse" /> = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE + else + 0 ) rustInterface = RustInterface(this) syncScheduler = SyncScheduler(this) From 065b4a5512898902c003cf4bc09e1b0f0c770254 Mon Sep 17 00:00:00 2001 From: TimeToBuildBob Date: Mon, 13 Jul 2026 19:48:31 +0000 Subject: [PATCH 3/3] fix: add PROPERTY_SPECIAL_USE_FGS_SUBTYPE manifest property Greptile flagged that specialUse without a subtype property can leave Play review without a machine-readable rationale. The property documents AW's use case (local on-device HTTP server for the web UI) directly in the manifest, aligned with the Play Console declaration form. --- mobile/src/main/AndroidManifest.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index 5badcd7d..247fec4e 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -80,7 +80,11 @@ android:name=".BackgroundService" android:enabled="true" android:exported="false" - android:foregroundServiceType="specialUse" /> + android:foregroundServiceType="specialUse"> + +