Skip to content

Commit 3622bf7

Browse files
committed
Add try/catch to setting prefs in exception handlr
1 parent f1e5a2d commit 3622bf7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,11 @@ public void uncaughtException(Thread t, Throwable e) {
12291229
&& e.getMessage().contains("invalid channel for service notification")) { //This is the message received in the exception for notification channel issues
12301230

12311231
// Set the flag to not delete the notification channel to avoid this exception in the future
1232-
SdlRouterService.this.setSdlRouterServicePrefs(KEY_AVOID_NOTIFICATION_CHANNEL_DELETE, true);
1232+
try{
1233+
SdlRouterService.this.setSdlRouterServicePrefs(KEY_AVOID_NOTIFICATION_CHANNEL_DELETE, true);
1234+
}catch (Exception exception){
1235+
//Unable to save flag for KEY_AVOID_NOTIFICATION_CHANNEL_DELETE
1236+
}
12331237
Looper.loop();
12341238
} else if (defaultUncaughtExceptionHandler != null) { //No other exception should be handled
12351239
defaultUncaughtExceptionHandler.uncaughtException(t, e);

0 commit comments

Comments
 (0)