Merge "Camera and MediaRecorder: Support AppOps" into jb-mr2-dev
diff --git a/api/current.txt b/api/current.txt
index b510704..86353d1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15849,7 +15849,7 @@
field public static final int ICE_CREAM_SANDWICH_MR1 = 15; // 0xf
field public static final int JELLY_BEAN = 16; // 0x10
field public static final int JELLY_BEAN_MR1 = 17; // 0x11
- field public static final int K = 10000; // 0x2710
+ field public static final int JELLY_BEAN_MR2 = 10000; // 0x2710
}
public final class Bundle implements java.lang.Cloneable android.os.Parcelable {
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 0a9ed58..2224490 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -362,7 +362,12 @@
try {
pi = pm.getPackageInfo(mPackageName, 0, UserHandle.myUserId());
} catch (RemoteException e) {
- throw new AssertionError(e);
+ throw new IllegalStateException("Unable to get package info for "
+ + mPackageName + "; is system dying?", e);
+ }
+ if (pi == null) {
+ throw new IllegalStateException("Unable to get package info for "
+ + mPackageName + "; is package not installed?");
}
/*
* Two possible indications that this package could be
diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java
index a282910..ce1276f 100644
--- a/core/java/android/net/TrafficStats.java
+++ b/core/java/android/net/TrafficStats.java
@@ -429,7 +429,7 @@
* monotonically since device boot. Statistics are measured at the network
* layer, so they include both TCP and UDP usage.
* <p>
- * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+ * Before {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, this may return
* {@link #UNSUPPORTED} on devices where statistics aren't available.
*
* @see android.os.Process#myUid()
@@ -445,7 +445,7 @@
* monotonically since device boot. Statistics are measured at the network
* layer, so they include both TCP and UDP usage.
* <p>
- * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+ * Before {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, this may return
* {@link #UNSUPPORTED} on devices where statistics aren't available.
*
* @see android.os.Process#myUid()
@@ -461,7 +461,7 @@
* monotonically since device boot. Statistics are measured at the network
* layer, so they include both TCP and UDP usage.
* <p>
- * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+ * Before {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, this may return
* {@link #UNSUPPORTED} on devices where statistics aren't available.
*
* @see android.os.Process#myUid()
@@ -477,7 +477,7 @@
* monotonically since device boot. Statistics are measured at the network
* layer, so they include both TCP and UDP usage.
* <p>
- * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+ * Before {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, this may return
* {@link #UNSUPPORTED} on devices where statistics aren't available.
*
* @see android.os.Process#myUid()
@@ -488,7 +488,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidTxBytes(int)
@@ -499,7 +499,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidRxBytes(int)
@@ -510,7 +510,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidTxBytes(int)
@@ -521,7 +521,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidRxBytes(int)
@@ -532,7 +532,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidTxPackets(int)
@@ -543,7 +543,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidRxPackets(int)
@@ -554,7 +554,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidTxPackets(int)
@@ -565,7 +565,7 @@
}
/**
- * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+ * @deprecated Starting in {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
* transport layer statistics are no longer available, and will
* always return {@link #UNSUPPORTED}.
* @see #getUidRxPackets(int)
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 52c89e8..97ac862 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -433,9 +433,9 @@
public static final int JELLY_BEAN_MR1 = 17;
/**
- * Android X.X: "K". Just "K"
+ * Android 4.X: Jelly Bean MR2, the revenge of the beans.
*/
- public static final int K = CUR_DEVELOPMENT;
+ public static final int JELLY_BEAN_MR2 = CUR_DEVELOPMENT;
}
/** The type of build, like "user" or "eng". */
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index e4a5e7f..51e3e7c 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -15,15 +15,15 @@
*/
package android.os;
-import com.android.internal.R;
-
import android.app.ActivityManagerNative;
import android.content.Context;
import android.content.pm.UserInfo;
-import android.graphics.Bitmap;
import android.content.res.Resources;
+import android.graphics.Bitmap;
import android.util.Log;
+import com.android.internal.R;
+
import java.util.List;
/**
@@ -71,6 +71,14 @@
*/
public static final String ALLOW_UNINSTALL_APPS = "uninstall_apps";
+ /** @hide *
+ * Key for user restrictions. Specifies if a user is allowed to toggle location sharing.
+ * Type: Boolean
+ * @see #setUserRestrictions(Bundle)
+ * @see #getUserRestrictions()
+ */
+ public static final String ALLOW_CONFIG_LOCATION_ACCESS = "config_location_access";
+
/** @hide */
public UserManager(Context context, IUserManager service) {
mService = service;
@@ -86,11 +94,11 @@
return getMaxSupportedUsers() > 1;
}
- /**
+ /**
* Returns the user handle for the user that this application is running for.
* @return the user handle of the user making this call.
* @hide
- * */
+ */
public int getUserHandle() {
return UserHandle.myUserId();
}
@@ -197,6 +205,13 @@
}
}
+ /** @hide */
+ public void setUserRestriction(String key, boolean value, UserHandle userHandle) {
+ Bundle bundle = getUserRestrictions(userHandle);
+ bundle.putBoolean(key, value);
+ setUserRestrictions(bundle, userHandle);
+ }
+
/**
* Return the serial number for a user. This is a device-unique
* number assigned to that user; if the user is deleted and then a new
@@ -433,4 +448,12 @@
}
return -1;
}
+
+ /**
+ * Returns whether the current user is allow to toggle location sharing settings.
+ * @hide
+ */
+ public boolean isLocationSharingToggleAllowed() {
+ return getUserRestrictions().getBoolean(ALLOW_CONFIG_LOCATION_ACCESS);
+ }
}
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 7929112..e086f5a 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -173,6 +173,19 @@
public static final String DEBUG_SHOW_OVERDRAW_PROPERTY = "debug.hwui.show_overdraw";
/**
+ * Turn on to debug non-rectangular clip operations.
+ *
+ * Possible values:
+ * "hide", to disable this debug mode
+ * "highlight", highlight drawing commands tested against a non-rectangular clip
+ * "stencil", renders the clip region on screen when set
+ *
+ * @hide
+ */
+ public static final String DEBUG_SHOW_NON_RECTANGULAR_CLIP_PROPERTY =
+ "debug.hwui.show_non_rect_clip";
+
+ /**
* A process can set this flag to false to prevent the use of hardware
* rendering.
*
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index e4ecb5c..f0c6241 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -99,6 +99,9 @@
void startAppFreezingScreen(IBinder token, int configChanges);
void stopAppFreezingScreen(IBinder token, boolean force);
void removeAppToken(IBinder token);
+ void moveAppToken(int index, IBinder token);
+ void moveAppTokensToTop(in List<IBinder> tokens);
+ void moveAppTokensToBottom(in List<IBinder> tokens);
// Re-evaluate the current orientation from the caller's state.
// If there is a change, the new Configuration is returned and the
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 7ef7e2b..ded2f47 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -509,13 +509,8 @@
if (displayToken == null) {
throw new IllegalArgumentException("displayToken must not be null");
}
- if (surface == null) {
- throw new IllegalArgumentException("surface must not be null");
- }
- if (surface.mNativeObject == 0)
- throw new NullPointerException("Surface native object is null. Are you using a released surface?");
-
- nativeSetDisplaySurface(displayToken, surface.mNativeObject);
+ int nativeSurface = surface != null ? surface.mNativeObject : 0;
+ nativeSetDisplaySurface(displayToken, nativeSurface);
}
public static IBinder createDisplay(String name, boolean secure) {
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 4436fbb..69e3177 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -2429,9 +2429,7 @@
View selectedView = getSelectedView();
int selectedPos = mSelectedPosition;
- int nextSelectedPosition = (direction == View.FOCUS_DOWN) ?
- lookForSelectablePosition(selectedPos + 1, true) :
- lookForSelectablePosition(selectedPos - 1, false);
+ int nextSelectedPosition = lookForSelectablePositionOnScreen(direction);
int amountToScroll = amountToScroll(direction, nextSelectedPosition);
// if we are moving focus, we may OVERRIDE the default behavior
@@ -2643,18 +2641,14 @@
final int listBottom = getHeight() - mListPadding.bottom;
final int listTop = mListPadding.top;
- int numChildren = getChildCount();
+ final int numChildren = getChildCount();
if (direction == View.FOCUS_DOWN) {
int indexToMakeVisible = numChildren - 1;
if (nextSelectedPosition != INVALID_POSITION) {
indexToMakeVisible = nextSelectedPosition - mFirstPosition;
}
- while (numChildren <= indexToMakeVisible) {
- // Child to view is not attached yet.
- addViewBelow(getChildAt(numChildren - 1), mFirstPosition + numChildren - 1);
- numChildren++;
- }
+
final int positionToMakeVisible = mFirstPosition + indexToMakeVisible;
final View viewToMakeVisible = getChildAt(indexToMakeVisible);
@@ -2688,12 +2682,6 @@
if (nextSelectedPosition != INVALID_POSITION) {
indexToMakeVisible = nextSelectedPosition - mFirstPosition;
}
- while (indexToMakeVisible < 0) {
- // Child to view is not attached yet.
- addViewAbove(getChildAt(0), mFirstPosition);
- mFirstPosition--;
- indexToMakeVisible = nextSelectedPosition - mFirstPosition;
- }
final int positionToMakeVisible = mFirstPosition + indexToMakeVisible;
final View viewToMakeVisible = getChildAt(indexToMakeVisible);
int goalTop = listTop;
diff --git a/core/jni/android_opengl_EGL14.cpp b/core/jni/android_opengl_EGL14.cpp
index 196004a5..664af07 100644
--- a/core/jni/android_opengl_EGL14.cpp
+++ b/core/jni/android_opengl_EGL14.cpp
@@ -155,8 +155,8 @@
android_eglInitialize
(JNIEnv *_env, jobject _this, jobject dpy, jintArray major_ref, jint majorOffset, jintArray minor_ref, jint minorOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLBoolean _returnValue = (EGLBoolean) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLint *major_base = (EGLint *) 0;
@@ -261,8 +261,8 @@
android_eglGetConfigs
(JNIEnv *_env, jobject _this, jobject dpy, jobjectArray configs_ref, jint configsOffset, jint config_size, jintArray num_config_ref, jint num_configOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLBoolean _returnValue = (EGLBoolean) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
jint _configsRemaining;
@@ -339,8 +339,8 @@
android_eglChooseConfig
(JNIEnv *_env, jobject _this, jobject dpy, jintArray attrib_list_ref, jint attrib_listOffset, jobjectArray configs_ref, jint configsOffset, jint config_size, jintArray num_config_ref, jint num_configOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLBoolean _returnValue = (EGLBoolean) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
bool attrib_list_sentinel = false;
@@ -462,8 +462,8 @@
android_eglGetConfigAttrib
(JNIEnv *_env, jobject _this, jobject dpy, jobject config, jint attribute, jintArray value_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLBoolean _returnValue = (EGLBoolean) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLConfig config_native = (EGLConfig) fromEGLHandle(_env, eglconfigGetHandleID, config);
@@ -675,8 +675,8 @@
android_eglCreatePbufferSurface
(JNIEnv *_env, jobject _this, jobject dpy, jobject config, jintArray attrib_list_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLSurface _returnValue = (EGLSurface) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLConfig config_native = (EGLConfig) fromEGLHandle(_env, eglconfigGetHandleID, config);
@@ -761,8 +761,8 @@
android_eglQuerySurface
(JNIEnv *_env, jobject _this, jobject dpy, jobject surface, jint attribute, jintArray value_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLBoolean _returnValue = (EGLBoolean) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLSurface surface_native = (EGLSurface) fromEGLHandle(_env, eglsurfaceGetHandleID, surface);
@@ -854,8 +854,8 @@
android_eglCreatePbufferFromClientBuffer
(JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jint buffer, jobject config, jintArray attrib_list_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLSurface _returnValue = (EGLSurface) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLConfig config_native = (EGLConfig) fromEGLHandle(_env, eglconfigGetHandleID, config);
@@ -981,8 +981,8 @@
android_eglCreateContext
(JNIEnv *_env, jobject _this, jobject dpy, jobject config, jobject share_context, jintArray attrib_list_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLContext _returnValue = (EGLContext) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLConfig config_native = (EGLConfig) fromEGLHandle(_env, eglconfigGetHandleID, config);
@@ -1108,8 +1108,8 @@
android_eglQueryContext
(JNIEnv *_env, jobject _this, jobject dpy, jobject ctx, jint attribute, jintArray value_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
EGLBoolean _returnValue = (EGLBoolean) 0;
EGLDisplay dpy_native = (EGLDisplay) fromEGLHandle(_env, egldisplayGetHandleID, dpy);
EGLContext ctx_native = (EGLContext) fromEGLHandle(_env, eglcontextGetHandleID, ctx);
diff --git a/core/jni/android_opengl_GLES10.cpp b/core/jni/android_opengl_GLES10.cpp
index 571f579..336c0ec 100644
--- a/core/jni/android_opengl_GLES10.cpp
+++ b/core/jni/android_opengl_GLES10.cpp
@@ -17,27 +17,14 @@
// This source file is automatically generated
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
-
#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
- const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count);
-}
static int initialized = 0;
@@ -50,6 +37,34 @@
static jfieldID limitID;
static jfieldID elementSizeShiftID;
+
+/* special calls implemented in Android's GLES wrapper used to more
+ * efficiently bound-check passed arrays */
+extern "C" {
+#ifdef GL_VERSION_ES_CM_1_1
+GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr, GLsizei count);
+GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
+ const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+#endif
+#ifdef GL_ES_VERSION_2_0
+static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
+ glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
+}
+#endif
+}
+
/* Cache method IDs each time the class is loaded. */
static void
@@ -105,7 +120,7 @@
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
+ commit ? 0 : JNI_ABORT);
}
static void *
@@ -122,11 +137,183 @@
return (void*) buf;
}
-static int
-getNumCompressedTextureFormats() {
- int numCompressedTextureFormats = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
- return numCompressedTextureFormats;
+// --------------------------------------------------------------------------
+
+/*
+ * returns the number of values glGet returns for a given pname.
+ *
+ * The code below is written such that pnames requiring only one values
+ * are the default (and are not explicitely tested for). This makes the
+ * checking code much shorter/readable/efficient.
+ *
+ * This means that unknown pnames (e.g.: extensions) will default to 1. If
+ * that unknown pname needs more than 1 value, then the validation check
+ * is incomplete and the app may crash if it passed the wrong number params.
+ */
+static int getNeededCount(GLint pname) {
+ int needed = 1;
+#ifdef GL_ES_VERSION_2_0
+ // GLES 2.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_BLEND_COLOR:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+
+ case GL_SHADER_BINARY_FORMATS:
+ glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
+ break;
+ }
+#endif
+
+#ifdef GL_VERSION_ES_CM_1_1
+ // GLES 1.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_CURRENT_NORMAL:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ needed = 3;
+ break;
+
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_CURRENT_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_FOG_COLOR:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ needed = 16;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+ }
+#endif
+ return needed;
+}
+
+template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+get
+ (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ CTYPE *params_base = (CTYPE *) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ if (!params_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "params == null";
+ goto exit;
+ }
+ if (offset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "offset < 0";
+ goto exit;
+ }
+ _remaining = _env->GetArrayLength(params_ref) - offset;
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
+ params_base = (CTYPE *)
+ _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
+ params = params_base + offset;
+
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (params_base) {
+ _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
+
+template <typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+getarray
+ (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_needed>0 && _remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (CTYPE *) (_paramsBase + _bufferOffset);
+ }
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (_array) {
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
// --------------------------------------------------------------------------
@@ -413,8 +600,8 @@
android_glDeleteTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
@@ -462,8 +649,8 @@
android_glDeleteTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -566,8 +753,8 @@
android_glDrawElements__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -647,8 +834,8 @@
android_glFogfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -668,27 +855,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
- _needed = 1;
- break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -721,8 +894,8 @@
android_glFogfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -731,27 +904,13 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
- _needed = 1;
- break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -793,8 +952,8 @@
android_glFogxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -814,27 +973,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
- _needed = 1;
- break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -867,8 +1012,8 @@
android_glFogxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -877,27 +1022,13 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
- _needed = 1;
- break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -966,8 +1097,8 @@
android_glGenTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
@@ -1015,8 +1146,8 @@
android_glGenTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1060,748 +1191,14 @@
static void
android_glGetIntegerv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- GLint *params_base = (GLint *) 0;
- jint _remaining;
- GLint *params = (GLint *) 0;
-
- if (!params_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "params == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(params_ref) - offset;
- int _needed;
- switch (pname) {
-#if defined(GL_ALPHA_BITS)
- case GL_ALPHA_BITS:
-#endif // defined(GL_ALPHA_BITS)
-#if defined(GL_ALPHA_TEST_FUNC)
- case GL_ALPHA_TEST_FUNC:
-#endif // defined(GL_ALPHA_TEST_FUNC)
-#if defined(GL_ALPHA_TEST_REF)
- case GL_ALPHA_TEST_REF:
-#endif // defined(GL_ALPHA_TEST_REF)
-#if defined(GL_BLEND_DST)
- case GL_BLEND_DST:
-#endif // defined(GL_BLEND_DST)
-#if defined(GL_BLUE_BITS)
- case GL_BLUE_BITS:
-#endif // defined(GL_BLUE_BITS)
-#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
- case GL_COLOR_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
-#if defined(GL_COLOR_ARRAY_SIZE)
- case GL_COLOR_ARRAY_SIZE:
-#endif // defined(GL_COLOR_ARRAY_SIZE)
-#if defined(GL_COLOR_ARRAY_STRIDE)
- case GL_COLOR_ARRAY_STRIDE:
-#endif // defined(GL_COLOR_ARRAY_STRIDE)
-#if defined(GL_COLOR_ARRAY_TYPE)
- case GL_COLOR_ARRAY_TYPE:
-#endif // defined(GL_COLOR_ARRAY_TYPE)
-#if defined(GL_CULL_FACE)
- case GL_CULL_FACE:
-#endif // defined(GL_CULL_FACE)
-#if defined(GL_DEPTH_BITS)
- case GL_DEPTH_BITS:
-#endif // defined(GL_DEPTH_BITS)
-#if defined(GL_DEPTH_CLEAR_VALUE)
- case GL_DEPTH_CLEAR_VALUE:
-#endif // defined(GL_DEPTH_CLEAR_VALUE)
-#if defined(GL_DEPTH_FUNC)
- case GL_DEPTH_FUNC:
-#endif // defined(GL_DEPTH_FUNC)
-#if defined(GL_DEPTH_WRITEMASK)
- case GL_DEPTH_WRITEMASK:
-#endif // defined(GL_DEPTH_WRITEMASK)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FRONT_FACE)
- case GL_FRONT_FACE:
-#endif // defined(GL_FRONT_FACE)
-#if defined(GL_GREEN_BITS)
- case GL_GREEN_BITS:
-#endif // defined(GL_GREEN_BITS)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
-#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
- case GL_LIGHT_MODEL_COLOR_CONTROL:
-#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
-#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
-#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
-#if defined(GL_LINE_SMOOTH_HINT)
- case GL_LINE_SMOOTH_HINT:
-#endif // defined(GL_LINE_SMOOTH_HINT)
-#if defined(GL_LINE_WIDTH)
- case GL_LINE_WIDTH:
-#endif // defined(GL_LINE_WIDTH)
-#if defined(GL_LOGIC_OP_MODE)
- case GL_LOGIC_OP_MODE:
-#endif // defined(GL_LOGIC_OP_MODE)
-#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
- case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
- case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
- case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
- case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
-#if defined(GL_MATRIX_MODE)
- case GL_MATRIX_MODE:
-#endif // defined(GL_MATRIX_MODE)
-#if defined(GL_MAX_CLIP_PLANES)
- case GL_MAX_CLIP_PLANES:
-#endif // defined(GL_MAX_CLIP_PLANES)
-#if defined(GL_MAX_ELEMENTS_INDICES)
- case GL_MAX_ELEMENTS_INDICES:
-#endif // defined(GL_MAX_ELEMENTS_INDICES)
-#if defined(GL_MAX_ELEMENTS_VERTICES)
- case GL_MAX_ELEMENTS_VERTICES:
-#endif // defined(GL_MAX_ELEMENTS_VERTICES)
-#if defined(GL_MAX_LIGHTS)
- case GL_MAX_LIGHTS:
-#endif // defined(GL_MAX_LIGHTS)
-#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
- case GL_MAX_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
-#if defined(GL_MAX_PALETTE_MATRICES_OES)
- case GL_MAX_PALETTE_MATRICES_OES:
-#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
-#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
- case GL_MAX_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_SIZE)
- case GL_MAX_TEXTURE_SIZE:
-#endif // defined(GL_MAX_TEXTURE_SIZE)
-#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
- case GL_MAX_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_UNITS)
- case GL_MAX_TEXTURE_UNITS:
-#endif // defined(GL_MAX_TEXTURE_UNITS)
-#if defined(GL_MAX_VERTEX_UNITS_OES)
- case GL_MAX_VERTEX_UNITS_OES:
-#endif // defined(GL_MAX_VERTEX_UNITS_OES)
-#if defined(GL_MODELVIEW_STACK_DEPTH)
- case GL_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MODELVIEW_STACK_DEPTH)
-#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
- case GL_NORMAL_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
-#if defined(GL_NORMAL_ARRAY_STRIDE)
- case GL_NORMAL_ARRAY_STRIDE:
-#endif // defined(GL_NORMAL_ARRAY_STRIDE)
-#if defined(GL_NORMAL_ARRAY_TYPE)
- case GL_NORMAL_ARRAY_TYPE:
-#endif // defined(GL_NORMAL_ARRAY_TYPE)
-#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
-#if defined(GL_PACK_ALIGNMENT)
- case GL_PACK_ALIGNMENT:
-#endif // defined(GL_PACK_ALIGNMENT)
-#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
- case GL_PERSPECTIVE_CORRECTION_HINT:
-#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
-#if defined(GL_POINT_SIZE)
- case GL_POINT_SIZE:
-#endif // defined(GL_POINT_SIZE)
-#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
- case GL_POINT_SIZE_ARRAY_STRIDE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
-#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
- case GL_POINT_SIZE_ARRAY_TYPE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
-#if defined(GL_POINT_SMOOTH_HINT)
- case GL_POINT_SMOOTH_HINT:
-#endif // defined(GL_POINT_SMOOTH_HINT)
-#if defined(GL_POLYGON_OFFSET_FACTOR)
- case GL_POLYGON_OFFSET_FACTOR:
-#endif // defined(GL_POLYGON_OFFSET_FACTOR)
-#if defined(GL_POLYGON_OFFSET_UNITS)
- case GL_POLYGON_OFFSET_UNITS:
-#endif // defined(GL_POLYGON_OFFSET_UNITS)
-#if defined(GL_PROJECTION_STACK_DEPTH)
- case GL_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_PROJECTION_STACK_DEPTH)
-#if defined(GL_RED_BITS)
- case GL_RED_BITS:
-#endif // defined(GL_RED_BITS)
-#if defined(GL_SHADE_MODEL)
- case GL_SHADE_MODEL:
-#endif // defined(GL_SHADE_MODEL)
-#if defined(GL_STENCIL_BITS)
- case GL_STENCIL_BITS:
-#endif // defined(GL_STENCIL_BITS)
-#if defined(GL_STENCIL_CLEAR_VALUE)
- case GL_STENCIL_CLEAR_VALUE:
-#endif // defined(GL_STENCIL_CLEAR_VALUE)
-#if defined(GL_STENCIL_FAIL)
- case GL_STENCIL_FAIL:
-#endif // defined(GL_STENCIL_FAIL)
-#if defined(GL_STENCIL_FUNC)
- case GL_STENCIL_FUNC:
-#endif // defined(GL_STENCIL_FUNC)
-#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
- case GL_STENCIL_PASS_DEPTH_FAIL:
-#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
-#if defined(GL_STENCIL_PASS_DEPTH_PASS)
- case GL_STENCIL_PASS_DEPTH_PASS:
-#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
-#if defined(GL_STENCIL_REF)
- case GL_STENCIL_REF:
-#endif // defined(GL_STENCIL_REF)
-#if defined(GL_STENCIL_VALUE_MASK)
- case GL_STENCIL_VALUE_MASK:
-#endif // defined(GL_STENCIL_VALUE_MASK)
-#if defined(GL_STENCIL_WRITEMASK)
- case GL_STENCIL_WRITEMASK:
-#endif // defined(GL_STENCIL_WRITEMASK)
-#if defined(GL_SUBPIXEL_BITS)
- case GL_SUBPIXEL_BITS:
-#endif // defined(GL_SUBPIXEL_BITS)
-#if defined(GL_TEXTURE_BINDING_2D)
- case GL_TEXTURE_BINDING_2D:
-#endif // defined(GL_TEXTURE_BINDING_2D)
-#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
-#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
- case GL_TEXTURE_COORD_ARRAY_SIZE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
-#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
-#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
- case GL_TEXTURE_COORD_ARRAY_TYPE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
-#if defined(GL_TEXTURE_STACK_DEPTH)
- case GL_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_TEXTURE_STACK_DEPTH)
-#if defined(GL_UNPACK_ALIGNMENT)
- case GL_UNPACK_ALIGNMENT:
-#endif // defined(GL_UNPACK_ALIGNMENT)
-#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
- case GL_VERTEX_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
-#if defined(GL_VERTEX_ARRAY_SIZE)
- case GL_VERTEX_ARRAY_SIZE:
-#endif // defined(GL_VERTEX_ARRAY_SIZE)
-#if defined(GL_VERTEX_ARRAY_STRIDE)
- case GL_VERTEX_ARRAY_STRIDE:
-#endif // defined(GL_VERTEX_ARRAY_STRIDE)
-#if defined(GL_VERTEX_ARRAY_TYPE)
- case GL_VERTEX_ARRAY_TYPE:
-#endif // defined(GL_VERTEX_ARRAY_TYPE)
-#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
- case GL_WEIGHT_ARRAY_SIZE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
-#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
- case GL_WEIGHT_ARRAY_STRIDE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
-#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
- case GL_WEIGHT_ARRAY_TYPE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
- _needed = 1;
- break;
-#if defined(GL_ALIASED_POINT_SIZE_RANGE)
- case GL_ALIASED_POINT_SIZE_RANGE:
-#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
-#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
- case GL_ALIASED_LINE_WIDTH_RANGE:
-#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
-#if defined(GL_DEPTH_RANGE)
- case GL_DEPTH_RANGE:
-#endif // defined(GL_DEPTH_RANGE)
-#if defined(GL_MAX_VIEWPORT_DIMS)
- case GL_MAX_VIEWPORT_DIMS:
-#endif // defined(GL_MAX_VIEWPORT_DIMS)
-#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
- case GL_SMOOTH_LINE_WIDTH_RANGE:
-#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
-#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
- case GL_SMOOTH_POINT_SIZE_RANGE:
-#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
- _needed = 2;
- break;
-#if defined(GL_COLOR_CLEAR_VALUE)
- case GL_COLOR_CLEAR_VALUE:
-#endif // defined(GL_COLOR_CLEAR_VALUE)
-#if defined(GL_COLOR_WRITEMASK)
- case GL_COLOR_WRITEMASK:
-#endif // defined(GL_COLOR_WRITEMASK)
-#if defined(GL_FOG_COLOR)
- case GL_FOG_COLOR:
-#endif // defined(GL_FOG_COLOR)
-#if defined(GL_LIGHT_MODEL_AMBIENT)
- case GL_LIGHT_MODEL_AMBIENT:
-#endif // defined(GL_LIGHT_MODEL_AMBIENT)
-#if defined(GL_SCISSOR_BOX)
- case GL_SCISSOR_BOX:
-#endif // defined(GL_SCISSOR_BOX)
-#if defined(GL_VIEWPORT)
- case GL_VIEWPORT:
-#endif // defined(GL_VIEWPORT)
- _needed = 4;
- break;
-#if defined(GL_MODELVIEW_MATRIX)
- case GL_MODELVIEW_MATRIX:
-#endif // defined(GL_MODELVIEW_MATRIX)
-#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_PROJECTION_MATRIX)
- case GL_PROJECTION_MATRIX:
-#endif // defined(GL_PROJECTION_MATRIX)
-#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_TEXTURE_MATRIX)
- case GL_TEXTURE_MATRIX:
-#endif // defined(GL_TEXTURE_MATRIX)
-#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- _needed = 16;
- break;
-#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
- case GL_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
- _needed = getNumCompressedTextureFormats();
- break;
- default:
- _needed = 0;
- break;
- }
- if (_remaining < _needed) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "length - offset < needed";
- goto exit;
- }
- params_base = (GLint *)
- _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
- params = params_base + offset;
-
- glGetIntegerv(
- (GLenum)pname,
- (GLint *)params
- );
-
-exit:
- if (params_base) {
- _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ get<jintArray, GLint, glGetIntegerv>(_env, _this, pname, params_ref, offset);
}
/* void glGetIntegerv ( GLenum pname, GLint *params ) */
static void
android_glGetIntegerv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLint *params = (GLint *) 0;
-
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
- int _needed;
- switch (pname) {
-#if defined(GL_ALPHA_BITS)
- case GL_ALPHA_BITS:
-#endif // defined(GL_ALPHA_BITS)
-#if defined(GL_ALPHA_TEST_FUNC)
- case GL_ALPHA_TEST_FUNC:
-#endif // defined(GL_ALPHA_TEST_FUNC)
-#if defined(GL_ALPHA_TEST_REF)
- case GL_ALPHA_TEST_REF:
-#endif // defined(GL_ALPHA_TEST_REF)
-#if defined(GL_BLEND_DST)
- case GL_BLEND_DST:
-#endif // defined(GL_BLEND_DST)
-#if defined(GL_BLUE_BITS)
- case GL_BLUE_BITS:
-#endif // defined(GL_BLUE_BITS)
-#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
- case GL_COLOR_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
-#if defined(GL_COLOR_ARRAY_SIZE)
- case GL_COLOR_ARRAY_SIZE:
-#endif // defined(GL_COLOR_ARRAY_SIZE)
-#if defined(GL_COLOR_ARRAY_STRIDE)
- case GL_COLOR_ARRAY_STRIDE:
-#endif // defined(GL_COLOR_ARRAY_STRIDE)
-#if defined(GL_COLOR_ARRAY_TYPE)
- case GL_COLOR_ARRAY_TYPE:
-#endif // defined(GL_COLOR_ARRAY_TYPE)
-#if defined(GL_CULL_FACE)
- case GL_CULL_FACE:
-#endif // defined(GL_CULL_FACE)
-#if defined(GL_DEPTH_BITS)
- case GL_DEPTH_BITS:
-#endif // defined(GL_DEPTH_BITS)
-#if defined(GL_DEPTH_CLEAR_VALUE)
- case GL_DEPTH_CLEAR_VALUE:
-#endif // defined(GL_DEPTH_CLEAR_VALUE)
-#if defined(GL_DEPTH_FUNC)
- case GL_DEPTH_FUNC:
-#endif // defined(GL_DEPTH_FUNC)
-#if defined(GL_DEPTH_WRITEMASK)
- case GL_DEPTH_WRITEMASK:
-#endif // defined(GL_DEPTH_WRITEMASK)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FRONT_FACE)
- case GL_FRONT_FACE:
-#endif // defined(GL_FRONT_FACE)
-#if defined(GL_GREEN_BITS)
- case GL_GREEN_BITS:
-#endif // defined(GL_GREEN_BITS)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
-#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
- case GL_LIGHT_MODEL_COLOR_CONTROL:
-#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
-#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
-#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
-#if defined(GL_LINE_SMOOTH_HINT)
- case GL_LINE_SMOOTH_HINT:
-#endif // defined(GL_LINE_SMOOTH_HINT)
-#if defined(GL_LINE_WIDTH)
- case GL_LINE_WIDTH:
-#endif // defined(GL_LINE_WIDTH)
-#if defined(GL_LOGIC_OP_MODE)
- case GL_LOGIC_OP_MODE:
-#endif // defined(GL_LOGIC_OP_MODE)
-#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
- case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
- case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
- case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
- case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
-#if defined(GL_MATRIX_MODE)
- case GL_MATRIX_MODE:
-#endif // defined(GL_MATRIX_MODE)
-#if defined(GL_MAX_CLIP_PLANES)
- case GL_MAX_CLIP_PLANES:
-#endif // defined(GL_MAX_CLIP_PLANES)
-#if defined(GL_MAX_ELEMENTS_INDICES)
- case GL_MAX_ELEMENTS_INDICES:
-#endif // defined(GL_MAX_ELEMENTS_INDICES)
-#if defined(GL_MAX_ELEMENTS_VERTICES)
- case GL_MAX_ELEMENTS_VERTICES:
-#endif // defined(GL_MAX_ELEMENTS_VERTICES)
-#if defined(GL_MAX_LIGHTS)
- case GL_MAX_LIGHTS:
-#endif // defined(GL_MAX_LIGHTS)
-#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
- case GL_MAX_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
-#if defined(GL_MAX_PALETTE_MATRICES_OES)
- case GL_MAX_PALETTE_MATRICES_OES:
-#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
-#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
- case GL_MAX_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_SIZE)
- case GL_MAX_TEXTURE_SIZE:
-#endif // defined(GL_MAX_TEXTURE_SIZE)
-#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
- case GL_MAX_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_UNITS)
- case GL_MAX_TEXTURE_UNITS:
-#endif // defined(GL_MAX_TEXTURE_UNITS)
-#if defined(GL_MAX_VERTEX_UNITS_OES)
- case GL_MAX_VERTEX_UNITS_OES:
-#endif // defined(GL_MAX_VERTEX_UNITS_OES)
-#if defined(GL_MODELVIEW_STACK_DEPTH)
- case GL_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MODELVIEW_STACK_DEPTH)
-#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
- case GL_NORMAL_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
-#if defined(GL_NORMAL_ARRAY_STRIDE)
- case GL_NORMAL_ARRAY_STRIDE:
-#endif // defined(GL_NORMAL_ARRAY_STRIDE)
-#if defined(GL_NORMAL_ARRAY_TYPE)
- case GL_NORMAL_ARRAY_TYPE:
-#endif // defined(GL_NORMAL_ARRAY_TYPE)
-#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
-#if defined(GL_PACK_ALIGNMENT)
- case GL_PACK_ALIGNMENT:
-#endif // defined(GL_PACK_ALIGNMENT)
-#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
- case GL_PERSPECTIVE_CORRECTION_HINT:
-#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
-#if defined(GL_POINT_SIZE)
- case GL_POINT_SIZE:
-#endif // defined(GL_POINT_SIZE)
-#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
- case GL_POINT_SIZE_ARRAY_STRIDE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
-#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
- case GL_POINT_SIZE_ARRAY_TYPE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
-#if defined(GL_POINT_SMOOTH_HINT)
- case GL_POINT_SMOOTH_HINT:
-#endif // defined(GL_POINT_SMOOTH_HINT)
-#if defined(GL_POLYGON_OFFSET_FACTOR)
- case GL_POLYGON_OFFSET_FACTOR:
-#endif // defined(GL_POLYGON_OFFSET_FACTOR)
-#if defined(GL_POLYGON_OFFSET_UNITS)
- case GL_POLYGON_OFFSET_UNITS:
-#endif // defined(GL_POLYGON_OFFSET_UNITS)
-#if defined(GL_PROJECTION_STACK_DEPTH)
- case GL_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_PROJECTION_STACK_DEPTH)
-#if defined(GL_RED_BITS)
- case GL_RED_BITS:
-#endif // defined(GL_RED_BITS)
-#if defined(GL_SHADE_MODEL)
- case GL_SHADE_MODEL:
-#endif // defined(GL_SHADE_MODEL)
-#if defined(GL_STENCIL_BITS)
- case GL_STENCIL_BITS:
-#endif // defined(GL_STENCIL_BITS)
-#if defined(GL_STENCIL_CLEAR_VALUE)
- case GL_STENCIL_CLEAR_VALUE:
-#endif // defined(GL_STENCIL_CLEAR_VALUE)
-#if defined(GL_STENCIL_FAIL)
- case GL_STENCIL_FAIL:
-#endif // defined(GL_STENCIL_FAIL)
-#if defined(GL_STENCIL_FUNC)
- case GL_STENCIL_FUNC:
-#endif // defined(GL_STENCIL_FUNC)
-#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
- case GL_STENCIL_PASS_DEPTH_FAIL:
-#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
-#if defined(GL_STENCIL_PASS_DEPTH_PASS)
- case GL_STENCIL_PASS_DEPTH_PASS:
-#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
-#if defined(GL_STENCIL_REF)
- case GL_STENCIL_REF:
-#endif // defined(GL_STENCIL_REF)
-#if defined(GL_STENCIL_VALUE_MASK)
- case GL_STENCIL_VALUE_MASK:
-#endif // defined(GL_STENCIL_VALUE_MASK)
-#if defined(GL_STENCIL_WRITEMASK)
- case GL_STENCIL_WRITEMASK:
-#endif // defined(GL_STENCIL_WRITEMASK)
-#if defined(GL_SUBPIXEL_BITS)
- case GL_SUBPIXEL_BITS:
-#endif // defined(GL_SUBPIXEL_BITS)
-#if defined(GL_TEXTURE_BINDING_2D)
- case GL_TEXTURE_BINDING_2D:
-#endif // defined(GL_TEXTURE_BINDING_2D)
-#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
-#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
- case GL_TEXTURE_COORD_ARRAY_SIZE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
-#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
-#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
- case GL_TEXTURE_COORD_ARRAY_TYPE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
-#if defined(GL_TEXTURE_STACK_DEPTH)
- case GL_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_TEXTURE_STACK_DEPTH)
-#if defined(GL_UNPACK_ALIGNMENT)
- case GL_UNPACK_ALIGNMENT:
-#endif // defined(GL_UNPACK_ALIGNMENT)
-#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
- case GL_VERTEX_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
-#if defined(GL_VERTEX_ARRAY_SIZE)
- case GL_VERTEX_ARRAY_SIZE:
-#endif // defined(GL_VERTEX_ARRAY_SIZE)
-#if defined(GL_VERTEX_ARRAY_STRIDE)
- case GL_VERTEX_ARRAY_STRIDE:
-#endif // defined(GL_VERTEX_ARRAY_STRIDE)
-#if defined(GL_VERTEX_ARRAY_TYPE)
- case GL_VERTEX_ARRAY_TYPE:
-#endif // defined(GL_VERTEX_ARRAY_TYPE)
-#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
- case GL_WEIGHT_ARRAY_SIZE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
-#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
- case GL_WEIGHT_ARRAY_STRIDE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
-#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
- case GL_WEIGHT_ARRAY_TYPE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
- _needed = 1;
- break;
-#if defined(GL_ALIASED_POINT_SIZE_RANGE)
- case GL_ALIASED_POINT_SIZE_RANGE:
-#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
-#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
- case GL_ALIASED_LINE_WIDTH_RANGE:
-#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
-#if defined(GL_DEPTH_RANGE)
- case GL_DEPTH_RANGE:
-#endif // defined(GL_DEPTH_RANGE)
-#if defined(GL_MAX_VIEWPORT_DIMS)
- case GL_MAX_VIEWPORT_DIMS:
-#endif // defined(GL_MAX_VIEWPORT_DIMS)
-#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
- case GL_SMOOTH_LINE_WIDTH_RANGE:
-#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
-#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
- case GL_SMOOTH_POINT_SIZE_RANGE:
-#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
- _needed = 2;
- break;
-#if defined(GL_COLOR_CLEAR_VALUE)
- case GL_COLOR_CLEAR_VALUE:
-#endif // defined(GL_COLOR_CLEAR_VALUE)
-#if defined(GL_COLOR_WRITEMASK)
- case GL_COLOR_WRITEMASK:
-#endif // defined(GL_COLOR_WRITEMASK)
-#if defined(GL_FOG_COLOR)
- case GL_FOG_COLOR:
-#endif // defined(GL_FOG_COLOR)
-#if defined(GL_LIGHT_MODEL_AMBIENT)
- case GL_LIGHT_MODEL_AMBIENT:
-#endif // defined(GL_LIGHT_MODEL_AMBIENT)
-#if defined(GL_SCISSOR_BOX)
- case GL_SCISSOR_BOX:
-#endif // defined(GL_SCISSOR_BOX)
-#if defined(GL_VIEWPORT)
- case GL_VIEWPORT:
-#endif // defined(GL_VIEWPORT)
- _needed = 4;
- break;
-#if defined(GL_MODELVIEW_MATRIX)
- case GL_MODELVIEW_MATRIX:
-#endif // defined(GL_MODELVIEW_MATRIX)
-#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_PROJECTION_MATRIX)
- case GL_PROJECTION_MATRIX:
-#endif // defined(GL_PROJECTION_MATRIX)
-#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_TEXTURE_MATRIX)
- case GL_TEXTURE_MATRIX:
-#endif // defined(GL_TEXTURE_MATRIX)
-#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- _needed = 16;
- break;
-#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
- case GL_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
- _needed = getNumCompressedTextureFormats();
- break;
- default:
- _needed = 0;
- break;
- }
- if (_remaining < _needed) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "remaining() < needed";
- goto exit;
- }
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- params = (GLint *) (_paramsBase + _bufferOffset);
- }
- glGetIntegerv(
- (GLenum)pname,
- (GLint *)params
- );
-
-exit:
- if (_array) {
- releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ getarray<GLint, glGetIntegerv>(_env, _this, pname, params_buf);
}
/* const GLubyte * glGetString ( GLenum name ) */
@@ -1834,8 +1231,8 @@
android_glLightModelfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -1855,18 +1252,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
- _needed = 1;
- break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1899,8 +1291,8 @@
android_glLightModelfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1909,18 +1301,13 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
- _needed = 1;
- break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1962,8 +1349,8 @@
android_glLightModelxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1983,18 +1370,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
- _needed = 1;
- break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2027,8 +1409,8 @@
android_glLightModelxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2037,18 +1419,13 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
- _needed = 1;
- break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2091,8 +1468,8 @@
android_glLightfv__II_3FI
(JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2112,23 +1489,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -2149,7 +1509,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2183,8 +1543,8 @@
android_glLightfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2193,23 +1553,6 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -2230,7 +1573,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2274,8 +1617,8 @@
android_glLightxv__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2295,23 +1638,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -2332,7 +1658,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2366,8 +1692,8 @@
android_glLightxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2376,23 +1702,6 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -2413,7 +1722,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2471,8 +1780,8 @@
android_glLoadMatrixf___3FI
(JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *m_base = (GLfloat *) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
@@ -2535,8 +1844,8 @@
android_glLoadMatrixx___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
@@ -2619,8 +1928,8 @@
android_glMaterialfv__II_3FI
(JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2640,11 +1949,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -2663,7 +1967,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2697,8 +2001,8 @@
android_glMaterialfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2707,11 +2011,6 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -2730,7 +2029,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2774,8 +2073,8 @@
android_glMaterialxv__II_3II
(JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2795,11 +2094,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -2818,7 +2112,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2852,8 +2146,8 @@
android_glMaterialxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2862,11 +2156,6 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -2885,7 +2174,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2927,8 +2216,8 @@
android_glMultMatrixf___3FI
(JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *m_base = (GLfloat *) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
@@ -2991,8 +2280,8 @@
android_glMultMatrixx___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
@@ -3397,8 +2686,8 @@
android_glTexEnvfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -3418,24 +2707,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3469,8 +2747,8 @@
android_glTexEnvfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3479,24 +2757,13 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3540,8 +2807,8 @@
android_glTexEnvxv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -3561,24 +2828,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3612,8 +2868,8 @@
android_glTexEnvxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3622,24 +2878,13 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
diff --git a/core/jni/android_opengl_GLES10Ext.cpp b/core/jni/android_opengl_GLES10Ext.cpp
index 1cd8e44..59e63e1 100644
--- a/core/jni/android_opengl_GLES10Ext.cpp
+++ b/core/jni/android_opengl_GLES10Ext.cpp
@@ -17,14 +17,14 @@
// This source file is automatically generated
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
-
#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
static int initialized = 0;
@@ -37,6 +37,34 @@
static jfieldID limitID;
static jfieldID elementSizeShiftID;
+
+/* special calls implemented in Android's GLES wrapper used to more
+ * efficiently bound-check passed arrays */
+extern "C" {
+#ifdef GL_VERSION_ES_CM_1_1
+GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr, GLsizei count);
+GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
+ const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+#endif
+#ifdef GL_ES_VERSION_2_0
+static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
+ glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
+}
+#endif
+}
+
/* Cache method IDs each time the class is loaded. */
static void
@@ -61,7 +89,6 @@
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
-
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
@@ -89,12 +116,204 @@
return NULL;
}
-
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
+ commit ? 0 : JNI_ABORT);
+}
+
+static void *
+getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
+ char* buf = (char*) _env->GetDirectBufferAddress(buffer);
+ if (buf) {
+ jint position = _env->GetIntField(buffer, positionID);
+ jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
+ buf += position << elementSizeShift;
+ } else {
+ jniThrowException(_env, "java/lang/IllegalArgumentException",
+ "Must use a native order direct Buffer");
+ }
+ return (void*) buf;
+}
+
+// --------------------------------------------------------------------------
+
+/*
+ * returns the number of values glGet returns for a given pname.
+ *
+ * The code below is written such that pnames requiring only one values
+ * are the default (and are not explicitely tested for). This makes the
+ * checking code much shorter/readable/efficient.
+ *
+ * This means that unknown pnames (e.g.: extensions) will default to 1. If
+ * that unknown pname needs more than 1 value, then the validation check
+ * is incomplete and the app may crash if it passed the wrong number params.
+ */
+static int getNeededCount(GLint pname) {
+ int needed = 1;
+#ifdef GL_ES_VERSION_2_0
+ // GLES 2.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_BLEND_COLOR:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+
+ case GL_SHADER_BINARY_FORMATS:
+ glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
+ break;
+ }
+#endif
+
+#ifdef GL_VERSION_ES_CM_1_1
+ // GLES 1.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_CURRENT_NORMAL:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ needed = 3;
+ break;
+
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_CURRENT_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_FOG_COLOR:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ needed = 16;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+ }
+#endif
+ return needed;
+}
+
+template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+get
+ (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ CTYPE *params_base = (CTYPE *) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ if (!params_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "params == null";
+ goto exit;
+ }
+ if (offset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "offset < 0";
+ goto exit;
+ }
+ _remaining = _env->GetArrayLength(params_ref) - offset;
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
+ params_base = (CTYPE *)
+ _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
+ params = params_base + offset;
+
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (params_base) {
+ _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
+
+template <typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+getarray
+ (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_needed>0 && _remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (CTYPE *) (_paramsBase + _bufferOffset);
+ }
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (_array) {
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
// --------------------------------------------------------------------------
@@ -103,8 +322,8 @@
android_glQueryMatrixxOES___3II_3II
(JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLbitfield _returnValue = -1;
GLfixed *mantissa_base = (GLfixed *) 0;
jint _mantissaRemaining;
@@ -184,8 +403,8 @@
android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _mantissaArray = (jarray) 0;
jint _mantissaBufferOffset = (jint) 0;
jarray _exponentArray = (jarray) 0;
diff --git a/core/jni/android_opengl_GLES11.cpp b/core/jni/android_opengl_GLES11.cpp
index 1e6ceb3..352f5bf 100644
--- a/core/jni/android_opengl_GLES11.cpp
+++ b/core/jni/android_opengl_GLES11.cpp
@@ -17,21 +17,14 @@
// This source file is automatically generated
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
-
#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-}
static int initialized = 0;
@@ -44,6 +37,34 @@
static jfieldID limitID;
static jfieldID elementSizeShiftID;
+
+/* special calls implemented in Android's GLES wrapper used to more
+ * efficiently bound-check passed arrays */
+extern "C" {
+#ifdef GL_VERSION_ES_CM_1_1
+GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr, GLsizei count);
+GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
+ const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+#endif
+#ifdef GL_ES_VERSION_2_0
+static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
+ glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
+}
+#endif
+}
+
/* Cache method IDs each time the class is loaded. */
static void
@@ -68,7 +89,6 @@
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
-
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
@@ -96,12 +116,11 @@
return NULL;
}
-
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
+ commit ? 0 : JNI_ABORT);
}
static void *
@@ -119,6 +138,185 @@
}
// --------------------------------------------------------------------------
+
+/*
+ * returns the number of values glGet returns for a given pname.
+ *
+ * The code below is written such that pnames requiring only one values
+ * are the default (and are not explicitely tested for). This makes the
+ * checking code much shorter/readable/efficient.
+ *
+ * This means that unknown pnames (e.g.: extensions) will default to 1. If
+ * that unknown pname needs more than 1 value, then the validation check
+ * is incomplete and the app may crash if it passed the wrong number params.
+ */
+static int getNeededCount(GLint pname) {
+ int needed = 1;
+#ifdef GL_ES_VERSION_2_0
+ // GLES 2.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_BLEND_COLOR:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+
+ case GL_SHADER_BINARY_FORMATS:
+ glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
+ break;
+ }
+#endif
+
+#ifdef GL_VERSION_ES_CM_1_1
+ // GLES 1.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_CURRENT_NORMAL:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ needed = 3;
+ break;
+
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_CURRENT_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_FOG_COLOR:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ needed = 16;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+ }
+#endif
+ return needed;
+}
+
+template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+get
+ (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ CTYPE *params_base = (CTYPE *) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ if (!params_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "params == null";
+ goto exit;
+ }
+ if (offset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "offset < 0";
+ goto exit;
+ }
+ _remaining = _env->GetArrayLength(params_ref) - offset;
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
+ params_base = (CTYPE *)
+ _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
+ params = params_base + offset;
+
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (params_base) {
+ _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
+
+template <typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+getarray
+ (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_needed>0 && _remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (CTYPE *) (_paramsBase + _bufferOffset);
+ }
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (_array) {
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
+// --------------------------------------------------------------------------
/* void glBindBuffer ( GLenum target, GLuint buffer ) */
static void
android_glBindBuffer__II
@@ -134,8 +332,8 @@
android_glBufferData__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -175,8 +373,8 @@
android_glBufferSubData__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -214,8 +412,8 @@
android_glClipPlanef__I_3FI
(JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *equation_base = (GLfloat *) 0;
jint _remaining;
GLfloat *equation = (GLfloat *) 0;
@@ -257,8 +455,8 @@
android_glClipPlanef__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -286,8 +484,8 @@
android_glClipPlanex__I_3II
(JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *equation_base = (GLfixed *) 0;
jint _remaining;
GLfixed *equation = (GLfixed *) 0;
@@ -329,8 +527,8 @@
android_glClipPlanex__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -382,8 +580,8 @@
android_glDeleteBuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *buffers_base = (GLuint *) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
@@ -431,8 +629,8 @@
android_glDeleteBuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -468,8 +666,8 @@
android_glDrawElements__IIII
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
glDrawElements(
(GLenum)mode,
(GLsizei)count,
@@ -486,8 +684,8 @@
android_glGenBuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *buffers_base = (GLuint *) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
@@ -535,8 +733,8 @@
android_glGenBuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -571,75 +769,22 @@
static void
android_glGetBooleanv__I_3ZI
(JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- GLboolean *params_base = (GLboolean *) 0;
- jint _remaining;
- GLboolean *params = (GLboolean *) 0;
-
- if (!params_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "params == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(params_ref) - offset;
- params_base = (GLboolean *)
- _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
- params = params_base + offset;
-
- glGetBooleanv(
- (GLenum)pname,
- (GLboolean *)params
- );
-
-exit:
- if (params_base) {
- _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ get<jbooleanArray, GLboolean, glGetBooleanv>(_env, _this, pname, params_ref, offset);
}
/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
static void
android_glGetBooleanv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLboolean *params = (GLboolean *) 0;
-
- params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- params = (GLboolean *) (_paramsBase + _bufferOffset);
- }
- glGetBooleanv(
- (GLenum)pname,
- (GLboolean *)params
- );
- if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
- }
+ getarray<GLboolean, glGetBooleanv>(_env, _this, pname, params_buf);
}
-
/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
static void
android_glGetBufferParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -688,8 +833,8 @@
android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -726,8 +871,8 @@
android_glGetClipPlanef__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *eqn_base = (GLfloat *) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
@@ -745,6 +890,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(eqn_ref) - offset;
+ if (_remaining < 4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 4 < needed";
+ goto exit;
+ }
eqn_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0);
eqn = eqn_base + offset;
@@ -768,12 +919,21 @@
static void
android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 4 < needed";
+ goto exit;
+ }
if (eqn == NULL) {
char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
eqn = (GLfloat *) (_eqnBase + _bufferOffset);
@@ -782,8 +942,13 @@
(GLenum)pname,
(GLfloat *)eqn
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, eqn, JNI_TRUE);
+ releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -792,8 +957,8 @@
android_glGetClipPlanex__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *eqn_base = (GLfixed *) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
@@ -811,6 +976,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(eqn_ref) - offset;
+ if (_remaining < 4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 4 < needed";
+ goto exit;
+ }
eqn_base = (GLfixed *)
_env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0);
eqn = eqn_base + offset;
@@ -834,12 +1005,21 @@
static void
android_glGetClipPlanex__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 4 < needed";
+ goto exit;
+ }
if (eqn == NULL) {
char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
eqn = (GLfixed *) (_eqnBase + _bufferOffset);
@@ -848,8 +1028,13 @@
(GLenum)pname,
(GLfixed *)eqn
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, eqn, JNI_TRUE);
+ releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -858,8 +1043,8 @@
android_glGetFixedv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -923,75 +1108,22 @@
static void
android_glGetFloatv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- GLfloat *params_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *params = (GLfloat *) 0;
-
- if (!params_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "params == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(params_ref) - offset;
- params_base = (GLfloat *)
- _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
- params = params_base + offset;
-
- glGetFloatv(
- (GLenum)pname,
- (GLfloat *)params
- );
-
-exit:
- if (params_base) {
- _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ get<jfloatArray, GLfloat, glGetFloatv>(_env, _this, pname, params_ref, offset);
}
/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
static void
android_glGetFloatv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *params = (GLfloat *) 0;
-
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- params = (GLfloat *) (_paramsBase + _bufferOffset);
- }
- glGetFloatv(
- (GLenum)pname,
- (GLfloat *)params
- );
- if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
- }
+ getarray<GLfloat, glGetFloatv>(_env, _this, pname, params_buf);
}
-
/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
static void
android_glGetLightfv__II_3FI
(JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -1011,23 +1143,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -1048,7 +1163,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1082,8 +1197,8 @@
android_glGetLightfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1092,23 +1207,6 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -1129,7 +1227,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1162,8 +1260,8 @@
android_glGetLightxv__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1183,23 +1281,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -1220,7 +1301,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1254,8 +1335,8 @@
android_glGetLightxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1264,23 +1345,6 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SPOT_EXPONENT)
- case GL_SPOT_EXPONENT:
-#endif // defined(GL_SPOT_EXPONENT)
-#if defined(GL_SPOT_CUTOFF)
- case GL_SPOT_CUTOFF:
-#endif // defined(GL_SPOT_CUTOFF)
-#if defined(GL_CONSTANT_ATTENUATION)
- case GL_CONSTANT_ATTENUATION:
-#endif // defined(GL_CONSTANT_ATTENUATION)
-#if defined(GL_LINEAR_ATTENUATION)
- case GL_LINEAR_ATTENUATION:
-#endif // defined(GL_LINEAR_ATTENUATION)
-#if defined(GL_QUADRATIC_ATTENUATION)
- case GL_QUADRATIC_ATTENUATION:
-#endif // defined(GL_QUADRATIC_ATTENUATION)
- _needed = 1;
- break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
@@ -1301,7 +1365,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1334,8 +1398,8 @@
android_glGetMaterialfv__II_3FI
(JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -1355,11 +1419,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -1378,7 +1437,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1412,8 +1471,8 @@
android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1422,11 +1481,6 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -1445,7 +1499,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1478,8 +1532,8 @@
android_glGetMaterialxv__II_3II
(JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1499,11 +1553,6 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -1522,7 +1571,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1556,8 +1605,8 @@
android_glGetMaterialxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1566,11 +1615,6 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_SHININESS)
- case GL_SHININESS:
-#endif // defined(GL_SHININESS)
- _needed = 1;
- break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
@@ -1589,7 +1633,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1622,8 +1666,8 @@
android_glGetTexEnvfv__II_3FI
(JNIEnv *_env, jobject _this, jint env, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -1643,24 +1687,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1694,8 +1727,8 @@
android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1704,24 +1737,13 @@
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1754,8 +1776,8 @@
android_glGetTexEnviv__II_3II
(JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -1775,24 +1797,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1826,8 +1837,8 @@
android_glGetTexEnviv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1836,24 +1847,13 @@
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1886,8 +1886,8 @@
android_glGetTexEnvxv__II_3II
(JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1907,24 +1907,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1958,8 +1947,8 @@
android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1968,24 +1957,13 @@
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2018,8 +1996,8 @@
android_glGetTexParameterfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2068,8 +2046,8 @@
android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2106,8 +2084,8 @@
android_glGetTexParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2156,8 +2134,8 @@
android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2194,8 +2172,8 @@
android_glGetTexParameterxv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2244,8 +2222,8 @@
android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2336,8 +2314,8 @@
android_glPointParameterfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2385,8 +2363,8 @@
android_glPointParameterfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2432,8 +2410,8 @@
android_glPointParameterxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2481,8 +2459,8 @@
android_glPointParameterxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2564,8 +2542,8 @@
android_glTexEnviv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2585,24 +2563,13 @@
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2636,8 +2603,8 @@
android_glTexEnviv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2646,24 +2613,13 @@
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
-#if defined(GL_TEXTURE_ENV_MODE)
- case GL_TEXTURE_ENV_MODE:
-#endif // defined(GL_TEXTURE_ENV_MODE)
-#if defined(GL_COMBINE_RGB)
- case GL_COMBINE_RGB:
-#endif // defined(GL_COMBINE_RGB)
-#if defined(GL_COMBINE_ALPHA)
- case GL_COMBINE_ALPHA:
-#endif // defined(GL_COMBINE_ALPHA)
- _needed = 1;
- break;
#if defined(GL_TEXTURE_ENV_COLOR)
case GL_TEXTURE_ENV_COLOR:
#endif // defined(GL_TEXTURE_ENV_COLOR)
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2696,8 +2652,8 @@
android_glTexParameterfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2746,8 +2702,8 @@
android_glTexParameterfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2795,8 +2751,8 @@
android_glTexParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2845,8 +2801,8 @@
android_glTexParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2883,8 +2839,8 @@
android_glTexParameterxv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2933,8 +2889,8 @@
android_glTexParameterxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
diff --git a/core/jni/android_opengl_GLES11Ext.cpp b/core/jni/android_opengl_GLES11Ext.cpp
index 073bbb2..c91baa25 100644
--- a/core/jni/android_opengl_GLES11Ext.cpp
+++ b/core/jni/android_opengl_GLES11Ext.cpp
@@ -17,23 +17,14 @@
// This source file is automatically generated
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
-
#include <assert.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-
-/* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
-extern "C" {
-GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr, GLsizei count);
-}
static int initialized = 0;
@@ -46,6 +37,34 @@
static jfieldID limitID;
static jfieldID elementSizeShiftID;
+
+/* special calls implemented in Android's GLES wrapper used to more
+ * efficiently bound-check passed arrays */
+extern "C" {
+#ifdef GL_VERSION_ES_CM_1_1
+GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr, GLsizei count);
+GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
+ const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+#endif
+#ifdef GL_ES_VERSION_2_0
+static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
+ glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
+}
+#endif
+}
+
/* Cache method IDs each time the class is loaded. */
static void
@@ -70,7 +89,6 @@
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
-
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
@@ -94,15 +112,15 @@
getBaseArrayID, buffer);
*offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
+
return NULL;
}
-
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
+ commit ? 0 : JNI_ABORT);
}
static void *
@@ -118,6 +136,186 @@
}
return (void*) buf;
}
+
+// --------------------------------------------------------------------------
+
+/*
+ * returns the number of values glGet returns for a given pname.
+ *
+ * The code below is written such that pnames requiring only one values
+ * are the default (and are not explicitely tested for). This makes the
+ * checking code much shorter/readable/efficient.
+ *
+ * This means that unknown pnames (e.g.: extensions) will default to 1. If
+ * that unknown pname needs more than 1 value, then the validation check
+ * is incomplete and the app may crash if it passed the wrong number params.
+ */
+static int getNeededCount(GLint pname) {
+ int needed = 1;
+#ifdef GL_ES_VERSION_2_0
+ // GLES 2.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_BLEND_COLOR:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+
+ case GL_SHADER_BINARY_FORMATS:
+ glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
+ break;
+ }
+#endif
+
+#ifdef GL_VERSION_ES_CM_1_1
+ // GLES 1.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_CURRENT_NORMAL:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ needed = 3;
+ break;
+
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_CURRENT_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_FOG_COLOR:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ needed = 16;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+ }
+#endif
+ return needed;
+}
+
+template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+get
+ (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ CTYPE *params_base = (CTYPE *) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ if (!params_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "params == null";
+ goto exit;
+ }
+ if (offset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "offset < 0";
+ goto exit;
+ }
+ _remaining = _env->GetArrayLength(params_ref) - offset;
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
+ params_base = (CTYPE *)
+ _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
+ params = params_base + offset;
+
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (params_base) {
+ _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
+
+template <typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+getarray
+ (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_needed>0 && _remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (CTYPE *) (_paramsBase + _bufferOffset);
+ }
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (_array) {
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
// --------------------------------------------------------------------------
/* void glBlendEquationSeparateOES ( GLenum modeRGB, GLenum modeAlpha ) */
static void
@@ -194,8 +392,8 @@
android_glDrawTexsvOES___3SI
(JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLshort *coords_base = (GLshort *) 0;
jint _remaining;
GLshort *coords = (GLshort *) 0;
@@ -242,8 +440,8 @@
android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -278,8 +476,8 @@
android_glDrawTexivOES___3II
(JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *coords_base = (GLint *) 0;
jint _remaining;
GLint *coords = (GLint *) 0;
@@ -326,8 +524,8 @@
android_glDrawTexivOES__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -362,8 +560,8 @@
android_glDrawTexxvOES___3II
(JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *coords_base = (GLfixed *) 0;
jint _remaining;
GLfixed *coords = (GLfixed *) 0;
@@ -410,8 +608,8 @@
android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -459,8 +657,8 @@
android_glDrawTexfvOES___3FI
(JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *coords_base = (GLfloat *) 0;
jint _remaining;
GLfloat *coords = (GLfloat *) 0;
@@ -507,8 +705,8 @@
android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -620,8 +818,8 @@
android_glClipPlanexOES__I_3II
(JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *equation_base = (GLfixed *) 0;
jint _remaining;
GLfixed *equation = (GLfixed *) 0;
@@ -718,8 +916,8 @@
android_glFogxvOES__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -798,8 +996,8 @@
android_glGetClipPlanexOES__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *eqn_base = (GLfixed *) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
@@ -847,8 +1045,8 @@
android_glGetClipPlanexOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -884,8 +1082,8 @@
android_glGetFixedvOES__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -950,8 +1148,8 @@
android_glGetLightxvOES__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1018,8 +1216,8 @@
android_glGetMaterialxvOES__II_3II
(JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1086,8 +1284,8 @@
android_glGetTexEnvxvOES__II_3II
(JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1154,8 +1352,8 @@
android_glGetTexParameterxvOES__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1232,8 +1430,8 @@
android_glLightModelxvOES__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1309,8 +1507,8 @@
android_glLightxvOES__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1386,8 +1584,8 @@
android_glLoadMatrixxOES___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
@@ -1461,8 +1659,8 @@
android_glMaterialxvOES__II_3II
(JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1529,8 +1727,8 @@
android_glMultMatrixxOES___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
@@ -1641,8 +1839,8 @@
android_glPointParameterxvOES__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1770,8 +1968,8 @@
android_glTexEnvxvOES__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1849,8 +2047,8 @@
android_glTexParameterxvOES__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -1949,8 +2147,8 @@
android_glDeleteRenderbuffersOES__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *renderbuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
@@ -1998,8 +2196,8 @@
android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2035,8 +2233,8 @@
android_glGenRenderbuffersOES__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *renderbuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
@@ -2084,8 +2282,8 @@
android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2133,8 +2331,8 @@
android_glGetRenderbufferParameterivOES__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2183,8 +2381,8 @@
android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2242,8 +2440,8 @@
android_glDeleteFramebuffersOES__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *framebuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
@@ -2291,8 +2489,8 @@
android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2328,8 +2526,8 @@
android_glGenFramebuffersOES__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *framebuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
@@ -2377,8 +2575,8 @@
android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2450,8 +2648,8 @@
android_glGetFramebufferAttachmentParameterivOES__III_3II
(JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2501,8 +2699,8 @@
android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2651,8 +2849,8 @@
android_glClipPlanefOES__I_3FI
(JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *equation_base = (GLfloat *) 0;
jint _remaining;
GLfloat *equation = (GLfloat *) 0;
@@ -2717,8 +2915,8 @@
android_glGetClipPlanefOES__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *eqn_base = (GLfloat *) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
@@ -2766,8 +2964,8 @@
android_glGetClipPlanefOES__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2823,8 +3021,8 @@
android_glTexGenfvOES__II_3FI
(JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2902,8 +3100,8 @@
android_glTexGenivOES__II_3II
(JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2981,8 +3179,8 @@
android_glTexGenxvOES__II_3II
(JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -3049,8 +3247,8 @@
android_glGetTexGenfvOES__II_3FI
(JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -3117,8 +3315,8 @@
android_glGetTexGenivOES__II_3II
(JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -3185,8 +3383,8 @@
android_glGetTexGenxvOES__II_3II
(JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
diff --git a/core/jni/android_opengl_GLES20.cpp b/core/jni/android_opengl_GLES20.cpp
index a263f8b..4179785 100644
--- a/core/jni/android_opengl_GLES20.cpp
+++ b/core/jni/android_opengl_GLES20.cpp
@@ -17,14 +17,14 @@
// This source file is automatically generated
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
-
#include <assert.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
static int initialized = 0;
@@ -37,6 +37,34 @@
static jfieldID limitID;
static jfieldID elementSizeShiftID;
+
+/* special calls implemented in Android's GLES wrapper used to more
+ * efficiently bound-check passed arrays */
+extern "C" {
+#ifdef GL_VERSION_ES_CM_1_1
+GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr, GLsizei count);
+GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
+ const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer, GLsizei count);
+#endif
+#ifdef GL_ES_VERSION_2_0
+static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
+ glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
+}
+#endif
+}
+
/* Cache method IDs each time the class is loaded. */
static void
@@ -61,7 +89,6 @@
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
-
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
@@ -89,12 +116,11 @@
return NULL;
}
-
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
+ commit ? 0 : JNI_ABORT);
}
static void *
@@ -111,16 +137,183 @@
return (void*) buf;
}
-static int
-getNumCompressedTextureFormats() {
- int numCompressedTextureFormats = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
- return numCompressedTextureFormats;
+// --------------------------------------------------------------------------
+
+/*
+ * returns the number of values glGet returns for a given pname.
+ *
+ * The code below is written such that pnames requiring only one values
+ * are the default (and are not explicitely tested for). This makes the
+ * checking code much shorter/readable/efficient.
+ *
+ * This means that unknown pnames (e.g.: extensions) will default to 1. If
+ * that unknown pname needs more than 1 value, then the validation check
+ * is incomplete and the app may crash if it passed the wrong number params.
+ */
+static int getNeededCount(GLint pname) {
+ int needed = 1;
+#ifdef GL_ES_VERSION_2_0
+ // GLES 2.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_BLEND_COLOR:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+
+ case GL_SHADER_BINARY_FORMATS:
+ glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
+ break;
+ }
+#endif
+
+#ifdef GL_VERSION_ES_CM_1_1
+ // GLES 1.x pnames
+ switch (pname) {
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ needed = 2;
+ break;
+
+ case GL_CURRENT_NORMAL:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ needed = 3;
+ break;
+
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_CURRENT_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_FOG_COLOR:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ needed = 4;
+ break;
+
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ needed = 16;
+ break;
+
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
+ break;
+ }
+#endif
+ return needed;
}
-static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
+template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+get
+ (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ CTYPE *params_base = (CTYPE *) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ if (!params_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "params == null";
+ goto exit;
+ }
+ if (offset < 0) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "offset < 0";
+ goto exit;
+ }
+ _remaining = _env->GetArrayLength(params_ref) - offset;
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
+ params_base = (CTYPE *)
+ _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
+ params = params_base + offset;
+
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (params_base) {
+ _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
+ _exception ? JNI_ABORT: 0);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
+
+template <typename CTYPE, void GET(GLenum, CTYPE*)>
+static void
+getarray
+ (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType;
+ const char * _exceptionMessage;
+ jarray _array = (jarray) 0;
+ jint _bufferOffset = (jint) 0;
+ jint _remaining;
+ CTYPE *params = (CTYPE *) 0;
+ int _needed = 0;
+
+ params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ _needed = getNeededCount(pname);
+ // if we didn't find this pname, we just assume the user passed
+ // an array of the right size -- this might happen with extensions
+ // or if we forget an enum here.
+ if (_needed>0 && _remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
+ if (params == NULL) {
+ char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
+ params = (CTYPE *) (_paramsBase + _bufferOffset);
+ }
+ GET(
+ (GLenum)pname,
+ (CTYPE *)params
+ );
+
+exit:
+ if (_array) {
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
// --------------------------------------------------------------------------
@@ -148,8 +341,8 @@
android_glBindAttribLocation__IILjava_lang_String_2
(JNIEnv *_env, jobject _this, jint program, jint index, jstring name) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
const char* _nativename = 0;
if (!name) {
@@ -273,8 +466,8 @@
android_glBufferData__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -314,8 +507,8 @@
android_glBufferSubData__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -544,8 +737,8 @@
android_glDeleteBuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *buffers_base = (GLuint *) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
@@ -593,8 +786,8 @@
android_glDeleteBuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -630,8 +823,8 @@
android_glDeleteFramebuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *framebuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
@@ -649,6 +842,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(framebuffers_ref) - offset;
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < n < needed";
+ goto exit;
+ }
framebuffers_base = (GLuint *)
_env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0);
framebuffers = framebuffers_base + offset;
@@ -672,12 +871,21 @@
static void
android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < n < needed";
+ goto exit;
+ }
if (framebuffers == NULL) {
char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
@@ -686,9 +894,14 @@
(GLsizei)n,
(GLuint *)framebuffers
);
+
+exit:
if (_array) {
releasePointer(_env, _array, framebuffers, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glDeleteProgram ( GLuint program ) */
@@ -705,8 +918,8 @@
android_glDeleteRenderbuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *renderbuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
@@ -724,6 +937,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < n < needed";
+ goto exit;
+ }
renderbuffers_base = (GLuint *)
_env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0);
renderbuffers = renderbuffers_base + offset;
@@ -747,12 +966,21 @@
static void
android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < n < needed";
+ goto exit;
+ }
if (renderbuffers == NULL) {
char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
@@ -761,9 +989,14 @@
(GLsizei)n,
(GLuint *)renderbuffers
);
+
+exit:
if (_array) {
releasePointer(_env, _array, renderbuffers, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glDeleteShader ( GLuint shader ) */
@@ -780,8 +1013,8 @@
android_glDeleteTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
@@ -829,8 +1062,8 @@
android_glDeleteTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -933,8 +1166,8 @@
android_glDrawElements__IIII
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
glDrawElements(
(GLenum)mode,
(GLsizei)count,
@@ -951,8 +1184,8 @@
android_glDrawElements__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1056,8 +1289,8 @@
android_glGenBuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *buffers_base = (GLuint *) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
@@ -1105,8 +1338,8 @@
android_glGenBuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1151,8 +1384,8 @@
android_glGenFramebuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *framebuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
@@ -1170,6 +1403,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(framebuffers_ref) - offset;
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < n < needed";
+ goto exit;
+ }
framebuffers_base = (GLuint *)
_env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0);
framebuffers = framebuffers_base + offset;
@@ -1193,12 +1432,21 @@
static void
android_glGenFramebuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < n < needed";
+ goto exit;
+ }
if (framebuffers == NULL) {
char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
@@ -1207,8 +1455,13 @@
(GLsizei)n,
(GLuint *)framebuffers
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, framebuffers, JNI_TRUE);
+ releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -1217,8 +1470,8 @@
android_glGenRenderbuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *renderbuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
@@ -1236,6 +1489,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < n < needed";
+ goto exit;
+ }
renderbuffers_base = (GLuint *)
_env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0);
renderbuffers = renderbuffers_base + offset;
@@ -1259,12 +1518,21 @@
static void
android_glGenRenderbuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < n) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < n < needed";
+ goto exit;
+ }
if (renderbuffers == NULL) {
char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
@@ -1273,8 +1541,13 @@
(GLsizei)n,
(GLuint *)renderbuffers
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, renderbuffers, JNI_TRUE);
+ releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -1283,8 +1556,8 @@
android_glGenTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
@@ -1332,8 +1605,8 @@
android_glGenTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2026,8 +2299,8 @@
android_glGetAttachedShaders__II_3II_3II
(JNIEnv *_env, jobject _this, jint program, jint maxcount, jintArray count_ref, jint countOffset, jintArray shaders_ref, jint shadersOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLsizei *count_base = (GLsizei *) 0;
jint _countRemaining;
GLsizei *count = (GLsizei *) 0;
@@ -2048,6 +2321,12 @@
goto exit;
}
_countRemaining = _env->GetArrayLength(count_ref) - countOffset;
+ if (_countRemaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - countOffset < 1 < needed";
+ goto exit;
+ }
count_base = (GLsizei *)
_env->GetPrimitiveArrayCritical(count_ref, (jboolean *)0);
count = count_base + countOffset;
@@ -2065,6 +2344,12 @@
goto exit;
}
_shadersRemaining = _env->GetArrayLength(shaders_ref) - shadersOffset;
+ if (_shadersRemaining < maxcount) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - shadersOffset < maxcount < needed";
+ goto exit;
+ }
shaders_base = (GLuint *)
_env->GetPrimitiveArrayCritical(shaders_ref, (jboolean *)0);
shaders = shaders_base + shadersOffset;
@@ -2094,6 +2379,9 @@
static void
android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint maxcount, jobject count_buf, jobject shaders_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _countArray = (jarray) 0;
jint _countBufferOffset = (jint) 0;
jarray _shadersArray = (jarray) 0;
@@ -2103,13 +2391,29 @@
jint _shadersRemaining;
GLuint *shaders = (GLuint *) 0;
- count = (GLsizei *)getPointer(_env, count_buf, &_countArray, &_countRemaining, &_countBufferOffset);
- shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining, &_shadersBufferOffset);
- if (count == NULL) {
+ if (count_buf) {
+ count = (GLsizei *)getPointer(_env, count_buf, &_countArray, &_countRemaining, &_countBufferOffset);
+ if (_countRemaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
+ }
+ if (shaders_buf) {
+ shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining, &_shadersBufferOffset);
+ if (_shadersRemaining < maxcount) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < maxcount < needed";
+ goto exit;
+ }
+ }
+ if (count_buf && count == NULL) {
char * _countBase = (char *)_env->GetPrimitiveArrayCritical(_countArray, (jboolean *) 0);
count = (GLsizei *) (_countBase + _countBufferOffset);
}
- if (shaders == NULL) {
+ if (shaders_buf && shaders == NULL) {
char * _shadersBase = (char *)_env->GetPrimitiveArrayCritical(_shadersArray, (jboolean *) 0);
shaders = (GLuint *) (_shadersBase + _shadersBufferOffset);
}
@@ -2119,11 +2423,16 @@
(GLsizei *)count,
(GLuint *)shaders
);
+
+exit:
if (_shadersArray) {
- releasePointer(_env, _shadersArray, shaders, JNI_TRUE);
+ releasePointer(_env, _shadersArray, shaders, _exception ? JNI_FALSE : JNI_TRUE);
}
if (_countArray) {
- releasePointer(_env, _countArray, count, JNI_TRUE);
+ releasePointer(_env, _countArray, count, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -2132,8 +2441,8 @@
android_glGetAttribLocation__ILjava_lang_String_2
(JNIEnv *_env, jobject _this, jint program, jstring name) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint _returnValue = 0;
const char* _nativename = 0;
@@ -2164,75 +2473,22 @@
static void
android_glGetBooleanv__I_3ZI
(JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- GLboolean *params_base = (GLboolean *) 0;
- jint _remaining;
- GLboolean *params = (GLboolean *) 0;
-
- if (!params_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "params == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(params_ref) - offset;
- params_base = (GLboolean *)
- _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
- params = params_base + offset;
-
- glGetBooleanv(
- (GLenum)pname,
- (GLboolean *)params
- );
-
-exit:
- if (params_base) {
- _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ get<jbooleanArray, GLboolean, glGetBooleanv>(_env, _this, pname, params_ref, offset);
}
/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
static void
android_glGetBooleanv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLboolean *params = (GLboolean *) 0;
-
- params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- params = (GLboolean *) (_paramsBase + _bufferOffset);
- }
- glGetBooleanv(
- (GLenum)pname,
- (GLboolean *)params
- );
- if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
- }
+ getarray<GLboolean, glGetBooleanv>(_env, _this, pname, params_buf);
}
-
/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
static void
android_glGetBufferParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2281,8 +2537,8 @@
android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2327,75 +2583,22 @@
static void
android_glGetFloatv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- GLfloat *params_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *params = (GLfloat *) 0;
-
- if (!params_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "params == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(params_ref) - offset;
- params_base = (GLfloat *)
- _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
- params = params_base + offset;
-
- glGetFloatv(
- (GLenum)pname,
- (GLfloat *)params
- );
-
-exit:
- if (params_base) {
- _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ get<jfloatArray, GLfloat, glGetFloatv>(_env, _this, pname, params_ref, offset);
}
/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
static void
android_glGetFloatv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *params = (GLfloat *) 0;
-
- params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- params = (GLfloat *) (_paramsBase + _bufferOffset);
- }
- glGetFloatv(
- (GLenum)pname,
- (GLfloat *)params
- );
- if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
- }
+ getarray<GLfloat, glGetFloatv>(_env, _this, pname, params_buf);
}
-
/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */
static void
android_glGetFramebufferAttachmentParameteriv__III_3II
(JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -2463,748 +2666,14 @@
static void
android_glGetIntegerv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- GLint *params_base = (GLint *) 0;
- jint _remaining;
- GLint *params = (GLint *) 0;
-
- if (!params_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "params == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(params_ref) - offset;
- int _needed;
- switch (pname) {
-#if defined(GL_ALPHA_BITS)
- case GL_ALPHA_BITS:
-#endif // defined(GL_ALPHA_BITS)
-#if defined(GL_ALPHA_TEST_FUNC)
- case GL_ALPHA_TEST_FUNC:
-#endif // defined(GL_ALPHA_TEST_FUNC)
-#if defined(GL_ALPHA_TEST_REF)
- case GL_ALPHA_TEST_REF:
-#endif // defined(GL_ALPHA_TEST_REF)
-#if defined(GL_BLEND_DST)
- case GL_BLEND_DST:
-#endif // defined(GL_BLEND_DST)
-#if defined(GL_BLUE_BITS)
- case GL_BLUE_BITS:
-#endif // defined(GL_BLUE_BITS)
-#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
- case GL_COLOR_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
-#if defined(GL_COLOR_ARRAY_SIZE)
- case GL_COLOR_ARRAY_SIZE:
-#endif // defined(GL_COLOR_ARRAY_SIZE)
-#if defined(GL_COLOR_ARRAY_STRIDE)
- case GL_COLOR_ARRAY_STRIDE:
-#endif // defined(GL_COLOR_ARRAY_STRIDE)
-#if defined(GL_COLOR_ARRAY_TYPE)
- case GL_COLOR_ARRAY_TYPE:
-#endif // defined(GL_COLOR_ARRAY_TYPE)
-#if defined(GL_CULL_FACE)
- case GL_CULL_FACE:
-#endif // defined(GL_CULL_FACE)
-#if defined(GL_DEPTH_BITS)
- case GL_DEPTH_BITS:
-#endif // defined(GL_DEPTH_BITS)
-#if defined(GL_DEPTH_CLEAR_VALUE)
- case GL_DEPTH_CLEAR_VALUE:
-#endif // defined(GL_DEPTH_CLEAR_VALUE)
-#if defined(GL_DEPTH_FUNC)
- case GL_DEPTH_FUNC:
-#endif // defined(GL_DEPTH_FUNC)
-#if defined(GL_DEPTH_WRITEMASK)
- case GL_DEPTH_WRITEMASK:
-#endif // defined(GL_DEPTH_WRITEMASK)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FRONT_FACE)
- case GL_FRONT_FACE:
-#endif // defined(GL_FRONT_FACE)
-#if defined(GL_GREEN_BITS)
- case GL_GREEN_BITS:
-#endif // defined(GL_GREEN_BITS)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
-#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
- case GL_LIGHT_MODEL_COLOR_CONTROL:
-#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
-#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
-#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
-#if defined(GL_LINE_SMOOTH_HINT)
- case GL_LINE_SMOOTH_HINT:
-#endif // defined(GL_LINE_SMOOTH_HINT)
-#if defined(GL_LINE_WIDTH)
- case GL_LINE_WIDTH:
-#endif // defined(GL_LINE_WIDTH)
-#if defined(GL_LOGIC_OP_MODE)
- case GL_LOGIC_OP_MODE:
-#endif // defined(GL_LOGIC_OP_MODE)
-#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
- case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
- case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
- case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
- case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
-#if defined(GL_MATRIX_MODE)
- case GL_MATRIX_MODE:
-#endif // defined(GL_MATRIX_MODE)
-#if defined(GL_MAX_CLIP_PLANES)
- case GL_MAX_CLIP_PLANES:
-#endif // defined(GL_MAX_CLIP_PLANES)
-#if defined(GL_MAX_ELEMENTS_INDICES)
- case GL_MAX_ELEMENTS_INDICES:
-#endif // defined(GL_MAX_ELEMENTS_INDICES)
-#if defined(GL_MAX_ELEMENTS_VERTICES)
- case GL_MAX_ELEMENTS_VERTICES:
-#endif // defined(GL_MAX_ELEMENTS_VERTICES)
-#if defined(GL_MAX_LIGHTS)
- case GL_MAX_LIGHTS:
-#endif // defined(GL_MAX_LIGHTS)
-#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
- case GL_MAX_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
-#if defined(GL_MAX_PALETTE_MATRICES_OES)
- case GL_MAX_PALETTE_MATRICES_OES:
-#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
-#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
- case GL_MAX_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_SIZE)
- case GL_MAX_TEXTURE_SIZE:
-#endif // defined(GL_MAX_TEXTURE_SIZE)
-#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
- case GL_MAX_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_UNITS)
- case GL_MAX_TEXTURE_UNITS:
-#endif // defined(GL_MAX_TEXTURE_UNITS)
-#if defined(GL_MAX_VERTEX_UNITS_OES)
- case GL_MAX_VERTEX_UNITS_OES:
-#endif // defined(GL_MAX_VERTEX_UNITS_OES)
-#if defined(GL_MODELVIEW_STACK_DEPTH)
- case GL_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MODELVIEW_STACK_DEPTH)
-#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
- case GL_NORMAL_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
-#if defined(GL_NORMAL_ARRAY_STRIDE)
- case GL_NORMAL_ARRAY_STRIDE:
-#endif // defined(GL_NORMAL_ARRAY_STRIDE)
-#if defined(GL_NORMAL_ARRAY_TYPE)
- case GL_NORMAL_ARRAY_TYPE:
-#endif // defined(GL_NORMAL_ARRAY_TYPE)
-#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
-#if defined(GL_PACK_ALIGNMENT)
- case GL_PACK_ALIGNMENT:
-#endif // defined(GL_PACK_ALIGNMENT)
-#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
- case GL_PERSPECTIVE_CORRECTION_HINT:
-#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
-#if defined(GL_POINT_SIZE)
- case GL_POINT_SIZE:
-#endif // defined(GL_POINT_SIZE)
-#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
- case GL_POINT_SIZE_ARRAY_STRIDE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
-#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
- case GL_POINT_SIZE_ARRAY_TYPE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
-#if defined(GL_POINT_SMOOTH_HINT)
- case GL_POINT_SMOOTH_HINT:
-#endif // defined(GL_POINT_SMOOTH_HINT)
-#if defined(GL_POLYGON_OFFSET_FACTOR)
- case GL_POLYGON_OFFSET_FACTOR:
-#endif // defined(GL_POLYGON_OFFSET_FACTOR)
-#if defined(GL_POLYGON_OFFSET_UNITS)
- case GL_POLYGON_OFFSET_UNITS:
-#endif // defined(GL_POLYGON_OFFSET_UNITS)
-#if defined(GL_PROJECTION_STACK_DEPTH)
- case GL_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_PROJECTION_STACK_DEPTH)
-#if defined(GL_RED_BITS)
- case GL_RED_BITS:
-#endif // defined(GL_RED_BITS)
-#if defined(GL_SHADE_MODEL)
- case GL_SHADE_MODEL:
-#endif // defined(GL_SHADE_MODEL)
-#if defined(GL_STENCIL_BITS)
- case GL_STENCIL_BITS:
-#endif // defined(GL_STENCIL_BITS)
-#if defined(GL_STENCIL_CLEAR_VALUE)
- case GL_STENCIL_CLEAR_VALUE:
-#endif // defined(GL_STENCIL_CLEAR_VALUE)
-#if defined(GL_STENCIL_FAIL)
- case GL_STENCIL_FAIL:
-#endif // defined(GL_STENCIL_FAIL)
-#if defined(GL_STENCIL_FUNC)
- case GL_STENCIL_FUNC:
-#endif // defined(GL_STENCIL_FUNC)
-#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
- case GL_STENCIL_PASS_DEPTH_FAIL:
-#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
-#if defined(GL_STENCIL_PASS_DEPTH_PASS)
- case GL_STENCIL_PASS_DEPTH_PASS:
-#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
-#if defined(GL_STENCIL_REF)
- case GL_STENCIL_REF:
-#endif // defined(GL_STENCIL_REF)
-#if defined(GL_STENCIL_VALUE_MASK)
- case GL_STENCIL_VALUE_MASK:
-#endif // defined(GL_STENCIL_VALUE_MASK)
-#if defined(GL_STENCIL_WRITEMASK)
- case GL_STENCIL_WRITEMASK:
-#endif // defined(GL_STENCIL_WRITEMASK)
-#if defined(GL_SUBPIXEL_BITS)
- case GL_SUBPIXEL_BITS:
-#endif // defined(GL_SUBPIXEL_BITS)
-#if defined(GL_TEXTURE_BINDING_2D)
- case GL_TEXTURE_BINDING_2D:
-#endif // defined(GL_TEXTURE_BINDING_2D)
-#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
-#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
- case GL_TEXTURE_COORD_ARRAY_SIZE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
-#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
-#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
- case GL_TEXTURE_COORD_ARRAY_TYPE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
-#if defined(GL_TEXTURE_STACK_DEPTH)
- case GL_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_TEXTURE_STACK_DEPTH)
-#if defined(GL_UNPACK_ALIGNMENT)
- case GL_UNPACK_ALIGNMENT:
-#endif // defined(GL_UNPACK_ALIGNMENT)
-#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
- case GL_VERTEX_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
-#if defined(GL_VERTEX_ARRAY_SIZE)
- case GL_VERTEX_ARRAY_SIZE:
-#endif // defined(GL_VERTEX_ARRAY_SIZE)
-#if defined(GL_VERTEX_ARRAY_STRIDE)
- case GL_VERTEX_ARRAY_STRIDE:
-#endif // defined(GL_VERTEX_ARRAY_STRIDE)
-#if defined(GL_VERTEX_ARRAY_TYPE)
- case GL_VERTEX_ARRAY_TYPE:
-#endif // defined(GL_VERTEX_ARRAY_TYPE)
-#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
- case GL_WEIGHT_ARRAY_SIZE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
-#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
- case GL_WEIGHT_ARRAY_STRIDE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
-#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
- case GL_WEIGHT_ARRAY_TYPE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
- _needed = 1;
- break;
-#if defined(GL_ALIASED_POINT_SIZE_RANGE)
- case GL_ALIASED_POINT_SIZE_RANGE:
-#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
-#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
- case GL_ALIASED_LINE_WIDTH_RANGE:
-#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
-#if defined(GL_DEPTH_RANGE)
- case GL_DEPTH_RANGE:
-#endif // defined(GL_DEPTH_RANGE)
-#if defined(GL_MAX_VIEWPORT_DIMS)
- case GL_MAX_VIEWPORT_DIMS:
-#endif // defined(GL_MAX_VIEWPORT_DIMS)
-#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
- case GL_SMOOTH_LINE_WIDTH_RANGE:
-#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
-#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
- case GL_SMOOTH_POINT_SIZE_RANGE:
-#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
- _needed = 2;
- break;
-#if defined(GL_COLOR_CLEAR_VALUE)
- case GL_COLOR_CLEAR_VALUE:
-#endif // defined(GL_COLOR_CLEAR_VALUE)
-#if defined(GL_COLOR_WRITEMASK)
- case GL_COLOR_WRITEMASK:
-#endif // defined(GL_COLOR_WRITEMASK)
-#if defined(GL_FOG_COLOR)
- case GL_FOG_COLOR:
-#endif // defined(GL_FOG_COLOR)
-#if defined(GL_LIGHT_MODEL_AMBIENT)
- case GL_LIGHT_MODEL_AMBIENT:
-#endif // defined(GL_LIGHT_MODEL_AMBIENT)
-#if defined(GL_SCISSOR_BOX)
- case GL_SCISSOR_BOX:
-#endif // defined(GL_SCISSOR_BOX)
-#if defined(GL_VIEWPORT)
- case GL_VIEWPORT:
-#endif // defined(GL_VIEWPORT)
- _needed = 4;
- break;
-#if defined(GL_MODELVIEW_MATRIX)
- case GL_MODELVIEW_MATRIX:
-#endif // defined(GL_MODELVIEW_MATRIX)
-#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_PROJECTION_MATRIX)
- case GL_PROJECTION_MATRIX:
-#endif // defined(GL_PROJECTION_MATRIX)
-#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_TEXTURE_MATRIX)
- case GL_TEXTURE_MATRIX:
-#endif // defined(GL_TEXTURE_MATRIX)
-#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- _needed = 16;
- break;
-#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
- case GL_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
- _needed = getNumCompressedTextureFormats();
- break;
- default:
- _needed = 0;
- break;
- }
- if (_remaining < _needed) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "length - offset < needed";
- goto exit;
- }
- params_base = (GLint *)
- _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
- params = params_base + offset;
-
- glGetIntegerv(
- (GLenum)pname,
- (GLint *)params
- );
-
-exit:
- if (params_base) {
- _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ get<jintArray, GLint, glGetIntegerv>(_env, _this, pname, params_ref, offset);
}
/* void glGetIntegerv ( GLenum pname, GLint *params ) */
static void
android_glGetIntegerv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLint *params = (GLint *) 0;
-
- params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
- int _needed;
- switch (pname) {
-#if defined(GL_ALPHA_BITS)
- case GL_ALPHA_BITS:
-#endif // defined(GL_ALPHA_BITS)
-#if defined(GL_ALPHA_TEST_FUNC)
- case GL_ALPHA_TEST_FUNC:
-#endif // defined(GL_ALPHA_TEST_FUNC)
-#if defined(GL_ALPHA_TEST_REF)
- case GL_ALPHA_TEST_REF:
-#endif // defined(GL_ALPHA_TEST_REF)
-#if defined(GL_BLEND_DST)
- case GL_BLEND_DST:
-#endif // defined(GL_BLEND_DST)
-#if defined(GL_BLUE_BITS)
- case GL_BLUE_BITS:
-#endif // defined(GL_BLUE_BITS)
-#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
- case GL_COLOR_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
-#if defined(GL_COLOR_ARRAY_SIZE)
- case GL_COLOR_ARRAY_SIZE:
-#endif // defined(GL_COLOR_ARRAY_SIZE)
-#if defined(GL_COLOR_ARRAY_STRIDE)
- case GL_COLOR_ARRAY_STRIDE:
-#endif // defined(GL_COLOR_ARRAY_STRIDE)
-#if defined(GL_COLOR_ARRAY_TYPE)
- case GL_COLOR_ARRAY_TYPE:
-#endif // defined(GL_COLOR_ARRAY_TYPE)
-#if defined(GL_CULL_FACE)
- case GL_CULL_FACE:
-#endif // defined(GL_CULL_FACE)
-#if defined(GL_DEPTH_BITS)
- case GL_DEPTH_BITS:
-#endif // defined(GL_DEPTH_BITS)
-#if defined(GL_DEPTH_CLEAR_VALUE)
- case GL_DEPTH_CLEAR_VALUE:
-#endif // defined(GL_DEPTH_CLEAR_VALUE)
-#if defined(GL_DEPTH_FUNC)
- case GL_DEPTH_FUNC:
-#endif // defined(GL_DEPTH_FUNC)
-#if defined(GL_DEPTH_WRITEMASK)
- case GL_DEPTH_WRITEMASK:
-#endif // defined(GL_DEPTH_WRITEMASK)
-#if defined(GL_FOG_DENSITY)
- case GL_FOG_DENSITY:
-#endif // defined(GL_FOG_DENSITY)
-#if defined(GL_FOG_END)
- case GL_FOG_END:
-#endif // defined(GL_FOG_END)
-#if defined(GL_FOG_MODE)
- case GL_FOG_MODE:
-#endif // defined(GL_FOG_MODE)
-#if defined(GL_FOG_START)
- case GL_FOG_START:
-#endif // defined(GL_FOG_START)
-#if defined(GL_FRONT_FACE)
- case GL_FRONT_FACE:
-#endif // defined(GL_FRONT_FACE)
-#if defined(GL_GREEN_BITS)
- case GL_GREEN_BITS:
-#endif // defined(GL_GREEN_BITS)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
-#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
-#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
-#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
- case GL_LIGHT_MODEL_COLOR_CONTROL:
-#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
-#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
-#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
-#if defined(GL_LIGHT_MODEL_TWO_SIDE)
- case GL_LIGHT_MODEL_TWO_SIDE:
-#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
-#if defined(GL_LINE_SMOOTH_HINT)
- case GL_LINE_SMOOTH_HINT:
-#endif // defined(GL_LINE_SMOOTH_HINT)
-#if defined(GL_LINE_WIDTH)
- case GL_LINE_WIDTH:
-#endif // defined(GL_LINE_WIDTH)
-#if defined(GL_LOGIC_OP_MODE)
- case GL_LOGIC_OP_MODE:
-#endif // defined(GL_LOGIC_OP_MODE)
-#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
- case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
- case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
- case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
-#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
- case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
-#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
-#if defined(GL_MATRIX_MODE)
- case GL_MATRIX_MODE:
-#endif // defined(GL_MATRIX_MODE)
-#if defined(GL_MAX_CLIP_PLANES)
- case GL_MAX_CLIP_PLANES:
-#endif // defined(GL_MAX_CLIP_PLANES)
-#if defined(GL_MAX_ELEMENTS_INDICES)
- case GL_MAX_ELEMENTS_INDICES:
-#endif // defined(GL_MAX_ELEMENTS_INDICES)
-#if defined(GL_MAX_ELEMENTS_VERTICES)
- case GL_MAX_ELEMENTS_VERTICES:
-#endif // defined(GL_MAX_ELEMENTS_VERTICES)
-#if defined(GL_MAX_LIGHTS)
- case GL_MAX_LIGHTS:
-#endif // defined(GL_MAX_LIGHTS)
-#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
- case GL_MAX_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
-#if defined(GL_MAX_PALETTE_MATRICES_OES)
- case GL_MAX_PALETTE_MATRICES_OES:
-#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
-#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
- case GL_MAX_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_SIZE)
- case GL_MAX_TEXTURE_SIZE:
-#endif // defined(GL_MAX_TEXTURE_SIZE)
-#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
- case GL_MAX_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
-#if defined(GL_MAX_TEXTURE_UNITS)
- case GL_MAX_TEXTURE_UNITS:
-#endif // defined(GL_MAX_TEXTURE_UNITS)
-#if defined(GL_MAX_VERTEX_UNITS_OES)
- case GL_MAX_VERTEX_UNITS_OES:
-#endif // defined(GL_MAX_VERTEX_UNITS_OES)
-#if defined(GL_MODELVIEW_STACK_DEPTH)
- case GL_MODELVIEW_STACK_DEPTH:
-#endif // defined(GL_MODELVIEW_STACK_DEPTH)
-#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
- case GL_NORMAL_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
-#if defined(GL_NORMAL_ARRAY_STRIDE)
- case GL_NORMAL_ARRAY_STRIDE:
-#endif // defined(GL_NORMAL_ARRAY_STRIDE)
-#if defined(GL_NORMAL_ARRAY_TYPE)
- case GL_NORMAL_ARRAY_TYPE:
-#endif // defined(GL_NORMAL_ARRAY_TYPE)
-#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
-#if defined(GL_PACK_ALIGNMENT)
- case GL_PACK_ALIGNMENT:
-#endif // defined(GL_PACK_ALIGNMENT)
-#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
- case GL_PERSPECTIVE_CORRECTION_HINT:
-#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
-#if defined(GL_POINT_SIZE)
- case GL_POINT_SIZE:
-#endif // defined(GL_POINT_SIZE)
-#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
- case GL_POINT_SIZE_ARRAY_STRIDE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
-#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
- case GL_POINT_SIZE_ARRAY_TYPE_OES:
-#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
-#if defined(GL_POINT_SMOOTH_HINT)
- case GL_POINT_SMOOTH_HINT:
-#endif // defined(GL_POINT_SMOOTH_HINT)
-#if defined(GL_POLYGON_OFFSET_FACTOR)
- case GL_POLYGON_OFFSET_FACTOR:
-#endif // defined(GL_POLYGON_OFFSET_FACTOR)
-#if defined(GL_POLYGON_OFFSET_UNITS)
- case GL_POLYGON_OFFSET_UNITS:
-#endif // defined(GL_POLYGON_OFFSET_UNITS)
-#if defined(GL_PROJECTION_STACK_DEPTH)
- case GL_PROJECTION_STACK_DEPTH:
-#endif // defined(GL_PROJECTION_STACK_DEPTH)
-#if defined(GL_RED_BITS)
- case GL_RED_BITS:
-#endif // defined(GL_RED_BITS)
-#if defined(GL_SHADE_MODEL)
- case GL_SHADE_MODEL:
-#endif // defined(GL_SHADE_MODEL)
-#if defined(GL_STENCIL_BITS)
- case GL_STENCIL_BITS:
-#endif // defined(GL_STENCIL_BITS)
-#if defined(GL_STENCIL_CLEAR_VALUE)
- case GL_STENCIL_CLEAR_VALUE:
-#endif // defined(GL_STENCIL_CLEAR_VALUE)
-#if defined(GL_STENCIL_FAIL)
- case GL_STENCIL_FAIL:
-#endif // defined(GL_STENCIL_FAIL)
-#if defined(GL_STENCIL_FUNC)
- case GL_STENCIL_FUNC:
-#endif // defined(GL_STENCIL_FUNC)
-#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
- case GL_STENCIL_PASS_DEPTH_FAIL:
-#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
-#if defined(GL_STENCIL_PASS_DEPTH_PASS)
- case GL_STENCIL_PASS_DEPTH_PASS:
-#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
-#if defined(GL_STENCIL_REF)
- case GL_STENCIL_REF:
-#endif // defined(GL_STENCIL_REF)
-#if defined(GL_STENCIL_VALUE_MASK)
- case GL_STENCIL_VALUE_MASK:
-#endif // defined(GL_STENCIL_VALUE_MASK)
-#if defined(GL_STENCIL_WRITEMASK)
- case GL_STENCIL_WRITEMASK:
-#endif // defined(GL_STENCIL_WRITEMASK)
-#if defined(GL_SUBPIXEL_BITS)
- case GL_SUBPIXEL_BITS:
-#endif // defined(GL_SUBPIXEL_BITS)
-#if defined(GL_TEXTURE_BINDING_2D)
- case GL_TEXTURE_BINDING_2D:
-#endif // defined(GL_TEXTURE_BINDING_2D)
-#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
-#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
- case GL_TEXTURE_COORD_ARRAY_SIZE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
-#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
-#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
- case GL_TEXTURE_COORD_ARRAY_TYPE:
-#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
-#if defined(GL_TEXTURE_STACK_DEPTH)
- case GL_TEXTURE_STACK_DEPTH:
-#endif // defined(GL_TEXTURE_STACK_DEPTH)
-#if defined(GL_UNPACK_ALIGNMENT)
- case GL_UNPACK_ALIGNMENT:
-#endif // defined(GL_UNPACK_ALIGNMENT)
-#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
- case GL_VERTEX_ARRAY_BUFFER_BINDING:
-#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
-#if defined(GL_VERTEX_ARRAY_SIZE)
- case GL_VERTEX_ARRAY_SIZE:
-#endif // defined(GL_VERTEX_ARRAY_SIZE)
-#if defined(GL_VERTEX_ARRAY_STRIDE)
- case GL_VERTEX_ARRAY_STRIDE:
-#endif // defined(GL_VERTEX_ARRAY_STRIDE)
-#if defined(GL_VERTEX_ARRAY_TYPE)
- case GL_VERTEX_ARRAY_TYPE:
-#endif // defined(GL_VERTEX_ARRAY_TYPE)
-#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
-#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
-#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
- case GL_WEIGHT_ARRAY_SIZE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
-#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
- case GL_WEIGHT_ARRAY_STRIDE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
-#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
- case GL_WEIGHT_ARRAY_TYPE_OES:
-#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
- _needed = 1;
- break;
-#if defined(GL_ALIASED_POINT_SIZE_RANGE)
- case GL_ALIASED_POINT_SIZE_RANGE:
-#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
-#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
- case GL_ALIASED_LINE_WIDTH_RANGE:
-#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
-#if defined(GL_DEPTH_RANGE)
- case GL_DEPTH_RANGE:
-#endif // defined(GL_DEPTH_RANGE)
-#if defined(GL_MAX_VIEWPORT_DIMS)
- case GL_MAX_VIEWPORT_DIMS:
-#endif // defined(GL_MAX_VIEWPORT_DIMS)
-#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
- case GL_SMOOTH_LINE_WIDTH_RANGE:
-#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
-#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
- case GL_SMOOTH_POINT_SIZE_RANGE:
-#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
- _needed = 2;
- break;
-#if defined(GL_COLOR_CLEAR_VALUE)
- case GL_COLOR_CLEAR_VALUE:
-#endif // defined(GL_COLOR_CLEAR_VALUE)
-#if defined(GL_COLOR_WRITEMASK)
- case GL_COLOR_WRITEMASK:
-#endif // defined(GL_COLOR_WRITEMASK)
-#if defined(GL_FOG_COLOR)
- case GL_FOG_COLOR:
-#endif // defined(GL_FOG_COLOR)
-#if defined(GL_LIGHT_MODEL_AMBIENT)
- case GL_LIGHT_MODEL_AMBIENT:
-#endif // defined(GL_LIGHT_MODEL_AMBIENT)
-#if defined(GL_SCISSOR_BOX)
- case GL_SCISSOR_BOX:
-#endif // defined(GL_SCISSOR_BOX)
-#if defined(GL_VIEWPORT)
- case GL_VIEWPORT:
-#endif // defined(GL_VIEWPORT)
- _needed = 4;
- break;
-#if defined(GL_MODELVIEW_MATRIX)
- case GL_MODELVIEW_MATRIX:
-#endif // defined(GL_MODELVIEW_MATRIX)
-#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_PROJECTION_MATRIX)
- case GL_PROJECTION_MATRIX:
-#endif // defined(GL_PROJECTION_MATRIX)
-#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
-#if defined(GL_TEXTURE_MATRIX)
- case GL_TEXTURE_MATRIX:
-#endif // defined(GL_TEXTURE_MATRIX)
-#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
-#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
- _needed = 16;
- break;
-#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
- case GL_COMPRESSED_TEXTURE_FORMATS:
-#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
- _needed = getNumCompressedTextureFormats();
- break;
- default:
- _needed = 0;
- break;
- }
- if (_remaining < _needed) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "remaining() < needed";
- goto exit;
- }
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- params = (GLint *) (_paramsBase + _bufferOffset);
- }
- glGetIntegerv(
- (GLenum)pname,
- (GLint *)params
- );
-
-exit:
- if (_array) {
- releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
+ getarray<GLint, glGetIntegerv>(_env, _this, pname, params_buf);
}
/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */
@@ -3212,8 +2681,8 @@
android_glGetProgramiv__II_3II
(JNIEnv *_env, jobject _this, jint program, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -3231,6 +2700,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 1 < needed";
+ goto exit;
+ }
params_base = (GLint *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -3255,12 +2730,21 @@
static void
android_glGetProgramiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLint *) (_paramsBase + _bufferOffset);
@@ -3270,8 +2754,13 @@
(GLenum)pname,
(GLint *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -3299,8 +2788,8 @@
android_glGetRenderbufferParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -3318,6 +2807,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 1 < needed";
+ goto exit;
+ }
params_base = (GLint *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -3342,12 +2837,21 @@
static void
android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLint *) (_paramsBase + _bufferOffset);
@@ -3357,8 +2861,13 @@
(GLenum)pname,
(GLint *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -3367,8 +2876,8 @@
android_glGetShaderiv__II_3II
(JNIEnv *_env, jobject _this, jint shader, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -3386,6 +2895,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 1 < needed";
+ goto exit;
+ }
params_base = (GLint *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -3410,12 +2925,21 @@
static void
android_glGetShaderiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint shader, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLint *) (_paramsBase + _bufferOffset);
@@ -3425,8 +2949,13 @@
(GLenum)pname,
(GLint *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -3454,8 +2983,8 @@
android_glGetShaderPrecisionFormat__II_3II_3II
(JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jintArray range_ref, jint rangeOffset, jintArray precision_ref, jint precisionOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *range_base = (GLint *) 0;
jint _rangeRemaining;
GLint *range = (GLint *) 0;
@@ -3476,6 +3005,12 @@
goto exit;
}
_rangeRemaining = _env->GetArrayLength(range_ref) - rangeOffset;
+ if (_rangeRemaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - rangeOffset < 1 < needed";
+ goto exit;
+ }
range_base = (GLint *)
_env->GetPrimitiveArrayCritical(range_ref, (jboolean *)0);
range = range_base + rangeOffset;
@@ -3493,6 +3028,12 @@
goto exit;
}
_precisionRemaining = _env->GetArrayLength(precision_ref) - precisionOffset;
+ if (_precisionRemaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - precisionOffset < 1 < needed";
+ goto exit;
+ }
precision_base = (GLint *)
_env->GetPrimitiveArrayCritical(precision_ref, (jboolean *)0);
precision = precision_base + precisionOffset;
@@ -3522,6 +3063,9 @@
static void
android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jobject range_buf, jobject precision_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _rangeArray = (jarray) 0;
jint _rangeBufferOffset = (jint) 0;
jarray _precisionArray = (jarray) 0;
@@ -3532,7 +3076,19 @@
GLint *precision = (GLint *) 0;
range = (GLint *)getPointer(_env, range_buf, &_rangeArray, &_rangeRemaining, &_rangeBufferOffset);
+ if (_rangeRemaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
precision = (GLint *)getPointer(_env, precision_buf, &_precisionArray, &_precisionRemaining, &_precisionBufferOffset);
+ if (_precisionRemaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (range == NULL) {
char * _rangeBase = (char *)_env->GetPrimitiveArrayCritical(_rangeArray, (jboolean *) 0);
range = (GLint *) (_rangeBase + _rangeBufferOffset);
@@ -3547,11 +3103,16 @@
(GLint *)range,
(GLint *)precision
);
+
+exit:
if (_precisionArray) {
- releasePointer(_env, _precisionArray, precision, JNI_TRUE);
+ releasePointer(_env, _precisionArray, precision, _exception ? JNI_FALSE : JNI_TRUE);
}
if (_rangeArray) {
- releasePointer(_env, _rangeArray, range, JNI_TRUE);
+ releasePointer(_env, _rangeArray, range, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -3676,8 +3237,8 @@
android_glGetTexParameterfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -3726,8 +3287,8 @@
android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3764,8 +3325,8 @@
android_glGetTexParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -3814,8 +3375,8 @@
android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3852,8 +3413,8 @@
android_glGetUniformfv__II_3FI
(JNIEnv *_env, jobject _this, jint program, jint location, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -3871,6 +3432,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 1 < needed";
+ goto exit;
+ }
params_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -3895,12 +3462,21 @@
static void
android_glGetUniformfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfloat *) (_paramsBase + _bufferOffset);
@@ -3910,8 +3486,13 @@
(GLint)location,
(GLfloat *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -3920,8 +3501,8 @@
android_glGetUniformiv__II_3II
(JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -3939,6 +3520,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 1 < needed";
+ goto exit;
+ }
params_base = (GLint *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -3963,12 +3550,21 @@
static void
android_glGetUniformiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLint *) (_paramsBase + _bufferOffset);
@@ -3978,8 +3574,13 @@
(GLint)location,
(GLint *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -3988,8 +3589,8 @@
android_glGetUniformLocation__ILjava_lang_String_2
(JNIEnv *_env, jobject _this, jint program, jstring name) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint _returnValue = 0;
const char* _nativename = 0;
@@ -4021,8 +3622,8 @@
android_glGetVertexAttribfv__II_3FI
(JNIEnv *_env, jobject _this, jint index, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -4040,6 +3641,23 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ int _needed;
+ switch (pname) {
+#if defined(GL_CURRENT_VERTEX_ATTRIB)
+ case GL_CURRENT_VERTEX_ATTRIB:
+#endif // defined(GL_CURRENT_VERTEX_ATTRIB)
+ _needed = 4;
+ break;
+ default:
+ _needed = 1;
+ break;
+ }
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
params_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -4064,12 +3682,32 @@
static void
android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ int _needed;
+ switch (pname) {
+#if defined(GL_CURRENT_VERTEX_ATTRIB)
+ case GL_CURRENT_VERTEX_ATTRIB:
+#endif // defined(GL_CURRENT_VERTEX_ATTRIB)
+ _needed = 4;
+ break;
+ default:
+ _needed = 1;
+ break;
+ }
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfloat *) (_paramsBase + _bufferOffset);
@@ -4079,8 +3717,13 @@
(GLenum)pname,
(GLfloat *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -4089,8 +3732,8 @@
android_glGetVertexAttribiv__II_3II
(JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -4108,6 +3751,23 @@
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
+ int _needed;
+ switch (pname) {
+#if defined(GL_CURRENT_VERTEX_ATTRIB)
+ case GL_CURRENT_VERTEX_ATTRIB:
+#endif // defined(GL_CURRENT_VERTEX_ATTRIB)
+ _needed = 4;
+ break;
+ default:
+ _needed = 1;
+ break;
+ }
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < needed";
+ goto exit;
+ }
params_base = (GLint *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
@@ -4132,12 +3792,32 @@
static void
android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
+ int _needed;
+ switch (pname) {
+#if defined(GL_CURRENT_VERTEX_ATTRIB)
+ case GL_CURRENT_VERTEX_ATTRIB:
+#endif // defined(GL_CURRENT_VERTEX_ATTRIB)
+ _needed = 4;
+ break;
+ default:
+ _needed = 1;
+ break;
+ }
+ if (_remaining < _needed) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < needed";
+ goto exit;
+ }
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLint *) (_paramsBase + _bufferOffset);
@@ -4147,8 +3827,13 @@
(GLenum)pname,
(GLint *)params
);
+
+exit:
if (_array) {
- releasePointer(_env, _array, params, JNI_TRUE);
+ releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
+ }
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
@@ -4351,8 +4036,8 @@
android_glShaderBinary__I_3IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint n, jintArray shaders_ref, jint offset, jint binaryformat, jobject binary_buf, jint length) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
GLuint *shaders_base = (GLuint *) 0;
@@ -4379,6 +4064,12 @@
shaders = shaders_base + offset;
binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining, &_bufferOffset);
+ if (_binaryRemaining < length) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < length < needed";
+ goto exit;
+ }
if (binary == NULL) {
char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
binary = (GLvoid *) (_binaryBase + _bufferOffset);
@@ -4408,6 +4099,9 @@
static void
android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint n, jobject shaders_buf, jint binaryformat, jobject binary_buf, jint length) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _shadersArray = (jarray) 0;
jint _shadersBufferOffset = (jint) 0;
jarray _binaryArray = (jarray) 0;
@@ -4419,6 +4113,12 @@
shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining, &_shadersBufferOffset);
binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
+ if (_binaryRemaining < length) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < length < needed";
+ goto exit;
+ }
if (shaders == NULL) {
char * _shadersBase = (char *)_env->GetPrimitiveArrayCritical(_shadersArray, (jboolean *) 0);
shaders = (GLuint *) (_shadersBase + _shadersBufferOffset);
@@ -4434,12 +4134,17 @@
(GLvoid *)binary,
(GLsizei)length
);
+
+exit:
if (_binaryArray) {
releasePointer(_env, _binaryArray, binary, JNI_FALSE);
}
if (_shadersArray) {
releasePointer(_env, _shadersArray, shaders, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
@@ -4572,8 +4277,8 @@
android_glTexParameterfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -4622,8 +4327,8 @@
android_glTexParameterfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4671,8 +4376,8 @@
android_glTexParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -4721,8 +4426,8 @@
android_glTexParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4801,8 +4506,8 @@
android_glUniform1fv__II_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *v_base = (GLfloat *) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
@@ -4820,6 +4525,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count < needed";
+ goto exit;
+ }
v_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -4844,12 +4555,21 @@
static void
android_glUniform1fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLfloat *) (_vBase + _bufferOffset);
@@ -4859,9 +4579,14 @@
(GLsizei)count,
(GLfloat *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform1i ( GLint location, GLint x ) */
@@ -4879,8 +4604,8 @@
android_glUniform1iv__II_3II
(JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *v_base = (GLint *) 0;
jint _remaining;
GLint *v = (GLint *) 0;
@@ -4898,6 +4623,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count < needed";
+ goto exit;
+ }
v_base = (GLint *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -4922,12 +4653,21 @@
static void
android_glUniform1iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLint *) (_vBase + _bufferOffset);
@@ -4937,9 +4677,14 @@
(GLsizei)count,
(GLint *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform2f ( GLint location, GLfloat x, GLfloat y ) */
@@ -4958,8 +4703,8 @@
android_glUniform2fv__II_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *v_base = (GLfloat *) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
@@ -4977,6 +4722,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count*2) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*2 < needed";
+ goto exit;
+ }
v_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -5001,12 +4752,21 @@
static void
android_glUniform2fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*2) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*2 < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLfloat *) (_vBase + _bufferOffset);
@@ -5016,9 +4776,14 @@
(GLsizei)count,
(GLfloat *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform2i ( GLint location, GLint x, GLint y ) */
@@ -5037,8 +4802,8 @@
android_glUniform2iv__II_3II
(JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *v_base = (GLint *) 0;
jint _remaining;
GLint *v = (GLint *) 0;
@@ -5056,6 +4821,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count*2) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*2 < needed";
+ goto exit;
+ }
v_base = (GLint *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -5080,12 +4851,21 @@
static void
android_glUniform2iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*2) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*2 < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLint *) (_vBase + _bufferOffset);
@@ -5095,9 +4875,14 @@
(GLsizei)count,
(GLint *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) */
@@ -5117,8 +4902,8 @@
android_glUniform3fv__II_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *v_base = (GLfloat *) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
@@ -5136,6 +4921,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count*3) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*3 < needed";
+ goto exit;
+ }
v_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -5160,12 +4951,21 @@
static void
android_glUniform3fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*3) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*3 < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLfloat *) (_vBase + _bufferOffset);
@@ -5175,9 +4975,14 @@
(GLsizei)count,
(GLfloat *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) */
@@ -5197,8 +5002,8 @@
android_glUniform3iv__II_3II
(JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *v_base = (GLint *) 0;
jint _remaining;
GLint *v = (GLint *) 0;
@@ -5216,6 +5021,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count*3) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*3 < needed";
+ goto exit;
+ }
v_base = (GLint *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -5240,12 +5051,21 @@
static void
android_glUniform3iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*3) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*3 < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLint *) (_vBase + _bufferOffset);
@@ -5255,9 +5075,14 @@
(GLsizei)count,
(GLint *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */
@@ -5278,8 +5103,8 @@
android_glUniform4fv__II_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *v_base = (GLfloat *) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
@@ -5297,6 +5122,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count*4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*4 < needed";
+ goto exit;
+ }
v_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -5321,12 +5152,21 @@
static void
android_glUniform4fv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *v = (GLfloat *) 0;
v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*4 < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLfloat *) (_vBase + _bufferOffset);
@@ -5336,9 +5176,14 @@
(GLsizei)count,
(GLfloat *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) */
@@ -5359,8 +5204,8 @@
android_glUniform4iv__II_3II
(JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *v_base = (GLint *) 0;
jint _remaining;
GLint *v = (GLint *) 0;
@@ -5378,6 +5223,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(v_ref) - offset;
+ if (_remaining < count*4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*4 < needed";
+ goto exit;
+ }
v_base = (GLint *)
_env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
v = v_base + offset;
@@ -5402,12 +5253,21 @@
static void
android_glUniform4iv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *v = (GLint *) 0;
v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*4 < needed";
+ goto exit;
+ }
if (v == NULL) {
char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
v = (GLint *) (_vBase + _bufferOffset);
@@ -5417,9 +5277,14 @@
(GLsizei)count,
(GLint *)v
);
+
+exit:
if (_array) {
releasePointer(_env, _array, v, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
@@ -5427,8 +5292,8 @@
android_glUniformMatrix2fv__IIZ_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *value_base = (GLfloat *) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
@@ -5446,6 +5311,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(value_ref) - offset;
+ if (_remaining < count*4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*4 < needed";
+ goto exit;
+ }
value_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
value = value_base + offset;
@@ -5471,12 +5342,21 @@
static void
android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*4 < needed";
+ goto exit;
+ }
if (value == NULL) {
char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
value = (GLfloat *) (_valueBase + _bufferOffset);
@@ -5487,9 +5367,14 @@
(GLboolean)transpose,
(GLfloat *)value
);
+
+exit:
if (_array) {
releasePointer(_env, _array, value, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
@@ -5497,8 +5382,8 @@
android_glUniformMatrix3fv__IIZ_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *value_base = (GLfloat *) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
@@ -5516,6 +5401,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(value_ref) - offset;
+ if (_remaining < count*9) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*9 < needed";
+ goto exit;
+ }
value_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
value = value_base + offset;
@@ -5541,12 +5432,21 @@
static void
android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*9) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*9 < needed";
+ goto exit;
+ }
if (value == NULL) {
char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
value = (GLfloat *) (_valueBase + _bufferOffset);
@@ -5557,9 +5457,14 @@
(GLboolean)transpose,
(GLfloat *)value
);
+
+exit:
if (_array) {
releasePointer(_env, _array, value, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
@@ -5567,8 +5472,8 @@
android_glUniformMatrix4fv__IIZ_3FI
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *value_base = (GLfloat *) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
@@ -5586,6 +5491,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(value_ref) - offset;
+ if (_remaining < count*16) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < count*16 < needed";
+ goto exit;
+ }
value_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
value = value_base + offset;
@@ -5611,12 +5522,21 @@
static void
android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *value = (GLfloat *) 0;
value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < count*16) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < count*16 < needed";
+ goto exit;
+ }
if (value == NULL) {
char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
value = (GLfloat *) (_valueBase + _bufferOffset);
@@ -5627,9 +5547,14 @@
(GLboolean)transpose,
(GLfloat *)value
);
+
+exit:
if (_array) {
releasePointer(_env, _array, value, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glUseProgram ( GLuint program ) */
@@ -5665,8 +5590,8 @@
android_glVertexAttrib1fv__I_3FI
(JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *values_base = (GLfloat *) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
@@ -5684,6 +5609,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(values_ref) - offset;
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 1 < needed";
+ goto exit;
+ }
values_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
values = values_base + offset;
@@ -5707,12 +5638,21 @@
static void
android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 1) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 1 < needed";
+ goto exit;
+ }
if (values == NULL) {
char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
values = (GLfloat *) (_valuesBase + _bufferOffset);
@@ -5721,9 +5661,14 @@
(GLuint)indx,
(GLfloat *)values
);
+
+exit:
if (_array) {
releasePointer(_env, _array, values, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) */
@@ -5742,8 +5687,8 @@
android_glVertexAttrib2fv__I_3FI
(JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *values_base = (GLfloat *) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
@@ -5761,6 +5706,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(values_ref) - offset;
+ if (_remaining < 2) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 2 < needed";
+ goto exit;
+ }
values_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
values = values_base + offset;
@@ -5784,12 +5735,21 @@
static void
android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 2) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 2 < needed";
+ goto exit;
+ }
if (values == NULL) {
char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
values = (GLfloat *) (_valuesBase + _bufferOffset);
@@ -5798,9 +5758,14 @@
(GLuint)indx,
(GLfloat *)values
);
+
+exit:
if (_array) {
releasePointer(_env, _array, values, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) */
@@ -5820,8 +5785,8 @@
android_glVertexAttrib3fv__I_3FI
(JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *values_base = (GLfloat *) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
@@ -5839,6 +5804,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(values_ref) - offset;
+ if (_remaining < 3) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 3 < needed";
+ goto exit;
+ }
values_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
values = values_base + offset;
@@ -5862,12 +5833,21 @@
static void
android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 3) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 3 < needed";
+ goto exit;
+ }
if (values == NULL) {
char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
values = (GLfloat *) (_valuesBase + _bufferOffset);
@@ -5876,9 +5856,14 @@
(GLuint)indx,
(GLfloat *)values
);
+
+exit:
if (_array) {
releasePointer(_env, _array, values, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */
@@ -5899,8 +5884,8 @@
android_glVertexAttrib4fv__I_3FI
(JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *values_base = (GLfloat *) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
@@ -5918,6 +5903,12 @@
goto exit;
}
_remaining = _env->GetArrayLength(values_ref) - offset;
+ if (_remaining < 4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "length - offset < 4 < needed";
+ goto exit;
+ }
values_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
values = values_base + offset;
@@ -5941,12 +5932,21 @@
static void
android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
+ jint _exception = 0;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *values = (GLfloat *) 0;
values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining, &_bufferOffset);
+ if (_remaining < 4) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "remaining() < 4 < needed";
+ goto exit;
+ }
if (values == NULL) {
char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
values = (GLfloat *) (_valuesBase + _bufferOffset);
@@ -5955,9 +5955,14 @@
(GLuint)indx,
(GLfloat *)values
);
+
+exit:
if (_array) {
releasePointer(_env, _array, values, JNI_FALSE);
}
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
}
/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) */
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 56b687c..6e21a11 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -178,7 +178,8 @@
whichHeap = HEAP_APK;
} else if (nameLen > 4 && strcmp(name+nameLen-4, ".ttf") == 0) {
whichHeap = HEAP_TTF;
- } else if (nameLen > 4 && strcmp(name+nameLen-4, ".dex") == 0) {
+ } else if ((nameLen > 4 && strcmp(name+nameLen-4, ".dex") == 0) ||
+ (nameLen > 5 && strcmp(name+nameLen-5, ".odex") == 0)) {
whichHeap = HEAP_DEX;
} else if (nameLen > 0) {
whichHeap = HEAP_UNKNOWN_MAP;
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index b4a19f1..02e76e5 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -388,7 +388,7 @@
env->GetFieldID(gSurfaceClassInfo.clazz, "mGenerationId", "I");
gSurfaceClassInfo.mCanvas =
env->GetFieldID(gSurfaceClassInfo.clazz, "mCanvas", "Landroid/graphics/Canvas;");
- gSurfaceClassInfo.ctor = env->GetMethodID(gSurfaceClassInfo.clazz, "<init>", "()V");
+ gSurfaceClassInfo.ctor = env->GetMethodID(gSurfaceClassInfo.clazz, "<init>", "(I)V");
clazz = env->FindClass("android/graphics/Canvas");
gCanvasClassInfo.mFinalizer = env->GetFieldID(clazz, "mFinalizer", "Landroid/graphics/Canvas$CanvasFinalizer;");
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index a218488..5da5b4f 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -320,8 +320,11 @@
jobject tokenObj, jint nativeSurfaceObject) {
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
if (token == NULL) return;
+ sp<IGraphicBufferProducer> bufferProducer;
sp<Surface> sur(reinterpret_cast<Surface *>(nativeSurfaceObject));
- sp<IGraphicBufferProducer> bufferProducer(sur->getIGraphicBufferProducer());
+ if (sur != NULL) {
+ bufferProducer = sur->getIGraphicBufferProducer();
+ }
SurfaceComposerClient::setDisplaySurface(token, bufferProducer);
}
diff --git a/core/jni/com_google_android_gles_jni_GLImpl.cpp b/core/jni/com_google_android_gles_jni_GLImpl.cpp
index 3f9942e..badd697 100644
--- a/core/jni/com_google_android_gles_jni_GLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_GLImpl.cpp
@@ -541,8 +541,8 @@
android_glDeleteTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
@@ -590,8 +590,8 @@
android_glDeleteTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -694,8 +694,8 @@
android_glDrawElements__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -775,8 +775,8 @@
android_glFogfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -816,7 +816,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -849,8 +849,8 @@
android_glFogfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -879,7 +879,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -921,8 +921,8 @@
android_glFogxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -962,7 +962,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -995,8 +995,8 @@
android_glFogxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1025,7 +1025,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1094,8 +1094,8 @@
android_glGenTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
@@ -1143,8 +1143,8 @@
android_glGenTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1189,8 +1189,8 @@
android_glGetIntegerv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -1536,7 +1536,7 @@
_needed = getNumCompressedTextureFormats();
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1569,8 +1569,8 @@
android_glGetIntegerv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -1905,7 +1905,7 @@
_needed = getNumCompressedTextureFormats();
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -1962,8 +1962,8 @@
android_glLightModelfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -1994,7 +1994,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2027,8 +2027,8 @@
android_glLightModelfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2048,7 +2048,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2090,8 +2090,8 @@
android_glLightModelxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2122,7 +2122,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2155,8 +2155,8 @@
android_glLightModelxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2176,7 +2176,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2219,8 +2219,8 @@
android_glLightfv__II_3FI
(JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2277,7 +2277,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2311,8 +2311,8 @@
android_glLightfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2358,7 +2358,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2402,8 +2402,8 @@
android_glLightxv__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2460,7 +2460,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2494,8 +2494,8 @@
android_glLightxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2541,7 +2541,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2599,8 +2599,8 @@
android_glLoadMatrixf___3FI
(JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *m_base = (GLfloat *) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
@@ -2663,8 +2663,8 @@
android_glLoadMatrixx___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
@@ -2747,8 +2747,8 @@
android_glMaterialfv__II_3FI
(JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -2791,7 +2791,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2825,8 +2825,8 @@
android_glMaterialfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -2858,7 +2858,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2902,8 +2902,8 @@
android_glMaterialxv__II_3II
(JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -2946,7 +2946,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -2980,8 +2980,8 @@
android_glMaterialxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3013,7 +3013,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3055,8 +3055,8 @@
android_glMultMatrixf___3FI
(JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *m_base = (GLfloat *) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
@@ -3119,8 +3119,8 @@
android_glMultMatrixx___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
@@ -3525,8 +3525,8 @@
android_glTexEnvfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -3563,7 +3563,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3597,8 +3597,8 @@
android_glTexEnvfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3624,7 +3624,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3668,8 +3668,8 @@
android_glTexEnvxv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -3706,7 +3706,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3740,8 +3740,8 @@
android_glTexEnvxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -3767,7 +3767,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -3944,8 +3944,8 @@
android_glQueryMatrixxOES___3II_3II
(JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLbitfield _returnValue = -1;
GLfixed *mantissa_base = (GLfixed *) 0;
jint _mantissaRemaining;
@@ -4025,8 +4025,8 @@
android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _mantissaArray = (jarray) 0;
jint _mantissaBufferOffset = (jint) 0;
jarray _exponentArray = (jarray) 0;
@@ -4092,8 +4092,8 @@
android_glBufferData__IILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4133,8 +4133,8 @@
android_glBufferSubData__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4172,8 +4172,8 @@
android_glClipPlanef__I_3FI
(JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *equation_base = (GLfloat *) 0;
jint _remaining;
GLfloat *equation = (GLfloat *) 0;
@@ -4221,8 +4221,8 @@
android_glClipPlanef__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4258,8 +4258,8 @@
android_glClipPlanex__I_3II
(JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *equation_base = (GLfixed *) 0;
jint _remaining;
GLfixed *equation = (GLfixed *) 0;
@@ -4307,8 +4307,8 @@
android_glClipPlanex__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4368,8 +4368,8 @@
android_glDeleteBuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *buffers_base = (GLuint *) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
@@ -4417,8 +4417,8 @@
android_glDeleteBuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4454,8 +4454,8 @@
android_glDrawElements__IIII
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
glDrawElements(
(GLenum)mode,
(GLsizei)count,
@@ -4472,8 +4472,8 @@
android_glGenBuffers__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *buffers_base = (GLuint *) 0;
jint _remaining;
GLuint *buffers = (GLuint *) 0;
@@ -4521,8 +4521,8 @@
android_glGenBuffers__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -4558,8 +4558,8 @@
android_glGetBooleanv__I_3ZI
(JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLboolean *params_base = (GLboolean *) 0;
jint _remaining;
GLboolean *params = (GLboolean *) 0;
@@ -4640,8 +4640,8 @@
android_glGetClipPlanef__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *eqn_base = (GLfloat *) 0;
jint _remaining;
GLfloat *eqn = (GLfloat *) 0;
@@ -4706,8 +4706,8 @@
android_glGetClipPlanex__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *eqn_base = (GLfixed *) 0;
jint _remaining;
GLfixed *eqn = (GLfixed *) 0;
@@ -4772,8 +4772,8 @@
android_glGetFixedv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -4838,8 +4838,8 @@
android_glGetFloatv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -4904,8 +4904,8 @@
android_glGetLightfv__II_3FI
(JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -4962,7 +4962,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -4996,8 +4996,8 @@
android_glGetLightfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5043,7 +5043,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5076,8 +5076,8 @@
android_glGetLightxv__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -5134,7 +5134,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5168,8 +5168,8 @@
android_glGetLightxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5215,7 +5215,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5248,8 +5248,8 @@
android_glGetMaterialfv__II_3FI
(JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -5292,7 +5292,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5326,8 +5326,8 @@
android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5359,7 +5359,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5392,8 +5392,8 @@
android_glGetMaterialxv__II_3II
(JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -5436,7 +5436,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5470,8 +5470,8 @@
android_glGetMaterialxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5503,7 +5503,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5536,8 +5536,8 @@
android_glGetTexEnviv__II_3II
(JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -5574,7 +5574,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5608,8 +5608,8 @@
android_glGetTexEnviv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5635,7 +5635,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5668,8 +5668,8 @@
android_glGetTexEnvxv__II_3II
(JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -5706,7 +5706,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5740,8 +5740,8 @@
android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5767,7 +5767,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -5800,8 +5800,8 @@
android_glGetTexParameterfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -5850,8 +5850,8 @@
android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5888,8 +5888,8 @@
android_glGetTexParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -5938,8 +5938,8 @@
android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -5976,8 +5976,8 @@
android_glGetTexParameterxv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -6026,8 +6026,8 @@
android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6118,8 +6118,8 @@
android_glPointParameterfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -6167,8 +6167,8 @@
android_glPointParameterfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6214,8 +6214,8 @@
android_glPointParameterxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -6263,8 +6263,8 @@
android_glPointParameterxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6346,8 +6346,8 @@
android_glTexEnviv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -6384,7 +6384,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -6418,8 +6418,8 @@
android_glTexEnviv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6445,7 +6445,7 @@
_needed = 4;
break;
default:
- _needed = 0;
+ _needed = 1;
break;
}
if (_remaining < _needed) {
@@ -6478,8 +6478,8 @@
android_glTexParameterfv__II_3FI
(JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -6528,8 +6528,8 @@
android_glTexParameterfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6577,8 +6577,8 @@
android_glTexParameteriv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -6627,8 +6627,8 @@
android_glTexParameteriv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6665,8 +6665,8 @@
android_glTexParameterxv__II_3II
(JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
@@ -6715,8 +6715,8 @@
android_glTexParameterxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6787,8 +6787,8 @@
android_glDrawTexfvOES___3FI
(JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *coords_base = (GLfloat *) 0;
jint _remaining;
GLfloat *coords = (GLfloat *) 0;
@@ -6835,8 +6835,8 @@
android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6884,8 +6884,8 @@
android_glDrawTexivOES___3II
(JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *coords_base = (GLint *) 0;
jint _remaining;
GLint *coords = (GLint *) 0;
@@ -6932,8 +6932,8 @@
android_glDrawTexivOES__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -6981,8 +6981,8 @@
android_glDrawTexsvOES___3SI
(JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLshort *coords_base = (GLshort *) 0;
jint _remaining;
GLshort *coords = (GLshort *) 0;
@@ -7029,8 +7029,8 @@
android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -7078,8 +7078,8 @@
android_glDrawTexxvOES___3II
(JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfixed *coords_base = (GLfixed *) 0;
jint _remaining;
GLfixed *coords = (GLfixed *) 0;
@@ -7126,8 +7126,8 @@
android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject coords_buf) {
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -7338,8 +7338,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *framebuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
@@ -7392,8 +7392,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -7434,8 +7434,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *renderbuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
@@ -7488,8 +7488,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -7579,8 +7579,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *framebuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *framebuffers = (GLuint *) 0;
@@ -7633,8 +7633,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -7675,8 +7675,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLuint *renderbuffers_base = (GLuint *) 0;
jint _remaining;
GLuint *renderbuffers = (GLuint *) 0;
@@ -7729,8 +7729,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
@@ -7771,8 +7771,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -7851,8 +7851,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -7929,8 +7929,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -8007,8 +8007,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -8085,8 +8085,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -8228,8 +8228,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
@@ -8322,8 +8322,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
@@ -8416,8 +8416,8 @@
return;
}
jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
+ const char * _exceptionType = NULL;
+ const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index f9e2785..3b3bb8f 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -26,14 +26,14 @@
</div>
</div>
-<div class="sidebox-wrapper">
+<div class="sidebox-wrapper">
<div class="sidebox">
- <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
- <p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
+ <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;padding-top:1em;">Google Play Filtering</p>
<p style="padding-top:1em;">Google Play uses the <code><uses-sdk></code>
- attributes declared in your app manifest to filter your app from devices
+ attributes declared in your app manifest to filter your app from devices
that do not meet it's platform version requirements. Before setting these
- attributes, make sure that you understand
+ attributes, make sure that you understand
<a href="{@docRoot}google/play/filters.html">Google Play filters</a>. </p>
</div>
</div>
@@ -41,7 +41,7 @@
<dl class="xml">
<dt>syntax:</dt>
<dd><pre>
-<uses-sdk android:<a href="#min">minSdkVersion</a>="<i>integer</i>"
+<uses-sdk android:<a href="#min">minSdkVersion</a>="<i>integer</i>"
android:<a href="#target">targetSdkVersion</a>="<i>integer</i>"
android:<a href="#max">maxSdkVersion</a>="<i>integer</i>" /></pre></dd>
@@ -55,14 +55,14 @@
</p>
<p>Despite its name, this element is used to specify the API Level, <em>not</em>
-the version number of the SDK (software development kit) or Android platform.
+the version number of the SDK (software development kit) or Android platform.
The API Level is always a single integer. You cannot derive the API Level from
its associated Android version number (for example, it is not the same as the
major version or the sum of the major and minor versions).</p>
<p>Also read the document about
<a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a>.
-</p></dd>
+</p></dd>
<dt>attributes:</dt>
@@ -117,8 +117,8 @@
</dd>
<dt><a name="max"></a>{@code android:maxSdkVersion}</dt>
- <dd>An integer designating the maximum API Level on which the application is
- designed to run.
+ <dd>An integer designating the maximum API Level on which the application is
+ designed to run.
<p>In Android 1.5, 1.6, 2.0, and 2.0.1, the system checks the value of this
attribute when installing an application and when re-validating the application
@@ -165,7 +165,7 @@
as a filter, however, when presenting users with applications available for
download. </div>
</dd>
-
+
</dl></dd>
@@ -217,7 +217,7 @@
<p>The framework API that an Android platform delivers is specified using an
integer identifier called "API Level". Each Android platform version supports
exactly one API Level, although support is implicit for all earlier API Levels
-(down to API Level 1). The initial release of the Android platform provided
+(down to API Level 1). The initial release of the Android platform provided
API Level 1 and subsequent releases have incremented the API Level.</p>
<p>The table below specifies the API Level supported by each version of the
@@ -227,8 +227,8 @@
<table>
<tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
-
- <tr><td><a href="{@docRoot}about/versions/android-4.2.html">Android 4.2</a></td>
+
+ <tr><td><a href="{@docRoot}about/versions/android-4.2.html">Android 4.2, 4.2.2</a></td>
<td><a href="{@docRoot}sdk/api_diff/17/changes.html" title="Diff Report">17</a></td>
<td>{@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}</td>
<td><a href="{@docRoot}about/versions/jelly-bean.html">Platform
@@ -250,70 +250,70 @@
<td><a href="{@docRoot}sdk/api_diff/14/changes.html" title="Diff Report">14</a></td>
<td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}</td>
</tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-3.2.html">Android 3.2</a></td>
<td><a href="{@docRoot}sdk/api_diff/13/changes.html" title="Diff Report">13</a></td>
<td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}</td>
<td><!-- <a href="{@docRoot}about/versions/android-3.2-highlights.html">Platform
Highlights</a>--></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-3.1.html">Android 3.1.x</a></td>
<td><a href="{@docRoot}sdk/api_diff/12/changes.html" title="Diff Report">12</a></td>
<td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR1}</td>
<td><a href="{@docRoot}about/versions/android-3.1-highlights.html">Platform Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-3.0.html">Android 3.0.x</td>
<td><a href="{@docRoot}sdk/api_diff/11/changes.html" title="Diff Report">11</a></td>
<td>{@link android.os.Build.VERSION_CODES#HONEYCOMB}</td>
<td><a href="{@docRoot}about/versions/android-3.0-highlights.html">Platform Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-2.3.3.html">Android 2.3.4<br>Android 2.3.3</td>
<td><a href="{@docRoot}sdk/api_diff/10/changes.html" title="Diff Report">10</a></td>
<td>{@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1}</td>
<td rowspan="2"><a href="{@docRoot}about/versions/android-2.3-highlights.html">Platform
Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-2.3.html">Android 2.3.2<br>Android 2.3.1<br>Android
2.3</td>
<td><a href="{@docRoot}sdk/api_diff/9/changes.html" title="Diff Report">9</a></td>
<td>{@link android.os.Build.VERSION_CODES#GINGERBREAD}</td>
</tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-2.2.html">Android 2.2.x</td>
<td ><a href="{@docRoot}sdk/api_diff/8/changes.html" title="Diff Report">8</a></td>
<td>{@link android.os.Build.VERSION_CODES#FROYO}</td>
<td><a href="{@docRoot}about/versions/android-2.2-highlights.html">Platform Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-2.1.html">Android 2.1.x</td>
<td><a href="{@docRoot}sdk/api_diff/7/changes.html" title="Diff Report">7</a></td>
<td>{@link android.os.Build.VERSION_CODES#ECLAIR_MR1}</td>
<td rowspan="3" ><a href="{@docRoot}about/versions/android-2.0-highlights.html">Platform
Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-2.0.1.html">Android 2.0.1</td>
<td><a href="{@docRoot}sdk/api_diff/6/changes.html" title="Diff Report">6</a></td>
<td>{@link android.os.Build.VERSION_CODES#ECLAIR_0_1}</td>
</tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-2.0.html">Android 2.0</td>
<td><a href="{@docRoot}sdk/api_diff/5/changes.html" title="Diff Report">5</a></td>
<td>{@link android.os.Build.VERSION_CODES#ECLAIR}</td>
</tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-1.6.html">Android 1.6</td>
<td><a href="{@docRoot}sdk/api_diff/4/changes.html" title="Diff Report">4</a></td>
<td>{@link android.os.Build.VERSION_CODES#DONUT}</td>
<td><a href="{@docRoot}about/versions/android-1.6-highlights.html">Platform Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-1.5.html">Android 1.5</td>
<td><a href="{@docRoot}sdk/api_diff/3/changes.html" title="Diff Report">3</a></td>
<td>{@link android.os.Build.VERSION_CODES#CUPCAKE}</td>
<td><a href="{@docRoot}about/versions/android-1.5-highlights.html">Platform Highlights</a></td></tr>
-
+
<tr><td><a href="{@docRoot}about/versions/android-1.1.html">Android 1.1</td>
<td>2</td>
<td>{@link android.os.Build.VERSION_CODES#BASE_1_1}</td><td></td></tr>
-
+
<tr><td>Android 1.0</td>
<td>1</td>
<td>{@link android.os.Build.VERSION_CODES#BASE}</td>
@@ -324,10 +324,10 @@
<h2 id="uses">Uses of API Level in Android</h2>
<p>The API Level identifier serves a key role in ensuring the best possible
-experience for users and application developers:
+experience for users and application developers:
<ul>
-<li>It lets the Android platform describe the maximum framework API revision
+<li>It lets the Android platform describe the maximum framework API revision
that it supports</li>
<li>It lets applications describe the framework API revision that they
require</li>
@@ -349,7 +349,7 @@
<li><code>android:targetSdkVersion</code> — Specifies the API Level
on which the application is designed to run. In some cases, this allows the
application to use manifest elements or behaviors defined in the target
-API Level, rather than being restricted to using only those defined
+API Level, rather than being restricted to using only those defined
for the minimum API Level.</li>
<li><code>android:maxSdkVersion</code> — Specifies the maximum API Level
on which the application is able to run. <strong>Important:</strong> Please read the <a
@@ -375,7 +375,7 @@
must be less than or equal to the system's API Level integer. If not declared,
the system assumes that the application requires API Level 1. </li>
<li>If a <code>android:maxSdkVersion</code> attribute is declared, its value
-must be equal to or greater than the system's API Level integer.
+must be equal to or greater than the system's API Level integer.
If not declared, the system assumes that the application
has no maximum API Level. Please read the <a
href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code><uses-sdk></code></a>
@@ -470,7 +470,7 @@
<p>When you are developing your application, you will need to choose
the platform version against which you will compile the application. In
general, you should compile your application against the lowest possible
-version of the platform that your application can support.
+version of the platform that your application can support.
<p>You can determine the lowest possible platform version by compiling the
application against successively lower build targets. After you determine the
@@ -513,7 +513,7 @@
located in the <sdk>/tools directory. You can launch the SDK updater by
executing <code>android sdk</code>. You can
also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
-In ADT, you can also access the updater by selecting
+In ADT, you can also access the updater by selecting
<strong>Window</strong> > <strong>Android SDK
Manager</strong>.</p>
@@ -552,9 +552,9 @@
<h2 id="filtering">Filtering the Reference Documentation by API Level</h2>
<p>Reference documentation pages on the Android Developers site offer a "Filter
-by API Level" control in the top-right area of each page. You can use the
-control to show documentation only for parts of the API that are actually
-accessible to your application, based on the API Level that it specifies in
+by API Level" control in the top-right area of each page. You can use the
+control to show documentation only for parts of the API that are actually
+accessible to your application, based on the API Level that it specifies in
the <code>android:minSdkVersion</code> attribute of its manifest file. </p>
<p>To use filtering, select the checkbox to enable filtering, just below the
@@ -574,10 +574,10 @@
</p>
<p>Also note that the reference documentation for individual API elements
-specifies the API Level at which each element was introduced. The API Level
-for packages and classes is specified as "Since <api level>" at the
-top-right corner of the content area on each documentation page. The API Level
-for class members is specified in their detailed description headers,
+specifies the API Level at which each element was introduced. The API Level
+for packages and classes is specified as "Since <api level>" at the
+top-right corner of the content area on each documentation page. The API Level
+for class members is specified in their detailed description headers,
at the right margin. </p>
diff --git a/docs/html/guide/topics/ui/notifiers/notifications.jd b/docs/html/guide/topics/ui/notifiers/notifications.jd
index 4a4b1d5..05ec279 100644
--- a/docs/html/guide/topics/ui/notifiers/notifications.jd
+++ b/docs/html/guide/topics/ui/notifiers/notifications.jd
@@ -355,7 +355,7 @@
new NotificationCompat.InboxStyle();
String[] events = new String[6];
// Sets a title for the Inbox style big view
-inboxStyle.SetBigContentTitle("Event tracker details:");
+inboxStyle.setBigContentTitle("Event tracker details:");
...
// Moves events into the big view
for (int i=0; i < events.length; i++) {
diff --git a/docs/html/images/home/io-logo-2013.png b/docs/html/images/home/io-logo-2013.png
new file mode 100644
index 0000000..c95719e
--- /dev/null
+++ b/docs/html/images/home/io-logo-2013.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index afda7a9..a0029b5 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -13,6 +13,21 @@
<div class="frame">
<ul>
<li class="item carousel-home">
+ <div class="content-left col-10">
+ <img src="{@docRoot}images/home/io-logo-2013.png" style="margin:40px 0 0">
+ </div>
+ <div class="content-right col-5">
+ <h1>Google I/O 2013</h1>
+ <p>Android will be at Google I/O on May 15-17, 2013, with sessions covering a variety of topics
+ such as design, performance, and how to extend your app with the latest Android features.
+ Registration opens on March 13, 2013 at 7:00 AM PDT (GMT-7).</p>
+ <p>For more information about event details and planned sessions,
+ stay tuned to <a
+ href="http://google.com/+GoogleDevelopers">+Google Developers</a>.</p>
+ <p><a href="https://developers.google.com/events/io/" class="button">Register here</a></p>
+ </div>
+ </li>
+ <li class="item carousel-home">
<div class="content-left col-11" style="padding-top:65px;">
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<div style="box-shadow: 3px 10px 18px 1px #999;width:600px;height:338px">
@@ -80,18 +95,6 @@
</li>
<li class="item carousel-home">
<div class="content-left col-10">
- <img src="{@docRoot}images/home/google-io.png">
- </div>
- <div class="content-right col-5">
- <h1>Android videos<br/> from Google I/O!</h1>
- <p>If you couldn't make it to Google I/O this year or want to review some of the material,
- all of the Android sessions are now available for viewing online.</p>
- <p><a href="http://www.youtube.com/playlist?list=PL4C6BCDE45E05F49E&feature=plcp"
-class="button">Watch the Android sessions</a></p>
- </div>
- </li>
- <li class="item carousel-home">
- <div class="content-left col-10">
<img src="{@docRoot}images/home/google-play.png"
style="margin-top:50px">
</div>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 6307c69..315c977 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -4,25 +4,25 @@
page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
-sdk.linux32_bundle_download=adt-bundle-linux-x86.zip
-sdk.linux32_bundle_bytes=418614971
-sdk.linux32_bundle_checksum=24506708af221a887326c2a9ca9625dc
+sdk.linux32_bundle_download=adt-bundle-linux-x86-20130219.zip
+sdk.linux32_bundle_bytes=418664018
+sdk.linux32_bundle_checksum=e56ebb5c8eb84eb3227cf7c255373f4b
-sdk.linux64_bundle_download=adt-bundle-linux-x86_64.zip
-sdk.linux64_bundle_bytes=418889835
-sdk.linux64_bundle_checksum=464c1fbe92ea293d6b2292c27af5066a
+sdk.linux64_bundle_download=adt-bundle-linux-x86_64-20130219.zip
+sdk.linux64_bundle_bytes=418939098
+sdk.linux64_bundle_checksum=90cb420934170787938d0477c1a83a7f
-sdk.mac64_bundle_download=adt-bundle-mac-x86_64.zip
-sdk.mac64_bundle_bytes=390649300
-sdk.mac64_bundle_checksum=f557bc61a4bff466633037839771bffb
+sdk.mac64_bundle_download=adt-bundle-mac-x86_64-20130219.zip
+sdk.mac64_bundle_bytes=390697025
+sdk.mac64_bundle_checksum=b768c28f380c1846479664c4790e9c53
-sdk.win32_bundle_download=adt-bundle-windows-x86.zip
-sdk.win32_bundle_bytes=425429957
-sdk.win32_bundle_checksum=cca97f12904774385a57d542e70a490f
+sdk.win32_bundle_download=adt-bundle-windows-x86-20130219.zip
+sdk.win32_bundle_bytes=425487608
+sdk.win32_bundle_checksum=4a40039f28048e6d7b2440adf55b8321
-sdk.win64_bundle_download=adt-bundle-windows-x86_64.zip
-sdk.win64_bundle_bytes=425553759
-sdk.win64_bundle_checksum=c51679f4517e1c3ddefa1e662bbf17f6
+sdk.win64_bundle_download=adt-bundle-windows-x86_64-20130219.zip
+sdk.win64_bundle_bytes=425611626
+sdk.win64_bundle_checksum=891f79816b4d19042faab26d670f4f77
diff --git a/docs/html/tools/debugging/debugging-tracing.jd b/docs/html/tools/debugging/debugging-tracing.jd
index f0d0c0b..7d750cf 100644
--- a/docs/html/tools/debugging/debugging-tracing.jd
+++ b/docs/html/tools/debugging/debugging-tracing.jd
@@ -18,15 +18,6 @@
</ol>
</li>
- <li>
- <a href="#format">Traceview File Format</a>
- <ol>
- <li><a href="#datafileformat">Data File Format</a></li>
-
- <li><a href="#keyfileformat">Key File Format</a></li>
- </ol>
- </li>
-
<li><a href="#creatingtracefiles">Creating Trace Files</a></li>
<li><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></li>
@@ -95,114 +86,6 @@
height="630" />
<p class="img-caption"><strong>Figure 2.</strong> The Traceview Profile Panel</p>
- <h2 id="format">Traceview File Format</h2>
-
- <p>Tracing creates two distinct pieces of output: a <em>data</em> file, which holds the trace
- data, and a <em>key</em> file, which provides a mapping from binary identifiers to thread and
- method names. The files are concatenated when tracing completes, into a single <em>.trace</em>
- file.</p>
-
- <p class="note"><strong>Note:</strong> The previous version of Traceview did not concatenate
- these files for you. If you have old key and data files that you'd still like to trace, you can
- concatenate them yourself with <code>cat mytrace.key mytrace.data >
- mytrace.trace</code>.</p>
-
- <h3 id="datafileformat">Data File Format</h3>
-
- <p>The data file is binary, structured as follows (all values are stored in little-endian
- order):</p>
- <pre>
-* File format:
-* header
-* record 0
-* record 1
-* ...
-*
-* Header format:
-* u4 magic 0x574f4c53 ('SLOW')
-* u2 version
-* u2 offset to data
-* u8 start date/time in usec
-*
-* Record format:
-* u1 thread ID
-* u4 method ID | method action
-* u4 time delta since start, in usec
-</pre>
-
- <p>The application is expected to parse all of the header fields, then seek to "offset to data"
- from the start of the file. From there it just reads 9-byte records until EOF is reached.</p>
-
- <p><em>u8 start date/time in usec</em> is the output from <code>gettimeofday()</code>. It's mainly there so
- that you can tell if the output was generated yesterday or three months ago.</p>
-
- <p><em>method action</em> sits in the two least-significant bits of the <em>method</em> word. The
- currently defined meanings are:</p>
-
- <ul>
- <li>0 - method entry</li>
-
- <li>1 - method exit</li>
-
- <li>2 - method "exited" when unrolled by exception handling</li>
-
- <li>3 - (reserved)</li>
- </ul>
-
- <p>An unsigned 32-bit integer can hold about 70 minutes of time in microseconds.</p>
-
- <h3 id="keyfileformat">Key File Format</h3>
-
- <p>The key file is a plain text file divided into three sections. Each section starts with a
- keyword that begins with '*'. If you see a '*' at the start of a line, you have found the start
- of a new section.</p>
-
- <p>An example file might look like this:</p>
- <pre>
-*version
-1
-clock=global
-*threads
-1 main
-6 JDWP Handler
-5 Async GC
-4 Reference Handler
-3 Finalizer
-2 Signal Handler
-*methods
-0x080f23f8 java/io/PrintStream write ([BII)V
-0x080f25d4 java/io/PrintStream print (Ljava/lang/String;)V
-0x080f27f4 java/io/PrintStream println (Ljava/lang/String;)V
-0x080da620 java/lang/RuntimeException <init> ()V
-[...]
-0x080f630c android/os/Debug startMethodTracing ()V
-0x080f6350 android/os/Debug startMethodTracing (Ljava/lang/String;Ljava/lang/String;I)V
-*end
-</pre>
-<p>The following list describes the major sections of a key file:</p>
- <dl>
- <dt><em>version section</em></dt>
-
- <dd>The first line is the file version number, currently 1. The second line,
- <code>clock=global</code>, indicates that we use a common clock across all threads. A future
- version may use per-thread CPU time counters that are independent for every thread.</dd>
-
- <dt><em>threads section</em></dt>
-
- <dd>One line per thread. Each line consists of two parts: the thread ID, followed by a tab,
- followed by the thread name. There are few restrictions on what a valid thread name is, so
- include everything to the end of the line.</dd>
-
- <dt><em>methods section</em></dt>
-
- <dd>One line per method entry or exit. A line consists of four pieces, separated by tab marks:
- <em>method-ID</em> [TAB] <em>class-name</em> [TAB] <em>method-name</em> [TAB]
- <em>signature</em> . Only the methods that were actually entered or exited are included in the
- list. Note that all three identifiers are required to uniquely identify a method.</dd>
- </dl>
-
- <p>Neither the threads nor methods sections are sorted.</p>
-
<h2 id="creatingtracefiles">Creating Trace Files</h2>
<p>To use Traceview, you need to generate log files containing the trace information you want to
@@ -269,9 +152,6 @@
<p>When using the Android emulator, you must specify an SD card when you create your AVD because the trace files
are written to the SD card. Your application must have permission to write to the SD card as well.
- <p>The format of the trace files is previously described <a href="#format">in this
- document</a>.</p>
-
<h2 id="copyingfiles">Copying Trace Files to a Host Machine</h2>
<p>After your application has run and the system has created your trace files
@@ -297,7 +177,7 @@
You can use the Proguard <code>mapping.txt</code> file to figure out the original unobfuscated names. For more information
on this file, see the <a href="{@docRoot}tools/help/proguard.html">Proguard</a> documentation.</p>
- <h2 id="dmtracedump">Using dmtracdedump</h2>
+ <h2 id="dmtracedump">Using dmtracedump</h2>
<p><code>dmtracedump</code> is a tool that gives you an alternate way of generating
graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to
@@ -399,4 +279,4 @@
</ol>
</dd>
- </dl>
\ No newline at end of file
+ </dl>
diff --git a/docs/html/tools/extras/support-library.jd b/docs/html/tools/extras/support-library.jd
index 08ac172..6475e3c 100644
--- a/docs/html/tools/extras/support-library.jd
+++ b/docs/html/tools/extras/support-library.jd
@@ -46,10 +46,33 @@
<p>The sections below provide notes about successive releases of
the Support Package, as denoted by revision number.</p>
-
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt=""
+/>Support Package, revision 12</a> <em>(February 2013)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Improved interaction behavior for {@link android.support.v4.view.ViewPager}.</li>
+ <li>Fixed a bug that could cause {@link android.support.v4.view.ViewPager} to select the
+ wrong page.</li>
+ <li>Fixed use of {@link android.support.v4.view.ViewPager#removeView removeView()} method
+ during layout for {@link android.support.v4.view.ViewPager}.</li>
+ <li>Fixed issue with {@link android.support.v4.widget.SearchViewCompat} where using the
+ back button to dismiss does not clear the search text. This fix only applies to
+ host API levels 14 and higher.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
/>Support Package, revision 11</a> <em>(November 2012)</em>
</p>
<div class="toggle-content-toggleme">
@@ -119,7 +142,7 @@
<dt>Changes for v4 support library:</dt>
<dd>
<ul>
- <li>Added support for notification features introduced in Android 4.1 (API Level 16) with
+ <li>Added support for notification features introduced in Android 4.1 (API level 16) with
additions to {@link android.support.v4.app.NotificationCompat}.</li>
</ul>
</dd>
@@ -210,7 +233,7 @@
<li>Fixed intent flags for {@link android.app.PendingIntent} objects generated
by {@link android.support.v4.app.TaskStackBuilder}.</li>
<li>Removed unused attributes from the gridlayout library projects to make sure
- the library can be built with API Level 7 and higher.</li>
+ the library can be built with API level 7 and higher.</li>
<li>Added {@code .classpath} and {@code .project} files for the gridlayout
library project.</li>
</ul>
diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd
index c1bc185..31cec0e 100644
--- a/docs/html/tools/revisions/platforms.jd
+++ b/docs/html/tools/revisions/platforms.jd
@@ -44,11 +44,28 @@
SDK tools to revision 20 or later and restart the Android SDK Manager. If you do not,
the Android 4.2 system components will not be available for download.</p>
-
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png"
+class="toggle-content-img" alt="" />Revision 2</a> <em>(February 2013)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <p>Maintenance update. The system version is 4.2.2.</p>
+ <dl>
+ <dt>Dependencies:</dt>
+ <dd>SDK Tools r21 or higher is required.</dd>
+ </dl>
+
+ </div>
+</div>
+
+<div class="toggle-content closed">
+
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
class="toggle-content-img" alt="" />Revision 1</a> <em>(November 2012)</em>
</p>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index 4adb7b2..a3f53bbe 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -69,7 +69,7 @@
<li>Java 1.6 or higher is required for ADT 21.1.0.</li>
<li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 21.1.0.</li>
<li>ADT 21.1.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK
- Tools r21.1.0</a>. If you haven't already installed SDK Tools r21.1.0 into your SDK, use the
+ Tools r21.1</a>. If you haven't already installed SDK Tools r21.1 into your SDK, use the
Android SDK Manager to do so.</li>
</ul>
</dd>
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index a5b7eee..7d121844 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -28,7 +28,7 @@
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
- alt=""/>SDK Tools, Revision 21.1.0</a> <em>(February 2013)</em>
+ alt=""/>SDK Tools, Revision 21.1</a> <em>(February 2013)</em>
</p>
<div class="toggle-content-toggleme">
@@ -38,7 +38,7 @@
<dd>
<ul>
<li>Android SDK Platform-tools revision 16 or later.</li>
- <li>If you are developing in Eclipse with ADT, note that the SDK Tools r21.1.0 is
+ <li>If you are developing in Eclipse with ADT, note that the SDK Tools r21.1 is
designed for use with ADT 21.1.0 and later. If you haven't already, update your
<a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 21.1.0.</li>
<li>If you are developing outside Eclipse, you must have
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 88f1d83..5befb95 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -91,6 +91,7 @@
debugLayersUpdates = false;
debugOverdraw = false;
+ debugStencilClip = kStencilHide;
mInitialized = true;
}
@@ -132,6 +133,7 @@
bool Caches::initProperties() {
bool prevDebugLayersUpdates = debugLayersUpdates;
bool prevDebugOverdraw = debugOverdraw;
+ StencilClipDebug prevDebugStencilClip = debugStencilClip;
char property[PROPERTY_VALUE_MAX];
if (property_get(PROPERTY_DEBUG_LAYERS_UPDATES, property, NULL) > 0) {
@@ -148,8 +150,23 @@
debugOverdraw = false;
}
+ // See Properties.h for valid values
+ if (property_get(PROPERTY_DEBUG_STENCIL_CLIP, property, NULL) > 0) {
+ INIT_LOGD(" Stencil clip debug enabled: %s", property);
+ if (!strcmp(property, "hide")) {
+ debugStencilClip = kStencilHide;
+ } else if (!strcmp(property, "highlight")) {
+ debugStencilClip = kStencilShowHighlight;
+ } else if (!strcmp(property, "region")) {
+ debugStencilClip = kStencilShowRegion;
+ }
+ } else {
+ debugStencilClip = kStencilHide;
+ }
+
return (prevDebugLayersUpdates != debugLayersUpdates) ||
- (prevDebugOverdraw != debugOverdraw);
+ (prevDebugOverdraw != debugOverdraw) ||
+ (prevDebugStencilClip != debugStencilClip);
}
void Caches::terminate() {
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 0ca2ffd..c35ad883 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -245,9 +245,18 @@
// Misc
GLint maxTextureSize;
+
+ // Debugging
bool debugLayersUpdates;
bool debugOverdraw;
+ enum StencilClipDebug {
+ kStencilHide,
+ kStencilShowHighlight,
+ kStencilShowRegion
+ };
+ StencilClipDebug debugStencilClip;
+
TextureCache textureCache;
LayerCache layerCache;
RenderBufferCache renderBufferCache;
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 9a6494f..773fe82 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -48,6 +48,7 @@
#define DEBUG_RENDER_BUFFERS 0
// Turn on to make stencil operations easier to debug
+// (writes 255 instead of 1 in the buffer, forces 8 bit stencil)
#define DEBUG_STENCIL 0
// Turn on to display debug info about 9patch objects
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 1afeaf0..34d1c98 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1368,6 +1368,12 @@
drawRegionRects(*mSnapshot->clipRegion, 0xff000000, SkXfermode::kSrc_Mode, false);
mCaches.stencil.enableTest();
+
+ // Draw the region used to generate the stencil if the appropriate debug
+ // mode is enabled
+ if (mCaches.debugStencilClip == Caches::kStencilShowRegion) {
+ drawRegionRects(*mSnapshot->clipRegion, 0x7f0000ff, SkXfermode::kSrcOver_Mode);
+ }
} else {
mCaches.stencil.disable();
}
@@ -1515,12 +1521,20 @@
}
setStencilFromClip();
}
+
mDescription.reset();
+
mSetShaderColor = false;
mColorSet = false;
mColorA = mColorR = mColorG = mColorB = 0.0f;
mTextureUnit = 0;
mTrackDirtyRegions = true;
+
+ // Enable debug highlight when what we're about to draw is tested against
+ // the stencil buffer and if stencil highlight debugging is on
+ mDescription.hasDebugHighlight = !mCaches.debugOverdraw &&
+ mCaches.debugStencilClip == Caches::kStencilShowHighlight &&
+ mCaches.stencil.isTestEnabled();
}
void OpenGLRenderer::setupDrawWithTexture(bool isAlpha8) {
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index 7b67b3c..13ee336 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -83,6 +83,8 @@
#define PROGRAM_HAS_COLORS 42
+#define PROGRAM_HAS_DEBUG_HIGHLIGHT 43
+
///////////////////////////////////////////////////////////////////////////////
// Types
///////////////////////////////////////////////////////////////////////////////
@@ -159,6 +161,8 @@
bool hasGammaCorrection;
float gamma;
+ bool hasDebugHighlight;
+
/**
* Resets this description. All fields are reset back to the default
* values they hold after building a new instance.
@@ -199,6 +203,8 @@
hasGammaCorrection = false;
gamma = 2.2f;
+
+ hasDebugHighlight = false;
}
/**
@@ -267,6 +273,7 @@
if (hasGammaCorrection) key |= programid(0x1) << PROGRAM_HAS_GAMMA_CORRECTION;
if (isSimpleGradient) key |= programid(0x1) << PROGRAM_IS_SIMPLE_GRADIENT;
if (hasColors) key |= programid(0x1) << PROGRAM_HAS_COLORS;
+ if (hasDebugHighlight) key |= programid(0x1) << PROGRAM_HAS_DEBUG_HIGHLIGHT;
return key;
}
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 74d598d..0f014cb 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -351,6 +351,8 @@
// PorterDuff
" fragColor = blendColors(colorBlend, fragColor);\n"
};
+const char* gFS_Main_DebugHighlight =
+ " gl_FragColor.rgb = vec3(0.0, gl_FragColor.a, 0.0);\n";
const char* gFS_Footer =
"}\n\n";
@@ -604,7 +606,8 @@
// Optimization for common cases
if (!description.isAA && !blendFramebuffer && !description.hasColors &&
- description.colorOp == ProgramDescription::kColorNone && !description.isPoint) {
+ description.colorOp == ProgramDescription::kColorNone &&
+ !description.isPoint && !description.hasDebugHighlight) {
bool fast = false;
const bool noShader = !description.hasGradient && !description.hasBitmap;
@@ -752,6 +755,9 @@
if (description.hasColors) {
shader.append(gFS_Main_FragColor_HasColors);
}
+ if (description.hasDebugHighlight) {
+ shader.append(gFS_Main_DebugHighlight);
+ }
}
// End the shader
shader.append(gFS_Footer);
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index f3957cf..b8559bc8 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -68,6 +68,20 @@
#define PROPERTY_DEBUG_OVERDRAW "debug.hwui.show_overdraw"
/**
+ * Used to enable/disable non-rectangular clipping debugging.
+ *
+ * The accepted values are:
+ * "highlight", drawing commands clipped by the stencil will
+ * be colored differently
+ * "region", renders the clipping region on screen whenever
+ * the stencil is set
+ * "hide", don't show the clip
+ *
+ * The default value is "hide".
+ */
+#define PROPERTY_DEBUG_STENCIL_CLIP "debug.hwui.show_non_rect_clip"
+
+/**
* Used to enable/disable scissor optimization. The accepted values are
* "true" and "false". The default value is "false".
*
diff --git a/libs/hwui/Stencil.h b/libs/hwui/Stencil.h
index 047f7ee..83ad668 100644
--- a/libs/hwui/Stencil.h
+++ b/libs/hwui/Stencil.h
@@ -87,6 +87,13 @@
return mState != kDisabled;
}
+ /**
+ * Indicates whether testing only is enabled.
+ */
+ bool isTestEnabled() {
+ return mState == kTest;
+ }
+
private:
void enable();
diff --git a/opengl/java/android/opengl/GLES10.java b/opengl/java/android/opengl/GLES10.java
index 790acbd..db52b82 100644
--- a/opengl/java/android/opengl/GLES10.java
+++ b/opengl/java/android/opengl/GLES10.java
@@ -669,22 +669,6 @@
java.nio.IntBuffer params
);
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
// C function const GLubyte * glGetString ( GLenum name )
public static native String glGetString(
diff --git a/opengl/java/android/opengl/GLES20.java b/opengl/java/android/opengl/GLES20.java
index e99d412..dd9f8b8 100644
--- a/opengl/java/android/opengl/GLES20.java
+++ b/opengl/java/android/opengl/GLES20.java
@@ -1024,22 +1024,6 @@
java.nio.IntBuffer params
);
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
// C function void glGetProgramInfoLog( GLuint program, GLsizei maxLength, GLsizei * length,
// GLchar * infoLog);
@@ -1080,22 +1064,6 @@
java.nio.IntBuffer params
);
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
// C function void glGetShaderInfoLog( GLuint shader, GLsizei maxLength, GLsizei * length,
// GLchar * infoLog);
@@ -1147,22 +1115,6 @@
public static native String glGetShaderSource(
int shader
);
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
// C function const GLubyte * glGetString ( GLenum name )
public static native String glGetString(
@@ -1415,22 +1367,6 @@
int length
);
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
// C function void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint* length )
public static native void glShaderSource(
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java
index 621e662..4a67997 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java
@@ -16,8 +16,6 @@
package com.android.providers.settings;
-import java.util.Locale;
-
import android.app.ActivityManagerNative;
import android.app.IActivityManager;
import android.app.backup.IBackupManager;
@@ -28,9 +26,12 @@
import android.os.IPowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.UserManager;
import android.provider.Settings;
import android.text.TextUtils;
+import java.util.Locale;
+
public class SettingsHelper {
private Context mContext;
private AudioManager mAudioManager;
@@ -96,6 +97,10 @@
}
private void setGpsLocation(String value) {
+ UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
+ if (! um.isLocationSharingToggleAllowed()) {
+ return;
+ }
final String GPS = LocationManager.GPS_PROVIDER;
boolean enabled =
GPS.equals(value) ||
diff --git a/services/java/com/android/server/NativeDaemonConnector.java b/services/java/com/android/server/NativeDaemonConnector.java
index 5e94a9fc..c3f2afa 100644
--- a/services/java/com/android/server/NativeDaemonConnector.java
+++ b/services/java/com/android/server/NativeDaemonConnector.java
@@ -206,18 +206,19 @@
/**
* Make command for daemon, escaping arguments as needed.
*/
- private void makeCommand(StringBuilder builder, String cmd, Object... args)
- throws NativeDaemonConnectorException {
- // TODO: eventually enforce that cmd doesn't contain arguments
+ private void makeCommand(StringBuilder builder, String cmd, Object... args) {
if (cmd.indexOf('\0') >= 0) {
- throw new IllegalArgumentException("unexpected command: " + cmd);
+ throw new IllegalArgumentException("Unexpected command: " + cmd);
+ }
+ if (cmd.indexOf(' ') >= 0) {
+ throw new IllegalArgumentException("Arguments must be separate from command");
}
builder.append(cmd);
for (Object arg : args) {
final String argString = String.valueOf(arg);
if (argString.indexOf('\0') >= 0) {
- throw new IllegalArgumentException("unexpected argument: " + arg);
+ throw new IllegalArgumentException("Unexpected argument: " + arg);
}
builder.append(' ');
@@ -240,7 +241,8 @@
/**
* Issue the given command to the native daemon and return a single expected
- * response.
+ * response. Any arguments must be separated from base command so they can
+ * be properly escaped.
*
* @throws NativeDaemonConnectorException when problem communicating with
* native daemon, or if the response matches
@@ -274,7 +276,8 @@
/**
* Issue the given command to the native daemon and return any
* {@link NativeDaemonEvent#isClassContinue()} responses, including the
- * final terminal response.
+ * final terminal response. Any arguments must be separated from base
+ * command so they can be properly escaped.
*
* @throws NativeDaemonConnectorException when problem communicating with
* native daemon, or if the response matches
@@ -287,10 +290,11 @@
}
/**
- * Issue the given command to the native daemon and return any
- * {@linke NativeDaemonEvent@isClassContinue()} responses, including the
- * final terminal response. Note that the timeout does not count time in
- * deep sleep.
+ * Issue the given command to the native daemon and return any {@linke
+ * NativeDaemonEvent@isClassContinue()} responses, including the final
+ * terminal response. Note that the timeout does not count time in deep
+ * sleep. Any arguments must be separated from base command so they can be
+ * properly escaped.
*
* @throws NativeDaemonConnectorException when problem communicating with
* native daemon, or if the response matches
@@ -353,51 +357,6 @@
}
/**
- * Issue a command to the native daemon and return the raw responses.
- *
- * @deprecated callers should move to {@link #execute(String, Object...)}
- * which returns parsed {@link NativeDaemonEvent}.
- */
- @Deprecated
- public ArrayList<String> doCommand(String cmd) throws NativeDaemonConnectorException {
- final ArrayList<String> rawEvents = Lists.newArrayList();
- final NativeDaemonEvent[] events = executeForList(cmd);
- for (NativeDaemonEvent event : events) {
- rawEvents.add(event.getRawEvent());
- }
- return rawEvents;
- }
-
- /**
- * Issues a list command and returns the cooked list of all
- * {@link NativeDaemonEvent#getMessage()} which match requested code.
- */
- @Deprecated
- public String[] doListCommand(String cmd, int expectedCode)
- throws NativeDaemonConnectorException {
- final ArrayList<String> list = Lists.newArrayList();
-
- final NativeDaemonEvent[] events = executeForList(cmd);
- for (int i = 0; i < events.length - 1; i++) {
- final NativeDaemonEvent event = events[i];
- final int code = event.getCode();
- if (code == expectedCode) {
- list.add(event.getMessage());
- } else {
- throw new NativeDaemonConnectorException(
- "unexpected list response " + code + " instead of " + expectedCode);
- }
- }
-
- final NativeDaemonEvent finalEvent = events[events.length - 1];
- if (!finalEvent.isClassOk()) {
- throw new NativeDaemonConnectorException("unexpected final event: " + finalEvent);
- }
-
- return list.toArray(new String[list.size()]);
- }
-
- /**
* Append the given argument to {@link StringBuilder}, escaping as needed,
* and surrounding with quotes when it contains spaces.
*/
@@ -444,7 +403,8 @@
}
/**
- * Command builder that handles argument list building.
+ * Command builder that handles argument list building. Any arguments must
+ * be separated from base command so they can be properly escaped.
*/
public static class Command {
private String mCmd;
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 25ed27a..5630b08 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -25,8 +25,6 @@
import static android.net.TrafficStats.UID_TETHERING;
import static com.android.server.NetworkManagementService.NetdResponseCode.InterfaceGetCfgResult;
import static com.android.server.NetworkManagementService.NetdResponseCode.InterfaceListResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.InterfaceRxThrottleResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.InterfaceTxThrottleResult;
import static com.android.server.NetworkManagementService.NetdResponseCode.IpFwdStatusResult;
import static com.android.server.NetworkManagementService.NetdResponseCode.TetherDnsFwdTgtListResult;
import static com.android.server.NetworkManagementService.NetdResponseCode.TetherInterfaceListResult;
@@ -121,8 +119,6 @@
public static final int SoftapStatusResult = 214;
public static final int InterfaceRxCounterResult = 216;
public static final int InterfaceTxCounterResult = 217;
- public static final int InterfaceRxThrottleResult = 218;
- public static final int InterfaceTxThrottleResult = 219;
public static final int QuotaCounterResult = 220;
public static final int TetheringStatsResult = 221;
public static final int DnsProxyQueryResult = 222;
@@ -836,31 +832,28 @@
}
// TODO(BT) Remove
- public void startReverseTethering(String iface)
- throws IllegalStateException {
- if (DBG) Slog.d(TAG, "startReverseTethering in");
+ @Override
+ public void startReverseTethering(String iface) {
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
// cmd is "tether start first_start first_stop second_start second_stop ..."
// an odd number of addrs will fail
- String cmd = "tether start-reverse";
- cmd += " " + iface;
- if (DBG) Slog.d(TAG, "startReverseTethering cmd: " + cmd);
try {
- mConnector.doCommand(cmd);
+ mConnector.execute("tether", "start-reverse", iface);
} catch (NativeDaemonConnectorException e) {
- throw new IllegalStateException("Unable to communicate to native daemon");
+ throw e.rethrowAsParcelableException();
}
BluetoothTetheringDataTracker.getInstance().startReverseTether(iface);
}
// TODO(BT) Remove
- public void stopReverseTethering() throws IllegalStateException {
+ @Override
+ public void stopReverseTethering() {
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
try {
- mConnector.doCommand("tether stop-reverse");
+ mConnector.execute("tether", "stop-reverse");
} catch (NativeDaemonConnectorException e) {
- throw new IllegalStateException("Unable to communicate to native daemon to stop tether");
+ throw e.rethrowAsParcelableException();
}
BluetoothTetheringDataTracker.getInstance().stopReverseTether();
}
@@ -1506,6 +1499,7 @@
}
/** {@inheritDoc} */
+ @Override
public void monitor() {
if (mConnector != null) {
mConnector.monitor();
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 22af3d5..f226683 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -37,7 +37,6 @@
import android.app.Activity;
import android.app.ActivityManager;
-import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.app.ActivityThread;
@@ -197,7 +196,7 @@
static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
static final boolean DEBUG_MU = localLOGV || false;
static final boolean DEBUG_IMMERSIVE = localLOGV || false;
- static final boolean VALIDATE_TOKENS = true;
+ static final boolean VALIDATE_TOKENS = false;
static final boolean SHOW_ACTIVITY_START_TIME = true;
// Control over CPU and battery monitoring.
@@ -329,7 +328,7 @@
/**
* List of intents that were used to start the most recent tasks.
*/
- private final ArrayList<TaskRecord> mRecentTasks = new ArrayList<TaskRecord>();
+ final ArrayList<TaskRecord> mRecentTasks = new ArrayList<TaskRecord>();
public class PendingActivityExtras extends Binder implements Runnable {
public final ActivityRecord activity;
@@ -597,8 +596,13 @@
* List of PendingThumbnailsRecord objects of clients who are still
* waiting to receive all of the thumbnails for a task.
*/
- final ArrayList<PendingThumbnailsRecord> mPendingThumbnails =
- new ArrayList<PendingThumbnailsRecord>();
+ final ArrayList mPendingThumbnails = new ArrayList();
+
+ /**
+ * List of HistoryRecord objects that have been finished and must
+ * still report back to a pending thumbnail receiver.
+ */
+ final ArrayList mCancelledThumbnails = new ArrayList();
final ProviderMap mProviderMap;
@@ -2838,8 +2842,11 @@
for (int i=0; i<activities.size(); i++) {
ActivityRecord r = activities.get(i);
if (!r.finishing) {
- mMainStack.finishActivityLocked(r, Activity.RESULT_CANCELED,
- null, "finish-heavy", true);
+ int index = mMainStack.indexOfTokenLocked(r.appToken);
+ if (index >= 0) {
+ mMainStack.finishActivityLocked(r, index, Activity.RESULT_CANCELED,
+ null, "finish-heavy", true);
+ }
}
}
@@ -2925,13 +2932,22 @@
}
}
- @Override
public boolean willActivityBeVisible(IBinder token) {
synchronized(this) {
- return mMainStack.willActivityBeVisibleLocked(token);
+ int i;
+ for (i=mMainStack.mHistory.size()-1; i>=0; i--) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
+ if (r.appToken == token) {
+ return true;
+ }
+ if (r.fullscreen && !r.finishing) {
+ return false;
+ }
+ }
+ return true;
}
}
-
+
public void overridePendingTransition(IBinder token, String packageName,
int enterAnim, int exitAnim) {
synchronized(this) {
@@ -3701,7 +3717,13 @@
}
mWindowManager.closeSystemDialogs(reason);
- mMainStack.closeSystemDialogsLocked();
+ for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
+ if ((r.info.flags&ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS) != 0) {
+ r.stack.finishActivityLocked(r, i,
+ Activity.RESULT_CANCELED, null, "close-sys", true);
+ }
+ }
broadcastIntentLocked(null, null, intent, null,
null, 0, null, null, null, AppOpsManager.OP_NONE, false, false, -1,
@@ -3908,12 +3930,37 @@
boolean didSomething = killPackageProcessesLocked(name, appId, userId,
-100, callerWillRestart, true, doit, evenPersistent,
name == null ? ("force stop user " + userId) : ("force stop " + name));
-
- if (mMainStack.forceStopPackageLocked(name, doit, evenPersistent, userId)) {
- if (!doit) {
- return true;
+
+ TaskRecord lastTask = null;
+ for (i=0; i<mMainStack.mHistory.size(); i++) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
+ final boolean samePackage = r.packageName.equals(name)
+ || (name == null && r.userId == userId);
+ if ((userId == UserHandle.USER_ALL || r.userId == userId)
+ && (samePackage || r.task == lastTask)
+ && (r.app == null || evenPersistent || !r.app.persistent)) {
+ if (!doit) {
+ if (r.finishing) {
+ // If this activity is just finishing, then it is not
+ // interesting as far as something to stop.
+ continue;
+ }
+ return true;
+ }
+ didSomething = true;
+ Slog.i(TAG, " Force finishing activity " + r);
+ if (samePackage) {
+ if (r.app != null) {
+ r.app.removed = true;
+ }
+ r.app = null;
+ }
+ lastTask = r.task;
+ if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
+ null, "force-stop", true)) {
+ i--;
+ }
}
- didSomething = true;
}
if (mServices.forceStopLocked(name, userId, evenPersistent, doit)) {
@@ -5623,12 +5670,12 @@
// TASK MANAGEMENT
// =========================================================
- @Override
- public List<RunningTaskInfo> getTasks(int maxNum, int flags,
+ public List getTasks(int maxNum, int flags,
IThumbnailReceiver receiver) {
- ArrayList<RunningTaskInfo> list = new ArrayList<RunningTaskInfo>();
+ ArrayList list = new ArrayList();
- PendingThumbnailsRecord pending = new PendingThumbnailsRecord(receiver);
+ PendingThumbnailsRecord pending = null;
+ IApplicationThread topThumbnail = null;
ActivityRecord topRecord = null;
synchronized(this) {
@@ -5654,19 +5701,88 @@
throw new SecurityException(msg);
}
- topRecord = mMainStack.getTasksLocked(maxNum, receiver, pending, list);
+ int pos = mMainStack.mHistory.size()-1;
+ ActivityRecord next =
+ pos >= 0 ? (ActivityRecord)mMainStack.mHistory.get(pos) : null;
+ ActivityRecord top = null;
+ TaskRecord curTask = null;
+ int numActivities = 0;
+ int numRunning = 0;
+ while (pos >= 0 && maxNum > 0) {
+ final ActivityRecord r = next;
+ pos--;
+ next = pos >= 0 ? (ActivityRecord)mMainStack.mHistory.get(pos) : null;
- if (!pending.pendingRecords.isEmpty()) {
+ // Initialize state for next task if needed.
+ if (top == null ||
+ (top.state == ActivityState.INITIALIZING
+ && top.task == r.task)) {
+ top = r;
+ curTask = r.task;
+ numActivities = numRunning = 0;
+ }
+
+ // Add 'r' into the current task.
+ numActivities++;
+ if (r.app != null && r.app.thread != null) {
+ numRunning++;
+ }
+
+ if (localLOGV) Slog.v(
+ TAG, r.intent.getComponent().flattenToShortString()
+ + ": task=" + r.task);
+
+ // If the next one is a different task, generate a new
+ // TaskInfo entry for what we have.
+ if (next == null || next.task != curTask) {
+ ActivityManager.RunningTaskInfo ci
+ = new ActivityManager.RunningTaskInfo();
+ ci.id = curTask.taskId;
+ ci.baseActivity = r.intent.getComponent();
+ ci.topActivity = top.intent.getComponent();
+ if (top.thumbHolder != null) {
+ ci.description = top.thumbHolder.lastDescription;
+ }
+ ci.numActivities = numActivities;
+ ci.numRunning = numRunning;
+ //System.out.println(
+ // "#" + maxNum + ": " + " descr=" + ci.description);
+ if (ci.thumbnail == null && receiver != null) {
+ if (localLOGV) Slog.v(
+ TAG, "State=" + top.state + "Idle=" + top.idle
+ + " app=" + top.app
+ + " thr=" + (top.app != null ? top.app.thread : null));
+ if (top.state == ActivityState.RESUMED
+ || top.state == ActivityState.PAUSING) {
+ if (top.idle && top.app != null
+ && top.app.thread != null) {
+ topRecord = top;
+ topThumbnail = top.app.thread;
+ } else {
+ top.thumbnailNeeded = true;
+ }
+ }
+ if (pending == null) {
+ pending = new PendingThumbnailsRecord(receiver);
+ }
+ pending.pendingRecords.add(top);
+ }
+ list.add(ci);
+ maxNum--;
+ top = null;
+ }
+ }
+
+ if (pending != null) {
mPendingThumbnails.add(pending);
}
}
if (localLOGV) Slog.v(TAG, "We have pending thumbnails: " + pending);
- if (topRecord != null) {
+ if (topThumbnail != null) {
if (localLOGV) Slog.v(TAG, "Requesting top thumbnail");
try {
- IApplicationThread topThumbnail = topRecord.app.thread;
topThumbnail.requestThumbnail(topRecord.appToken);
} catch (Exception e) {
Slog.w(TAG, "Exception thrown when requesting thumbnail", e);
@@ -5901,6 +6017,43 @@
return false;
}
+ private final int findAffinityTaskTopLocked(int startIndex, String affinity) {
+ int j;
+ TaskRecord startTask = ((ActivityRecord)mMainStack.mHistory.get(startIndex)).task;
+ TaskRecord jt = startTask;
+
+ // First look backwards
+ for (j=startIndex-1; j>=0; j--) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(j);
+ if (r.task != jt) {
+ jt = r.task;
+ if (affinity.equals(jt.affinity)) {
+ return j;
+ }
+ }
+ }
+
+ // Now look forwards
+ final int N = mMainStack.mHistory.size();
+ jt = startTask;
+ for (j=startIndex+1; j<N; j++) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(j);
+ if (r.task != jt) {
+ if (affinity.equals(jt.affinity)) {
+ return j;
+ }
+ jt = r.task;
+ }
+ }
+
+ // Might it be at the top?
+ if (affinity.equals(((ActivityRecord)mMainStack.mHistory.get(N-1)).task.affinity)) {
+ return N-1;
+ }
+
+ return -1;
+ }
+
/**
* TODO: Add mController hook
*/
@@ -5929,8 +6082,20 @@
mMainStack.moveTaskToFrontLocked(tr, null, options);
return;
}
- if (mMainStack.findTaskToMoveToFrontLocked(task, flags, options)) {
- return;
+ for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
+ ActivityRecord hr = (ActivityRecord)mMainStack.mHistory.get(i);
+ if (hr.task.taskId == task) {
+ if ((flags&ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
+ mMainStack.mUserLeaving = true;
+ }
+ if ((flags&ActivityManager.MOVE_TASK_WITH_HOME) != 0) {
+ // Caller wants the home activity moved with it. To accomplish this,
+ // we'll just move the home task to the top first.
+ mMainStack.moveHomeToFrontLocked();
+ }
+ mMainStack.moveTaskToFrontLocked(hr.task, null, options);
+ return;
+ }
}
} finally {
Binder.restoreCallingIdentity(origId);
@@ -5970,7 +6135,7 @@
enforceNotIsolatedCaller("moveActivityTaskToBack");
synchronized(this) {
final long origId = Binder.clearCallingIdentity();
- int taskId = mMainStack.getTaskForActivityLocked(token, !nonRoot);
+ int taskId = getTaskForActivityLocked(token, !nonRoot);
if (taskId >= 0) {
return mMainStack.moveTaskToBackLocked(taskId, null);
}
@@ -6000,10 +6165,27 @@
public int getTaskForActivity(IBinder token, boolean onlyRoot) {
synchronized(this) {
- return mMainStack.getTaskForActivityLocked(token, onlyRoot);
+ return getTaskForActivityLocked(token, onlyRoot);
}
}
+ int getTaskForActivityLocked(IBinder token, boolean onlyRoot) {
+ final int N = mMainStack.mHistory.size();
+ TaskRecord lastTask = null;
+ for (int i=0; i<N; i++) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
+ if (r.appToken == token) {
+ if (!onlyRoot || lastTask != r.task) {
+ return r.task.taskId;
+ }
+ return -1;
+ }
+ lastTask = r.task;
+ }
+
+ return -1;
+ }
+
// =========================================================
// THUMBNAILS
// =========================================================
@@ -6909,10 +7091,13 @@
"unhandledBack()");
synchronized(this) {
- final long origId = Binder.clearCallingIdentity();
- try {
- mMainStack.unhandledBackLocked();
- } finally {
+ int count = mMainStack.mHistory.size();
+ if (DEBUG_SWITCH) Slog.d(
+ TAG, "Performing unhandledBack(): stack size = " + count);
+ if (count > 1) {
+ final long origId = Binder.clearCallingIdentity();
+ mMainStack.finishActivityLocked((ActivityRecord)mMainStack.mHistory.get(count-1),
+ count-1, Activity.RESULT_CANCELED, null, "unhandled-back", true);
Binder.restoreCallingIdentity(origId);
}
}
@@ -7974,7 +8159,15 @@
+ " has crashed too many times: killing!");
EventLog.writeEvent(EventLogTags.AM_PROCESS_CRASHED_TOO_MUCH,
app.userId, app.info.processName, app.uid);
- mMainStack.handleAppCrashLocked(app);
+ for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
+ ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
+ if (r.app == app) {
+ Slog.w(TAG, " Force finishing activity "
+ + r.intent.getComponent().flattenToShortString());
+ r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
+ null, "crashed", false);
+ }
+ }
if (!app.persistent) {
// We don't want to start this process again until the user
// explicitly does so... but for persistent process, we really
@@ -7999,7 +8192,33 @@
}
mMainStack.resumeTopActivityLocked(null);
} else {
- mMainStack.finishTopRunningActivityLocked(app);
+ ActivityRecord r = mMainStack.topRunningActivityLocked(null);
+ if (r != null && r.app == app) {
+ // If the top running activity is from this crashing
+ // process, then terminate it to avoid getting in a loop.
+ Slog.w(TAG, " Force finishing activity "
+ + r.intent.getComponent().flattenToShortString());
+ int index = mMainStack.indexOfActivityLocked(r);
+ r.stack.finishActivityLocked(r, index,
+ Activity.RESULT_CANCELED, null, "crashed", false);
+ // Also terminate any activities below it that aren't yet
+ // stopped, to avoid a situation where one will get
+ // re-start our crashing activity once it gets resumed again.
+ index--;
+ if (index >= 0) {
+ r = (ActivityRecord)mMainStack.mHistory.get(index);
+ if (r.state == ActivityState.RESUMED
+ || r.state == ActivityState.PAUSING
+ || r.state == ActivityState.PAUSED) {
+ if (!r.isHomeActivity || mHomeProcess != r.app) {
+ Slog.w(TAG, " Force finishing activity "
+ + r.intent.getComponent().flattenToShortString());
+ r.stack.finishActivityLocked(r, index,
+ Activity.RESULT_CANCELED, null, "crashed", false);
+ }
+ }
+ }
+ }
}
// Bump up the crash count of any services currently running in the proc.
@@ -9018,7 +9237,8 @@
int opti, boolean dumpAll, boolean dumpClient, String dumpPackage) {
pw.println("ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)");
pw.println(" Main stack:");
- mMainStack.dumpActivitiesLocked(fd, pw, dumpAll, dumpClient, dumpPackage);
+ dumpHistoryList(fd, pw, mMainStack.mHistory, " ", "Hist", true, !dumpAll, dumpClient,
+ dumpPackage);
pw.println(" ");
pw.println(" Running activities (most recent first):");
dumpHistoryList(fd, pw, mMainStack.mLRUActivities, " ", "Run", false, !dumpAll, false,
@@ -9548,10 +9768,32 @@
*/
protected boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args,
int opti, boolean dumpAll) {
- ArrayList<ActivityRecord> activities;
-
- synchronized (this) {
- activities = mMainStack.getDumpActivitiesLocked(name);
+ ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>();
+
+ if ("all".equals(name)) {
+ synchronized (this) {
+ for (ActivityRecord r1 : (ArrayList<ActivityRecord>)mMainStack.mHistory) {
+ activities.add(r1);
+ }
+ }
+ } else if ("top".equals(name)) {
+ synchronized (this) {
+ final int N = mMainStack.mHistory.size();
+ if (N > 0) {
+ activities.add((ActivityRecord)mMainStack.mHistory.get(N-1));
+ }
+ }
+ } else {
+ ItemMatcher matcher = new ItemMatcher();
+ matcher.build(name);
+
+ synchronized (this) {
+ for (ActivityRecord r1 : (ArrayList<ActivityRecord>)mMainStack.mHistory) {
+ if (matcher.match(r1, r1.intent.getComponent())) {
+ activities.add(r1);
+ }
+ }
+ }
}
if (activities.size() <= 0) {
@@ -9803,7 +10045,7 @@
return needSep;
}
- static final void dumpHistoryList(FileDescriptor fd, PrintWriter pw, List list,
+ private static final void dumpHistoryList(FileDescriptor fd, PrintWriter pw, List list,
String prefix, String label, boolean complete, boolean brief, boolean client,
String dumpPackage) {
TaskRecord lastTask = null;
@@ -12341,14 +12583,95 @@
public boolean navigateUpTo(IBinder token, Intent destIntent, int resultCode,
Intent resultData) {
+ ComponentName dest = destIntent.getComponent();
synchronized (this) {
ActivityRecord srec = ActivityRecord.forToken(token);
if (srec == null) {
return false;
}
- ActivityStack stack = srec.stack;
- return stack.navigateUpToLocked(srec, destIntent, resultCode, resultData);
+ ArrayList<ActivityRecord> history = srec.stack.mHistory;
+ final int start = history.indexOf(srec);
+ if (start < 0) {
+ // Current activity is not in history stack; do nothing.
+ return false;
+ }
+ int finishTo = start - 1;
+ ActivityRecord parent = null;
+ boolean foundParentInTask = false;
+ if (dest != null) {
+ TaskRecord tr = srec.task;
+ for (int i = start - 1; i >= 0; i--) {
+ ActivityRecord r = history.get(i);
+ if (tr != r.task) {
+ // Couldn't find parent in the same task; stop at the one above this.
+ // (Root of current task; in-app "home" behavior)
+ // Always at least finish the current activity.
+ finishTo = Math.min(start - 1, i + 1);
+ parent = history.get(finishTo);
+ break;
+ } else if (r.info.packageName.equals(dest.getPackageName()) &&
+ r.info.name.equals(dest.getClassName())) {
+ finishTo = i;
+ parent = r;
+ foundParentInTask = true;
+ break;
+ }
+ }
+ }
+
+ if (mController != null) {
+ ActivityRecord next = mMainStack.topRunningActivityLocked(token, 0);
+ if (next != null) {
+ // ask watcher if this is allowed
+ boolean resumeOK = true;
+ try {
+ resumeOK = mController.activityResuming(next.packageName);
+ } catch (RemoteException e) {
+ mController = null;
+ }
+
+ if (!resumeOK) {
+ return false;
+ }
+ }
+ }
+ final long origId = Binder.clearCallingIdentity();
+ for (int i = start; i > finishTo; i--) {
+ ActivityRecord r = history.get(i);
+ mMainStack.requestFinishActivityLocked(r.appToken, resultCode, resultData,
+ "navigate-up", true);
+ // Only return the supplied result for the first activity finished
+ resultCode = Activity.RESULT_CANCELED;
+ resultData = null;
+ }
+
+ if (parent != null && foundParentInTask) {
+ final int parentLaunchMode = parent.info.launchMode;
+ final int destIntentFlags = destIntent.getFlags();
+ if (parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE ||
+ parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK ||
+ parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP ||
+ (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
+ parent.deliverNewIntentLocked(srec.info.applicationInfo.uid, destIntent);
+ } else {
+ try {
+ ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(
+ destIntent.getComponent(), 0, srec.userId);
+ int res = mMainStack.startActivityLocked(srec.app.thread, destIntent,
+ null, aInfo, parent.appToken, null,
+ 0, -1, parent.launchedFromUid, parent.launchedFromPackage,
+ 0, null, true, null);
+ foundParentInTask = res == ActivityManager.START_SUCCESS;
+ } catch (RemoteException e) {
+ foundParentInTask = false;
+ }
+ mMainStack.requestFinishActivityLocked(parent.appToken, resultCode,
+ resultData, "navigate-up", true);
+ }
+ }
+ Binder.restoreCallingIdentity(origId);
+ return foundParentInTask;
}
}
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index a2f3372..cde17c9 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -22,7 +22,6 @@
import android.app.Activity;
import android.app.ActivityOptions;
-import android.app.ResultInfo;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -96,9 +95,9 @@
ActivityRecord resultTo; // who started this entry, so will get our reply
final String resultWho; // additional identifier for use by resultTo.
final int requestCode; // code given by requester (resultTo)
- ArrayList<ResultInfo> results; // pending ActivityResult objs we have received
+ ArrayList results; // pending ActivityResult objs we have received
HashSet<WeakReference<PendingIntentRecord>> pendingResults; // all pending intents for this act
- ArrayList<Intent> newIntents; // any pending new intents for single-top mode
+ ArrayList newIntents; // any pending new intents for single-top mode
ActivityOptions pendingOptions; // most recently given options
HashSet<ConnectionRecord> connections; // All ConnectionRecord we hold
UriPermissionOwner uriPermissions; // current special URI access perms.
@@ -471,8 +470,6 @@
void setTask(TaskRecord newTask, ThumbnailHolder newThumbHolder, boolean isRoot) {
if (inHistory && !finishing) {
if (task != null) {
- // TODO: If this is the last ActivityRecord in task, remove from ActivityStack.
- task.removeActivity(this);
task.numActivities--;
}
if (newTask != null) {
@@ -507,7 +504,6 @@
inHistory = false;
if (task != null && !finishing) {
task.numActivities--;
- task = null;
}
clearOptionsLocked();
}
@@ -542,7 +538,7 @@
ActivityResult r = new ActivityResult(from, resultWho,
requestCode, resultCode, resultData);
if (results == null) {
- results = new ArrayList<ResultInfo>();
+ results = new ArrayList();
}
results.add(r);
}
@@ -953,8 +949,6 @@
StringBuilder sb = new StringBuilder(128);
sb.append("ActivityRecord{");
sb.append(Integer.toHexString(System.identityHashCode(this)));
- sb.append(" t");
- sb.append(task.taskId);
sb.append(" u");
sb.append(userId);
sb.append(' ');
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index e0b8015..526b24f 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -21,23 +21,18 @@
import com.android.internal.app.HeavyWeightSwitcherActivity;
import com.android.internal.os.BatteryStatsImpl;
-import com.android.server.am.ActivityManagerService.ItemMatcher;
import com.android.server.am.ActivityManagerService.PendingActivityLaunch;
import com.android.server.wm.AppTransition;
-import com.android.server.wm.TaskGroup;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.AppGlobals;
-import android.app.IActivityController;
import android.app.IActivityManager;
-import android.app.IThumbnailReceiver;
import android.app.IThumbnailRetriever;
import android.app.IApplicationThread;
import android.app.PendingIntent;
import android.app.ResultInfo;
-import android.app.ActivityManager.RunningTaskInfo;
import android.app.IActivityManager.WaitResult;
import android.content.ComponentName;
import android.content.Context;
@@ -54,7 +49,6 @@
import android.graphics.Bitmap.Config;
import android.os.Binder;
import android.os.Bundle;
-import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -67,12 +61,9 @@
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
-import android.util.SparseArray;
import android.view.Display;
-import java.io.FileDescriptor;
import java.io.IOException;
-import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
@@ -100,8 +91,7 @@
static final boolean DEBUG_APP = false;
static final boolean VALIDATE_TOKENS = ActivityManagerService.VALIDATE_TOKENS;
- static final boolean VALIDATE_TASK_REPLACE = true;
-
+
// How long we wait until giving up on the last activity telling us it
// is idle.
static final int IDLE_TIMEOUT = 10*1000;
@@ -140,7 +130,7 @@
// Set to false to disable the preview that is shown while a new activity
// is being started.
static final boolean SHOW_APP_STARTING_PREVIEW = true;
-
+
enum ActivityState {
INITIALIZING,
RESUMED,
@@ -157,28 +147,17 @@
final boolean mMainStack;
final Context mContext;
-
+
/**
* The back history of all previous (and possibly still
- * running) activities. It contains #ActivityRecord objects.
+ * running) activities. It contains HistoryRecord objects.
*/
- private final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
-
- /**
- * The back history of all previous (and possibly still
- * running) activities. It contains #TaskRecord objects.
- */
- private ArrayList<TaskRecord> mTaskHistory = new ArrayList<TaskRecord>();
-
- /**
- * Mapping from taskId to TaskRecord
- */
- private SparseArray<TaskRecord> mTaskIdToTaskRecord = new SparseArray<TaskRecord>();
+ final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
/**
* Used for validating app tokens with window manager.
*/
- final ArrayList<TaskGroup> mValidateAppTokens = new ArrayList<TaskGroup>();
+ final ArrayList<IBinder> mValidateAppTokens = new ArrayList<IBinder>();
/**
* List of running activities, sorted by recent usage.
@@ -310,12 +289,6 @@
private ActivityRecord mLastScreenshotActivity = null;
private Bitmap mLastScreenshotBitmap = null;
- /**
- * List of ActivityRecord objects that have been finished and must
- * still report back to a pending thumbnail receiver.
- */
- private final ArrayList<ActivityRecord> mCancelledThumbnails = new ArrayList<ActivityRecord>();
-
int mThumbnailWidth = -1;
int mThumbnailHeight = -1;
@@ -345,8 +318,6 @@
final Handler mHandler;
- String mLastHistoryModifier;
-
final class ActivityStackHandler extends Handler {
//public Handler() {
// if (localLOGV) Slog.v(TAG, "Handler started!");
@@ -473,66 +444,26 @@
}
final ActivityRecord topRunningActivityLocked(ActivityRecord notTop) {
- ActivityRecord newAr = newTopRunningActivityLocked(notTop);
-
int i = mHistory.size()-1;
while (i >= 0) {
ActivityRecord r = mHistory.get(i);
if (!r.finishing && r != notTop && okToShow(r)) {
- if (VALIDATE_TASK_REPLACE && newAr != r) logHistories(
- "topRunningActivityLocked", true);
return r;
}
i--;
}
- if (VALIDATE_TASK_REPLACE && newAr != null) Slog.w(TAG,
- "topRunningActivityLocked: mismatch: newAr!=null");
- return null;
- }
-
- final ActivityRecord newTopRunningActivityLocked(ActivityRecord notTop) {
- for (int i = mTaskHistory.size() - 1; i >= 0; --i) {
- final TaskRecord task = mTaskHistory.get(i);
- final ArrayList<ActivityRecord> activities = task.mActivities;
- for (int j = activities.size() - 1; j >= 0; --j) {
- ActivityRecord r = activities.get(j);
- if (!r.finishing && r != notTop && okToShow(r)) {
- return r;
- }
- }
- }
return null;
}
final ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) {
- ActivityRecord newAr = newTopRunningNonDelayedActivityLocked(notTop);
-
int i = mHistory.size()-1;
while (i >= 0) {
ActivityRecord r = mHistory.get(i);
if (!r.finishing && !r.delayedResume && r != notTop && okToShow(r)) {
- if (VALIDATE_TASK_REPLACE && newAr != r) Slog.w(TAG,
- "topRunningNonDelayedActivityLocked: mismatch: newAr=" + newAr + " r=" + r);
return r;
}
i--;
}
- if (VALIDATE_TASK_REPLACE && newAr != null) Slog.w(TAG,
- "topRunningNonDelayedActivityLocked: mismatch: newAr!=null");
- return null;
- }
-
- final ActivityRecord newTopRunningNonDelayedActivityLocked(ActivityRecord notTop) {
- for (int i = mTaskHistory.size() - 1; i >= 0; --i) {
- final TaskRecord task = mTaskHistory.get(i);
- final ArrayList<ActivityRecord> activities = task.mActivities;
- for (int j = activities.size() - 1; j >= 0; --j) {
- ActivityRecord r = activities.get(j);
- if (!r.finishing && !r.delayedResume && r != notTop && okToShow(r)) {
- return r;
- }
- }
- }
return null;
}
@@ -546,111 +477,35 @@
* @return Returns the HistoryRecord of the next activity on the stack.
*/
final ActivityRecord topRunningActivityLocked(IBinder token, int taskId) {
- ActivityRecord newAr = newTopRunningActivityLocked(token, taskId);
-
int i = mHistory.size()-1;
while (i >= 0) {
ActivityRecord r = mHistory.get(i);
// Note: the taskId check depends on real taskId fields being non-zero
if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId)
&& okToShow(r)) {
- if (VALIDATE_TASK_REPLACE && newAr != r) Slog.w(TAG,
- "topRunningActivityLocked(token): mismatch: newAr=" + newAr + " r=" + r);
return r;
}
i--;
}
- if (VALIDATE_TASK_REPLACE && newAr != null) Slog.w(TAG,
- "topRunningActivityLocked(token): mismatch: newAr!=null");
return null;
}
- final ActivityRecord newTopRunningActivityLocked(IBinder token, int taskId) {
- for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
- TaskRecord task = mTaskHistory.get(taskNdx);
- if (task.taskId == taskId) {
- continue;
- }
- ArrayList<ActivityRecord> activities = task.mActivities;
- for (int i = activities.size() - 1; i >= 0; --i) {
- final ActivityRecord r = activities.get(i);
- // Note: the taskId check depends on real taskId fields being non-zero
- if (!r.finishing && (token != r.appToken) && okToShow(r)) {
- return r;
- }
- }
- }
- return null;
- }
-
- private final int indexOfTokenLocked(IBinder token) {
+ final int indexOfTokenLocked(IBinder token) {
return mHistory.indexOf(ActivityRecord.forToken(token));
}
- final ActivityRecord isInStackLocked(IBinder token) {
- ActivityRecord newAr = newIsInStackLocked(token);
+ final int indexOfActivityLocked(ActivityRecord r) {
+ return mHistory.indexOf(r);
+ }
+ final ActivityRecord isInStackLocked(IBinder token) {
ActivityRecord r = ActivityRecord.forToken(token);
if (mHistory.contains(r)) {
- if (VALIDATE_TASK_REPLACE && newAr != r) Slog.w(TAG,
- "isInStackLocked: mismatch: newAr=" + newAr + " r=" + r);
return r;
}
- if (VALIDATE_TASK_REPLACE && newAr != null) Slog.w(TAG,
- "isInStackLocked: mismatch: newAr!=null");
return null;
}
- final ActivityRecord newIsInStackLocked(IBinder token) {
- final ActivityRecord r = ActivityRecord.forToken(token);
- if (r != null) {
- final TaskRecord task = r.task;
- if (mTaskHistory.contains(task) && task.mActivities.contains(r)) {
- return r;
- }
- }
- return null;
- }
-
- int getTaskForActivityLocked(IBinder token, boolean onlyRoot) {
- int newTaskId = newGetTaskForActivityLocked(token, onlyRoot);
-
- TaskRecord lastTask = null;
- final int N = mHistory.size();
- for (int i = 0; i < N; i++) {
- ActivityRecord r = mHistory.get(i);
- if (r.appToken == token) {
- if (!onlyRoot || lastTask != r.task) {
- if (VALIDATE_TASK_REPLACE && newTaskId != r.task.taskId) Slog.w(TAG,
- "getTaskForActivityLocked: mismatch: new=" + newTaskId
- + " taskId=" + r.task.taskId);
- return r.task.taskId;
- }
- if (VALIDATE_TASK_REPLACE && newTaskId != -1) Slog.w(TAG,
- "getTaskForActivityLocked: mismatch: newTaskId=" + newTaskId + " not -1.");
- return -1;
- }
- lastTask = r.task;
- }
-
- if (VALIDATE_TASK_REPLACE && newTaskId != -1) Slog.w(TAG,
- "getTaskForActivityLocked: mismatch at end: newTaskId=" + newTaskId + " not -1.");
- return -1;
- }
-
- int newGetTaskForActivityLocked(IBinder token, boolean onlyRoot) {
- final ActivityRecord r = ActivityRecord.forToken(token);
- if (r == null) {
- return -1;
- }
- final TaskRecord task = r.task;
- switch (task.mActivities.indexOf(r)) {
- case -1: return -1;
- case 0: return task.taskId;
- default: return onlyRoot ? -1 : task.taskId;
- }
- }
-
private final boolean updateLRUListLocked(ActivityRecord r) {
final boolean hadit = mLRUActivities.remove(r);
mLRUActivities.add(r);
@@ -743,29 +598,17 @@
* @return whether there are any activities for the specified user.
*/
final boolean switchUserLocked(int userId, UserStartedState uss) {
- if (VALIDATE_TOKENS) {
- validateAppTokensLocked();
- }
- final boolean newResult = newSwitchUserLocked(userId, uss);
-
mCurrentUser = userId;
mStartingUsers.add(uss);
// Only one activity? Nothing to do...
- if (mHistory.size() < 2) {
- if (VALIDATE_TASK_REPLACE && newResult) Slog.w(TAG,
- "switchUserLocked: mismatch: " + newResult + " " + false);
+ if (mHistory.size() < 2)
return false;
- }
boolean haveActivities = false;
// Check if the top activity is from the new user.
ActivityRecord top = mHistory.get(mHistory.size() - 1);
- if (top.userId == userId) {
- if (VALIDATE_TASK_REPLACE && !newResult) Slog.w(TAG,
- "switchUserLocked: mismatch: " + newResult + " " + true);
- return true;
- }
+ if (top.userId == userId) return true;
// Otherwise, move the user's activities to the top.
int N = mHistory.size();
int i = 0;
@@ -782,44 +625,7 @@
}
}
// Transition from the old top to the new top
- if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
- "switchUserLocked: calling resumeTopActivity " + top);
resumeTopActivityLocked(top);
- if (VALIDATE_TASK_REPLACE && (newResult != haveActivities)) Slog.w(TAG,
- "switchUserLocked: mismatch: " + newResult + " " + haveActivities);
- return haveActivities;
- }
-
- /*
- * Move the activities around in the stack to bring a user to the foreground.
- * @return whether there are any activities for the specified user.
- */
- final boolean newSwitchUserLocked(int userId, UserStartedState uss) {
-// mStartingUsers.add(uss);
- if (mCurrentUser == userId) {
- return true;
- }
- mCurrentUser = userId;
-
- // Move userId's tasks to the top.
- boolean haveActivities = false;
- TaskRecord task = null;
- int index = mTaskHistory.size();
- for (int i = 0; i < index; ++i) {
- task = mTaskHistory.get(i);
- if (task.userId == userId) {
- haveActivities = true;
- mTaskHistory.remove(i);
- mTaskHistory.add(task);
- --index;
- }
- }
-
- // task is now the original topmost TaskRecord. Transition from the old top to the new top.
- ActivityRecord top = task != null ? task.getTopActivity() : null;
- if (VALIDATE_TASK_REPLACE) Slog.w(TAG,
- "newSwitchUserLocked: would call resumeTopActivity " + top);
-// resumeTopActivityLocked(top);
return haveActivities;
}
@@ -903,13 +709,7 @@
try {
profileFd = profileFd.dup();
} catch (IOException e) {
- if (profileFd != null) {
- try {
- profileFd.close();
- } catch (IOException o) {
- }
- profileFd = null;
- }
+ profileFd = null;
}
}
app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,
@@ -1057,9 +857,6 @@
mGoingToSleep.release();
}
// Ensure activities are no longer sleeping.
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
for (int i=mHistory.size()-1; i>=0; i--) {
ActivityRecord r = mHistory.get(i);
r.setSleeping(false);
@@ -1104,9 +901,6 @@
// Make sure any stopped but visible activities are now sleeping.
// This ensures that the activity's onStop() is called.
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
for (int i=mHistory.size()-1; i>=0; i--) {
ActivityRecord r = mHistory.get(i);
if (r.state == ActivityState.STOPPING || r.state == ActivityState.STOPPED) {
@@ -1251,9 +1045,6 @@
ActivityRecord r = null;
synchronized (mService) {
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
int index = indexOfTokenLocked(token);
if (index >= 0) {
r = mHistory.get(index);
@@ -1271,9 +1062,6 @@
ActivityRecord r = null;
synchronized (mService) {
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
int index = indexOfTokenLocked(token);
if (index >= 0) {
r = mHistory.get(index);
@@ -1486,9 +1274,6 @@
// If the top activity is not fullscreen, then we need to
// make sure any activities under it are now visible.
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
final int count = mHistory.size();
int i = count-1;
while (mHistory.get(i) != top) {
@@ -1937,7 +1722,7 @@
try {
// Deliver all pending results.
- ArrayList<ResultInfo> a = next.results;
+ ArrayList a = next.results;
if (a != null) {
final int N = a.size();
if (!next.finishing && N > 0) {
@@ -2025,21 +1810,8 @@
return true;
}
- /** Temporary until startActivityLocked is rewritten for tasks. */
- private int convertAddPos(int addPos) {
- final int taskId = mHistory.get(addPos).task.taskId;
- addPos--;
- int taskOffset = 0;
- while (addPos >= 0 && taskId == mHistory.get(addPos).task.taskId) {
- ++taskOffset;
- --addPos;
- }
- return taskOffset;
- }
-
private final void startActivityLocked(ActivityRecord r, boolean newTask,
boolean doResume, boolean keepCurTransition, Bundle options) {
- mLastHistoryModifier = "startActivityLocked";
final int NH = mHistory.size();
int addPos = -1;
@@ -2064,15 +1836,13 @@
Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos,
here);
}
- r.task.addActivityToTop(r);
mHistory.add(addPos, r);
r.putInHistory();
- mService.mWindowManager.addAppToken(convertAddPos(addPos), r.appToken,
- r.task.taskId, r.info.screenOrientation, r.fullscreen,
+ mService.mWindowManager.addAppToken(addPos, r.appToken, r.task.taskId,
+ r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
if (VALIDATE_TOKENS) {
validateAppTokensLocked();
- verifyActivityRecords(true);
}
ActivityOptions.abort(options);
return;
@@ -2105,15 +1875,9 @@
here.fillInStackTrace();
Slog.i(TAG, "Adding activity " + r + " to stack at " + addPos, here);
}
- r.task.addActivityToTop(r);
mHistory.add(addPos, r);
r.putInHistory();
r.frontOfTask = newTask;
- if (VALIDATE_TASK_REPLACE) {
- if (verifyActivityRecords(false)) {
- Slog.w(TAG, "startActivityLocked: addPos=" + addPos);
- }
- }
if (NH > 0) {
// We want to show the starting preview window if we are
// switching to a new task, or the next activity's process is
@@ -2139,8 +1903,8 @@
mNoAnimActivities.remove(r);
}
r.updateOptionsLocked(options);
- mService.mWindowManager.addAppToken(convertAddPos(addPos),
- r.appToken, r.task.taskId, r.info.screenOrientation, r.fullscreen,
+ mService.mWindowManager.addAppToken(
+ addPos, r.appToken, r.task.taskId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
boolean doShow = true;
if (newTask) {
@@ -2178,7 +1942,7 @@
} else {
// If this is the first activity, don't do any fancy animations,
// because there is nothing for it to animate on top of.
- mService.mWindowManager.addAppToken(convertAddPos(addPos), r.appToken, r.task.taskId,
+ mService.mWindowManager.addAppToken(addPos, r.appToken, r.task.taskId,
r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
ActivityOptions.abort(options);
@@ -2190,27 +1954,13 @@
if (doResume) {
resumeTopActivityLocked(null);
}
- if (VALIDATE_TASK_REPLACE) {
- if (verifyActivityRecords(true)) {
- Slog.w(TAG, "startActivityLocked: addPos=" + addPos);
- }
- }
}
final void validateAppTokensLocked() {
mValidateAppTokens.clear();
mValidateAppTokens.ensureCapacity(mHistory.size());
- int taskId = Integer.MIN_VALUE;
- TaskGroup task = null;
for (int i=0; i<mHistory.size(); i++) {
- final ActivityRecord r = mHistory.get(i);
- if (taskId != r.task.taskId) {
- taskId = r.task.taskId;
- task = new TaskGroup();
- task.taskId = taskId;
- mValidateAppTokens.add(task);
- }
- task.tokens.add(r.appToken);
+ mValidateAppTokens.add(mHistory.get(i).appToken);
}
mService.mWindowManager.validateAppTokens(mValidateAppTokens);
}
@@ -2221,8 +1971,6 @@
*/
private final ActivityRecord resetTaskIfNeededLocked(ActivityRecord taskTop,
ActivityRecord newActivity) {
- mLastHistoryModifier = "resetTaskIfNeededLocked";
-
boolean forceReset = (newActivity.info.flags
&ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH) != 0;
if (ACTIVITY_INACTIVE_RESET_TIME > 0
@@ -2318,20 +2066,19 @@
if (mService.mCurTask <= 0) {
mService.mCurTask = 1;
}
- target.setTask(createTaskRecord(mService.mCurTask, target.info, null,
- false), null, false);
+ target.setTask(new TaskRecord(mService.mCurTask, target.info, null),
+ null, false);
target.task.affinityIntent = target.intent;
if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
+ " out to new task " + target.task);
}
- mService.mWindowManager.setAppGroupId(target.appToken, target.task.taskId);
+ mService.mWindowManager.setAppGroupId(target.appToken, task.taskId);
if (replyChainEnd < 0) {
replyChainEnd = targetI;
}
int dstPos = 0;
ThumbnailHolder curThumbHolder = target.thumbHolder;
boolean gotOptions = !canMoveOptions;
- final int taskId = target.task.taskId;
for (int srcPos=targetI; srcPos<=replyChainEnd; srcPos++) {
p = mHistory.get(srcPos);
if (p.finishing) {
@@ -2356,15 +2103,14 @@
}
mHistory.remove(srcPos);
mHistory.add(dstPos, p);
- mService.mWindowManager.setAppGroupId(p.appToken, taskId);
+ mService.mWindowManager.moveAppToken(dstPos, p.appToken);
+ mService.mWindowManager.setAppGroupId(p.appToken, p.task.taskId);
dstPos++;
+ if (VALIDATE_TOKENS) {
+ validateAppTokensLocked();
+ }
i++;
}
- rebuildTaskHistory();
- mService.mWindowManager.moveTaskToBottom(taskId);
- if (VALIDATE_TOKENS) {
- validateAppTokensLocked();
- }
if (taskTop == p) {
taskTop = below;
}
@@ -2384,7 +2130,8 @@
// like these are all in the reply chain.
replyChainEnd = targetI+1;
while (replyChainEnd < mHistory.size() &&
- (mHistory.get(replyChainEnd)).task == task) {
+ (mHistory.get(
+ replyChainEnd)).task == task) {
replyChainEnd++;
}
replyChainEnd--;
@@ -2481,7 +2228,6 @@
if (replyChainEnd < 0) {
replyChainEnd = targetI;
}
- final int taskId = task.taskId;
if (DEBUG_TASKS) Slog.v(TAG, "Reparenting task at index "
+ targetI + " to " + replyChainEnd);
for (int srcPos=replyChainEnd; srcPos>=targetI; srcPos--) {
@@ -2507,13 +2253,11 @@
if (DEBUG_TASKS) Slog.v(TAG, "Pulling activity " + p
+ " from " + srcPos + " to " + lastReparentPos
+ " in to resetting task " + task);
- mService.mWindowManager.setAppGroupId(p.appToken, taskId);
- }
- rebuildTaskHistory();
- // TODO: This is wrong because it doesn't take lastReparentPos into account.
- mService.mWindowManager.moveTaskToTop(taskId);
- if (VALIDATE_TOKENS) {
- validateAppTokensLocked();
+ mService.mWindowManager.moveAppToken(lastReparentPos, p.appToken);
+ mService.mWindowManager.setAppGroupId(p.appToken, p.task.taskId);
+ if (VALIDATE_TOKENS) {
+ validateAppTokensLocked();
+ }
}
replyChainEnd = -1;
@@ -2558,9 +2302,6 @@
}
}
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
return taskTop;
}
@@ -2627,7 +2368,7 @@
if (ret.launchMode == ActivityInfo.LAUNCH_MULTIPLE
&& (launchFlags&Intent.FLAG_ACTIVITY_SINGLE_TOP) == 0) {
if (!ret.finishing) {
- int index = mHistory.indexOf(ret);
+ int index = indexOfTokenLocked(ret.appToken);
if (index >= 0) {
finishActivityLocked(ret, index, Activity.RESULT_CANCELED,
null, "clear", false);
@@ -2725,7 +2466,6 @@
*/
private final ActivityRecord moveActivityToFrontLocked(int where) {
ActivityRecord newTop = mHistory.remove(where);
- newMoveActivityToFrontLocked(newTop);
int top = mHistory.size();
ActivityRecord oldTop = mHistory.get(top-1);
if (DEBUG_ADD_REMOVE) {
@@ -2735,17 +2475,6 @@
+ top, here);
}
mHistory.add(top, newTop);
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
- return newTop;
- }
-
- private final ActivityRecord newMoveActivityToFrontLocked(ActivityRecord newTop) {
- final TaskRecord task = newTop.task;
- ActivityRecord oldTop = task.getTopActivity();
- task.mActivities.remove(newTop);
- task.mActivities.add(newTop);
oldTop.frontOfTask = false;
newTop.frontOfTask = true;
return newTop;
@@ -2756,7 +2485,6 @@
String resultWho, int requestCode,
int callingPid, int callingUid, String callingPackage, int startFlags, Bundle options,
boolean componentSpecified, ActivityRecord[] outActivity) {
- mLastHistoryModifier = "startActivityLocked(IApplicationThread)";
int err = ActivityManager.START_SUCCESS;
@@ -3239,7 +2967,7 @@
if (mService.mCurTask <= 0) {
mService.mCurTask = 1;
}
- r.setTask(createTaskRecord(mService.mCurTask, r.info, intent, true), null, true);
+ r.setTask(new TaskRecord(mService.mCurTask, r.info, intent), null, true);
if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r
+ " in new task " + r.task);
} else {
@@ -3303,7 +3031,7 @@
N > 0 ? mHistory.get(N-1) : null;
r.setTask(prev != null
? prev.task
- : createTaskRecord(mService.mCurTask, r.info, intent, true), null, true);
+ : new TaskRecord(mService.mCurTask, r.info, intent), null, true);
if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r
+ " in new guessed " + r.task);
}
@@ -3795,7 +3523,7 @@
}
// Get the activity record.
- int index = mHistory.indexOf(r);
+ int index = indexOfActivityLocked(r);
if (index >= 0) {
res = r;
@@ -3851,9 +3579,9 @@
finishes = new ArrayList<ActivityRecord>(mFinishingActivities);
mFinishingActivities.clear();
}
- if ((NT=mCancelledThumbnails.size()) > 0) {
- thumbnails = new ArrayList<ActivityRecord>(mCancelledThumbnails);
- mCancelledThumbnails.clear();
+ if ((NT=mService.mCancelledThumbnails.size()) > 0) {
+ thumbnails = new ArrayList<ActivityRecord>(mService.mCancelledThumbnails);
+ mService.mCancelledThumbnails.clear();
}
if (mMainStack) {
@@ -3881,7 +3609,7 @@
// Stop any activities that are scheduled to do so but have been
// waiting for the next one to start.
for (i=0; i<NS; i++) {
- ActivityRecord r = stops.get(i);
+ ActivityRecord r = (ActivityRecord)stops.get(i);
synchronized (mService) {
if (r.finishing) {
finishCurrentActivityLocked(r, FINISH_IMMEDIATELY, false);
@@ -3894,7 +3622,7 @@
// Finish any activities that are scheduled to do so but have been
// waiting for the next one to start.
for (i=0; i<NF; i++) {
- ActivityRecord r = finishes.get(i);
+ ActivityRecord r = (ActivityRecord)finishes.get(i);
synchronized (mService) {
activityRemoved = destroyActivityLocked(r, true, false, "finish-idle");
}
@@ -3902,7 +3630,7 @@
// Report back to any thumbnail receivers.
for (i=0; i<NT; i++) {
- ActivityRecord r = thumbnails.get(i);
+ ActivityRecord r = (ActivityRecord)thumbnails.get(i);
mService.sendPendingThumbnail(r, null, null, null, true);
}
@@ -3957,7 +3685,7 @@
int i;
for (i=mHistory.size()-1; i>=0; i--) {
- ActivityRecord r = mHistory.get(i);
+ ActivityRecord r = (ActivityRecord)mHistory.get(i);
if (r.resultTo == self && r.requestCode == requestCode) {
if ((r.resultWho == null && resultWho == null) ||
(r.resultWho != null && r.resultWho.equals(resultWho))) {
@@ -3969,36 +3697,6 @@
mService.updateOomAdjLocked();
}
- final void finishTopRunningActivityLocked(ProcessRecord app) {
- ActivityRecord r = topRunningActivityLocked(null);
- if (r != null && r.app == app) {
- // If the top running activity is from this crashing
- // process, then terminate it to avoid getting in a loop.
- Slog.w(TAG, " Force finishing activity "
- + r.intent.getComponent().flattenToShortString());
- int index = mHistory.indexOf(r);
- r.stack.finishActivityLocked(r, index,
- Activity.RESULT_CANCELED, null, "crashed", false);
- // Also terminate any activities below it that aren't yet
- // stopped, to avoid a situation where one will get
- // re-start our crashing activity once it gets resumed again.
- index--;
- if (index >= 0) {
- r = mHistory.get(index);
- if (r.state == ActivityState.RESUMED
- || r.state == ActivityState.PAUSING
- || r.state == ActivityState.PAUSED) {
- if (!r.isHomeActivity || mService.mHomeProcess != r.app) {
- Slog.w(TAG, " Force finishing activity "
- + r.intent.getComponent().flattenToShortString());
- r.stack.finishActivityLocked(r, index,
- Activity.RESULT_CANCELED, null, "crashed", false);
- }
- }
- }
- }
- }
-
final boolean finishActivityAffinityLocked(IBinder token) {
int index = indexOfTokenLocked(token);
if (DEBUG_RESULTS) Slog.v(
@@ -4057,19 +3755,6 @@
* @return Returns true if this activity has been removed from the history
* list, or false if it is still in the list and will be removed later.
*/
- final boolean finishActivityLocked(ActivityRecord r,
- int resultCode, Intent resultData, String reason, boolean oomAdj) {
- int index = mHistory.indexOf(r);
- if (index >= 0) {
- return finishActivityLocked(r, index, resultCode, resultData, reason, false, oomAdj);
- }
- return false;
- }
-
- /**
- * @return Returns true if this activity has been removed from the history
- * list, or false if it is still in the list and will be removed later.
- */
final boolean finishActivityLocked(ActivityRecord r, int index,
int resultCode, Intent resultData, String reason, boolean oomAdj) {
return finishActivityLocked(r, index, resultCode, resultData, reason, false, oomAdj);
@@ -4119,7 +3804,7 @@
// There are clients waiting to receive thumbnails so, in case
// this is an activity that someone is waiting for, add it
// to the pending list so we can correctly update the clients.
- mCancelledThumbnails.add(r);
+ mService.mCancelledThumbnails.add(r);
}
if (immediate) {
@@ -4162,7 +3847,7 @@
private final ActivityRecord finishCurrentActivityLocked(ActivityRecord r,
int mode, boolean oomAdj) {
- final int index = mHistory.indexOf(r);
+ final int index = indexOfActivityLocked(r);
if (index < 0) {
return null;
}
@@ -4218,102 +3903,16 @@
resumeTopActivityLocked(null);
}
return activityRemoved ? null : r;
+ } else {
+ // Need to go through the full pause cycle to get this
+ // activity into the stopped state and then finish it.
+ if (localLOGV) Slog.v(TAG, "Enqueueing pending finish: " + r);
+ mFinishingActivities.add(r);
+ resumeTopActivityLocked(null);
}
-
- // Need to go through the full pause cycle to get this
- // activity into the stopped state and then finish it.
- if (localLOGV) Slog.v(TAG, "Enqueueing pending finish: " + r);
- mFinishingActivities.add(r);
- resumeTopActivityLocked(null);
return r;
}
- final boolean navigateUpToLocked(ActivityRecord srec, Intent destIntent, int resultCode,
- Intent resultData) {
- final int start = mHistory.indexOf(srec);
- if (start < 0) {
- // Current activity is not in history stack; do nothing.
- return false;
- }
- int finishTo = start - 1;
- ActivityRecord parent = null;
- boolean foundParentInTask = false;
- ComponentName dest = destIntent.getComponent();
- if (dest != null) {
- TaskRecord tr = srec.task;
- for (int i = start - 1; i >= 0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (tr != r.task) {
- // Couldn't find parent in the same task; stop at the one above this.
- // (Root of current task; in-app "home" behavior)
- // Always at least finish the current activity.
- finishTo = Math.min(start - 1, i + 1);
- parent = mHistory.get(finishTo);
- break;
- } else if (r.info.packageName.equals(dest.getPackageName()) &&
- r.info.name.equals(dest.getClassName())) {
- finishTo = i;
- parent = r;
- foundParentInTask = true;
- break;
- }
- }
- }
-
- IActivityController controller = mService.mController;
- if (controller != null) {
- ActivityRecord next = topRunningActivityLocked(srec.appToken, 0);
- if (next != null) {
- // ask watcher if this is allowed
- boolean resumeOK = true;
- try {
- resumeOK = controller.activityResuming(next.packageName);
- } catch (RemoteException e) {
- mService.mController = null;
- }
-
- if (!resumeOK) {
- return false;
- }
- }
- }
- final long origId = Binder.clearCallingIdentity();
- for (int i = start; i > finishTo; i--) {
- ActivityRecord r = mHistory.get(i);
- requestFinishActivityLocked(r.appToken, resultCode, resultData,
- "navigate-up", true);
- // Only return the supplied result for the first activity finished
- resultCode = Activity.RESULT_CANCELED;
- resultData = null;
- }
-
- if (parent != null && foundParentInTask) {
- final int parentLaunchMode = parent.info.launchMode;
- final int destIntentFlags = destIntent.getFlags();
- if (parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE ||
- parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TASK ||
- parentLaunchMode == ActivityInfo.LAUNCH_SINGLE_TOP ||
- (destIntentFlags & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
- parent.deliverNewIntentLocked(srec.info.applicationInfo.uid, destIntent);
- } else {
- try {
- ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(
- destIntent.getComponent(), 0, srec.userId);
- int res = startActivityLocked(srec.app.thread, destIntent,
- null, aInfo, parent.appToken, null,
- 0, -1, parent.launchedFromUid, parent.launchedFromPackage,
- 0, null, true, null);
- foundParentInTask = res == ActivityManager.START_SUCCESS;
- } catch (RemoteException e) {
- foundParentInTask = false;
- }
- requestFinishActivityLocked(parent.appToken, resultCode,
- resultData, "navigate-up", true);
- }
- }
- Binder.restoreCallingIdentity(origId);
- return foundParentInTask;
- }
/**
* Perform the common clean-up of an activity record. This is called both
* as part of destroyActivityLocked() (when destroying the client-side
@@ -4365,7 +3964,7 @@
// There are clients waiting to receive thumbnails so, in case
// this is an activity that someone is waiting for, add it
// to the pending list so we can correctly update the clients.
- mCancelledThumbnails.add(r);
+ mService.mCancelledThumbnails.add(r);
}
// Get rid of any pending idle timeouts.
@@ -4388,10 +3987,6 @@
here.fillInStackTrace();
Slog.i(TAG, "Removing activity " + r + " from stack");
}
- final TaskRecord task = r.task;
- if (task != null) {
- task.removeActivity(r);
- }
mHistory.remove(r);
r.takeFromHistory();
removeTimeoutsForActivityLocked(r);
@@ -4576,7 +4171,7 @@
mHandler.removeMessages(DESTROY_TIMEOUT_MSG, r);
}
- int index = mHistory.indexOf(r);
+ int index = indexOfActivityLocked(r);
if (index >= 0) {
if (r.state == ActivityState.DESTROYING) {
cleanUpActivityLocked(r, true, false);
@@ -4590,15 +4185,15 @@
}
}
- private void removeHistoryRecordsForAppLocked(ArrayList<ActivityRecord> list,
- ProcessRecord app, String listName) {
+ private void removeHistoryRecordsForAppLocked(ArrayList list, ProcessRecord app,
+ String listName) {
int i = list.size();
if (DEBUG_CLEANUP) Slog.v(
TAG, "Removing app " + app + " from list " + listName
+ " with " + i + " entries");
while (i > 0) {
i--;
- ActivityRecord r = list.get(i);
+ ActivityRecord r = (ActivityRecord)list.get(i);
if (DEBUG_CLEANUP) Slog.v(TAG, "Record #" + i + " " + r);
if (r.app == app) {
if (DEBUG_CLEANUP) Slog.v(TAG, "---> REMOVING this entry!");
@@ -4624,7 +4219,7 @@
TAG, "Removing app " + app + " from history with " + i + " entries");
while (i > 0) {
i--;
- ActivityRecord r = mHistory.get(i);
+ ActivityRecord r = (ActivityRecord)mHistory.get(i);
if (DEBUG_CLEANUP) Slog.v(
TAG, "Record #" + i + " " + r + ": app=" + r.app);
if (r.app == app) {
@@ -4692,7 +4287,6 @@
* of the stack.
*/
final void moveHomeToFrontLocked() {
- newMoveHomeToFrontLocked();
TaskRecord homeTask = null;
for (int i=mHistory.size()-1; i>=0; i--) {
ActivityRecord hr = mHistory.get(i);
@@ -4702,23 +4296,6 @@
}
}
if (homeTask != null) {
-// moveTaskToFrontLocked(homeTask, null, null);
- }
- }
-
- final void newMoveHomeToFrontLocked() {
- TaskRecord homeTask = null;
- for (int taskNdx = mTaskHistory.size() - 1; homeTask == null && taskNdx >= 0; --taskNdx) {
- final ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
- for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
- final ActivityRecord r = activities.get(activityNdx);
- if (r.isHomeActivity) {
- homeTask = r.task;
- break;
- }
- }
- }
- if (homeTask != null) {
moveTaskToFrontLocked(homeTask, null, null);
}
}
@@ -4735,39 +4312,32 @@
mService.mWindowManager.prepareAppTransition(transit, false);
}
- final boolean findTaskToMoveToFrontLocked(int taskId, int flags, Bundle options) {
- for (int i = mHistory.size() - 1; i >= 0; i--) {
- ActivityRecord hr = mHistory.get(i);
- if (hr.task.taskId == taskId) {
- if ((flags & ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
- mUserLeaving = true;
- }
- if ((flags & ActivityManager.MOVE_TASK_WITH_HOME) != 0) {
- // Caller wants the home activity moved with it. To accomplish this,
- // we'll just move the home task to the top first.
- moveHomeToFrontLocked();
- }
- moveTaskToFrontLocked(hr.task, null, options);
- return true;
- }
- }
- return false;
- }
-
final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord reason, Bundle options) {
+ if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
final int task = tr.taskId;
int top = mHistory.size()-1;
if (top < 0 || (mHistory.get(top)).task.taskId == task) {
// nothing to do!
+ if (reason != null &&
+ (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
+ ActivityOptions.abort(options);
+ } else {
+ updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
+ }
return;
}
+ ArrayList<IBinder> moved = new ArrayList<IBinder>();
+
+ // Applying the affinities may have removed entries from the history,
+ // so get the size again.
+ top = mHistory.size()-1;
+ int pos = top;
// Shift all activities with this task up to the top
// of the stack, keeping them in the same internal order.
- int pos = top;
while (pos >= 0) {
ActivityRecord r = mHistory.get(pos);
if (localLOGV) Slog.v(
@@ -4781,37 +4351,18 @@
}
mHistory.remove(pos);
mHistory.add(top, r);
+ moved.add(0, r.appToken);
top--;
}
pos--;
}
- //
- // Start new code here! Delete everything above.
- //
- if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
- final int numTasks = mTaskHistory.size();
- final int index = mTaskHistory.indexOf(tr);
- if (numTasks == 0 || index < 0 || index == numTasks - 1) {
- // nothing to do!
- if (reason != null &&
- (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
- ActivityOptions.abort(options);
- } else {
- updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
- }
- return;
- }
-
- // Shift all activities with this task up to the top
- // of the stack, keeping them in the same internal order.
- mTaskHistory.remove(tr);
- mTaskHistory.add(tr);
-
- if (DEBUG_TRANSITION) Slog.v(TAG, "Prepare to front transition: task=" + tr);
+ if (DEBUG_TRANSITION) Slog.v(TAG,
+ "Prepare to front transition: task=" + tr);
if (reason != null &&
(reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
- mService.mWindowManager.prepareAppTransition(AppTransition.TRANSIT_NONE, false);
+ mService.mWindowManager.prepareAppTransition(
+ AppTransition.TRANSIT_NONE, false);
ActivityRecord r = topRunningActivityLocked(null);
if (r != null) {
mNoAnimActivities.add(r);
@@ -4820,18 +4371,14 @@
} else {
updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
}
-
- mService.mWindowManager.moveTaskToTop(task);
-
- finishTaskMoveLocked(task);
- EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, tr.userId, task);
-
+
+ mService.mWindowManager.moveAppTokensToTop(moved);
if (VALIDATE_TOKENS) {
validateAppTokensLocked();
}
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
+
+ finishTaskMoveLocked(task);
+ EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, tr.userId, task);
}
private final void finishTaskMoveLocked(int task) {
@@ -4851,7 +4398,7 @@
*/
final boolean moveTaskToBackLocked(int task, ActivityRecord reason) {
Slog.i(TAG, "moveTaskToBack: " + task);
-
+
// If we have a watcher, preflight the move before committing to it. First check
// for *other* available tasks, but if none are available, then try again allowing the
// current task to be selected.
@@ -4874,14 +4421,11 @@
}
}
+ ArrayList<IBinder> moved = new ArrayList<IBinder>();
+
if (DEBUG_TRANSITION) Slog.v(TAG,
"Prepare to back transition: task=" + task);
-
- final TaskRecord tr = mTaskIdToTaskRecord.get(task);
- mTaskHistory.remove(tr);
- mTaskHistory.add(0, tr);
-
- // BEGIN REGION TO REMOVE.
+
final int N = mHistory.size();
int bottom = 0;
int pos = 0;
@@ -4902,18 +4446,16 @@
}
mHistory.remove(pos);
mHistory.add(bottom, r);
+ moved.add(r.appToken);
bottom++;
}
pos++;
}
- if (VALIDATE_TASK_REPLACE) {
- verifyActivityRecords(true);
- }
- // END REGION TO REMOVE
if (reason != null &&
(reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
- mService.mWindowManager.prepareAppTransition(AppTransition.TRANSIT_NONE, false);
+ mService.mWindowManager.prepareAppTransition(
+ AppTransition.TRANSIT_NONE, false);
ActivityRecord r = topRunningActivityLocked(null);
if (r != null) {
mNoAnimActivities.add(r);
@@ -4922,8 +4464,7 @@
mService.mWindowManager.prepareAppTransition(
AppTransition.TRANSIT_TASK_TO_BACK, false);
}
- mService.mWindowManager.moveTaskToBottom(task);
-
+ mService.mWindowManager.moveAppTokensToBottom(moved);
if (VALIDATE_TOKENS) {
validateAppTokensLocked();
}
@@ -4956,8 +4497,9 @@
TaskAccessInfo info = getTaskAccessInfoLocked(tr.taskId, true);
if (info.numSubThumbbails <= 0) {
return info.mainThumbnail != null ? info.mainThumbnail : tr.lastThumbnail;
+ } else {
+ return info.subtasks.get(info.numSubThumbbails-1).holder.lastThumbnail;
}
- return info.subtasks.get(info.numSubThumbbails-1).holder.lastThumbnail;
}
public ActivityRecord removeTaskActivitiesLocked(int taskId, int subTaskIndex,
@@ -5037,7 +4579,6 @@
}
if (thumbs.numSubThumbbails > 0) {
thumbs.retriever = new IThumbnailRetriever.Stub() {
- @Override
public Bitmap getThumbnail(int index) {
if (index < 0 || index >= thumbs.subtasks.size()) {
return null;
@@ -5236,283 +4777,4 @@
public void dismissKeyguardOnNextActivityLocked() {
mDismissKeyguardOnNextActivity = true;
}
-
- boolean willActivityBeVisibleLocked(IBinder token) {
- int i;
- for (i = mHistory.size() - 1; i >= 0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (r.appToken == token) {
- return true;
- }
- if (r.fullscreen && !r.finishing) {
- return false;
- }
- }
- return true;
- }
-
- void closeSystemDialogsLocked() {
- for (int i = mHistory.size() - 1; i >= 0; i--) {
- ActivityRecord r = mHistory.get(i);
- if ((r.info.flags&ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS) != 0) {
- r.stack.finishActivityLocked(r, i,
- Activity.RESULT_CANCELED, null, "close-sys", true);
- }
- }
- }
-
- boolean forceStopPackageLocked(String name, boolean doit, boolean evenPersistent, int userId) {
- boolean didSomething = false;
- TaskRecord lastTask = null;
- final int N = mHistory.size();
- for (int i = 0; i < N; i++) {
- ActivityRecord r = mHistory.get(i);
- final boolean samePackage = r.packageName.equals(name)
- || (name == null && r.userId == userId);
- if ((userId == UserHandle.USER_ALL || r.userId == userId)
- && (samePackage || r.task == lastTask)
- && (r.app == null || evenPersistent || !r.app.persistent)) {
- if (!doit) {
- if (r.finishing) {
- // If this activity is just finishing, then it is not
- // interesting as far as something to stop.
- continue;
- }
- return true;
- }
- didSomething = true;
- Slog.i(TAG, " Force finishing activity " + r);
- if (samePackage) {
- if (r.app != null) {
- r.app.removed = true;
- }
- r.app = null;
- }
- lastTask = r.task;
- if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
- null, "force-stop", true)) {
- i--;
- }
- }
- }
- return didSomething;
- }
-
- ActivityRecord getTasksLocked(int maxNum, IThumbnailReceiver receiver,
- PendingThumbnailsRecord pending, List<RunningTaskInfo> list) {
- ActivityRecord topRecord = null;
- int pos = mHistory.size() - 1;
- ActivityRecord next = pos >= 0 ? mHistory.get(pos) : null;
- ActivityRecord top = null;
- TaskRecord curTask = null;
- int numActivities = 0;
- int numRunning = 0;
- while (pos >= 0 && maxNum > 0) {
- final ActivityRecord r = next;
- pos--;
- next = pos >= 0 ? mHistory.get(pos) : null;
-
- // Initialize state for next task if needed.
- if (top == null || (top.state == ActivityState.INITIALIZING && top.task == r.task)) {
- top = r;
- curTask = r.task;
- numActivities = numRunning = 0;
- }
-
- // Add 'r' into the current task.
- numActivities++;
- if (r.app != null && r.app.thread != null) {
- numRunning++;
- }
-
- if (localLOGV) Slog.v(
- TAG, r.intent.getComponent().flattenToShortString()
- + ": task=" + r.task);
-
- // If the next one is a different task, generate a new
- // TaskInfo entry for what we have.
- if (next == null || next.task != curTask) {
- RunningTaskInfo ci = new RunningTaskInfo();
- ci.id = curTask.taskId;
- ci.baseActivity = r.intent.getComponent();
- ci.topActivity = top.intent.getComponent();
- if (top.thumbHolder != null) {
- ci.description = top.thumbHolder.lastDescription;
- }
- ci.numActivities = numActivities;
- ci.numRunning = numRunning;
- //System.out.println(
- // "#" + maxNum + ": " + " descr=" + ci.description);
- if (receiver != null) {
- if (localLOGV) Slog.v(
- TAG, "State=" + top.state + "Idle=" + top.idle
- + " app=" + top.app
- + " thr=" + (top.app != null ? top.app.thread : null));
- if (top.state == ActivityState.RESUMED || top.state == ActivityState.PAUSING) {
- if (top.idle && top.app != null && top.app.thread != null) {
- topRecord = top;
- } else {
- top.thumbnailNeeded = true;
- }
- }
- pending.pendingRecords.add(top);
- }
- list.add(ci);
- maxNum--;
- top = null;
- }
- }
- return topRecord;
- }
-
- public void unhandledBackLocked() {
- int top = mHistory.size() - 1;
- if (DEBUG_SWITCH) Slog.d(
- TAG, "Performing unhandledBack(): top activity at " + top);
- if (top > 0) {
- finishActivityLocked(mHistory.get(top),
- top, Activity.RESULT_CANCELED, null, "unhandled-back", true);
- }
- }
-
- void handleAppCrashLocked(ProcessRecord app) {
- for (int i = mHistory.size() - 1; i >= 0; i--) {
- ActivityRecord r = mHistory.get(i);
- if (r.app == app) {
- Slog.w(TAG, " Force finishing activity "
- + r.intent.getComponent().flattenToShortString());
- r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
- null, "crashed", false);
- }
- }
- }
-
- void dumpActivitiesLocked(FileDescriptor fd, PrintWriter pw, boolean dumpAll,
- boolean dumpClient, String dumpPackage) {
- ActivityManagerService.dumpHistoryList(fd, pw, mHistory, " ", "Hist", true, !dumpAll,
- dumpClient, dumpPackage);
- }
-
- ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) {
- ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>();
-
- if ("all".equals(name)) {
- for (ActivityRecord r1 : mHistory) {
- activities.add(r1);
- }
- } else if ("top".equals(name)) {
- final int N = mHistory.size();
- if (N > 0) {
- activities.add(mHistory.get(N-1));
- }
- } else {
- ItemMatcher matcher = new ItemMatcher();
- matcher.build(name);
-
- for (ActivityRecord r1 : mHistory) {
- if (matcher.match(r1, r1.intent.getComponent())) {
- activities.add(r1);
- }
- }
- }
-
- return activities;
- }
-
- ActivityRecord restartPackage(String packageName) {
- ActivityRecord starting = topRunningActivityLocked(null);
-
- // All activities that came from the package must be
- // restarted as if there was a config change.
- for (int i = mHistory.size() - 1; i >= 0; i--) {
- ActivityRecord a = mHistory.get(i);
- if (a.info.packageName.equals(packageName)) {
- a.forceNewConfig = true;
- if (starting != null && a == starting && a.visible) {
- a.startFreezingScreenLocked(starting.app, ActivityInfo.CONFIG_SCREEN_LAYOUT);
- }
- }
- }
-
- return starting;
- }
-
- void rebuildTaskHistory() {
- mTaskHistory.clear();
- final int numActivities = mHistory.size();
- TaskRecord task = null;
- for (int i = 0; i < numActivities; ++i) {
- final ActivityRecord r = mHistory.get(i);
- if (r.task != task) {
- task = r.task;
- task.mActivities.clear();
- mTaskHistory.add(task);
- }
- task.mActivities.add(r);
- }
- }
-
- boolean verifyActivityRecords(boolean rebuild) {
- final int numHistory = mHistory.size();
- int historyNdx = 0;
-
- final int numTasks = mTaskHistory.size();
- int taskNdx;
- for (taskNdx = historyNdx = 0; taskNdx < numTasks; ++taskNdx) {
- final TaskRecord task = mTaskHistory.get(taskNdx);
- final ArrayList<ActivityRecord> activities = task.mActivities;
- final int numActivities = activities.size();
- int activityNdx;
- for (activityNdx = 0;
- activityNdx < numActivities && historyNdx < numHistory;
- ++activityNdx, ++historyNdx) {
- ActivityRecord r1 = mHistory.get(historyNdx);
- ActivityRecord r2 = activities.get(activityNdx);
- if (r1 != r2) {
- break;
- }
- }
- if (activityNdx != numActivities) {
- // either a mismatch or mHistory ran out before mTaskHistory.
- break;
- }
- }
- if (taskNdx != numTasks || historyNdx != numHistory) {
- logHistories("verifyActivityRecords", rebuild);
- return true;
- }
- return false;
- }
-
- private void logHistories(String caller, boolean rebuild) {
- Slog.w(TAG, "Mismatch! " + caller + " mHistory=" + mHistory);
- ArrayList<ArrayList<ActivityRecord>> nestedRecords =
- new ArrayList<ArrayList<ActivityRecord>>();
- for (TaskRecord task : mTaskHistory) {
- nestedRecords.add(task.mActivities);
- }
- Slog.w(TAG, "Mismatch! " + caller + " mTaskHistory" + nestedRecords);
- Slog.w(TAG, "Mismatch! " + caller + " lastHistoryModifier=" + mLastHistoryModifier
- + " Caller=" + Debug.getCallers(4));
- if (rebuild) {
- rebuildTaskHistory();
- }
- }
-
- private TaskRecord createTaskRecord(int taskId, ActivityInfo info, Intent intent,
- boolean toTop) {
- TaskRecord oldTask = mTaskIdToTaskRecord.get(taskId);
- if (oldTask != null) {
- Slog.w(TAG, "createTaskRecord: Reusing taskId=" + taskId + " without removing");
- mTaskHistory.remove(oldTask);
- }
- TaskRecord task = new TaskRecord(taskId, info, intent);
- mTaskIdToTaskRecord.put(taskId, task);
- if (toTop) {
- mTaskHistory.add(task);
- } else {
- mTaskHistory.add(0, task);
- }
- return task;
- }
}
diff --git a/services/java/com/android/server/am/CompatModePackages.java b/services/java/com/android/server/am/CompatModePackages.java
index 863bdad..3a6492e 100644
--- a/services/java/com/android/server/am/CompatModePackages.java
+++ b/services/java/com/android/server/am/CompatModePackages.java
@@ -295,8 +295,20 @@
Message msg = mHandler.obtainMessage(MSG_WRITE);
mHandler.sendMessageDelayed(msg, 10000);
-
- ActivityRecord starting = mService.mMainStack.restartPackage(packageName);
+ ActivityRecord starting = mService.mMainStack.topRunningActivityLocked(null);
+
+ // All activities that came from the package must be
+ // restarted as if there was a config change.
+ for (int i=mService.mMainStack.mHistory.size()-1; i>=0; i--) {
+ ActivityRecord a = (ActivityRecord)mService.mMainStack.mHistory.get(i);
+ if (a.info.packageName.equals(packageName)) {
+ a.forceNewConfig = true;
+ if (starting != null && a == starting && a.visible) {
+ a.startFreezingScreenLocked(starting.app,
+ ActivityInfo.CONFIG_SCREEN_LAYOUT);
+ }
+ }
+ }
// Tell all processes that loaded this package about the change.
for (int i=mService.mLruProcesses.size()-1; i>=0; i--) {
diff --git a/services/java/com/android/server/am/PendingThumbnailsRecord.java b/services/java/com/android/server/am/PendingThumbnailsRecord.java
index c460791..ed478c9 100644
--- a/services/java/com/android/server/am/PendingThumbnailsRecord.java
+++ b/services/java/com/android/server/am/PendingThumbnailsRecord.java
@@ -27,13 +27,13 @@
class PendingThumbnailsRecord
{
final IThumbnailReceiver receiver; // who is waiting.
- final HashSet<ActivityRecord> pendingRecords; // HistoryRecord objects we still wait for.
+ HashSet pendingRecords; // HistoryRecord objects we still wait for.
boolean finished; // Is pendingRecords empty?
PendingThumbnailsRecord(IThumbnailReceiver _receiver)
{
receiver = _receiver;
- pendingRecords = new HashSet<ActivityRecord>();
+ pendingRecords = new HashSet();
finished = false;
}
}
diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java
index f9b0d4c..1bae9ca 100644
--- a/services/java/com/android/server/am/TaskRecord.java
+++ b/services/java/com/android/server/am/TaskRecord.java
@@ -23,7 +23,6 @@
import android.util.Slog;
import java.io.PrintWriter;
-import java.util.ArrayList;
class TaskRecord extends ThumbnailHolder {
final int taskId; // Unique identifier for this task.
@@ -40,11 +39,7 @@
String stringName; // caching of toString() result.
int userId; // user for which this task was created
-
- int numFullscreen; // Number of fullscreen activities.
-
- final ArrayList<ActivityRecord> mActivities = new ArrayList<ActivityRecord>();
-
+
TaskRecord(int _taskId, ActivityInfo info, Intent _intent) {
taskId = _taskId;
affinity = info.taskAffinity;
@@ -109,63 +104,12 @@
userId = UserHandle.getUserId(info.applicationInfo.uid);
}
}
-
- ActivityRecord getTopActivity() {
- for (int i = mActivities.size() - 1; i >= 0; --i) {
- final ActivityRecord r = mActivities.get(i);
- if (r.finishing) {
- continue;
- }
- return r;
- }
- return null;
- }
-
- void addActivityAtBottom(ActivityRecord r) {
- if (!mActivities.remove(r) && r.fullscreen) {
- // Was not previously in list.
- numFullscreen++;
- }
- mActivities.add(0, r);
- }
-
- void addActivityToTop(ActivityRecord r) {
- if (!mActivities.remove(r) && r.fullscreen) {
- // Was not previously in list.
- numFullscreen++;
- }
- // TODO: This only matters to achieve identical results as mHistory. Later we won't need
- // to skip over finishing activities.
- int i;
- for (i = mActivities.size() - 1; i >= 0; --i) {
- if (!mActivities.get(i).finishing) {
- break;
- }
- }
- if (i >= 0) {
- // Add below finishing activities.
- mActivities.add(i + 1, r);
- } else {
- // All activities are finishing, add to top.
- mActivities.add(r);
- }
- }
-
- /** @return true if this was the last activity in the task */
- boolean removeActivity(ActivityRecord r) {
- if (mActivities.remove(r) && r.fullscreen) {
- // Was previously in list.
- numFullscreen--;
- }
- return mActivities.size() == 0;
- }
-
+
void dump(PrintWriter pw, String prefix) {
if (numActivities != 0 || rootWasReset || userId != 0) {
pw.print(prefix); pw.print("numActivities="); pw.print(numActivities);
pw.print(" rootWasReset="); pw.print(rootWasReset);
- pw.print(" userId="); pw.print(userId);
- pw.print(" numFullscreen="); pw.println(numFullscreen);
+ pw.print(" userId="); pw.println(userId);
}
if (affinity != null) {
pw.print(prefix); pw.print("affinity="); pw.println(affinity);
@@ -192,7 +136,6 @@
pw.print(prefix); pw.print("realActivity=");
pw.println(realActivity.flattenToShortString());
}
- pw.print(prefix); pw.print("Activities="); pw.println(mActivities);
if (!askedCompatMode) {
pw.print(prefix); pw.print("askedCompatMode="); pw.println(askedCompatMode);
}
@@ -203,7 +146,6 @@
pw.print((getInactiveDuration()/1000)); pw.println("s)");
}
- @Override
public String toString() {
if (stringName != null) {
return stringName;
@@ -214,21 +156,19 @@
sb.append(" #");
sb.append(taskId);
if (affinity != null) {
- sb.append(" A=");
+ sb.append(" A ");
sb.append(affinity);
} else if (intent != null) {
- sb.append(" I=");
+ sb.append(" I ");
sb.append(intent.getComponent().flattenToShortString());
} else if (affinityIntent != null) {
- sb.append(" aI=");
+ sb.append(" aI ");
sb.append(affinityIntent.getComponent().flattenToShortString());
} else {
sb.append(" ??");
}
- sb.append(" U=");
+ sb.append(" U ");
sb.append(userId);
- sb.append(" sz=");
- sb.append(mActivities.size());
sb.append('}');
return stringName = sb.toString();
}
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index 5f44ff4..7fb8902 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -1454,7 +1454,7 @@
if ("group".equals(name)) {
String gidStr = parser.getAttributeValue(null, "gid");
if (gidStr != null) {
- int gid = Integer.parseInt(gidStr);
+ int gid = Process.getGidForName(gidStr);
mGlobalGids = appendInt(mGlobalGids, gid);
} else {
Slog.w(TAG, "<group> without gid at "
diff --git a/services/java/com/android/server/pm/UserManagerService.java b/services/java/com/android/server/pm/UserManagerService.java
index 18ccf75..c3f4256 100644
--- a/services/java/com/android/server/pm/UserManagerService.java
+++ b/services/java/com/android/server/pm/UserManagerService.java
@@ -603,6 +603,7 @@
writeBoolean(serializer, restrictions, UserManager.ALLOW_MODIFY_ACCOUNTS);
writeBoolean(serializer, restrictions, UserManager.ALLOW_INSTALL_APPS);
writeBoolean(serializer, restrictions, UserManager.ALLOW_UNINSTALL_APPS);
+ writeBoolean(serializer, restrictions, UserManager.ALLOW_CONFIG_LOCATION_ACCESS);
serializer.endTag(null, TAG_RESTRICTIONS);
}
serializer.endTag(null, TAG_USER);
@@ -719,6 +720,7 @@
readBoolean(parser, restrictions, UserManager.ALLOW_MODIFY_ACCOUNTS);
readBoolean(parser, restrictions, UserManager.ALLOW_INSTALL_APPS);
readBoolean(parser, restrictions, UserManager.ALLOW_UNINSTALL_APPS);
+ readBoolean(parser, restrictions, UserManager.ALLOW_CONFIG_LOCATION_ACCESS);
}
}
}
@@ -763,6 +765,7 @@
restrictions.putBoolean(UserManager.ALLOW_MODIFY_ACCOUNTS, true);
restrictions.putBoolean(UserManager.ALLOW_INSTALL_APPS, true);
restrictions.putBoolean(UserManager.ALLOW_UNINSTALL_APPS, true);
+ restrictions.putBoolean(UserManager.ALLOW_CONFIG_LOCATION_ACCESS, true);
}
private int readIntAttribute(XmlPullParser parser, String attr, int defaultValue) {
diff --git a/services/java/com/android/server/wm/AppWindowToken.java b/services/java/com/android/server/wm/AppWindowToken.java
index 8cc1d02..fbb5013 100644
--- a/services/java/com/android/server/wm/AppWindowToken.java
+++ b/services/java/com/android/server/wm/AppWindowToken.java
@@ -30,10 +30,6 @@
import android.view.WindowManager;
import java.io.PrintWriter;
-import java.util.ArrayList;
-
-class AppTokenList extends ArrayList<AppWindowToken> {
-}
/**
* Version of WindowToken that is specifically for a particular application (or
diff --git a/services/java/com/android/server/wm/DisplayContent.java b/services/java/com/android/server/wm/DisplayContent.java
index 6aae202..59e4b0e 100644
--- a/services/java/com/android/server/wm/DisplayContent.java
+++ b/services/java/com/android/server/wm/DisplayContent.java
@@ -16,17 +16,11 @@
package com.android.server.wm;
-import static com.android.server.wm.WindowManagerService.FORWARD_ITERATOR;
-import static com.android.server.wm.WindowManagerService.REVERSE_ITERATOR;
-
-import android.util.SparseArray;
import android.view.Display;
import android.view.DisplayInfo;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
class DisplayContentList extends ArrayList<DisplayContent> {
}
@@ -39,7 +33,6 @@
* WindowManagerService.mWindowMap.
*/
class DisplayContent {
-// private final static String TAG = "DisplayContent";
/** Unique identifier of this stack. */
private final int mDisplayId;
@@ -74,26 +67,6 @@
final boolean isDefaultDisplay;
/**
- * Window tokens that are in the process of exiting, but still
- * on screen for animations.
- */
- final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
-
- /**
- * Application tokens that are in the process of exiting, but still
- * on screen for animations.
- */
- final AppTokenList mExitingAppTokens = new AppTokenList();
-
- /**
- * Sorted most recent at top, oldest at [0].
- */
- ArrayList<TaskList> mTaskLists = new ArrayList<TaskList>();
- SparseArray<TaskList> mTaskIdToTaskList = new SparseArray<TaskList>();
-
- private final AppTokenIterator mTmpAppIterator = new AppTokenIterator();
-
- /**
* @param display May not be null.
*/
DisplayContent(Display display) {
@@ -123,147 +96,6 @@
mDisplay.getDisplayInfo(mDisplayInfo);
}
- /**
- * Find the location to insert a new AppWindowToken into the window-ordered app token list.
- * @param addPos The location the token was inserted into in mAppTokens.
- * @param wtoken The token to insert.
- */
- void addAppToken(final int addPos, final AppWindowToken wtoken) {
- TaskList task = mTaskIdToTaskList.get(wtoken.groupId);
- if (task == null) {
- task = new TaskList(wtoken, this);
- mTaskIdToTaskList.put(wtoken.groupId, task);
- mTaskLists.add(task);
- } else {
- task.mAppTokens.add(addPos, wtoken);
- }
- }
-
- void removeAppToken(final AppWindowToken wtoken) {
- final int taskId = wtoken.groupId;
- final TaskList task = mTaskIdToTaskList.get(taskId);
- if (task != null) {
- AppTokenList appTokens = task.mAppTokens;
- appTokens.remove(wtoken);
- if (appTokens.size() == 0) {
- mTaskLists.remove(task);
- mTaskIdToTaskList.delete(taskId);
- }
- }
- }
-
- void setAppTaskId(AppWindowToken wtoken, int newTaskId) {
- final int taskId = wtoken.groupId;
- TaskList task = mTaskIdToTaskList.get(taskId);
- if (task != null) {
- AppTokenList appTokens = task.mAppTokens;
- appTokens.remove(wtoken);
- if (appTokens.size() == 0) {
- mTaskIdToTaskList.delete(taskId);
- }
- }
-
- task = mTaskIdToTaskList.get(newTaskId);
- if (task == null) {
- task = new TaskList(wtoken, this);
- mTaskIdToTaskList.put(newTaskId, task);
- } else {
- task.mAppTokens.add(wtoken);
- }
-
- wtoken.groupId = newTaskId;
- }
-
- /**
- * Return the utility iterator so we don't have to construct new iterators every time we
- * iterate.
- * NOTE: Do not ever nest this call or you will have a bad time!
- * @param reverse Direction of iterator.
- * @return The utility iterator.
- */
- AppTokenIterator getTmpAppIterator(boolean reverse) {
- mTmpAppIterator.reset(reverse);
- return mTmpAppIterator;
- }
-
- class AppTokenIterator implements Iterator<AppWindowToken> {
- boolean mReverse;
- int mTasksNdx;
- int mActivityNdx;
- TaskList mTaskList;
-
- public AppTokenIterator() {
- this(FORWARD_ITERATOR);
- }
-
- public AppTokenIterator(boolean reverse) {
- reset(reverse);
- }
-
- void reset(boolean reverse) {
- mReverse = reverse;
- mTasksNdx = reverse ? mTaskLists.size() - 1 : 0;
- getNextTaskList();
- }
-
- private void getNextTaskList() {
- if (mReverse) {
- if (mTasksNdx >= 0) {
- mTaskList = mTaskLists.get(mTasksNdx);
- --mTasksNdx;
- mActivityNdx = mTaskList.mAppTokens.size() - 1;
- }
- } else {
- if (mTasksNdx < mTaskLists.size()) {
- mTaskList = mTaskLists.get(mTasksNdx);
- ++mTasksNdx;
- mActivityNdx = 0;
- }
- }
- }
-
- @Override
- public boolean hasNext() {
- if (mTaskList == null) {
- return false;
- }
- if (mReverse) {
- return mActivityNdx >= 0;
- }
- return mActivityNdx < mTaskList.mAppTokens.size();
- }
-
- @Override
- public AppWindowToken next() {
- if (hasNext()) {
- AppWindowToken wtoken = mTaskList.mAppTokens.get(mActivityNdx);
- mActivityNdx += mReverse ? -1 : 1;
- if (!hasNext()) {
- getNextTaskList();
- }
- return wtoken;
- }
- throw new NoSuchElementException();
- }
-
- @Override
- public void remove() {
- throw new IllegalArgumentException();
- }
-
- int size() {
- int size = 0;
- for (int i = mTaskLists.size() - 1; i >= 0; --i) {
- size += mTaskLists.get(i).mAppTokens.size();
- }
- return size;
- }
-
- @Override public String toString() {
- return mTaskLists.toString();
- }
- }
-
public void dump(String prefix, PrintWriter pw) {
pw.print(prefix); pw.print("Display: mDisplayId="); pw.println(mDisplayId);
final String subPrefix = " " + prefix;
@@ -287,51 +119,7 @@
pw.print("x"); pw.print(mDisplayInfo.smallestNominalAppHeight);
pw.print("-"); pw.print(mDisplayInfo.largestNominalAppWidth);
pw.print("x"); pw.println(mDisplayInfo.largestNominalAppHeight);
- pw.print(subPrefix); pw.print("layoutNeeded="); pw.println(layoutNeeded);
- AppTokenIterator iterator = getTmpAppIterator(REVERSE_ITERATOR);
- int ndx = iterator.size() - 1;
- if (ndx >= 0) {
- pw.println();
- pw.println(" Application tokens in Z order:");
- while (iterator.hasNext()) {
- AppWindowToken wtoken = iterator.next();
- pw.print(" App #"); pw.print(ndx--);
- pw.print(' '); pw.print(wtoken); pw.println(":");
- wtoken.dump(pw, " ");
- }
- }
- if (mExitingTokens.size() > 0) {
- pw.println();
- pw.println(" Exiting tokens:");
- for (int i=mExitingTokens.size()-1; i>=0; i--) {
- WindowToken token = mExitingTokens.get(i);
- pw.print(" Exiting #"); pw.print(i);
- pw.print(' '); pw.print(token);
- pw.println(':');
- token.dump(pw, " ");
- }
- }
- if (mExitingAppTokens.size() > 0) {
- pw.println();
- pw.println(" Exiting application tokens:");
- for (int i=mExitingAppTokens.size()-1; i>=0; i--) {
- WindowToken token = mExitingAppTokens.get(i);
- pw.print(" Exiting App #"); pw.print(i);
- pw.print(' '); pw.print(token);
- pw.println(':');
- token.dump(pw, " ");
- }
- }
- if (mTaskIdToTaskList.size() > 0) {
- pw.println();
- for (int i = 0; i < mTaskIdToTaskList.size(); ++i) {
- pw.print(" TaskList #"); pw.print(i);
- pw.print(" taskId="); pw.println(mTaskIdToTaskList.keyAt(i));
- pw.print(" mAppTokens=");
- pw.println(mTaskIdToTaskList.valueAt(i).mAppTokens);
- pw.println();
- }
- }
+ pw.print(subPrefix); pw.print("layoutNeeded="); pw.print(layoutNeeded);
pw.println();
}
}
diff --git a/services/java/com/android/server/wm/TaskGroup.java b/services/java/com/android/server/wm/TaskGroup.java
deleted file mode 100644
index 1f1dd58..0000000
--- a/services/java/com/android/server/wm/TaskGroup.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.wm;
-
-import android.view.IApplicationToken;
-
-import java.util.ArrayList;
-
-public class TaskGroup {
- public int taskId = -1;
- public ArrayList<IApplicationToken> tokens = new ArrayList<IApplicationToken>();
-
- @Override
- public String toString() {
- return "id=" + taskId + " tokens=" + tokens;
- }
-}
diff --git a/services/java/com/android/server/wm/TaskList.java b/services/java/com/android/server/wm/TaskList.java
deleted file mode 100644
index 67dfa4f..0000000
--- a/services/java/com/android/server/wm/TaskList.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.wm;
-
-class TaskList {
-// private final String TAG = "TaskGroup";
- DisplayContent mDisplayContent;
- final AppTokenList mAppTokens = new AppTokenList();
- final int taskId;
-
- TaskList(AppWindowToken wtoken, DisplayContent displayContent) {
- taskId = wtoken.groupId;
- mAppTokens.add(wtoken);
- mDisplayContent = displayContent;
- }
-
- @Override
- public String toString() {
- return "id=" + taskId + " appTokens=" + mAppTokens;
- }
-}
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index 67daf75..3964782 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -10,8 +10,6 @@
import static com.android.server.wm.WindowManagerService.LayoutFields.SET_FORCE_HIDING_CHANGED;
import static com.android.server.wm.WindowManagerService.LayoutFields.SET_ORIENTATION_CHANGE_COMPLETE;
import static com.android.server.wm.WindowManagerService.LayoutFields.SET_WALLPAPER_ACTION_PENDING;
-import static com.android.server.wm.WindowManagerService.FORWARD_ITERATOR;
-import static com.android.server.wm.WindowManagerService.REVERSE_ITERATOR;
import android.content.Context;
import android.os.Debug;
@@ -28,7 +26,6 @@
import android.view.WindowManagerPolicy;
import android.view.animation.Animation;
-import com.android.server.wm.DisplayContent.AppTokenIterator;
import com.android.server.wm.WindowManagerService.DisplayContentsIterator;
import com.android.server.wm.WindowManagerService.LayoutFields;
@@ -175,12 +172,12 @@
}
}
- private void updateAppWindowsLocked(int displayId) {
+ private void updateAppWindowsLocked() {
int i;
- final DisplayContent displayContent = mService.getDisplayContentLocked(displayId);
- AppTokenIterator iterator = displayContent.getTmpAppIterator(FORWARD_ITERATOR);
- while (iterator.hasNext()) {
- final AppWindowAnimator appAnimator = iterator.next().mAppAnimator;
+ final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
+ final int NAT = appTokens.size();
+ for (i=0; i<NAT; i++) {
+ final AppWindowAnimator appAnimator = appTokens.get(i).mAppAnimator;
final boolean wasAnimating = appAnimator.animation != null
&& appAnimator.animation != AppWindowAnimator.sDummyAnimation;
if (appAnimator.stepAnimationLocked(mCurrentTime)) {
@@ -194,10 +191,9 @@
}
}
- final AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
- final int NEAT = exitingAppTokens.size();
+ final int NEAT = mService.mExitingAppTokens.size();
for (i=0; i<NEAT; i++) {
- final AppWindowAnimator appAnimator = exitingAppTokens.get(i).mAppAnimator;
+ final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator;
final boolean wasAnimating = appAnimator.animation != null
&& appAnimator.animation != AppWindowAnimator.sDummyAnimation;
if (appAnimator.stepAnimationLocked(mCurrentTime)) {
@@ -458,13 +454,13 @@
/** See if any windows have been drawn, so they (and others associated with them) can now be
* shown. */
- private void testTokenMayBeDrawnLocked(int displayId) {
+ private void testTokenMayBeDrawnLocked() {
// See if any windows have been drawn, so they (and others
// associated with them) can now be shown.
- AppTokenIterator iterator =
- mService.getDisplayContentLocked(displayId).getTmpAppIterator(FORWARD_ITERATOR);
- while (iterator.hasNext()) {
- AppWindowToken wtoken = iterator.next();
+ final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
+ final int NT = appTokens.size();
+ for (int i=0; i<NT; i++) {
+ AppWindowToken wtoken = appTokens.get(i);
AppWindowAnimator appAnimator = wtoken.mAppAnimator;
final boolean allDrawn = wtoken.allDrawn;
if (allDrawn != appAnimator.allDrawn) {
@@ -534,10 +530,11 @@
SurfaceControl.openTransaction();
SurfaceControl.setAnimationTransaction();
try {
+ updateAppWindowsLocked();
+
final int numDisplays = mDisplayContentsAnimators.size();
for (int i = 0; i < numDisplays; i++) {
final int displayId = mDisplayContentsAnimators.keyAt(i);
- updateAppWindowsLocked(displayId);
DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);
final ScreenRotationAnimation screenRotationAnimation =
@@ -563,11 +560,10 @@
}
}
+ testTokenMayBeDrawnLocked();
+
for (int i = 0; i < numDisplays; i++) {
final int displayId = mDisplayContentsAnimators.keyAt(i);
-
- testTokenMayBeDrawnLocked(displayId);
-
DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);
final ScreenRotationAnimation screenRotationAnimation =
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 086da37..a6ce54c 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -58,7 +58,6 @@
import com.android.server.input.InputManagerService;
import com.android.server.power.PowerManagerService;
import com.android.server.power.ShutdownThread;
-import com.android.server.wm.DisplayContent.AppTokenIterator;
import android.Manifest;
import android.app.ActivityManagerNative;
@@ -182,7 +181,7 @@
static final boolean DEBUG_INPUT_METHOD = false;
static final boolean DEBUG_VISIBILITY = false;
static final boolean DEBUG_WINDOW_MOVEMENT = false;
- static final boolean DEBUG_TOKEN_MOVEMENT = true;
+ static final boolean DEBUG_TOKEN_MOVEMENT = false;
static final boolean DEBUG_ORIENTATION = false;
static final boolean DEBUG_APP_ORIENTATION = false;
static final boolean DEBUG_CONFIGURATION = false;
@@ -198,7 +197,6 @@
static final boolean DEBUG_LAYOUT_REPEATS = true;
static final boolean DEBUG_SURFACE_TRACE = false;
static final boolean DEBUG_WINDOW_TRACE = false;
- static final boolean DEBUG_TASK_MOVEMENT = false;
static final boolean SHOW_SURFACE_ALLOC = false;
static final boolean SHOW_TRANSACTIONS = false;
static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS;
@@ -208,9 +206,6 @@
static final boolean PROFILE_ORIENTATION = false;
static final boolean localLOGV = DEBUG;
- final static boolean REVERSE_ITERATOR = true;
- final static boolean FORWARD_ITERATOR = false;
-
/** How much to multiply the policy's type layer, to reserve room
* for multiple windows of the same type and Z-ordering adjustment
* with TYPE_LAYER_OFFSET. */
@@ -337,7 +332,34 @@
/**
* Mapping from a token IBinder to a WindowToken object.
*/
- final HashMap<IBinder, WindowToken> mTokenMap = new HashMap<IBinder, WindowToken>();
+ final HashMap<IBinder, WindowToken> mTokenMap =
+ new HashMap<IBinder, WindowToken>();
+
+ /**
+ * Window tokens that are in the process of exiting, but still
+ * on screen for animations.
+ */
+ final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
+
+ /**
+ * List controlling the ordering of windows in different applications which must
+ * be kept in sync with ActivityManager.
+ */
+ final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>();
+
+ /**
+ * AppWindowTokens in the Z order they were in at the start of an animation. Between
+ * animations this list is maintained in the exact order of mAppTokens. If tokens
+ * are added to mAppTokens during an animation an attempt is made to insert them at the same
+ * logical location in this list. Note that this list is always in sync with mWindows.
+ */
+ ArrayList<AppWindowToken> mAnimatingAppTokens = new ArrayList<AppWindowToken>();
+
+ /**
+ * Application tokens that are in the process of exiting, but still
+ * on screen for animations.
+ */
+ final ArrayList<AppWindowToken> mExitingAppTokens = new ArrayList<AppWindowToken>();
/**
* List of window tokens that have finished starting their application,
@@ -422,12 +444,8 @@
String mLastANRState;
- /** All DisplayContents in the world, kept here */
+ /** All DisplayDontents in the world, kept here */
private SparseArray<DisplayContent> mDisplayContents = new SparseArray<DisplayContent>();
- private SparseArray<DisplayContent> mTaskIdToDisplayContents =
- new SparseArray<DisplayContent>();
-
- private final AllWindowsIterator mTmpWindowsIterator = new AllWindowsIterator();
int mRotation = 0;
int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
@@ -901,6 +919,7 @@
final WindowList windows = win.getWindowList();
final int N = windows.size();
final WindowState attached = win.mAttachedWindow;
+ int i;
WindowList tokenWindowList = getTokenWindowsOnDisplay(token, displayContent);
if (attached == null) {
int tokenWindowsPos = 0;
@@ -950,11 +969,12 @@
+ client.asBinder() + " (token=" + token + ")");
// Figure out where the window should go, based on the
// order of applications.
+ final int NA = mAnimatingAppTokens.size();
WindowState pos = null;
- AppTokenIterator iterator = displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- AppWindowToken t = iterator.next();
+ for (i=NA-1; i>=0; i--) {
+ AppWindowToken t = mAnimatingAppTokens.get(i);
if (t == token) {
+ i--;
break;
}
@@ -987,14 +1007,15 @@
} else {
// Continue looking down until we find the first
// token that has windows on this display.
- while (iterator.hasNext()) {
- AppWindowToken t = iterator.next();
- tokenWindowList = getTokenWindowsOnDisplay(t, displayContent);
+ while (i >= 0) {
+ AppWindowToken t = mAnimatingAppTokens.get(i);
+ tokenWindowList = getTokenWindowsOnDisplay(t, win.mDisplayContent);
final int NW = tokenWindowList.size();
if (NW > 0) {
pos = tokenWindowList.get(NW-1);
break;
}
+ i--;
}
if (pos != null) {
// Move in front of any windows attached to this
@@ -1013,8 +1034,7 @@
} else {
// Just search for the start of this layer.
final int myLayer = win.mBaseLayer;
- int i;
- for (i = 0; i < N; i++) {
+ for (i=0; i<N; i++) {
WindowState w = windows.get(i);
if (w.mBaseLayer > myLayer) {
break;
@@ -1032,8 +1052,7 @@
} else {
// Figure out where window should go, based on layer.
final int myLayer = win.mBaseLayer;
- int i;
- for (i = N - 1; i >= 0; i--) {
+ for (i=N-1; i>=0; i--) {
if (windows.get(i).mBaseLayer <= myLayer) {
break;
}
@@ -1058,8 +1077,7 @@
final int sublayer = win.mSubLayer;
int largestSublayer = Integer.MIN_VALUE;
WindowState windowWithLargestSublayer = null;
- int i;
- for (i = 0; i < NA; i++) {
+ for (i=0; i<NA; i++) {
WindowState w = tokenWindowList.get(i);
final int wSublayer = w.mSubLayer;
if (wSublayer >= largestSublayer) {
@@ -2464,15 +2482,22 @@
public void updateAppOpsState() {
synchronized(mWindowMap) {
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState win = mTmpWindowsIterator.next();
- if (win.mAppOp != AppOpsManager.OP_NONE) {
- final int mode = mAppOps.checkOpNoThrow(win.mAppOp, win.getOwningUid(),
- win.getOwningPackage());
- win.setAppOpVisibilityLw(mode == AppOpsManager.MODE_ALLOWED);
+ boolean changed = false;
+ for (int i=0; i<mDisplayContents.size(); i++) {
+ DisplayContent display = mDisplayContents.valueAt(i);
+ WindowList windows = display.getWindowList();
+ for (int j=0; j<windows.size(); j++) {
+ final WindowState win = windows.get(j);
+ if (win.mAppOp != AppOpsManager.OP_NONE) {
+ changed |= win.setAppOpVisibilityLw(mAppOps.checkOpNoThrow(win.mAppOp,
+ win.getOwningUid(),
+ win.getOwningPackage()) == AppOpsManager.MODE_ALLOWED);
+ }
}
}
+ if (changed) {
+ scheduleAnimationLocked();
+ }
}
}
@@ -3112,58 +3137,32 @@
// Application Window Tokens
// -------------------------------------------------------------
- public void validateAppTokens(List<TaskGroup> tasks) {
- synchronized (mWindowMap) {
- int t = tasks.size() - 1;
- if (t < 0) {
- Slog.w(TAG, "validateAppTokens: empty task list");
- return;
+ public void validateAppTokens(List<IBinder> tokens) {
+ int v = tokens.size()-1;
+ int m = mAppTokens.size()-1;
+ while (v >= 0 && m >= 0) {
+ AppWindowToken atoken = mAppTokens.get(m);
+ if (atoken.removed) {
+ m--;
+ continue;
}
-
- TaskGroup task = tasks.get(0);
- int taskId = task.taskId;
- DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent == null) {
- Slog.w(TAG, "validateAppTokens: no Display for taskId=" + taskId);
- return;
+ if (tokens.get(v) != atoken.token) {
+ Slog.w(TAG, "Tokens out of sync: external is " + tokens.get(v)
+ + " @ " + v + ", internal is " + atoken.token + " @ " + m);
}
-
- boolean mismatch = false;
- AppTokenIterator iterator = displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- for ( ; t >= 0 && !mismatch; --t) {
- task = tasks.get(t);
- List<IApplicationToken> tokens = task.tokens;
- int v = task.tokens.size() - 1;
-
- DisplayContent lastDisplayContent = displayContent;
- displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent != lastDisplayContent) {
- Slog.w(TAG, "validateAppTokens: displayContent changed in TaskGroup list!");
- return;
- }
-
- while (v >= 0) {
- if (!iterator.hasNext()) {
- mismatch = true;
- break;
- }
- AppWindowToken atoken = iterator.next();
- if (atoken.removed) {
- continue;
- }
- if (tokens.get(v) != atoken.token) {
- mismatch = true;
- break;
- }
- v--;
- }
+ v--;
+ m--;
+ }
+ while (v >= 0) {
+ Slog.w(TAG, "External token not found: " + tokens.get(v) + " @ " + v);
+ v--;
+ }
+ while (m >= 0) {
+ AppWindowToken atoken = mAppTokens.get(m);
+ if (!atoken.removed) {
+ Slog.w(TAG, "Invalid internal atoken: " + atoken.token + " @ " + m);
}
-
- if (mismatch || iterator.hasNext()) {
- Slog.w(TAG, "validateAppTokens: Mismatch! ActivityManager=" + tasks);
- Slog.w(TAG, "validateAppTokens: Mismatch! WindowManager=" + iterator);
- Slog.w(TAG, "validateAppTokens: Mismatch! Callers=" + Debug.getCallers(4));
- }
+ m--;
}
}
@@ -3227,7 +3226,6 @@
final long origId = Binder.clearCallingIdentity();
synchronized(mWindowMap) {
- DisplayContent displayContent = null;
WindowToken wtoken = mTokenMap.remove(token);
if (wtoken != null) {
boolean delayed = false;
@@ -3237,7 +3235,6 @@
for (int i=0; i<N; i++) {
WindowState win = wtoken.windows.get(i);
- displayContent = win.mDisplayContent;
if (win.mWinAnimator.isAnimating()) {
delayed = true;
@@ -3247,12 +3244,13 @@
win.mWinAnimator.applyAnimationLocked(WindowManagerPolicy.TRANSIT_EXIT,
false);
//TODO (multidisplay): Magnification is supported only for the default
- if (mDisplayMagnifier != null && win.isDefaultDisplay()) {
+ if (mDisplayMagnifier != null
+ && win.getDisplayId() == Display.DEFAULT_DISPLAY) {
mDisplayMagnifier.onWindowTransitionLocked(win,
WindowManagerPolicy.TRANSIT_EXIT);
}
changed = true;
- displayContent.layoutNeeded = true;
+ win.mDisplayContent.layoutNeeded = true;
}
}
@@ -3265,7 +3263,7 @@
}
if (delayed) {
- displayContent.mExitingTokens.add(wtoken);
+ mExitingTokens.add(wtoken);
} else if (wtoken.windowType == TYPE_WALLPAPER) {
mWallpaperTokens.remove(wtoken);
}
@@ -3279,9 +3277,27 @@
Binder.restoreCallingIdentity(origId);
}
+ /**
+ * Find the location to insert a new AppWindowToken into the window-ordered app token list.
+ * Note that mAppTokens.size() == mAnimatingAppTokens.size() + 1.
+ * @param addPos The location the token was inserted into in mAppTokens.
+ * @param atoken The token to insert.
+ */
+ private void addAppTokenToAnimating(final int addPos, final AppWindowToken atoken) {
+ if (addPos == 0 || addPos == mAnimatingAppTokens.size()) {
+ // It was inserted into the beginning or end of mAppTokens. Honor that.
+ mAnimatingAppTokens.add(addPos, atoken);
+ return;
+ }
+ // Find the item immediately above the mAppTokens insertion point and put the token
+ // immediately below that one in mAnimatingAppTokens.
+ final AppWindowToken aboveAnchor = mAppTokens.get(addPos + 1);
+ mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), atoken);
+ }
+
@Override
public void addAppToken(int addPos, IApplicationToken token,
- int taskId, int requestedOrientation, boolean fullscreen, boolean showWhenLocked) {
+ int groupId, int requestedOrientation, boolean fullscreen, boolean showWhenLocked) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"addAppToken()")) {
throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
@@ -3309,21 +3325,15 @@
}
atoken = new AppWindowToken(this, token);
atoken.inputDispatchingTimeoutNanos = inputDispatchingTimeoutNanos;
- atoken.groupId = taskId;
+ atoken.groupId = groupId;
atoken.appFullscreen = fullscreen;
atoken.showWhenLocked = showWhenLocked;
atoken.requestedOrientation = requestedOrientation;
if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
+ " at " + addPos);
-
- DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent == null) {
- displayContent = getDefaultDisplayContentLocked();
- mTaskIdToDisplayContents.put(taskId, displayContent);
- }
- displayContent.addAppToken(addPos, atoken);
+ mAppTokens.add(addPos, atoken);
+ addAppTokenToAnimating(addPos, atoken);
mTokenMap.put(token.asBinder(), atoken);
- mTaskIdToDisplayContents.put(taskId, displayContent);
// Application tokens start out hidden.
atoken.hidden = true;
@@ -3341,17 +3351,12 @@
}
synchronized(mWindowMap) {
- final AppWindowToken atoken = findAppWindowToken(token);
+ AppWindowToken atoken = findAppWindowToken(token);
if (atoken == null) {
Slog.w(TAG, "Attempted to set group id of non-existing app token: " + token);
return;
}
- DisplayContent displayContent = mTaskIdToDisplayContents.get(atoken.groupId);
- if (displayContent == null) {
- Slog.w(TAG, "setAppGroupId: No DisplayContent for taskId=" + atoken.groupId);
- displayContent = getDefaultDisplayContentLocked();
- }
- displayContent.setAppTaskId(atoken, groupId);
+ atoken.groupId = groupId;
}
}
@@ -3397,11 +3402,8 @@
boolean findingBehind = false;
boolean haveGroup = false;
boolean lastFullscreen = false;
- // TODO: Multi window.
- DisplayContent displayContent = getDefaultDisplayContentLocked();
- AppTokenIterator iterator = displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- AppWindowToken atoken = iterator.next();
+ for (int pos = mAppTokens.size() - 1; pos >= 0; pos--) {
+ AppWindowToken atoken = mAppTokens.get(pos);
if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + atoken);
@@ -4316,12 +4318,11 @@
TAG, "Removing app " + wtoken + " delayed=" + delayed
+ " animation=" + wtoken.mAppAnimator.animation
+ " animating=" + wtoken.mAppAnimator.animating);
- DisplayContent displayContent = mTaskIdToDisplayContents.get(wtoken.groupId);
if (delayed) {
// set the token aside because it has an active animation to be finished
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
"removeAppToken make exiting: " + wtoken);
- displayContent.mExitingAppTokens.add(wtoken);
+ mExitingAppTokens.add(wtoken);
} else {
// Make sure there is no animation running on this token,
// so any windows associated with it will be removed as
@@ -4331,7 +4332,8 @@
}
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
"removeAppToken: " + wtoken);
- displayContent.removeAppToken(wtoken);
+ mAppTokens.remove(wtoken);
+ mAnimatingAppTokens.remove(wtoken);
wtoken.removed = true;
if (wtoken.startingData != null) {
startingToken = wtoken;
@@ -4383,74 +4385,78 @@
}
void dumpAppTokensLocked() {
- DisplayContentsIterator iterator = new DisplayContentsIterator();
- while (iterator.hasNext()) {
- DisplayContent displayContent = iterator.next();
- Slog.v(TAG, " Display " + displayContent.getDisplayId());
- AppTokenIterator appIterator = displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- int i = appIterator.size();
- while (appIterator.hasNext()) {
- Slog.v(TAG, " #" + --i + ": " + appIterator.next().token);
- }
+ for (int i=mAppTokens.size()-1; i>=0; i--) {
+ Slog.v(TAG, " #" + i + ": " + mAppTokens.get(i).token);
+ }
+ }
+
+ void dumpAnimatingAppTokensLocked() {
+ for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
+ Slog.v(TAG, " #" + i + ": " + mAnimatingAppTokens.get(i).token);
}
}
void dumpWindowsLocked() {
int i = 0;
- mTmpWindowsIterator.reset(REVERSE_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState w = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
+ while (iterator.hasNext()) {
+ final WindowState w = iterator.next();
Slog.v(TAG, " #" + i++ + ": " + w);
}
}
- private int findAppWindowInsertionPointLocked(AppWindowToken target) {
- final int taskId = target.groupId;
- DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent == null) {
- Slog.w(TAG, "findTopAppWindowLocked: no DisplayContent for " + target);
- return 0;
- }
- final WindowList windows = displayContent.getWindowList();
+ private int findWindowOffsetLocked(WindowList windows, int tokenPos) {
final int NW = windows.size();
- AppTokenIterator iterator = displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- if (iterator.next() == target) {
- break;
+ if (tokenPos >= mAnimatingAppTokens.size()) {
+ int i = NW;
+ while (i > 0) {
+ i--;
+ WindowState win = windows.get(i);
+ if (win.getAppToken() != null) {
+ return i+1;
+ }
}
}
- while (iterator.hasNext()) {
+ while (tokenPos > 0) {
// Find the first app token below the new position that has
// a window displayed.
- final AppWindowToken wtoken = iterator.next();
- if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows in " + wtoken.token);
+ final AppWindowToken wtoken = mAppTokens.get(tokenPos-1);
+ if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows @ "
+ + tokenPos + " -- " + wtoken.token);
if (wtoken.sendingToBottom) {
- if (DEBUG_REORDER) Slog.v(TAG, "Skipping token -- currently sending to bottom");
+ if (DEBUG_REORDER) Slog.v(TAG,
+ "Skipping token -- currently sending to bottom");
+ tokenPos--;
continue;
}
- for (int i = wtoken.windows.size() - 1; i >= 0; --i) {
+ int i = wtoken.windows.size();
+ while (i > 0) {
+ i--;
WindowState win = wtoken.windows.get(i);
- for (int j = win.mChildWindows.size() - 1; j >= 0; --j) {
+ int j = win.mChildWindows.size();
+ while (j > 0) {
+ j--;
WindowState cwin = win.mChildWindows.get(j);
if (cwin.mSubLayer >= 0) {
- for (int pos = NW - 1; pos >= 0; pos--) {
+ for (int pos=NW-1; pos>=0; pos--) {
if (windows.get(pos) == cwin) {
if (DEBUG_REORDER) Slog.v(TAG,
- "Found child win @" + (pos + 1));
- return pos + 1;
+ "Found child win @" + (pos+1));
+ return pos+1;
}
}
}
}
- for (int pos = NW - 1; pos >= 0; pos--) {
+ for (int pos=NW-1; pos>=0; pos--) {
if (windows.get(pos) == win) {
- if (DEBUG_REORDER) Slog.v(TAG, "Found win @" + (pos + 1));
- return pos + 1;
+ if (DEBUG_REORDER) Slog.v(TAG, "Found win @" + (pos+1));
+ return pos+1;
}
}
}
+ tokenPos--;
}
return 0;
@@ -4499,104 +4505,198 @@
return index;
}
- private void moveTaskWindowsLocked(int taskId) {
- DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent == null) {
- Slog.w(TAG, "moveTaskWindowsLocked: can't find DisplayContent for taskId=" + taskId);
- return;
+ @Override
+ public void moveAppToken(int index, IBinder token) {
+ if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
+ "moveAppToken()")) {
+ throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
}
- TaskList taskList = displayContent.mTaskIdToTaskList.get(taskId);
- if (taskList == null) {
- Slog.w(TAG, "moveTaskWindowsLocked: can't find TaskList for taskId=" + taskId);
- return;
- }
+ synchronized(mWindowMap) {
+ if (DEBUG_REORDER) Slog.v(TAG, "Initial app tokens:");
+ if (DEBUG_REORDER) dumpAppTokensLocked();
+ final AppWindowToken wtoken = findAppWindowToken(token);
+ final int oldIndex = mAppTokens.indexOf(wtoken);
+ if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
+ "Start moving token " + wtoken + " initially at "
+ + oldIndex);
+ if (oldIndex > index && mAppTransition.isTransitionSet()) {
+ // animation towards back has not started, copy old list for duration of animation.
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
+ }
+ if (wtoken == null || !mAppTokens.remove(wtoken)) {
+ Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
+ + token + " (" + wtoken + ")");
+ return;
+ }
+ mAppTokens.add(index, wtoken);
+ if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":");
+ else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index);
+ if (DEBUG_REORDER) dumpAppTokensLocked();
+ if (!mAppTransition.isTransitionSet()) {
+ // Not animating, bring animating app list in line with mAppTokens.
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
+ // Bring window ordering, window focus and input window in line with new app token
+ final long origId = Binder.clearCallingIdentity();
+ if (DEBUG_REORDER) Slog.v(TAG, "Removing windows in " + token + ":");
+ if (DEBUG_REORDER) dumpWindowsLocked();
+ if (tmpRemoveAppWindowsLocked(wtoken)) {
+ if (DEBUG_REORDER) Slog.v(TAG, "Adding windows back in:");
+ if (DEBUG_REORDER) dumpWindowsLocked();
+ DisplayContentsIterator iterator = new DisplayContentsIterator();
+ while(iterator.hasNext()) {
+ final DisplayContent displayContent = iterator.next();
+ final WindowList windows = displayContent.getWindowList();
+ final int pos = findWindowOffsetLocked(windows, index);
+ final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken);
+ if (pos != newPos) {
+ displayContent.layoutNeeded = true;
+ }
+ }
+ if (DEBUG_REORDER) Slog.v(TAG, "Final window list:");
+ if (DEBUG_REORDER) dumpWindowsLocked();
+ updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
+ false /*updateInputWindows*/);
+ mInputMonitor.setUpdateInputWindowsNeededLw();
+ performLayoutAndPlaceSurfacesLocked();
+ mInputMonitor.updateInputWindowsLw(false /*force*/);
+ }
+ Binder.restoreCallingIdentity(origId);
+ }
+ }
+ }
+
+ private void removeAppTokensLocked(List<IBinder> tokens) {
+ // XXX This should be done more efficiently!
+ // (take advantage of the fact that both lists should be
+ // ordered in the same way.)
+ int N = tokens.size();
+ for (int i=0; i<N; i++) {
+ IBinder token = tokens.get(i);
+ final AppWindowToken wtoken = findAppWindowToken(token);
+ if (DEBUG_REORDER || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
+ "Temporarily removing " + wtoken + " from " + mAppTokens.indexOf(wtoken));
+ if (!mAppTokens.remove(wtoken)) {
+ Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
+ + token + " (" + wtoken + ")");
+ i--;
+ N--;
+ }
+ }
+ }
+
+ private void moveAppWindowsLocked(List<IBinder> tokens, int tokenPos) {
// First remove all of the windows from the list.
- for (AppWindowToken wtoken : taskList.mAppTokens) {
- tmpRemoveAppWindowsLocked(wtoken);
+ final int N = tokens.size();
+ int i;
+ for (i=0; i<N; i++) {
+ WindowToken token = mTokenMap.get(tokens.get(i));
+ if (token != null) {
+ tmpRemoveAppWindowsLocked(token);
+ }
}
// And now add them back at the correct place.
- // Where to start adding?
- int pos = findAppWindowInsertionPointLocked(taskList.mAppTokens.get(0));
- for (AppWindowToken wtoken : taskList.mAppTokens) {
- if (wtoken != null) {
- final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken);
- if (newPos != pos) {
- displayContent.layoutNeeded = true;
+ DisplayContentsIterator iterator = new DisplayContentsIterator();
+ while (iterator.hasNext()) {
+ final DisplayContent displayContent = iterator.next();
+ final WindowList windows = displayContent.getWindowList();
+ // Where to start adding?
+ int pos = findWindowOffsetLocked(windows, tokenPos);
+ for (i=0; i<N; i++) {
+ WindowToken token = mTokenMap.get(tokens.get(i));
+ if (token != null) {
+ final int newPos = reAddAppWindowsLocked(displayContent, pos, token);
+ if (newPos != pos) {
+ displayContent.layoutNeeded = true;
+ }
+ pos = newPos;
}
- pos = newPos;
+ }
+ if (!updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
+ false /*updateInputWindows*/)) {
+ assignLayersLocked(windows);
}
}
- if (!updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
- false /*updateInputWindows*/)) {
- assignLayersLocked(displayContent.getWindowList());
- }
- updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
- false /*updateInputWindows*/);
mInputMonitor.setUpdateInputWindowsNeededLw();
+
+ // Note that the above updateFocusedWindowLocked used to sit here.
+
performLayoutAndPlaceSurfacesLocked();
mInputMonitor.updateInputWindowsLw(false /*force*/);
//dump();
}
- public void moveTaskToTop(int taskId) {
- final long origId = Binder.clearCallingIdentity();
- try {
- synchronized(mWindowMap) {
- DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent == null) {
- Slog.e(TAG, "moveTaskToTop: taskId=" + taskId
- + " not found in mTaskIdToDisplayContents");
- return;
- }
- TaskList taskList = displayContent.mTaskIdToTaskList.get(taskId);
- if (taskList == null) {
- Slog.e(TAG, "moveTaskToTop: taskId=" + taskId
- + " not found in mTaskIdToTaskLists");
- return;
- }
- if (!displayContent.mTaskLists.remove(taskList)) {
- Slog.e(TAG, "moveTaskToTop: taskId=" + taskId + " not found in mTaskLists");
- }
- displayContent.mTaskLists.add(taskList);
-
- moveTaskWindowsLocked(taskId);
- }
- } finally {
- Binder.restoreCallingIdentity(origId);
+ @Override
+ public void moveAppTokensToTop(List<IBinder> tokens) {
+ if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
+ "moveAppTokensToTop()")) {
+ throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
}
+
+ final long origId = Binder.clearCallingIdentity();
+ synchronized(mWindowMap) {
+ removeAppTokensLocked(tokens);
+ final int N = tokens.size();
+ for (int i=0; i<N; i++) {
+ AppWindowToken wt = findAppWindowToken(tokens.get(i));
+ if (wt != null) {
+ if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
+ "Adding next to top: " + wt);
+ mAppTokens.add(wt);
+ if (mAppTransition.isTransitionSet()) {
+ wt.sendingToBottom = false;
+ }
+ }
+ }
+
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
+ moveAppWindowsLocked(tokens, mAppTokens.size());
+ }
+ Binder.restoreCallingIdentity(origId);
}
- public void moveTaskToBottom(int taskId) {
- final long origId = Binder.clearCallingIdentity();
- try {
- synchronized(mWindowMap) {
- DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
- if (displayContent == null) {
- Slog.e(TAG, "moveTaskToBottom: taskId=" + taskId
- + " not found in mTaskIdToDisplayContents");
- return;
- }
- TaskList taskList = displayContent.mTaskIdToTaskList.get(taskId);
- if (taskList == null) {
- Slog.e(TAG, "moveTaskToTopBottom: taskId=" + taskId
- + " not found in mTaskIdToTaskLists");
- return;
- }
- if (!displayContent.mTaskLists.remove(taskList)) {
- Slog.e(TAG, "moveTaskToBottom: taskId=" + taskId + " not found in mTaskLists");
- }
- displayContent.mTaskLists.add(0, taskList);
-
- moveTaskWindowsLocked(taskId);
- }
- } finally {
- Binder.restoreCallingIdentity(origId);
+ @Override
+ public void moveAppTokensToBottom(List<IBinder> tokens) {
+ if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
+ "moveAppTokensToBottom()")) {
+ throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
}
+
+ final long origId = Binder.clearCallingIdentity();
+ synchronized(mWindowMap) {
+ final int N = tokens.size();
+ if (N > 0) {
+ // animating towards back, hang onto old list for duration of animation.
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
+ }
+ removeAppTokensLocked(tokens);
+ int pos = 0;
+ for (int i=0; i<N; i++) {
+ AppWindowToken wt = findAppWindowToken(tokens.get(i));
+ if (wt != null) {
+ if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
+ "Adding next to bottom: " + wt + " at " + pos);
+ mAppTokens.add(pos, wt);
+ if (mAppTransition.isTransitionSet()) {
+ wt.sendingToBottom = true;
+ }
+ pos++;
+ }
+ }
+
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
+ moveAppWindowsLocked(tokens, 0);
+ }
+ Binder.restoreCallingIdentity(origId);
}
// -------------------------------------------------------------
@@ -4717,9 +4817,9 @@
@Override
public void closeSystemDialogs(String reason) {
synchronized(mWindowMap) {
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState w = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator();
+ while (iterator.hasNext()) {
+ final WindowState w = iterator.next();
if (w.mHasSurface) {
try {
w.mClient.closeSystemDialogs(reason);
@@ -5113,9 +5213,9 @@
// the background..)
if (on) {
boolean isVisible = false;
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState ws = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator();
+ while (iterator.hasNext()) {
+ final WindowState ws = iterator.next();
if (ws.mSession.mPid == pid && ws.isVisibleLw()) {
isVisible = true;
break;
@@ -6010,9 +6110,9 @@
}
synchronized (mWindowMap) {
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState w = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator();
+ while (iterator.hasNext()) {
+ final WindowState w = iterator.next();
if (System.identityHashCode(w) == hashCode) {
return w;
}
@@ -6561,10 +6661,10 @@
// TODO(multidisplay): Call isScreenOn for each display.
private void sendScreenStatusToClientsLocked() {
final boolean on = mPowerManager.isScreenOn();
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
+ final AllWindowsIterator iterator = new AllWindowsIterator();
+ while (iterator.hasNext()) {
try {
- mTmpWindowsIterator.next().mClient.dispatchScreenState(on);
+ iterator.next().mClient.dispatchScreenState(on);
} catch (RemoteException e) {
// Ignored
}
@@ -6860,6 +6960,8 @@
if (mAppTransition.isTransitionSet()) {
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** APP TRANSITION TIMEOUT");
mAppTransition.setTimeout();
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
performLayoutAndPlaceSurfacesLocked();
}
}
@@ -6904,11 +7006,10 @@
case APP_FREEZE_TIMEOUT: {
synchronized (mWindowMap) {
Slog.w(TAG, "App freeze timeout expired.");
- DisplayContent displayContent = getDefaultDisplayContentLocked();
- AppTokenIterator iterator =
- displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- while (iterator.hasNext()) {
- AppWindowToken tok = iterator.next();
+ int i = mAppTokens.size();
+ while (i > 0) {
+ i--;
+ AppWindowToken tok = mAppTokens.get(i);
if (tok.mAppAnimator.freezingScreen) {
Slog.w(TAG, "Force clearing freeze: " + tok);
unsetAppFreezingScreenLocked(tok, true, true);
@@ -7307,7 +7408,6 @@
performLayoutAndPlaceSurfacesLocked();
}
- @Override
public void setOverscan(int displayId, int left, int top, int right, int bottom) {
if (mContext.checkCallingOrSelfPermission(
android.Manifest.permission.WRITE_SECURE_SETTINGS) !=
@@ -7426,16 +7526,15 @@
// in the main app list, but still have windows shown. We put them
// in the back because now that the animation is over we no longer
// will care about them.
- AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
- int NT = exitingAppTokens.size();
+ int NT = mExitingAppTokens.size();
for (int j=0; j<NT; j++) {
- i = reAddAppWindowsLocked(displayContent, i, exitingAppTokens.get(j));
+ i = reAddAppWindowsLocked(displayContent, i, mExitingAppTokens.get(j));
}
// And add in the still active app tokens in Z order.
- AppTokenIterator iterator = displayContent.getTmpAppIterator(FORWARD_ITERATOR);
- while (iterator.hasNext()) {
- i = reAddAppWindowsLocked(displayContent, i, iterator.next());
+ NT = mAnimatingAppTokens.size();
+ for (int j=0; j<NT; j++) {
+ i = reAddAppWindowsLocked(displayContent, i, mAnimatingAppTokens.get(j));
}
i -= lastBelow;
@@ -7455,7 +7554,7 @@
}
}
Slog.w(TAG, "Current app token list:");
- dumpAppTokensLocked();
+ dumpAnimatingAppTokensLocked();
Slog.w(TAG, "Final window list:");
dumpWindowsLocked();
}
@@ -8105,11 +8204,11 @@
mAppTransition.setIdle();
// Restore window app tokens to the ActivityManager views
- final DisplayContent displayContent = getDefaultDisplayContentLocked();
- AppTokenIterator iterator = displayContent.getTmpAppIterator(FORWARD_ITERATOR);
- while (iterator.hasNext()) {
- iterator.next().sendingToBottom = false;
+ for (int i = mAnimatingAppTokens.size() - 1; i >= 0; i--) {
+ mAnimatingAppTokens.get(i).sendingToBottom = false;
}
+ mAnimatingAppTokens.clear();
+ mAnimatingAppTokens.addAll(mAppTokens);
rebuildAppWindowListLocked();
changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
@@ -8266,12 +8365,13 @@
}
}
- private void updateAllDrawnLocked(DisplayContent displayContent) {
+ private void updateAllDrawnLocked() {
// See if any windows have been drawn, so they (and others
// associated with them) can now be shown.
- AppTokenIterator iterator = displayContent.getTmpAppIterator(FORWARD_ITERATOR);
- while (iterator.hasNext()) {
- AppWindowToken wtoken = iterator.next();
+ final ArrayList<AppWindowToken> appTokens = mAnimatingAppTokens;
+ final int NT = appTokens.size();
+ for (int i=0; i<NT; i++) {
+ AppWindowToken wtoken = appTokens.get(i);
if (!wtoken.allDrawn) {
int numInteresting = wtoken.numInterestingWindows;
if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
@@ -8303,17 +8403,13 @@
}
// Initialize state of exiting tokens.
- DisplayContentsIterator iterator = new DisplayContentsIterator();
- while (iterator.hasNext()) {
- final DisplayContent displayContent = iterator.next();
- for (i=displayContent.mExitingTokens.size()-1; i>=0; i--) {
- displayContent.mExitingTokens.get(i).hasVisible = false;
- }
+ for (i=mExitingTokens.size()-1; i>=0; i--) {
+ mExitingTokens.get(i).hasVisible = false;
+ }
- // Initialize state of exiting applications.
- for (i=displayContent.mExitingAppTokens.size()-1; i>=0; i--) {
- displayContent.mExitingAppTokens.get(i).hasVisible = false;
- }
+ // Initialize state of exiting applications.
+ for (i=mExitingAppTokens.size()-1; i>=0; i--) {
+ mExitingAppTokens.get(i).hasVisible = false;
}
mInnerFields.mHoldScreen = null;
@@ -8342,10 +8438,10 @@
}
boolean focusDisplayed = false;
+ boolean updateAllDrawn = false;
- iterator = new DisplayContentsIterator();
+ DisplayContentsIterator iterator = new DisplayContentsIterator();
while (iterator.hasNext()) {
- boolean updateAllDrawn = false;
final DisplayContent displayContent = iterator.next();
WindowList windows = displayContent.getWindowList();
DisplayInfo displayInfo = displayContent.getDisplayInfo();
@@ -8589,10 +8685,10 @@
if (!mInnerFields.mDimming && mAnimator.isDimmingLocked(displayId)) {
stopDimmingLocked(displayId);
}
+ }
- if (updateAllDrawn) {
- updateAllDrawnLocked(displayContent);
- }
+ if (updateAllDrawn) {
+ updateAllDrawnLocked();
}
if (focusDisplayed) {
@@ -8739,35 +8835,30 @@
}
// Time to remove any exiting tokens?
- iterator = new DisplayContentsIterator();
- while (iterator.hasNext()) {
- final DisplayContent displayContent = iterator.next();
- ArrayList<WindowToken> exitingTokens = displayContent.mExitingTokens;
- for (i = exitingTokens.size() - 1; i >= 0; i--) {
- WindowToken token = exitingTokens.get(i);
- if (!token.hasVisible) {
- exitingTokens.remove(i);
- if (token.windowType == TYPE_WALLPAPER) {
- mWallpaperTokens.remove(token);
- }
+ for (i=mExitingTokens.size()-1; i>=0; i--) {
+ WindowToken token = mExitingTokens.get(i);
+ if (!token.hasVisible) {
+ mExitingTokens.remove(i);
+ if (token.windowType == TYPE_WALLPAPER) {
+ mWallpaperTokens.remove(token);
}
}
+ }
- // Time to remove any exiting applications?
- AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
- for (i = exitingAppTokens.size() - 1; i >= 0; i--) {
- AppWindowToken token = exitingAppTokens.get(i);
- if (!token.hasVisible && !mClosingApps.contains(token)) {
- // Make sure there is no animation running on this token,
- // so any windows associated with it will be removed as
- // soon as their animations are complete
- token.mAppAnimator.clearAnimation();
- token.mAppAnimator.animating = false;
- if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
- "performLayout: App token exiting now removed" + token);
- displayContent.removeAppToken(token);
- exitingAppTokens.remove(i);
- }
+ // Time to remove any exiting applications?
+ for (i=mExitingAppTokens.size()-1; i>=0; i--) {
+ AppWindowToken token = mExitingAppTokens.get(i);
+ if (!token.hasVisible && !mClosingApps.contains(token)) {
+ // Make sure there is no animation running on this token,
+ // so any windows associated with it will be removed as
+ // soon as their animations are complete
+ token.mAppAnimator.clearAnimation();
+ token.mAppAnimator.animating = false;
+ if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
+ "performLayout: App token exiting now removed" + token);
+ mAppTokens.remove(token);
+ mAnimatingAppTokens.remove(token);
+ mExitingAppTokens.remove(i);
}
}
@@ -8787,7 +8878,7 @@
defaultDisplay.layoutNeeded = true;
}
- iterator = new DisplayContentsIterator();
+ DisplayContentsIterator iterator = new DisplayContentsIterator();
while (iterator.hasNext()) {
DisplayContent displayContent = iterator.next();
if (displayContent.pendingLayoutChanges != 0) {
@@ -9038,10 +9129,10 @@
// window list to make sure we haven't left any dangling surfaces
// around.
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
+ AllWindowsIterator iterator = new AllWindowsIterator();
Slog.i(TAG, "Out of memory for surface! Looking for leaks...");
- while (mTmpWindowsIterator.hasNext()) {
- WindowState ws = mTmpWindowsIterator.next();
+ while (iterator.hasNext()) {
+ WindowState ws = iterator.next();
WindowStateAnimator wsa = ws.mWinAnimator;
if (wsa.mSurfaceControl != null) {
if (!mSessions.contains(wsa.mSession)) {
@@ -9074,9 +9165,9 @@
if (!leakedSurface) {
Slog.w(TAG, "No leaked surfaces; killing applicatons!");
SparseIntArray pidCandidates = new SparseIntArray();
- mTmpWindowsIterator.reset(FORWARD_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- WindowState ws = mTmpWindowsIterator.next();
+ iterator = new AllWindowsIterator();
+ while (iterator.hasNext()) {
+ WindowState ws = iterator.next();
if (mForceRemoves.contains(ws)) {
continue;
}
@@ -9202,8 +9293,8 @@
}
private WindowState findFocusedWindowLocked(DisplayContent displayContent) {
- AppTokenIterator iterator = displayContent.getTmpAppIterator(REVERSE_ITERATOR);
- WindowToken nextApp = iterator.hasNext() ? iterator.next() : null;
+ int nextAppIndex = mAppTokens.size()-1;
+ WindowToken nextApp = nextAppIndex >= 0 ? mAppTokens.get(nextAppIndex) : null;
final WindowList windows = displayContent.getWindowList();
for (int i = windows.size() - 1; i >= 0; i--) {
@@ -9229,8 +9320,8 @@
// through the app tokens until we find its app.
if (thisApp != null && nextApp != null && thisApp != nextApp
&& win.mAttrs.type != TYPE_APPLICATION_STARTING) {
- final WindowToken origAppToken = nextApp;
- while (iterator.hasNext()) {
+ int origAppIndex = nextAppIndex;
+ while (nextAppIndex > 0) {
if (nextApp == mFocusedApp) {
// Whoops, we are below the focused app... no focus
// for you!
@@ -9238,7 +9329,8 @@
TAG, "Reached focused app: " + mFocusedApp);
return null;
}
- nextApp = iterator.next();
+ nextAppIndex--;
+ nextApp = mAppTokens.get(nextAppIndex);
if (nextApp == thisApp) {
break;
}
@@ -9247,14 +9339,8 @@
// Uh oh, the app token doesn't exist! This shouldn't
// happen, but if it does we can get totally hosed...
// so restart at the original app.
- nextApp = origAppToken;
- iterator = displayContent.new AppTokenIterator(true);
- while (iterator.hasNext()) {
- // return iterator to same place.
- if (iterator.next() == origAppToken) {
- break;
- }
- }
+ nextAppIndex = origAppIndex;
+ nextApp = mAppTokens.get(nextAppIndex);
}
}
@@ -9624,6 +9710,15 @@
}
}
}
+ if (mAppTokens.size() > 0) {
+ pw.println();
+ pw.println(" Application tokens in Z order:");
+ for (int i=mAppTokens.size()-1; i>=0; i--) {
+ pw.print(" App #"); pw.print(i);
+ pw.print(' '); pw.print(mAppTokens.get(i)); pw.println(":");
+ mAppTokens.get(i).dump(pw, " ");
+ }
+ }
if (mFinishedStarting.size() > 0) {
pw.println();
pw.println(" Finishing start of application tokens:");
@@ -9639,6 +9734,51 @@
}
}
}
+ if (mExitingTokens.size() > 0) {
+ pw.println();
+ pw.println(" Exiting tokens:");
+ for (int i=mExitingTokens.size()-1; i>=0; i--) {
+ WindowToken token = mExitingTokens.get(i);
+ pw.print(" Exiting #"); pw.print(i);
+ pw.print(' '); pw.print(token);
+ if (dumpAll) {
+ pw.println(':');
+ token.dump(pw, " ");
+ } else {
+ pw.println();
+ }
+ }
+ }
+ if (mExitingAppTokens.size() > 0) {
+ pw.println();
+ pw.println(" Exiting application tokens:");
+ for (int i=mExitingAppTokens.size()-1; i>=0; i--) {
+ WindowToken token = mExitingAppTokens.get(i);
+ pw.print(" Exiting App #"); pw.print(i);
+ pw.print(' '); pw.print(token);
+ if (dumpAll) {
+ pw.println(':');
+ token.dump(pw, " ");
+ } else {
+ pw.println();
+ }
+ }
+ }
+ if (mAppTransition.isRunning() && mAnimatingAppTokens.size() > 0) {
+ pw.println();
+ pw.println(" Application tokens during animation:");
+ for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
+ WindowToken token = mAnimatingAppTokens.get(i);
+ pw.print(" App moving to bottom #"); pw.print(i);
+ pw.print(' '); pw.print(token);
+ if (dumpAll) {
+ pw.println(':');
+ token.dump(pw, " ");
+ } else {
+ pw.println();
+ }
+ }
+ }
if (mOpeningApps.size() > 0 || mClosingApps.size() > 0) {
pw.println();
if (mOpeningApps.size() > 0) {
@@ -9683,9 +9823,9 @@
void dumpWindowsNoHeaderLocked(PrintWriter pw, boolean dumpAll,
ArrayList<WindowState> windows) {
int j = 0;
- mTmpWindowsIterator.reset(REVERSE_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState w = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
+ while (iterator.hasNext()) {
+ final WindowState w = iterator.next();
if (windows == null || windows.contains(w)) {
pw.print(" Window #"); pw.print(j++); pw.print(' ');
pw.print(w); pw.println(":");
@@ -9871,9 +10011,9 @@
WindowList windows = new WindowList();
if ("visible".equals(name)) {
synchronized(mWindowMap) {
- mTmpWindowsIterator.reset(REVERSE_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState w = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
+ while (iterator.hasNext()) {
+ final WindowState w = iterator.next();
if (w.mWinAnimator.mSurfaceShown) {
windows.add(w);
}
@@ -9888,9 +10028,9 @@
} catch (RuntimeException e) {
}
synchronized(mWindowMap) {
- mTmpWindowsIterator.reset(REVERSE_ITERATOR);
- while (mTmpWindowsIterator.hasNext()) {
- final WindowState w = mTmpWindowsIterator.next();
+ final AllWindowsIterator iterator = new AllWindowsIterator(REVERSE_ITERATOR);
+ while (iterator.hasNext()) {
+ final WindowState w = iterator.next();
if (name != null) {
if (w.mAttrs.getTitle().toString().contains(name)) {
windows.add(w);
@@ -10143,10 +10283,6 @@
class DisplayContentsIterator implements Iterator<DisplayContent> {
private int cur;
- void reset() {
- cur = 0;
- }
-
@Override
public boolean hasNext() {
return cur < mDisplayContents.size();
@@ -10166,6 +10302,7 @@
}
}
+ final static boolean REVERSE_ITERATOR = true;
class AllWindowsIterator implements Iterator<WindowState> {
private DisplayContent mDisplayContent;
private DisplayContentsIterator mDisplayContentsIterator;
@@ -10174,33 +10311,19 @@
private boolean mReverse;
AllWindowsIterator() {
- this(false);
+ mDisplayContentsIterator = new DisplayContentsIterator();
+ mDisplayContent = mDisplayContentsIterator.next();
+ mWindowList = mDisplayContent.getWindowList();
}
AllWindowsIterator(boolean reverse) {
- mDisplayContentsIterator = new DisplayContentsIterator();
- reset(reverse);
- }
-
- void reset(boolean reverse) {
+ this();
mReverse = reverse;
- mDisplayContentsIterator.reset();
- if (mDisplayContentsIterator.hasNext()) {
- mDisplayContent = mDisplayContentsIterator.next();
- mWindowList = mDisplayContent.getWindowList();
- mWindowListIndex = reverse ? mWindowList.size() - 1 : 0;
- } else {
- mDisplayContent = null;
- mWindowList = null;
- mWindowListIndex = 0;
- }
+ mWindowListIndex = reverse ? mWindowList.size() - 1 : 0;
}
@Override
public boolean hasNext() {
- if (mDisplayContent == null) {
- return false;
- }
if (mReverse) {
return mWindowListIndex >= 0;
}
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 517c4e4..a600623 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -52,12 +52,6 @@
import java.util.ArrayList;
class WindowList extends ArrayList<WindowState> {
- WindowList() {
- super();
- }
- WindowList(WindowList windows) {
- super(windows);
- }
}
/**
@@ -1092,7 +1086,7 @@
return true;
}
- public void setAppOpVisibilityLw(boolean state) {
+ public boolean setAppOpVisibilityLw(boolean state) {
if (mAppOpVisibility != state) {
mAppOpVisibility = state;
if (state) {
@@ -1102,11 +1096,13 @@
// ops modifies they should only be hidden by policy due to the
// lock screen, and the user won't be changing this if locked.
// Plus it will quickly be fixed the next time we do a layout.
- showLw(true, true);
+ showLw(true, false);
} else {
- hideLw(true, true);
+ hideLw(true, false);
}
+ return true;
}
+ return false;
}
@Override
diff --git a/services/java/com/android/server/wm/WindowToken.java b/services/java/com/android/server/wm/WindowToken.java
index 2267123..bd0ace8 100644
--- a/services/java/com/android/server/wm/WindowToken.java
+++ b/services/java/com/android/server/wm/WindowToken.java
@@ -19,6 +19,7 @@
import android.os.IBinder;
import java.io.PrintWriter;
+import java.util.ArrayList;
/**
* Container of a set of related windows in the window manager. Often this
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
index c4911a0..7ef1485 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
@@ -22,8 +22,6 @@
import android.content.IntentFilter;
import android.content.pm.UserInfo;
import android.os.Bundle;
-import android.os.Debug;
-import android.os.Environment;
import android.os.UserHandle;
import android.os.UserManager;
import android.test.AndroidTestCase;
@@ -67,6 +65,9 @@
&& !user.isAdmin()
&& !user.isPrimary()) {
found = true;
+ Bundle restrictions = mUserManager.getUserRestrictions(user.getUserHandle());
+ assertTrue("New user should have ALLOW_CONFIG_WIFI =true by default",
+ restrictions.getBoolean(UserManager.ALLOW_CONFIG_WIFI));
}
}
assertTrue(found);
diff --git a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
index 03871f6..746ac06 100644
--- a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
+++ b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java
@@ -222,7 +222,37 @@
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
- }
+
+ try {
+ mWm.moveAppToken(0, null);
+ fail("IWindowManager.moveAppToken did not throw SecurityException as"
+ + " expected");
+ } catch (SecurityException e) {
+ // expected
+ } catch (RemoteException e) {
+ fail("Unexpected remote exception");
+ }
+
+ try {
+ mWm.moveAppTokensToTop(null);
+ fail("IWindowManager.moveAppTokensToTop did not throw SecurityException as"
+ + " expected");
+ } catch (SecurityException e) {
+ // expected
+ } catch (RemoteException e) {
+ fail("Unexpected remote exception");
+ }
+
+ try {
+ mWm.moveAppTokensToBottom(null);
+ fail("IWindowManager.moveAppTokensToBottom did not throw SecurityException as"
+ + " expected");
+ } catch (SecurityException e) {
+ // expected
+ } catch (RemoteException e) {
+ fail("Unexpected remote exception");
+ }
+ }
@SmallTest
public void testDISABLE_KEYGUARD() {
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 5cec06f..84f5a5c 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -1283,7 +1283,7 @@
// network location feature, we infer that it meant to
printf("uses-feature:'android.hardware.location.network'\n");
printf("uses-implied-feature:'android.hardware.location.network'," \
- "'requested android.permission.ACCESS_COURSE_LOCATION permission'\n");
+ "'requested android.permission.ACCESS_COARSE_LOCATION permission'\n");
}
// Bluetooth-related compatibility logic
diff --git a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
index 278413e..59ae1a1 100644
--- a/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
+++ b/tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
@@ -210,6 +210,24 @@
}
@Override
+ public void moveAppToken(int arg0, IBinder arg1) throws RemoteException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void moveAppTokensToBottom(List<IBinder> arg0) throws RemoteException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void moveAppTokensToTop(List<IBinder> arg0) throws RemoteException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
public IWindowSession openSession(IInputMethodClient arg0, IInputContext arg1)
throws RemoteException {
// TODO Auto-generated method stub