a foreground-service start Android refuses becomes a reported FOREGROUND_START_BLOCKED instead of a crash or silence: PeachSyncService.start and onStartCommand's own startForeground both route through startOrReportBlocked, which catches IllegalStateException (the supertype of API 31's ForegroundServiceStartNotAllowedException, so no minSdk guard is needed) and reports through SyncOutcomeStore, fetched via a Hilt EntryPoint so all six call sites are covered by the one guard; a refused START_STICKY restart now stops itself rather than returning to be refused again
$ koh steal kepr.uk/peach-android@0c5ab4dfdcdf
·
parent: ab426d4fb44a
discussion
log in to leave a comment.