summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorDave Burke <daveburke@google.com>2011-08-30 14:39:17 +0100
committerDave Burke <daveburke@google.com>2011-09-02 11:26:59 +0100
commitfc301b0bb5c635c6bb51b48c504a8db5f9010e5c (patch)
tree463dec648e238d2e6821a86d121f2a3f8048b3ff /media/java
parent117999d1f44ec3423369385495ae207898b7b73e (diff)
downloadframeworks_base-fc301b0bb5c635c6bb51b48c504a8db5f9010e5c.zip
frameworks_base-fc301b0bb5c635c6bb51b48c504a8db5f9010e5c.tar.gz
frameworks_base-fc301b0bb5c635c6bb51b48c504a8db5f9010e5c.tar.bz2
Require INTERNET permission for network-based content.
Bug #1870981 Change-Id: Ia3ad166390c4d60cea19c3783895b078a2c4c15f
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/MediaPlayer.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 1ee9a1f..e25f654 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -459,6 +459,9 @@ import java.lang.ref.WeakReference;
* android.R.styleable#AndroidManifestUsesPermission &lt;uses-permission&gt;}
* element.
*
+ * <p>This class requires the {@link android.Manifest.permission#INTERNET} permission
+ * when used with network-based content.
+ *
* <a name="Callbacks"></a>
* <h3>Callbacks</h3>
* <p>Applications may want to register for informational and error
@@ -828,6 +831,7 @@ public class MediaPlayer
fd.close();
}
}
+
Log.d(TAG, "Couldn't open file on client side, trying server side");
setDataSource(uri.toString(), headers);
return;
@@ -839,7 +843,8 @@ public class MediaPlayer
* @param path the path of the file, or the http/rtsp URL of the stream you want to play
* @throws IllegalStateException if it is called in an invalid state
*/
- public native void setDataSource(String path) throws IOException, IllegalArgumentException, IllegalStateException;
+ public native void setDataSource(String path)
+ throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
/**
* Sets the data source (file-path or http/rtsp URL) to use.
@@ -850,7 +855,7 @@ public class MediaPlayer
* @hide pending API council
*/
public void setDataSource(String path, Map<String, String> headers)
- throws IOException, IllegalArgumentException, IllegalStateException
+ throws IOException, IllegalArgumentException, SecurityException, IllegalStateException
{
String[] keys = null;
String[] values = null;
@@ -871,7 +876,7 @@ public class MediaPlayer
private native void _setDataSource(
String path, String[] keys, String[] values)
- throws IOException, IllegalArgumentException, IllegalStateException;
+ throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
/**
* Sets the data source (FileDescriptor) to use. It is the caller's responsibility