diff --git a/app/src/main/java/com/kabouzeid/gramophone/appwidget/WidgetMedium.java b/app/src/main/java/com/kabouzeid/gramophone/appwidget/WidgetMedium.java index f9babc65..54f10367 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/appwidget/WidgetMedium.java +++ b/app/src/main/java/com/kabouzeid/gramophone/appwidget/WidgetMedium.java @@ -132,7 +132,7 @@ public class WidgetMedium extends AppWidgetProvider { pendingIntent = PendingIntent.getActivity(context, 0, action, 0); return pendingIntent; case 1: - action = new Intent(MusicService.ACTION_TOGGLE_PLAYBACK); + action = new Intent(MusicService.ACTION_TOGGLE_PAUSE); action.setComponent(serviceName); pendingIntent = PendingIntent.getService(context, 1, action, 0); return pendingIntent; diff --git a/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java b/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java index 9f0889fc..89accaac 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java +++ b/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java @@ -143,7 +143,7 @@ public class PlayingNotificationHelper { final ComponentName serviceName = new ComponentName(service, MusicService.class); switch (which) { case 1: - action = new Intent(MusicService.ACTION_TOGGLE_PLAYBACK); + action = new Intent(MusicService.ACTION_TOGGLE_PAUSE); action.setComponent(serviceName); pendingIntent = PendingIntent.getService(service, 1, action, 0); return pendingIntent; diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java b/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java index d3587d55..5e801404 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java +++ b/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java @@ -29,7 +29,7 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver { break; case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: - command = MusicService.ACTION_TOGGLE_PLAYBACK; + command = MusicService.ACTION_TOGGLE_PAUSE; break; case KeyEvent.KEYCODE_MEDIA_PLAY: command = MusicService.ACTION_PLAY; diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java index b7d89c74..cc30a60f 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java +++ b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java @@ -66,20 +66,21 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP public static final String PHONOGRAPH_PACKAGE_NAME = "com.kabouzeid.gramophone"; public static final String MUSIC_PACKAGE_NAME = "com.android.music"; - public static final String ACTION_TOGGLE_PLAYBACK = "com.kabouzeid.gramophone.action.TOGGLE_PLAYBACK"; - public static final String ACTION_PLAY = "com.kabouzeid.gramophone.action.PLAY"; - public static final String ACTION_PAUSE = "com.kabouzeid.gramophone.action.PAUSE"; - public static final String ACTION_STOP = "com.kabouzeid.gramophone.action.STOP"; - public static final String ACTION_SKIP = "com.kabouzeid.gramophone.action.SKIP"; - public static final String ACTION_REWIND = "com.kabouzeid.gramophone.action.REWIND"; - public static final String ACTION_QUIT = "com.kabouzeid.gramophone.action.QUIT"; + public static final String ACTION_TOGGLE_PAUSE = "com.kabouzeid.gramophone.togglepause"; + public static final String ACTION_PLAY = "com.kabouzeid.gramophone.play"; + public static final String ACTION_PAUSE = "com.kabouzeid.gramophone.pause"; + public static final String ACTION_STOP = "com.kabouzeid.gramophone.stop"; + public static final String ACTION_SKIP = "com.kabouzeid.gramophone.skip"; + public static final String ACTION_REWIND = "com.kabouzeid.gramophone.rewind"; + public static final String ACTION_QUIT = "com.kabouzeid.gramophone.quitservice"; - public static final String META_CHANGED = "com.kabouzeid.gramophone.meta_changed"; - public static final String PLAY_STATE_CHANGED = "com.kabouzeid.gramophone.playstate_changed"; - public static final String REPEAT_MODE_CHANGED = "com.kabouzeid.gramophone.repeat_mode_changed"; - public static final String SHUFFLE_MODE_CHANGED = "com.kabouzeid.gramophone.shuffle_mode_changed"; + // do not change this strings as it will break support with other apps (e.g. last.fm scrobbling) + public static final String META_CHANGED = "com.kabouzeid.gramophone.metachanged"; + public static final String PLAY_STATE_CHANGED = "com.kabouzeid.gramophone.playstatechanged"; + public static final String REPEAT_MODE_CHANGED = "com.kabouzeid.gramophone.repeatmodechanged"; + public static final String SHUFFLE_MODE_CHANGED = "com.kabouzeid.gramophone.shufflemodechanged"; - public static final String MEDIA_STORE_CHANGED = "com.kabouzeid.gramophone.media_store_changed"; + public static final String MEDIA_STORE_CHANGED = "com.kabouzeid.gramophone.mediastorechanged"; public static final String SAVED_POSITION = "POSITION"; public static final String SAVED_POSITION_IN_TRACK = "POSITION_IN_TRACK"; @@ -226,7 +227,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP if (intent.getAction() != null) { String action = intent.getAction(); switch (action) { - case ACTION_TOGGLE_PLAYBACK: + case ACTION_TOGGLE_PAUSE: if (isPlaying()) { pause(); } else {