If onStartCommand received a null intent (possible when START_STICKY restarts a killed service) or an unrecognized action, the service would start foreground (showing a persistent notification) but never call stopSelf(), leaving it running indefinitely. Added an else branch to call stopSelf(startId) immediately in these cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>