Skip to content

Commit 6bb8745

Browse files
committed
Fix shut up google notification playing when pressing play from new notification
1 parent c62b800 commit 6bb8745

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/github/daneren2005/dsub/service/DownloadService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ public boolean onError(MediaPlayer mediaPlayer, int what, int more) {
310310
public int onStartCommand(Intent intent, int flags, int startId) {
311311
super.onStartCommand(intent, flags, startId);
312312
lifecycleSupport.onStart(intent);
313-
if(Build.VERSION.SDK_INT >= 26 && !this.isForeground()) {
313+
314+
String action = intent.getAction();
315+
if(Build.VERSION.SDK_INT >= 26 && !this.isForeground() && !"KEYCODE_MEDIA_START".equals(action)) {
314316
Notifications.shutGoogleUpNotification(this);
315317
}
316318
return START_NOT_STICKY;

0 commit comments

Comments
 (0)