summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2014-09-10 09:15:50 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2014-09-10 09:15:50 -0700
commit60f22fbf67a69e8f3604afb46ccd7c3bd2819cb1 (patch)
tree68f381d0d727ca77590c3783f6367d8470eb89b4 /media
parent033a54ec746bd8a4c5913f8290deb4a4ec653c50 (diff)
downloadframeworks_base-60f22fbf67a69e8f3604afb46ccd7c3bd2819cb1.zip
frameworks_base-60f22fbf67a69e8f3604afb46ccd7c3bd2819cb1.tar.gz
frameworks_base-60f22fbf67a69e8f3604afb46ccd7c3bd2819cb1.tar.bz2
Do not restore the media button event receiver
Do not restore the media button event receiver on behalf of the application that registered. Prevents reported vulnerability. Bug 15428797 Change-Id: If40ee6bc0c77c191643129daa92eb26755e70cb0
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioService.java27
1 files changed, 0 insertions, 27 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index cad20b8..f87a108 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -779,9 +779,6 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
// Broadcast vibrate settings
broadcastVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);
broadcastVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION);
-
- // Restore the default media button receiver from the system settings
- restoreMediaButtonReceiver();
}
private int rescaleIndex(int index, int srcStream, int dstStream) {
@@ -5169,30 +5166,6 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
/**
* Helper function:
- * Restore remote control receiver from the system settings.
- */
- private void restoreMediaButtonReceiver() {
- String receiverName = Settings.System.getStringForUser(mContentResolver,
- 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);
- // the associated intent will be handled by the component being registered
- mediaButtonIntent.setComponent(eventReceiver);
- PendingIntent pi = PendingIntent.getBroadcast(mContext,
- 0/*requestCode, ignored*/, mediaButtonIntent, 0/*flags*/);
- registerMediaButtonIntent(pi, eventReceiver, null);
- }
- }
-
- /**
- * 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