Loading media/java/android/media/AudioManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -2127,7 +2127,7 @@ public class AudioManager { mediaButtonIntent.setComponent(eventReceiver); PendingIntent pi = PendingIntent.getBroadcast(mContext, 0/*requestCode, ignored*/, mediaButtonIntent, 0/*flags*/); unregisterMediaButtonIntent(pi, eventReceiver); unregisterMediaButtonIntent(pi); } /** Loading @@ -2139,16 +2139,16 @@ public class AudioManager { if (eventReceiver == null) { return; } unregisterMediaButtonIntent(eventReceiver, null); unregisterMediaButtonIntent(eventReceiver); } /** * @hide */ public void unregisterMediaButtonIntent(PendingIntent pi, ComponentName eventReceiver) { public void unregisterMediaButtonIntent(PendingIntent pi) { IAudioService service = getService(); try { service.unregisterMediaButtonIntent(pi, eventReceiver); service.unregisterMediaButtonIntent(pi); } catch (RemoteException e) { Log.e(TAG, "Dead object in unregisterMediaButtonIntent"+e); } Loading media/java/android/media/AudioService.java +12 −6 Original line number Diff line number Diff line Loading @@ -4889,7 +4889,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { mRemoteVolumeObs = null; } /** precondition: mediaIntent != null, eventReceiver != null */ /** precondition: mediaIntent != null */ public RemoteControlStackEntry(PendingIntent mediaIntent, ComponentName eventReceiver) { mMediaIntent = mediaIntent; mReceiverComponent = eventReceiver; Loading Loading @@ -5062,6 +5062,10 @@ public class AudioService extends IAudioService.Stub implements OnFinished { Settings.System.MEDIA_BUTTON_RECEIVER, UserHandle.USER_CURRENT); if ((null != receiverName) && !receiverName.isEmpty()) { ComponentName eventReceiver = ComponentName.unflattenFromString(receiverName); if (eventReceiver == null) { // an invalid name was persisted return; } // construct a PendingIntent targeted to the restored component name // for the media button and register it Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); Loading @@ -5077,7 +5081,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { * Helper function: * Set the new remote control receiver at the top of the RC focus stack. * Called synchronized on mAudioFocusLock, then mRCStack * precondition: mediaIntent != null, target != null * precondition: mediaIntent != null */ private void pushMediaButtonReceiver_syncAfRcs(PendingIntent mediaIntent, ComponentName target) { // already at top of stack? Loading Loading @@ -5106,9 +5110,11 @@ public class AudioService extends IAudioService.Stub implements OnFinished { mRCStack.push(rcse); // rcse is never null // post message to persist the default media button receiver if (target != null) { mAudioHandler.sendMessage( mAudioHandler.obtainMessage( MSG_PERSIST_MEDIABUTTONRECEIVER, 0, 0, target/*obj*/) ); } } /** * Helper function: Loading Loading @@ -5407,7 +5413,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { /** * see AudioManager.registerMediaButtonIntent(PendingIntent pi, ComponentName c) * precondition: mediaIntent != null, target != null * precondition: mediaIntent != null */ public void registerMediaButtonIntent(PendingIntent mediaIntent, ComponentName eventReceiver) { Log.i(TAG, " Remote Control registerMediaButtonIntent() for " + mediaIntent); Loading @@ -5425,7 +5431,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { * see AudioManager.unregisterMediaButtonIntent(PendingIntent mediaIntent) * precondition: mediaIntent != null, eventReceiver != null */ public void unregisterMediaButtonIntent(PendingIntent mediaIntent, ComponentName eventReceiver) public void unregisterMediaButtonIntent(PendingIntent mediaIntent) { Log.i(TAG, " Remote Control unregisterMediaButtonIntent() for " + mediaIntent); Loading media/java/android/media/IAudioService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ interface IAudioService { void dispatchMediaKeyEventUnderWakelock(in KeyEvent keyEvent); void registerMediaButtonIntent(in PendingIntent pi, in ComponentName c); oneway void unregisterMediaButtonIntent(in PendingIntent pi, in ComponentName c); oneway void unregisterMediaButtonIntent(in PendingIntent pi); oneway void registerMediaButtonEventReceiverForCalls(in ComponentName c); oneway void unregisterMediaButtonEventReceiverForCalls(); Loading Loading
media/java/android/media/AudioManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -2127,7 +2127,7 @@ public class AudioManager { mediaButtonIntent.setComponent(eventReceiver); PendingIntent pi = PendingIntent.getBroadcast(mContext, 0/*requestCode, ignored*/, mediaButtonIntent, 0/*flags*/); unregisterMediaButtonIntent(pi, eventReceiver); unregisterMediaButtonIntent(pi); } /** Loading @@ -2139,16 +2139,16 @@ public class AudioManager { if (eventReceiver == null) { return; } unregisterMediaButtonIntent(eventReceiver, null); unregisterMediaButtonIntent(eventReceiver); } /** * @hide */ public void unregisterMediaButtonIntent(PendingIntent pi, ComponentName eventReceiver) { public void unregisterMediaButtonIntent(PendingIntent pi) { IAudioService service = getService(); try { service.unregisterMediaButtonIntent(pi, eventReceiver); service.unregisterMediaButtonIntent(pi); } catch (RemoteException e) { Log.e(TAG, "Dead object in unregisterMediaButtonIntent"+e); } Loading
media/java/android/media/AudioService.java +12 −6 Original line number Diff line number Diff line Loading @@ -4889,7 +4889,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { mRemoteVolumeObs = null; } /** precondition: mediaIntent != null, eventReceiver != null */ /** precondition: mediaIntent != null */ public RemoteControlStackEntry(PendingIntent mediaIntent, ComponentName eventReceiver) { mMediaIntent = mediaIntent; mReceiverComponent = eventReceiver; Loading Loading @@ -5062,6 +5062,10 @@ public class AudioService extends IAudioService.Stub implements OnFinished { Settings.System.MEDIA_BUTTON_RECEIVER, UserHandle.USER_CURRENT); if ((null != receiverName) && !receiverName.isEmpty()) { ComponentName eventReceiver = ComponentName.unflattenFromString(receiverName); if (eventReceiver == null) { // an invalid name was persisted return; } // construct a PendingIntent targeted to the restored component name // for the media button and register it Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); Loading @@ -5077,7 +5081,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { * Helper function: * Set the new remote control receiver at the top of the RC focus stack. * Called synchronized on mAudioFocusLock, then mRCStack * precondition: mediaIntent != null, target != null * precondition: mediaIntent != null */ private void pushMediaButtonReceiver_syncAfRcs(PendingIntent mediaIntent, ComponentName target) { // already at top of stack? Loading Loading @@ -5106,9 +5110,11 @@ public class AudioService extends IAudioService.Stub implements OnFinished { mRCStack.push(rcse); // rcse is never null // post message to persist the default media button receiver if (target != null) { mAudioHandler.sendMessage( mAudioHandler.obtainMessage( MSG_PERSIST_MEDIABUTTONRECEIVER, 0, 0, target/*obj*/) ); } } /** * Helper function: Loading Loading @@ -5407,7 +5413,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { /** * see AudioManager.registerMediaButtonIntent(PendingIntent pi, ComponentName c) * precondition: mediaIntent != null, target != null * precondition: mediaIntent != null */ public void registerMediaButtonIntent(PendingIntent mediaIntent, ComponentName eventReceiver) { Log.i(TAG, " Remote Control registerMediaButtonIntent() for " + mediaIntent); Loading @@ -5425,7 +5431,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { * see AudioManager.unregisterMediaButtonIntent(PendingIntent mediaIntent) * precondition: mediaIntent != null, eventReceiver != null */ public void unregisterMediaButtonIntent(PendingIntent mediaIntent, ComponentName eventReceiver) public void unregisterMediaButtonIntent(PendingIntent mediaIntent) { Log.i(TAG, " Remote Control unregisterMediaButtonIntent() for " + mediaIntent); Loading
media/java/android/media/IAudioService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ interface IAudioService { void dispatchMediaKeyEventUnderWakelock(in KeyEvent keyEvent); void registerMediaButtonIntent(in PendingIntent pi, in ComponentName c); oneway void unregisterMediaButtonIntent(in PendingIntent pi, in ComponentName c); oneway void unregisterMediaButtonIntent(in PendingIntent pi); oneway void registerMediaButtonEventReceiverForCalls(in ComponentName c); oneway void unregisterMediaButtonEventReceiverForCalls(); Loading