Loading media/java/android/media/MediaController.java +2 −7 Original line number Diff line number Diff line Loading @@ -176,12 +176,7 @@ class MediaController implements DeathRecipient { try { mToken.linkToDeath(this, 0); } catch (RemoteException e) { //FIXME do not access the event handler directly mController.mEventHandler.post(new Runnable() { @Override public void run() { mController.unregisterMediaButtonIntent(mMediaIntent); } }); mController.unregisterMediaButtonIntentAsync(mMediaIntent); } } } Loading Loading @@ -209,7 +204,7 @@ class MediaController implements DeathRecipient { @Override public void binderDied() { mController.unregisterMediaButtonIntent(mMediaIntent); mController.unregisterMediaButtonIntentAsync(mMediaIntent); } @Override Loading media/java/android/media/MediaFocusControl.java +15 −4 Original line number Diff line number Diff line Loading @@ -73,8 +73,7 @@ public class MediaFocusControl implements OnFinished { private boolean mIsRinging = false; private final PowerManager.WakeLock mMediaEventWakeLock; //FIXME should be private protected final MediaEventHandler mEventHandler; private final MediaEventHandler mEventHandler; private final Context mContext; private final ContentResolver mContentResolver; private final VolumeController mVolumeController; Loading Loading @@ -330,6 +329,7 @@ public class MediaFocusControl implements OnFinished { private static final int MSG_RCC_UPDATE_METADATA = 9; private static final int MSG_RCDISPLAY_INIT_INFO = 10; private static final int MSG_REEVALUATE_RCD = 11; private static final int MSG_UNREGISTER_MEDIABUTTONINTENT = 12; // sendMsg() flags /** If the msg is already queued, replace it with this one. */ Loading @@ -351,8 +351,7 @@ public class MediaFocusControl implements OnFinished { handler.sendMessageDelayed(handler.obtainMessage(msg, arg1, arg2, obj), delay); } //FIXME should be private protected class MediaEventHandler extends Handler { private class MediaEventHandler extends Handler { MediaEventHandler(Looper looper) { super(looper); } Loading Loading @@ -416,6 +415,10 @@ public class MediaFocusControl implements OnFinished { case MSG_REEVALUATE_RCD: onReevaluateRemoteControlDisplays(); break; case MSG_UNREGISTER_MEDIABUTTONINTENT: unregisterMediaButtonIntent( (PendingIntent) msg.obj ); break; } } } Loading Loading @@ -1056,6 +1059,7 @@ public class MediaFocusControl implements OnFinished { * Inner class to monitor remote control client deaths, and remove the client for the * remote control stack if necessary. */ //FIXME should move to MediaController protected class RcClientDeathHandler implements IBinder.DeathRecipient { //FIXME should be private final protected IBinder mCb; // To be notified of client's death Loading @@ -1080,6 +1084,7 @@ public class MediaFocusControl implements OnFinished { } } //FIXME should move to MediaController protected class RemotePlaybackState { int mRccId; int mVolume; Loading Loading @@ -1698,6 +1703,12 @@ public class MediaFocusControl implements OnFinished { } } protected void unregisterMediaButtonIntentAsync(final PendingIntent mediaIntent) { mEventHandler.sendMessage( mEventHandler.obtainMessage(MSG_UNREGISTER_MEDIABUTTONINTENT, 0, 0, mediaIntent)); } /** * see AudioManager.registerMediaButtonEventReceiverForCalls(ComponentName c) * precondition: c != null Loading Loading
media/java/android/media/MediaController.java +2 −7 Original line number Diff line number Diff line Loading @@ -176,12 +176,7 @@ class MediaController implements DeathRecipient { try { mToken.linkToDeath(this, 0); } catch (RemoteException e) { //FIXME do not access the event handler directly mController.mEventHandler.post(new Runnable() { @Override public void run() { mController.unregisterMediaButtonIntent(mMediaIntent); } }); mController.unregisterMediaButtonIntentAsync(mMediaIntent); } } } Loading Loading @@ -209,7 +204,7 @@ class MediaController implements DeathRecipient { @Override public void binderDied() { mController.unregisterMediaButtonIntent(mMediaIntent); mController.unregisterMediaButtonIntentAsync(mMediaIntent); } @Override Loading
media/java/android/media/MediaFocusControl.java +15 −4 Original line number Diff line number Diff line Loading @@ -73,8 +73,7 @@ public class MediaFocusControl implements OnFinished { private boolean mIsRinging = false; private final PowerManager.WakeLock mMediaEventWakeLock; //FIXME should be private protected final MediaEventHandler mEventHandler; private final MediaEventHandler mEventHandler; private final Context mContext; private final ContentResolver mContentResolver; private final VolumeController mVolumeController; Loading Loading @@ -330,6 +329,7 @@ public class MediaFocusControl implements OnFinished { private static final int MSG_RCC_UPDATE_METADATA = 9; private static final int MSG_RCDISPLAY_INIT_INFO = 10; private static final int MSG_REEVALUATE_RCD = 11; private static final int MSG_UNREGISTER_MEDIABUTTONINTENT = 12; // sendMsg() flags /** If the msg is already queued, replace it with this one. */ Loading @@ -351,8 +351,7 @@ public class MediaFocusControl implements OnFinished { handler.sendMessageDelayed(handler.obtainMessage(msg, arg1, arg2, obj), delay); } //FIXME should be private protected class MediaEventHandler extends Handler { private class MediaEventHandler extends Handler { MediaEventHandler(Looper looper) { super(looper); } Loading Loading @@ -416,6 +415,10 @@ public class MediaFocusControl implements OnFinished { case MSG_REEVALUATE_RCD: onReevaluateRemoteControlDisplays(); break; case MSG_UNREGISTER_MEDIABUTTONINTENT: unregisterMediaButtonIntent( (PendingIntent) msg.obj ); break; } } } Loading Loading @@ -1056,6 +1059,7 @@ public class MediaFocusControl implements OnFinished { * Inner class to monitor remote control client deaths, and remove the client for the * remote control stack if necessary. */ //FIXME should move to MediaController protected class RcClientDeathHandler implements IBinder.DeathRecipient { //FIXME should be private final protected IBinder mCb; // To be notified of client's death Loading @@ -1080,6 +1084,7 @@ public class MediaFocusControl implements OnFinished { } } //FIXME should move to MediaController protected class RemotePlaybackState { int mRccId; int mVolume; Loading Loading @@ -1698,6 +1703,12 @@ public class MediaFocusControl implements OnFinished { } } protected void unregisterMediaButtonIntentAsync(final PendingIntent mediaIntent) { mEventHandler.sendMessage( mEventHandler.obtainMessage(MSG_UNREGISTER_MEDIABUTTONINTENT, 0, 0, mediaIntent)); } /** * see AudioManager.registerMediaButtonEventReceiverForCalls(ComponentName c) * precondition: c != null Loading