Skip to content

Commit 5862456

Browse files
committed
Add a lock to foreground check
1 parent 09d6862 commit 5862456

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3912,10 +3912,12 @@ public void clear() {
39123912
@TargetApi(11)
39133913
@SuppressLint("NewApi")
39143914
private void notifySppError() {
3915-
// Check first to see if the RouterService is in the Foreground
3916-
// This is to prevent the notification appearing in error
3917-
if (!this.isForeground) {
3918-
return;
3915+
synchronized (FOREGROUND_NOTIFICATION_LOCK) {
3916+
// Check first to see if the RouterService is in the Foreground
3917+
// This is to prevent the notification appearing in error
3918+
if (!this.isForeground) {
3919+
return;
3920+
}
39193921
}
39203922
Notification.Builder builder;
39213923
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {

0 commit comments

Comments
 (0)