commit
e236903602
@ -8,9 +8,9 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:support-v4:21.0.3'
|
||||
compile 'com.android.support:appcompat-v7:21.0.3'
|
||||
compile 'com.android.support:gridlayout-v7:21.0.3'
|
||||
compile 'com.android.support:support-v4:22.2.1'
|
||||
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||
compile 'com.android.support:gridlayout-v7:22.2.1'
|
||||
compile 'org.apache.commons:commons-lang3:3.3.2'
|
||||
compile('org.shredzone.flattr4j:flattr4j-core:2.12') {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
@ -44,12 +44,12 @@ def getMyVersionCode() {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "22.0.1"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 10
|
||||
targetSdkVersion 21
|
||||
targetSdkVersion 22
|
||||
versionCode getMyVersionCode()
|
||||
versionName "${getMyVersionName()}"
|
||||
testApplicationId "de.test.antennapod"
|
||||
|
@ -188,10 +188,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null);
|
||||
@ -260,11 +256,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null);
|
||||
@ -337,11 +328,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null);
|
||||
@ -416,10 +402,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, null);
|
||||
@ -487,10 +469,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
@ -558,11 +536,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
@ -633,11 +606,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
@ -711,11 +679,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
@ -764,11 +727,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
private void pauseTestSkeleton(final PlayerStatus initialState, final boolean stream, final boolean abandonAudioFocus, final boolean reinit, long timeoutSeconds) throws InterruptedException {
|
||||
@ -841,11 +799,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
@ -952,11 +905,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
if (initialState == PlayerStatus.PREPARED || initialState == PlayerStatus.PLAYING || initialState == PlayerStatus.PAUSED) {
|
||||
@ -1038,11 +986,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
@ -1137,11 +1080,6 @@ public class PlaybackServiceMediaPlayerTest extends InstrumentationTestCase {
|
||||
public boolean endPlayback(boolean playNextEpisode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
PlaybackServiceMediaPlayer psmp = new PlaybackServiceMediaPlayer(c, callback);
|
||||
Playable p = writeTestPlayable(PLAYABLE_FILE_URL, PLAYABLE_LOCAL_URL);
|
||||
|
@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'me.tatarka.retrolambda'
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "22.0.1"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 10
|
||||
targetSdkVersion 21
|
||||
targetSdkVersion 22
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testApplicationId "de.danoeh.antennapod.core.tests"
|
||||
@ -34,8 +34,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:21.0.3'
|
||||
compile 'com.android.support:support-v4:21.0.3'
|
||||
compile 'com.android.support:support-v4:22.2.1'
|
||||
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||
compile 'com.android.support:support-v4:22.2.1'
|
||||
compile 'org.apache.commons:commons-lang3:3.3.2'
|
||||
compile ('org.shredzone.flattr4j:flattr4j-core:2.12') {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
|
@ -0,0 +1,27 @@
|
||||
package de.danoeh.antennapod.core.service.playback;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
public class MediaButtonIntentReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String TAG = "MediaButtonIntentReceiver";
|
||||
|
||||
private static PlaybackServiceMediaPlayer mMediaPlayer;
|
||||
|
||||
public static void setMediaPlayer(PlaybackServiceMediaPlayer mediaPlayer) {
|
||||
mMediaPlayer = mediaPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.d(TAG, "onReceive(Context, " + intent.toString() +")");
|
||||
if (mMediaPlayer != null && Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) {
|
||||
mMediaPlayer.handleMediaKey((KeyEvent)intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -237,7 +237,6 @@ public class PlaybackService extends Service {
|
||||
ACTION_PAUSE_PLAY_CURRENT_EPISODE));
|
||||
registerReceiver(pauseResumeCurrentEpisodeReceiver, new IntentFilter(
|
||||
ACTION_RESUME_PLAY_CURRENT_EPISODE));
|
||||
remoteControlClient = setupRemoteControlClient();
|
||||
taskManager = new PlaybackServiceTaskManager(this, taskManagerCallback);
|
||||
mediaPlayer = new PlaybackServiceMediaPlayer(this, mediaPlayerCallback);
|
||||
|
||||
@ -499,7 +498,6 @@ public class PlaybackService extends Service {
|
||||
// statusUpdate.putExtra(EXTRA_NEW_PLAYER_STATUS, newInfo.playerStatus.ordinal());
|
||||
sendBroadcast(statusUpdate);
|
||||
updateWidget();
|
||||
refreshRemoteControlClientState(newInfo);
|
||||
bluetoothNotifyChange(newInfo, AVRCP_ACTION_PLAYER_STATUS_CHANGED);
|
||||
bluetoothNotifyChange(newInfo, AVRCP_ACTION_META_CHANGED);
|
||||
}
|
||||
@ -552,11 +550,6 @@ public class PlaybackService extends Service {
|
||||
PlaybackService.this.endPlayback(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteControlClient getRemoteControlClient() {
|
||||
return remoteControlClient;
|
||||
}
|
||||
};
|
||||
|
||||
private void endPlayback(boolean playNextEpisode) {
|
||||
@ -965,74 +958,6 @@ public class PlaybackService extends Service {
|
||||
return taskManager.getSleepTimerTimeLeft();
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private RemoteControlClient setupRemoteControlClient() {
|
||||
if (Build.VERSION.SDK_INT < 14) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
|
||||
mediaButtonIntent.setComponent(new ComponentName(getPackageName(),
|
||||
MediaButtonReceiver.class.getName()));
|
||||
PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(
|
||||
getApplicationContext(), 0, mediaButtonIntent, 0);
|
||||
remoteControlClient = new RemoteControlClient(mediaPendingIntent);
|
||||
int controlFlags;
|
||||
if (android.os.Build.VERSION.SDK_INT < 16) {
|
||||
controlFlags = RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
|
||||
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT;
|
||||
} else {
|
||||
controlFlags = RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE;
|
||||
}
|
||||
remoteControlClient.setTransportControlFlags(controlFlags);
|
||||
return remoteControlClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh player status and metadata.
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
private void refreshRemoteControlClientState(PlaybackServiceMediaPlayer.PSMPInfo info) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||
if (remoteControlClient != null) {
|
||||
switch (info.playerStatus) {
|
||||
case PLAYING:
|
||||
remoteControlClient
|
||||
.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
|
||||
break;
|
||||
case PAUSED:
|
||||
case INITIALIZED:
|
||||
remoteControlClient
|
||||
.setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);
|
||||
break;
|
||||
case STOPPED:
|
||||
remoteControlClient
|
||||
.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
|
||||
break;
|
||||
case ERROR:
|
||||
remoteControlClient
|
||||
.setPlaybackState(RemoteControlClient.PLAYSTATE_ERROR);
|
||||
break;
|
||||
default:
|
||||
remoteControlClient
|
||||
.setPlaybackState(RemoteControlClient.PLAYSTATE_BUFFERING);
|
||||
}
|
||||
if (info.playable != null) {
|
||||
MetadataEditor editor = remoteControlClient
|
||||
.editMetadata(false);
|
||||
editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE,
|
||||
info.playable.getEpisodeTitle());
|
||||
|
||||
editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM,
|
||||
info.playable.getFeedTitle());
|
||||
|
||||
editor.apply();
|
||||
}
|
||||
Log.d(TAG, "RemoteControlClient state was refreshed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void bluetoothNotifyChange(PlaybackServiceMediaPlayer.PSMPInfo info, String whatChanged) {
|
||||
boolean isPlaying = false;
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
package de.danoeh.antennapod.core.service.playback;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioManager;
|
||||
import android.media.RemoteControlClient;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.PowerManager;
|
||||
import android.support.v4.media.MediaMetadataCompat;
|
||||
@ -12,6 +13,7 @@ import android.support.v4.media.session.PlaybackStateCompat;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.SurfaceHolder;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
@ -29,7 +31,6 @@ import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||
import de.danoeh.antennapod.core.feed.MediaType;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.receiver.MediaButtonReceiver;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.util.playback.AudioPlayer;
|
||||
import de.danoeh.antennapod.core.util.playback.IPlayer;
|
||||
@ -98,9 +99,16 @@ public class PlaybackServiceMediaPlayer {
|
||||
}
|
||||
);
|
||||
|
||||
mediaSession = new MediaSessionCompat(context, TAG);
|
||||
MediaButtonIntentReceiver.setMediaPlayer(this);
|
||||
ComponentName eventReceiver = new ComponentName(context.getPackageName(), MediaButtonIntentReceiver.class.getName());
|
||||
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
|
||||
mediaButtonIntent.setComponent(eventReceiver);
|
||||
PendingIntent buttonReceiverIntent = PendingIntent.getBroadcast(context, 0, mediaButtonIntent, 0);
|
||||
|
||||
mediaSession = new MediaSessionCompat(context, TAG, eventReceiver, buttonReceiverIntent);
|
||||
mediaSession.setCallback(sessionCallback);
|
||||
mediaSession.setFlags(MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
|
||||
mediaSession.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
|
||||
mediaSession.setActive(true);
|
||||
|
||||
mediaPlayer = null;
|
||||
statusBeforeSeeking = null;
|
||||
@ -249,7 +257,9 @@ public class PlaybackServiceMediaPlayer {
|
||||
|
||||
private MediaMetadataCompat getMediaSessionMetadata(Playable p) {
|
||||
MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder();
|
||||
builder.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, p.getFeedTitle());
|
||||
builder.putString(MediaMetadataCompat.METADATA_KEY_TITLE, p.getEpisodeTitle());
|
||||
builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, p.getEpisodeTitle());
|
||||
builder.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, p.getFeedTitle());
|
||||
return builder.build();
|
||||
}
|
||||
@ -287,16 +297,6 @@ public class PlaybackServiceMediaPlayer {
|
||||
|
||||
setPlayerStatus(PlayerStatus.PLAYING, media);
|
||||
pausedBecauseOfTransientAudiofocusLoss = false;
|
||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||
RemoteControlClient remoteControlClient = callback.getRemoteControlClient();
|
||||
if (remoteControlClient != null) {
|
||||
audioManager
|
||||
.registerRemoteControlClient(remoteControlClient);
|
||||
}
|
||||
}
|
||||
audioManager
|
||||
.registerMediaButtonEventReceiver(new ComponentName(context.getPackageName(),
|
||||
MediaButtonReceiver.class.getName()));
|
||||
media.onPlaybackStart();
|
||||
|
||||
} else {
|
||||
@ -975,8 +975,6 @@ public class PlaybackServiceMediaPlayer {
|
||||
public boolean onMediaPlayerError(Object inObj, int what, int extra);
|
||||
|
||||
public boolean endPlayback(boolean playNextEpisode);
|
||||
|
||||
public RemoteControlClient getRemoteControlClient();
|
||||
}
|
||||
|
||||
private IPlayer setMediaPlayerListeners(IPlayer mp) {
|
||||
@ -1154,5 +1152,76 @@ public class PlaybackServiceMediaPlayer {
|
||||
super.onSeekTo(pos);
|
||||
seekTo((int) pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMediaButtonEvent(final Intent mediaButton) {
|
||||
Log.d(TAG, "GOT MediaButton EVENT");
|
||||
if (mediaButton != null) {
|
||||
KeyEvent keyEvent = (KeyEvent) mediaButton.getExtras().get(Intent.EXTRA_KEY_EVENT);
|
||||
handleMediaKey(keyEvent);
|
||||
}
|
||||
return super.onMediaButtonEvent(mediaButton);
|
||||
}
|
||||
};
|
||||
|
||||
public boolean handleMediaKey(KeyEvent event) {
|
||||
if (event != null
|
||||
&& event.getAction() == KeyEvent.ACTION_DOWN
|
||||
&& event.getRepeatCount() == 0) {
|
||||
switch (event.getKeyCode()) {
|
||||
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
|
||||
case KeyEvent.KEYCODE_HEADSETHOOK:
|
||||
{
|
||||
Log.d(TAG, "Received Play/Pause event from RemoteControlClient");
|
||||
if (playerStatus == PlayerStatus.PAUSED || playerStatus == PlayerStatus.PREPARED) {
|
||||
resume();
|
||||
} else if (playerStatus == PlayerStatus.INITIALIZED) {
|
||||
setStartWhenPrepared(true);
|
||||
prepare();
|
||||
} else if (playerStatus == PlayerStatus.PLAYING) {
|
||||
pause(false, true);
|
||||
if (UserPreferences.isPersistNotify()) {
|
||||
pause(false, true);
|
||||
} else {
|
||||
pause(true, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case KeyEvent.KEYCODE_MEDIA_PLAY:
|
||||
{
|
||||
Log.d(TAG, "Received Play event from RemoteControlClient");
|
||||
if (playerStatus == PlayerStatus.PAUSED || playerStatus == PlayerStatus.PREPARED) {
|
||||
resume();
|
||||
} else if (playerStatus == PlayerStatus.INITIALIZED) {
|
||||
setStartWhenPrepared(true);
|
||||
prepare();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case KeyEvent.KEYCODE_MEDIA_PAUSE:
|
||||
{
|
||||
Log.d(TAG, "Received Pause event from RemoteControlClient");
|
||||
if (playerStatus == PlayerStatus.PLAYING) {
|
||||
pause(false, true);
|
||||
}
|
||||
if (UserPreferences.isPersistNotify()) {
|
||||
pause(false, true);
|
||||
} else {
|
||||
pause(true, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case KeyEvent.KEYCODE_MEDIA_STOP:
|
||||
{
|
||||
Log.d(TAG, "Received Stop event from RemoteControlClient");
|
||||
stop();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user