Prepend ACTION_ to PlaybackService actions

This commit is contained in:
Christopher Eby 2010-04-26 19:18:04 -05:00
parent 58c53567bf
commit 618c364f72
2 changed files with 8 additions and 8 deletions

View File

@ -70,11 +70,11 @@ public class OneCellWidget extends AppWidgetProvider {
} }
Intent playPause = new Intent(context, PlaybackService.class); Intent playPause = new Intent(context, PlaybackService.class);
playPause.setAction(PlaybackService.TOGGLE_PLAYBACK); playPause.setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK);
views.setOnClickPendingIntent(R.id.play_pause, PendingIntent.getService(context, 0, playPause, 0)); views.setOnClickPendingIntent(R.id.play_pause, PendingIntent.getService(context, 0, playPause, 0));
Intent next = new Intent(context, PlaybackService.class); Intent next = new Intent(context, PlaybackService.class);
next.setAction(PlaybackService.NEXT_SONG); next.setAction(PlaybackService.ACTION_NEXT_SONG);
views.setOnClickPendingIntent(R.id.next, PendingIntent.getService(context, 0, next, 0)); views.setOnClickPendingIntent(R.id.next, PendingIntent.getService(context, 0, next, 0));
if (song == null) { if (song == null) {

View File

@ -58,9 +58,9 @@ public final class PlaybackService extends Service implements Handler.Callback,
private static final int NOTIFICATION_ID = 2; private static final int NOTIFICATION_ID = 2;
private static final int DOUBLE_CLICK_DELAY = 400; private static final int DOUBLE_CLICK_DELAY = 400;
public static final String TOGGLE_PLAYBACK = "org.kreed.vanilla.action.TOGGLE_PLAYBACK"; public static final String ACTION_TOGGLE_PLAYBACK = "org.kreed.vanilla.action.TOGGLE_PLAYBACK";
public static final String NEXT_SONG = "org.kreed.vanilla.action.NEXT_SONG"; public static final String ACTION_NEXT_SONG = "org.kreed.vanilla.action.NEXT_SONG";
public static final String PREVIOUS_SONG = "org.kreed.vanilla.action.PREVIOUS_SONG"; public static final String ACTION_PREVIOUS_SONG = "org.kreed.vanilla.action.PREVIOUS_SONG";
public static final String EVENT_REPLACE_SONG = "org.kreed.vanilla.event.REPLACE_SONG"; public static final String EVENT_REPLACE_SONG = "org.kreed.vanilla.event.REPLACE_SONG";
public static final String EVENT_CHANGED = "org.kreed.vanilla.event.CHANGED"; public static final String EVENT_CHANGED = "org.kreed.vanilla.event.CHANGED";
@ -151,12 +151,12 @@ public final class PlaybackService extends Service implements Handler.Callback,
String action = intent.getAction(); String action = intent.getAction();
int delta; int delta;
if (TOGGLE_PLAYBACK.equals(action)) { if (ACTION_TOGGLE_PLAYBACK.equals(action)) {
delta = 0; delta = 0;
} else if (NEXT_SONG.equals(action)) { } else if (ACTION_NEXT_SONG.equals(action)) {
delta = 1; delta = 1;
broadcastReplaceSong(0, getSong(+1)); broadcastReplaceSong(0, getSong(+1));
} else if (PREVIOUS_SONG.equals(action)) { } else if (ACTION_PREVIOUS_SONG.equals(action)) {
delta = -1; delta = -1;
} else if (Intent.ACTION_MEDIA_BUTTON.equals(action)) { } else if (Intent.ACTION_MEDIA_BUTTON.equals(action)) {
delta = 10; delta = 10;