mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Catch a foreground service start exception.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user