Skip to content

Commit 790bf54

Browse files
committed
Use temp pause to keep the notification visible
1 parent 792eb70 commit 790bf54

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • app/src/main/java/github/paroj/dsub2000/util

app/src/main/java/github/paroj/dsub2000/util/Util.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,9 @@ public void onAudioFocusChange(int focusChange) {
13651365
} else if(focusChange == AudioManager.AUDIOFOCUS_LOSS && !downloadService.isRemoteEnabled()) {
13661366
Log.i(TAG, "Permanently lost focus");
13671367
focusListener = null;
1368-
downloadService.pause();
1368+
// Use temp pause to keep the notification visible so the
1369+
// foreground service is not stopped and the user can resume.
1370+
downloadService.pause(true);
13691371

13701372
if(audioFocusRequest != null && Build.VERSION.SDK_INT >= 26) {
13711373
audioManager.abandonAudioFocusRequest(audioFocusRequest);

0 commit comments

Comments
 (0)