Skip to content

Commit

Permalink
Fix shut up google notification playing when pressing play from new n…
Browse files Browse the repository at this point in the history
…otification
  • Loading branch information
daneren2005 committed Sep 22, 2020
1 parent c62b800 commit 6bb8745
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ public boolean onError(MediaPlayer mediaPlayer, int what, int more) {
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
lifecycleSupport.onStart(intent);
if(Build.VERSION.SDK_INT >= 26 && !this.isForeground()) {

String action = intent.getAction();
if(Build.VERSION.SDK_INT >= 26 && !this.isForeground() && !"KEYCODE_MEDIA_START".equals(action)) {
Notifications.shutGoogleUpNotification(this);
}
return START_NOT_STICKY;
Expand Down

0 comments on commit 6bb8745

Please sign in to comment.