Problem
SpeedMonitorService.kt:179 calls manager.notify(SpeedNotifications.NOTIFICATION_ID, notification) without first checking whether the runtime POST_NOTIFICATIONS permission is granted. On Android 13+ (API 33+), if the user revokes the permission while the service is running, the call throws SecurityException and crashes the service tick loop.
Detected by ./gradlew :app:lintDebug — one lint error in the project:
```
SpeedMonitorService.kt:179: Error: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException [MissingPermission]
```
Suggested fix
Wrap the `manager.notify(...)` call in a `runCatching { ... }` (same pattern already used for `registerNetworkCallback` and `unregisterReceiver` in the same file) or pre-check with `NotificationManagerCompat.from(this).areNotificationsEnabled()` and skip the tick when false.
The `runCatching` option is the smaller change and keeps behaviour identical when permissions are granted.
Acceptance
- `./gradlew :app:lintDebug` passes with zero errors.
- Manually revoking `POST_NOTIFICATIONS` while the service is running does not crash the app — ticking silently pauses (or continues without updating the icon) until permission is restored.
Problem
SpeedMonitorService.kt:179callsmanager.notify(SpeedNotifications.NOTIFICATION_ID, notification)without first checking whether the runtimePOST_NOTIFICATIONSpermission is granted. On Android 13+ (API 33+), if the user revokes the permission while the service is running, the call throwsSecurityExceptionand crashes the service tick loop.Detected by
./gradlew :app:lintDebug— one lint error in the project:```
SpeedMonitorService.kt:179: Error: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException [MissingPermission]
```
Suggested fix
Wrap the `manager.notify(...)` call in a `runCatching { ... }` (same pattern already used for `registerNetworkCallback` and `unregisterReceiver` in the same file) or pre-check with `NotificationManagerCompat.from(this).areNotificationsEnabled()` and skip the tick when false.
The `runCatching` option is the smaller change and keeps behaviour identical when permissions are granted.
Acceptance