From 4120d686b8a656db3211ab3f10e04a49f7792873 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Wed, 15 Jun 2016 22:15:21 +0200 Subject: [PATCH] Some key events were not working with the default audio player. Reported in #322 --- .../service/receivers/GBMusicControlReceiver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/receivers/GBMusicControlReceiver.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/receivers/GBMusicControlReceiver.java index 459d3c15..eaaa046c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/receivers/GBMusicControlReceiver.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/receivers/GBMusicControlReceiver.java @@ -69,7 +69,9 @@ public class GBMusicControlReceiver extends BroadcastReceiver { Intent upIntent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); KeyEvent upEvent = new KeyEvent(eventtime, eventtime, KeyEvent.ACTION_UP, keyCode, 0); upIntent.putExtra(Intent.EXTRA_KEY_EVENT, upEvent); - upIntent.setPackage(audioPlayer); + if (!"default".equals(audioPlayer)) { + upIntent.setPackage(audioPlayer); + } context.sendOrderedBroadcast(upIntent, null); } }