Lines Matching defs:env

38     virtual void raiseException(JNIEnv* env, const char* msg, jthrowable exceptionObj);
40 void pollOnce(JNIEnv* env, int timeoutMillis);
56 bool MessageQueue::raiseAndClearException(JNIEnv* env, const char* msg) {
57 jthrowable exceptionObj = env->ExceptionOccurred();
59 env->ExceptionClear();
60 raiseException(env, msg, exceptionObj);
61 env->DeleteLocalRef(exceptionObj);
78 void NativeMessageQueue::raiseException(JNIEnv* env, const char* msg, jthrowable exceptionObj) {
82 env->DeleteLocalRef(mExceptionObj);
84 mExceptionObj = jthrowable(env->NewLocalRef(exceptionObj));
86 jniLogException(env, ANDROID_LOG_ERROR, LOG_TAG, exceptionObj);
89 jniLogException(env, ANDROID_LOG_ERROR, LOG_TAG, exceptionObj);
95 void NativeMessageQueue::pollOnce(JNIEnv* env, int timeoutMillis) {
100 env->Throw(mExceptionObj);
101 env->DeleteLocalRef(mExceptionObj);
112 static NativeMessageQueue* android_os_MessageQueue_getNativeMessageQueue(JNIEnv* env,
114 jint intPtr = env->GetIntField(messageQueueObj, gMessageQueueClassInfo.mPtr);
118 static void android_os_MessageQueue_setNativeMessageQueue(JNIEnv* env, jobject messageQueueObj,
120 env->SetIntField(messageQueueObj, gMessageQueueClassInfo.mPtr,
124 sp<MessageQueue> android_os_MessageQueue_getMessageQueue(JNIEnv* env, jobject messageQueueObj) {
126 android_os_MessageQueue_getNativeMessageQueue(env, messageQueueObj);
130 static void android_os_MessageQueue_nativeInit(JNIEnv* env, jobject obj) {
133 jniThrowRuntimeException(env, "Unable to allocate native queue");
137 nativeMessageQueue->incStrong(env);
138 android_os_MessageQueue_setNativeMessageQueue(env, obj, nativeMessageQueue);
141 static void android_os_MessageQueue_nativeDestroy(JNIEnv* env, jobject obj) {
143 android_os_MessageQueue_getNativeMessageQueue(env, obj);
145 android_os_MessageQueue_setNativeMessageQueue(env, obj, NULL);
146 nativeMessageQueue->decStrong(env);
150 static void throwQueueNotInitialized(JNIEnv* env) {
151 jniThrowException(env, "java/lang/IllegalStateException", "Message queue not initialized");
154 static void android_os_MessageQueue_nativePollOnce(JNIEnv* env, jobject obj,
157 nativeMessageQueue->pollOnce(env, timeoutMillis);
160 static void android_os_MessageQueue_nativeWake(JNIEnv* env, jobject obj, jint ptr) {
176 var = env->FindClass(className); \
180 var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
183 int register_android_os_MessageQueue(JNIEnv* env) {
184 int res = jniRegisterNativeMethods(env, "android/os/MessageQueue",