File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
android/src/main/java/io/wazo/callkeep Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,12 @@ private void startForegroundService() {
335335 Log .d (TAG , "[VoiceConnectionService] Starting foreground service" );
336336
337337 Notification notification = notificationBuilder .build ();
338- startForeground (FOREGROUND_SERVICE_TYPE_MICROPHONE , notification );
338+
339+ try {
340+ startForeground (FOREGROUND_SERVICE_TYPE_MICROPHONE , notification );
341+ } catch (Exception e ) {
342+ Log .w (TAG , "[VoiceConnectionService] Can't start foreground service : " + e .toString ());
343+ }
339344 }
340345
341346 private void stopForegroundService () {
@@ -347,7 +352,11 @@ private void stopForegroundService() {
347352 return ;
348353 }
349354
350- stopForeground (FOREGROUND_SERVICE_TYPE_MICROPHONE );
355+ try {
356+ stopForeground (FOREGROUND_SERVICE_TYPE_MICROPHONE );
357+ } catch (Exception e ) {
358+ Log .w (TAG , "[VoiceConnectionService] can't stop foreground service :" + e .toString ());
359+ }
351360 }
352361
353362 private boolean isForegroundServiceConfigured () {
You can’t perform that action at this time.
0 commit comments