Loading media/java/android/media/MediaPlayer.java +0 −67 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.AssetFileDescriptor; import android.net.Proxy; import android.net.ProxyProperties; import android.net.Uri; import android.os.Handler; import android.os.HandlerThread; Loading Loading @@ -882,8 +880,6 @@ public class MediaPlayer implements SubtitleController.Listener */ public void setDataSource(Context context, Uri uri, Map<String, String> headers) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { disableProxyListener(); String scheme = uri.getScheme(); if(scheme == null || scheme.equals("file")) { setDataSource(uri.getPath()); Loading Loading @@ -917,11 +913,6 @@ public class MediaPlayer implements SubtitleController.Listener Log.d(TAG, "Couldn't open file on client side, trying server side"); setDataSource(uri.toString(), headers); if (scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https")) { setupProxyListener(context); } } /** Loading Loading @@ -972,8 +963,6 @@ public class MediaPlayer implements SubtitleController.Listener private void setDataSource(String path, String[] keys, String[] values) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { disableProxyListener(); final Uri uri = Uri.parse(path); if ("file".equals(uri.getScheme())) { path = uri.getPath(); Loading Loading @@ -1029,7 +1018,6 @@ public class MediaPlayer implements SubtitleController.Listener */ public void setDataSource(FileDescriptor fd, long offset, long length) throws IOException, IllegalArgumentException, IllegalStateException { disableProxyListener(); _setDataSource(fd, offset, length); } Loading Loading @@ -1401,8 +1389,6 @@ public class MediaPlayer implements SubtitleController.Listener if (mEventHandler != null) { mEventHandler.removeCallbacksAndMessages(null); } disableProxyListener(); } private native void _reset(); Loading Loading @@ -2750,59 +2736,6 @@ public class MediaPlayer implements SubtitleController.Listener mode == VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); } private Context mProxyContext = null; private ProxyReceiver mProxyReceiver = null; private void setupProxyListener(Context context) { IntentFilter filter = new IntentFilter(); filter.addAction(Proxy.PROXY_CHANGE_ACTION); mProxyReceiver = new ProxyReceiver(); mProxyContext = context; Intent currentProxy = context.getApplicationContext().registerReceiver(mProxyReceiver, filter); if (currentProxy != null) { handleProxyBroadcast(currentProxy); } } private void disableProxyListener() { if (mProxyReceiver == null) { return; } Context appContext = mProxyContext.getApplicationContext(); if (appContext != null) { appContext.unregisterReceiver(mProxyReceiver); } mProxyReceiver = null; mProxyContext = null; } private void handleProxyBroadcast(Intent intent) { ProxyProperties props = (ProxyProperties)intent.getExtra(Proxy.EXTRA_PROXY_INFO); if (props == null || props.getHost() == null) { updateProxyConfig(null); } else { updateProxyConfig(props); } } private class ProxyReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Proxy.PROXY_CHANGE_ACTION)) { handleProxyBroadcast(intent); } } } private native void updateProxyConfig(ProxyProperties props); /** @hide */ static class TimeProvider implements MediaPlayer.OnSeekCompleteListener, MediaTimeProvider { Loading media/jni/android_media_MediaPlayer.cpp +0 −47 Original line number Diff line number Diff line Loading @@ -816,52 +816,6 @@ android_media_MediaPlayer_setNextMediaPlayer(JNIEnv *env, jobject thiz, jobject ; } static void android_media_MediaPlayer_updateProxyConfig( JNIEnv *env, jobject thiz, jobject proxyProps) { ALOGV("updateProxyConfig"); sp<MediaPlayer> thisplayer = getMediaPlayer(env, thiz); if (thisplayer == NULL) { return; } if (proxyProps == NULL) { thisplayer->updateProxyConfig( NULL /* host */, 0 /* port */, NULL /* exclusionList */); } else { jstring hostObj = (jstring)env->CallObjectMethod( proxyProps, fields.proxyConfigGetHost); const char *host = env->GetStringUTFChars(hostObj, NULL); int port = env->CallIntMethod(proxyProps, fields.proxyConfigGetPort); jstring exclusionListObj = (jstring)env->CallObjectMethod( proxyProps, fields.proxyConfigGetExclusionList); if (host != NULL && exclusionListObj != NULL) { const char *exclusionList = env->GetStringUTFChars(exclusionListObj, NULL); if (exclusionList != NULL) { thisplayer->updateProxyConfig(host, port, exclusionList); env->ReleaseStringUTFChars(exclusionListObj, exclusionList); exclusionList = NULL; } else { thisplayer->updateProxyConfig(host, port, ""); } } else if (host != NULL) { thisplayer->updateProxyConfig(host, port, ""); } if (host != NULL) { env->ReleaseStringUTFChars(hostObj, host); host = NULL; } } } // ---------------------------------------------------------------------------- static JNINativeMethod gMethods[] = { Loading Loading @@ -904,7 +858,6 @@ static JNINativeMethod gMethods[] = { {"native_pullBatteryData", "(Landroid/os/Parcel;)I", (void *)android_media_MediaPlayer_pullBatteryData}, {"native_setRetransmitEndpoint", "(Ljava/lang/String;I)I", (void *)android_media_MediaPlayer_setRetransmitEndpoint}, {"setNextMediaPlayer", "(Landroid/media/MediaPlayer;)V", (void *)android_media_MediaPlayer_setNextMediaPlayer}, {"updateProxyConfig", "(Landroid/net/ProxyProperties;)V", (void *)android_media_MediaPlayer_updateProxyConfig}, }; static const char* const kClassPathName = "android/media/MediaPlayer"; Loading Loading
media/java/android/media/MediaPlayer.java +0 −67 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.AssetFileDescriptor; import android.net.Proxy; import android.net.ProxyProperties; import android.net.Uri; import android.os.Handler; import android.os.HandlerThread; Loading Loading @@ -882,8 +880,6 @@ public class MediaPlayer implements SubtitleController.Listener */ public void setDataSource(Context context, Uri uri, Map<String, String> headers) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { disableProxyListener(); String scheme = uri.getScheme(); if(scheme == null || scheme.equals("file")) { setDataSource(uri.getPath()); Loading Loading @@ -917,11 +913,6 @@ public class MediaPlayer implements SubtitleController.Listener Log.d(TAG, "Couldn't open file on client side, trying server side"); setDataSource(uri.toString(), headers); if (scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https")) { setupProxyListener(context); } } /** Loading Loading @@ -972,8 +963,6 @@ public class MediaPlayer implements SubtitleController.Listener private void setDataSource(String path, String[] keys, String[] values) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { disableProxyListener(); final Uri uri = Uri.parse(path); if ("file".equals(uri.getScheme())) { path = uri.getPath(); Loading Loading @@ -1029,7 +1018,6 @@ public class MediaPlayer implements SubtitleController.Listener */ public void setDataSource(FileDescriptor fd, long offset, long length) throws IOException, IllegalArgumentException, IllegalStateException { disableProxyListener(); _setDataSource(fd, offset, length); } Loading Loading @@ -1401,8 +1389,6 @@ public class MediaPlayer implements SubtitleController.Listener if (mEventHandler != null) { mEventHandler.removeCallbacksAndMessages(null); } disableProxyListener(); } private native void _reset(); Loading Loading @@ -2750,59 +2736,6 @@ public class MediaPlayer implements SubtitleController.Listener mode == VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); } private Context mProxyContext = null; private ProxyReceiver mProxyReceiver = null; private void setupProxyListener(Context context) { IntentFilter filter = new IntentFilter(); filter.addAction(Proxy.PROXY_CHANGE_ACTION); mProxyReceiver = new ProxyReceiver(); mProxyContext = context; Intent currentProxy = context.getApplicationContext().registerReceiver(mProxyReceiver, filter); if (currentProxy != null) { handleProxyBroadcast(currentProxy); } } private void disableProxyListener() { if (mProxyReceiver == null) { return; } Context appContext = mProxyContext.getApplicationContext(); if (appContext != null) { appContext.unregisterReceiver(mProxyReceiver); } mProxyReceiver = null; mProxyContext = null; } private void handleProxyBroadcast(Intent intent) { ProxyProperties props = (ProxyProperties)intent.getExtra(Proxy.EXTRA_PROXY_INFO); if (props == null || props.getHost() == null) { updateProxyConfig(null); } else { updateProxyConfig(props); } } private class ProxyReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Proxy.PROXY_CHANGE_ACTION)) { handleProxyBroadcast(intent); } } } private native void updateProxyConfig(ProxyProperties props); /** @hide */ static class TimeProvider implements MediaPlayer.OnSeekCompleteListener, MediaTimeProvider { Loading
media/jni/android_media_MediaPlayer.cpp +0 −47 Original line number Diff line number Diff line Loading @@ -816,52 +816,6 @@ android_media_MediaPlayer_setNextMediaPlayer(JNIEnv *env, jobject thiz, jobject ; } static void android_media_MediaPlayer_updateProxyConfig( JNIEnv *env, jobject thiz, jobject proxyProps) { ALOGV("updateProxyConfig"); sp<MediaPlayer> thisplayer = getMediaPlayer(env, thiz); if (thisplayer == NULL) { return; } if (proxyProps == NULL) { thisplayer->updateProxyConfig( NULL /* host */, 0 /* port */, NULL /* exclusionList */); } else { jstring hostObj = (jstring)env->CallObjectMethod( proxyProps, fields.proxyConfigGetHost); const char *host = env->GetStringUTFChars(hostObj, NULL); int port = env->CallIntMethod(proxyProps, fields.proxyConfigGetPort); jstring exclusionListObj = (jstring)env->CallObjectMethod( proxyProps, fields.proxyConfigGetExclusionList); if (host != NULL && exclusionListObj != NULL) { const char *exclusionList = env->GetStringUTFChars(exclusionListObj, NULL); if (exclusionList != NULL) { thisplayer->updateProxyConfig(host, port, exclusionList); env->ReleaseStringUTFChars(exclusionListObj, exclusionList); exclusionList = NULL; } else { thisplayer->updateProxyConfig(host, port, ""); } } else if (host != NULL) { thisplayer->updateProxyConfig(host, port, ""); } if (host != NULL) { env->ReleaseStringUTFChars(hostObj, host); host = NULL; } } } // ---------------------------------------------------------------------------- static JNINativeMethod gMethods[] = { Loading Loading @@ -904,7 +858,6 @@ static JNINativeMethod gMethods[] = { {"native_pullBatteryData", "(Landroid/os/Parcel;)I", (void *)android_media_MediaPlayer_pullBatteryData}, {"native_setRetransmitEndpoint", "(Ljava/lang/String;I)I", (void *)android_media_MediaPlayer_setRetransmitEndpoint}, {"setNextMediaPlayer", "(Landroid/media/MediaPlayer;)V", (void *)android_media_MediaPlayer_setNextMediaPlayer}, {"updateProxyConfig", "(Landroid/net/ProxyProperties;)V", (void *)android_media_MediaPlayer_updateProxyConfig}, }; static const char* const kClassPathName = "android/media/MediaPlayer"; Loading