Skip to content

Commit 853b918

Browse files
committed
Only add timer if notificaiton should be displayed
1 parent 870a118 commit 853b918

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,9 @@ private void enterForeground(String content, long chronometerLength, boolean ong
14441444
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
14451445
builder.setContentIntent(pendingIntent);
14461446

1447-
if(chronometerLength > 0 && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
1447+
if(chronometerLength > (FOREGROUND_TIMEOUT/1000) && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
14481448
//The countdown method is only available in SDKs >= 24
1449+
// Only add countdown if it is over the min timeout
14491450
builder.setWhen(chronometerLength + System.currentTimeMillis());
14501451
builder.setUsesChronometer(true);
14511452
builder.setChronometerCountDown(true);

0 commit comments

Comments
 (0)