Skip to content

Commit 6531ba8

Browse files
committed
Add check to see if RouterService is in the Foreground before we put up the notification
1 parent 1783ffc commit 6531ba8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3909,6 +3909,11 @@ public void clear() {
39093909
@TargetApi(11)
39103910
@SuppressLint("NewApi")
39113911
private void notifySppError() {
3912+
// Check first to see if the RouterService is in the Foreground
3913+
// This is to prevent the notification appearing in error
3914+
if (!this.isForeground) {
3915+
return;
3916+
}
39123917
Notification.Builder builder;
39133918
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
39143919
builder = new Notification.Builder(getApplicationContext());

0 commit comments

Comments
 (0)