Remove code for Android API level < 9

We don't support API levels < 9, so we can simplify this code
a little.

Change-Id: I9823d4c5a44d265e03dec0ceedeeb3c34a1e1eab
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2013-04-02 12:34:02 +02:00 committed by The Qt Project
parent 72e9cad560
commit c1ac77b34c

View File

@ -74,9 +74,7 @@
# include "qandroidopenglplatformwindow.h"
#endif
#if __ANDROID_API__ > 8
# include <android/native_window_jni.h>
#endif
#include <android/native_window_jni.h>
static jmethodID m_redrawSurfaceMethodID = 0;
@ -543,32 +541,6 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
env->DeleteGlobalRef(m_bitmapDrawableClass);
}
#ifdef ANDROID_PLUGIN_OPENGL
#if __ANDROID_API__ < 9
struct FakeNativeWindow
{
long long dummyNativeWindow;// force 64 bits alignment
};
class FakeSurface: public FakeNativeWindow
{
public:
virtual void FakeSurfaceMethod()
{
fakeSurface = 0;
}
int fakeSurface;
};
EGLNativeWindowType ANativeWindow_fromSurface(JNIEnv *env, jobject jSurface)
{
FakeSurface *surface = static_cast<FakeSurface *>(env->GetIntField(jSurface, m_surfaceFieldID));
return static_cast<EGLNativeWindowType>(static_cast<FakeNativeWindow*>(surface));
}
#endif // __ANDROID_API__ < 9
#endif // ANDROID_PLUGIN_OPENGL
static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
{
#ifndef ANDROID_PLUGIN_OPENGL
@ -753,12 +725,7 @@ static int registerNatives(JNIEnv *env)
#ifdef ANDROID_PLUGIN_OPENGL
FIND_AND_CHECK_CLASS("android/view/Surface");
#if __ANDROID_API__ < 9
# define ANDROID_VIEW_SURFACE_JNI_ID "mSurface"
#else
# define ANDROID_VIEW_SURFACE_JNI_ID "mNativeSurface"
#endif
GET_AND_CHECK_FIELD(m_surfaceFieldID, clazz, ANDROID_VIEW_SURFACE_JNI_ID, "I");
GET_AND_CHECK_FIELD(m_surfaceFieldID, clazz, "mNativeSurface", "I");
#endif
jmethodID methodID;