Catch a foreground service start exception.

fork-5.53.8
Greyson Parrelli 2022-10-07 09:52:23 -04:00
rodzic 50ded5c92a
commit 04b0c01015
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -83,7 +83,12 @@ object FcmFetchManager {
context.stopService(Intent(context, FcmFetchBackgroundService::class.java))
if (startedForeground) {
context.startService(FcmFetchForegroundService.buildStopIntent(context))
try {
context.startService(FcmFetchForegroundService.buildStopIntent(context))
} catch (e: IllegalStateException) {
Log.w(TAG, "Failed to stop the foreground notification!", e)
}
startedForeground = false
}
}