mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Hopeful fix for crash on API 19.
This commit is contained in:
@@ -178,9 +178,13 @@ public final class GenericForegroundService extends Service {
|
||||
} else {
|
||||
try {
|
||||
ContextCompat.startForegroundService(context, intent);
|
||||
} catch (ForegroundServiceStartNotAllowedException e) {
|
||||
Log.e(TAG, "Unable to start foreground service", e);
|
||||
throw new UnableToStartException(e);
|
||||
} catch (IllegalStateException e) {
|
||||
if (e instanceof ForegroundServiceStartNotAllowedException) {
|
||||
Log.e(TAG, "Unable to start foreground service", e);
|
||||
throw new UnableToStartException(e);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user