本文整理汇总了Java中android.media.RemoteControlClient.FLAG_KEY_MEDIA_PAUSE属性的典型用法代码示例。如果您正苦于以下问题:Java RemoteControlClient.FLAG_KEY_MEDIA_PAUSE属性的具体用法?Java RemoteControlClient.FLAG_KEY_MEDIA_PAUSE怎么用?Java RemoteControlClient.FLAG_KEY_MEDIA_PAUSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.media.RemoteControlClient
的用法示例。
在下文中一共展示了RemoteControlClient.FLAG_KEY_MEDIA_PAUSE属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerRemote
/**
* Perform initialization required for RemoteControlClient.
*
* @param context A context to use.
* @param am The AudioManager service.
*/
public static void registerRemote(Context context, AudioManager am)
{
if (!MediaButtonReceiver.useHeadsetControls(context)) {
// RemoteControlClient requires MEDIA_BUTTON intent
return;
}
MediaButtonReceiver.registerMediaButton(context);
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(new ComponentName(context.getPackageName(), MediaButtonReceiver.class.getName()));
PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(context, 0, mediaButtonIntent, 0);
RemoteControlClient remote = new RemoteControlClient(mediaPendingIntent);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_NEXT
| RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE;
remote.setTransportControlFlags(flags);
am.registerRemoteControlClient(remote);
sRemote = remote;
}
示例2: setUpRemoteControlClient
/**
* Initializes the remote control client
*/
private void setUpRemoteControlClient() {
if (mEnableLockscreenControls) {
if (mRemoteControlClientCompat == null) {
final Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(mMediaButtonReceiverComponent);
mRemoteControlClientCompat = new RemoteControlClientCompat(
PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent,
PendingIntent.FLAG_UPDATE_CURRENT));
RemoteControlHelper.registerRemoteControlClient(mAudioManager,
mRemoteControlClientCompat);
}
// Flags for the media transport control that this client supports.
final int flags = RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP;
mRemoteControlClientCompat.setTransportControlFlags(flags);
}
}
示例3: registerRemote
public static void registerRemote(Context context, AudioManager am) {
MediaButtonReceiver.registerMediaButton(context);
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(new ComponentName(context.getPackageName(),
MediaButtonReceiver.class.getName()));
PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(context, 0,
mediaButtonIntent, 0);
RemoteControlClient remote = new RemoteControlClient(mediaPendingIntent);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_NEXT
| RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE;
remote.setTransportControlFlags(flags);
am.registerRemoteControlClient(remote);
sRemote = remote;
}
示例4: getTransportFlags
protected int getTransportFlags() {
return RemoteControlClient.FLAG_KEY_MEDIA_PLAY |
RemoteControlClient.FLAG_KEY_MEDIA_PAUSE |
RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE |
RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS |
RemoteControlClient.FLAG_KEY_MEDIA_NEXT |
RemoteControlClient.FLAG_KEY_MEDIA_STOP;
}
示例5: getFlags
int getFlags() {
return RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP;
}
示例6: onCreate
@SuppressLint({ "WorldWriteableFiles", "WorldReadableFiles" })
@Override
public void onCreate() {
super.onCreate();
mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
ComponentName rec = new ComponentName(getPackageName(),
MediaButtonIntentReceiver.class.getName());
mAudioManager.registerMediaButtonEventReceiver(rec);
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(rec);
PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0,
mediaButtonIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
mAudioManager.registerRemoteControlClient(mRemoteControlClient);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT | RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP;
mRemoteControlClient.setTransportControlFlags(flags);
mPreferences = getSharedPreferences(APOLLO_PREFERENCES, MODE_WORLD_READABLE
| MODE_WORLD_WRITEABLE);
mCardId = MusicUtils.getCardId(this);
registerExternalStorageListener();
// Needs to be done in this thread, since otherwise
// ApplicationContext.getPowerManager() crashes.
mPlayer = new MultiPlayer();
mPlayer.setHandler(mMediaplayerHandler);
reloadQueue();
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
IntentFilter commandFilter = new IntentFilter();
commandFilter.addAction(SERVICECMD);
commandFilter.addAction(TOGGLEPAUSE_ACTION);
commandFilter.addAction(PAUSE_ACTION);
commandFilter.addAction(NEXT_ACTION);
commandFilter.addAction(PREVIOUS_ACTION);
commandFilter.addAction(CYCLEREPEAT_ACTION);
commandFilter.addAction(TOGGLESHUFFLE_ACTION);
registerReceiver(mIntentReceiver, commandFilter);
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
mWakeLock.setReferenceCounted(false);
// If the service was idle, but got killed before it stopped itself, the
// system will relaunch it. Make sure it gets stopped again in that
// case.
Message msg = mDelayedStopHandler.obtainMessage();
mDelayedStopHandler.sendMessageDelayed(msg, IDLE_DELAY);
}
示例7: ensureTransportControls
private static void ensureTransportControls(MediaSessionCompat session, PlaybackStateCompat playbackState) {
long actions = playbackState.getActions();
Object remoteObj = session.getRemoteControlClient();
if(actions != 0 && remoteObj != null) {
int transportControls = 0;
if((actions & PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS;
}
if((actions & PlaybackStateCompat.ACTION_REWIND) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_REWIND;
}
if((actions & PlaybackStateCompat.ACTION_PLAY) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_PLAY;
}
if((actions & PlaybackStateCompat.ACTION_PLAY_PAUSE) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE;
}
if((actions & PlaybackStateCompat.ACTION_PAUSE) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_PAUSE;
}
if((actions & PlaybackStateCompat.ACTION_STOP) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_STOP;
}
if((actions & PlaybackStateCompat.ACTION_FAST_FORWARD) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_FAST_FORWARD;
}
if((actions & PlaybackStateCompat.ACTION_SKIP_TO_NEXT) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_NEXT;
}
if((actions & PlaybackStateCompat.ACTION_SEEK_TO) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_POSITION_UPDATE;
}
if((actions & PlaybackStateCompat.ACTION_SET_RATING) != 0){
transportControls |= RemoteControlClient.FLAG_KEY_MEDIA_RATING;
}
((RemoteControlClient)remoteObj).setTransportControlFlags(transportControls);
}
}
示例8: handleKeyEvent
public void handleKeyEvent(KeyEvent event) {
if(event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() > 0) {
switch (event.getKeyCode()) {
case RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS:
case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
downloadService.fastForward();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_NEXT:
case KeyEvent.KEYCODE_MEDIA_NEXT:
downloadService.rewind();
break;
}
} else if(event.getAction() == KeyEvent.ACTION_UP) {
switch (event.getKeyCode()) {
case RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE:
downloadService.togglePlayPause();
break;
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
if(lastPressTime < (System.currentTimeMillis() - 500)) {
lastPressTime = System.currentTimeMillis();
downloadService.togglePlayPause();
} else {
downloadService.next(false, true);
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS:
case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
if(lastPressTime < (System.currentTimeMillis() - DEBOUNCE_TIME)) {
lastPressTime = System.currentTimeMillis();
downloadService.previous();
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_NEXT:
case KeyEvent.KEYCODE_MEDIA_NEXT:
if(lastPressTime < (System.currentTimeMillis() - DEBOUNCE_TIME)) {
lastPressTime = System.currentTimeMillis();
downloadService.next();
}
break;
case KeyEvent.KEYCODE_MEDIA_REWIND:
downloadService.rewind();
break;
case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
downloadService.fastForward();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_STOP:
case KeyEvent.KEYCODE_MEDIA_STOP:
downloadService.stop();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PLAY:
case KeyEvent.KEYCODE_MEDIA_PLAY:
if(downloadService.getPlayerState() != PlayerState.STARTED) {
downloadService.start();
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PAUSE:
downloadService.pause();
default:
break;
}
}
}
示例9: handleKeyEvent
private void handleKeyEvent(KeyEvent event) {
if (event.getAction() != KeyEvent.ACTION_DOWN || event.getRepeatCount() > 0) {
return;
}
switch (event.getKeyCode()) {
case RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_HEADSETHOOK:
downloadService.togglePlayPause();
break;
case KeyEvent.KEYCODE_STAR:
downloadService.toggleStarred();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS:
case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
downloadService.previous();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_NEXT:
case KeyEvent.KEYCODE_MEDIA_NEXT:
if (downloadService.getCurrentPlayingIndex() < downloadService.size() - 1) {
downloadService.next();
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_STOP:
case KeyEvent.KEYCODE_MEDIA_STOP:
downloadService.stop();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PLAY:
case KeyEvent.KEYCODE_MEDIA_PLAY:
if(downloadService.getPlayerState() != PlayerState.STARTED) {
downloadService.start();
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PAUSE:
downloadService.pause();
default:
break;
}
}
示例10: onCreate
@SuppressLint({ "WorldWriteableFiles", "WorldReadableFiles" })
@Override
public void onCreate() {
super.onCreate();
mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
ComponentName rec = new ComponentName(getPackageName(),
MediaButtonIntentReceiver.class.getName());
mAudioManager.registerMediaButtonEventReceiver(rec);
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(rec);
PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0,
mediaButtonIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
mAudioManager.registerRemoteControlClient(mRemoteControlClient);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT | RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP;
mRemoteControlClient.setTransportControlFlags(flags);
mPreferences = getSharedPreferences(APOLLO_PREFERENCES, MODE_WORLD_READABLE
| MODE_WORLD_WRITEABLE);
mCardId = MusicUtils.getCardId(this);
registerExternalStorageListener();
// Needs to be done in this thread, since otherwise
// ApplicationContext.getPowerManager() crashes.
mPlayer = new MultiPlayer();
mPlayer.setHandler(mMediaplayerHandler);
reloadQueue();
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
IntentFilter commandFilter = new IntentFilter();
commandFilter.addAction(SERVICECMD);
commandFilter.addAction(TOGGLEPAUSE_ACTION);
commandFilter.addAction(PAUSE_ACTION);
commandFilter.addAction(NEXT_ACTION);
commandFilter.addAction(PREVIOUS_ACTION);
commandFilter.addAction(CYCLEREPEAT_ACTION);
commandFilter.addAction(TOGGLESHUFFLE_ACTION);
registerReceiver(mIntentReceiver, commandFilter);
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
mWakeLock.setReferenceCounted(false);
// If the service was idle, but got killed before it stopped itself, the
// system will relaunch it. Make sure it gets stopped again in that
// case.
Message msg = mDelayedStopHandler.obtainMessage();
mDelayedStopHandler.sendMessageDelayed(msg, IDLE_DELAY);
}
示例11: onCreate
@SuppressLint({ "WorldWriteableFiles", "WorldReadableFiles" })
@Override
public void onCreate() {
super.onCreate();
mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
ComponentName rec = new ComponentName(getPackageName(),
MediaButtonIntentReceiver.class.getName());
mAudioManager.registerMediaButtonEventReceiver(rec);
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(rec);
PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0,
mediaButtonIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
mAudioManager.registerRemoteControlClient(mRemoteControlClient);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT | RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP;
mRemoteControlClient.setTransportControlFlags(flags);
mPreferences = getSharedPreferences(APOLLO_PREFERENCES, MODE_WORLD_READABLE
| MODE_WORLD_WRITEABLE);
mCardId = MusicUtils.getCardId(this);
registerExternalStorageListener();
// Needs to be done in this thread, since otherwise
// ApplicationContext.getPowerManager() crashes.
mPlayer = new MultiPlayer();
mPlayer.setHandler(mMediaplayerHandler);
reloadQueue();
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
IntentFilter commandFilter = new IntentFilter();
commandFilter.addAction(SERVICECMD);
commandFilter.addAction(TOGGLEPAUSE_ACTION);
commandFilter.addAction(PAUSE_ACTION);
commandFilter.addAction(NEXT_ACTION);
commandFilter.addAction(PREVIOUS_ACTION);
commandFilter.addAction(CYCLEREPEAT_ACTION);
commandFilter.addAction(TOGGLESHUFFLE_ACTION);
registerReceiver(mIntentReceiver, commandFilter);
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, this.getClass().getName());
mWakeLock.setReferenceCounted(false);
// If the service was idle, but got killed before it stopped itself, the
// system will relaunch it. Make sure it gets stopped again in that
// case.
Message msg = mDelayedStopHandler.obtainMessage();
mDelayedStopHandler.sendMessageDelayed(msg, IDLE_DELAY);
}
示例12: handleKeyEvent
private void handleKeyEvent(KeyEvent event) {
if (event.getAction() != KeyEvent.ACTION_DOWN || event.getRepeatCount() > 0) {
return;
}
switch (event.getKeyCode()) {
case RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_HEADSETHOOK:
downloadService.togglePlayPause();
break;
case KeyEvent.KEYCODE_STAR:
downloadService.toggleStarred();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS:
case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
downloadService.previous();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_NEXT:
case KeyEvent.KEYCODE_MEDIA_NEXT:
if (downloadService.getCurrentPlayingIndex() < downloadService.size() - 1) {
downloadService.next();
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_STOP:
case KeyEvent.KEYCODE_MEDIA_STOP:
downloadService.reset();
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PLAY:
case KeyEvent.KEYCODE_MEDIA_PLAY:
if(downloadService.getPlayerState() != PlayerState.STARTED) {
downloadService.start();
}
break;
case RemoteControlClient.FLAG_KEY_MEDIA_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PAUSE:
downloadService.pause();
default:
break;
}
}
示例13: onCreate
@Override
public void onCreate() {
super.onCreate();
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
ComponentName rec = new ComponentName(getPackageName(),
MediaButtonIntentReceiver.class.getName());
mAudioManager.registerMediaButtonEventReceiver(rec);
Intent i = new Intent(Intent.ACTION_MEDIA_BUTTON);
i.setComponent(rec);
PendingIntent pi = PendingIntent.getBroadcast(this /*context*/,
0 /*requestCode, ignored*/, i /*intent*/, 0 /*flags*/);
mRemoteControlClient = new RemoteControlClient(pi);
mAudioManager.registerRemoteControlClient(mRemoteControlClient);
int flags = RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
| RemoteControlClient.FLAG_KEY_MEDIA_NEXT
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY
| RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE
| RemoteControlClient.FLAG_KEY_MEDIA_STOP;
mRemoteControlClient.setTransportControlFlags(flags);
mPreferences = getSharedPreferences("Music", MODE_WORLD_READABLE | MODE_WORLD_WRITEABLE);
mCardId = MusicUtils.getCardId(this);
registerExternalStorageListener();
// Needs to be done in this thread, since otherwise ApplicationContext.getPowerManager() crashes.
mPlayer = new MultiPlayer();
mPlayer.setHandler(mMediaplayerHandler);
reloadQueue();
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
IntentFilter commandFilter = new IntentFilter();
commandFilter.addAction(SERVICECMD);
commandFilter.addAction(TOGGLEPAUSE_ACTION);
commandFilter.addAction(PAUSE_ACTION);
commandFilter.addAction(NEXT_ACTION);
commandFilter.addAction(PREVIOUS_ACTION);
registerReceiver(mIntentReceiver, commandFilter);
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, this.getClass().getName());
mWakeLock.setReferenceCounted(false);
// If the service was idle, but got killed before it stopped itself, the
// system will relaunch it. Make sure it gets stopped again in that case.
Message msg = mDelayedStopHandler.obtainMessage();
mDelayedStopHandler.sendMessageDelayed(msg, IDLE_DELAY);
}
开发者ID:AndroidLearnerchn,项目名称:Android-Application-Using-CAF-Library,代码行数:54,代码来源:MediaPlaybackService.java