[Android] Remove unused code for apiSdk
Jean-Baptiste Kempf
git at videolan.org
Wed Jun 20 23:45:27 CEST 2012
android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jun 21 00:36:03 2012 +0200| [1d821e22548f809c351119a11e238c684a4cf350] | committer: Jean-Baptiste Kempf
Remove unused code for apiSdk
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=1d821e22548f809c351119a11e238c684a4cf350
---
vlc-android/jni/libvlcjni.c | 20 --------------------
vlc-android/src/org/videolan/vlc/Util.java | 25 -------------------------
2 files changed, 45 deletions(-)
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index f9fa601..0391b8f 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -327,26 +327,6 @@ void Java_org_videolan_vlc_LibVLC_nativeDestroy(JNIEnv *env, jobject thiz)
(*env)->SetIntField(env, thiz, field, 0);
}
-int currentSdk( JNIEnv *p_env, jobject thiz )
-{
- jclass cls = (*p_env)->FindClass( p_env, "org/videolan/vlc/Util" );
- if ( !cls )
- {
- LOGE("Failed to load util class (org/videolan/vlc/Util)" );
- return 0;
- }
- jmethodID methodSdkVersion = (*p_env)->GetStaticMethodID( p_env, cls,
- "getApiLevel", "()I" );
- if ( !methodSdkVersion )
- {
- LOGE("Failed to load method getApiLevel()" );
- return 0;
- }
- int version = (*p_env)->CallStaticIntMethod( p_env, cls, methodSdkVersion );
- LOGI("Phone running on API level %d\n", version );
- return version;
-}
-
void Java_org_videolan_vlc_LibVLC_detachEventManager(JNIEnv *env, jobject thiz)
{
if (eventManagerInstance != NULL) {
diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 68db351..89c3261 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -21,7 +21,6 @@
package org.videolan.vlc;
import java.io.File;
-import java.lang.reflect.Field;
import java.text.DecimalFormat;
import android.content.Context;
@@ -88,30 +87,6 @@ public class Util {
return time;
}
- private static int apiLevel = 0;
-
- /**
- * Returns the current Android SDK version
- * This function is called by the native code.
- * This is used to know if we should use the native audio output,
- * or the amem as a fallback.
- */
- public static int getApiLevel() {
- if (apiLevel > 0)
- return apiLevel;
- if (android.os.Build.VERSION.SDK.equalsIgnoreCase("3")) {
- apiLevel = 3;
- } else {
- try {
- final Field f = android.os.Build.VERSION.class.getDeclaredField("SDK_INT");
- apiLevel = (Integer) f.get(null);
- } catch (final Exception e) {
- return 0;
- }
- }
- return apiLevel;
- }
-
public static Bitmap scaleDownBitmap(Context context, Bitmap bitmap, int width) {
if (bitmap != null) {
final float densityMultiplier = context.getResources().getDisplayMetrics().density;
More information about the Android
mailing list