Home
last modified time | relevance | path

Searched refs:env (Results 1 – 25 of 146) sorted by relevance

123456

/packages/services/BuiltInPrintService/jni/lib/
DwprintJNI.c132 static void stringToJava(JNIEnv *env, jobject obj, jfieldID id, const char *str);
284 static void _get_pdf_page_range(JNIEnv *env, jobject javaJobParams, int *pages_ary, int num_pages, in _get_pdf_page_range() argument
287 jstring pageRangeObject = (jstring) (*env)->GetObjectField(env, javaJobParams, in _get_pdf_page_range()
290 int page_range_size = (*env)->GetStringLength(env, pageRangeObject); in _get_pdf_page_range()
291 const jbyte *pageRange = (jbyte *) (*env)->GetStringUTFChars(env, pageRangeObject, 0); in _get_pdf_page_range()
303 (*env)->ReleaseStringUTFChars(env, pageRangeObject, (const char *) pageRange); in _get_pdf_page_range()
386 static void _initJNI(JNIEnv *env, jobject callbackReceiver, jstring fakeDir) { in _initJNI() argument
387 _fakeDir = (jstring) (*env)->NewGlobalRef(env, fakeDir); in _initJNI()
390 _LocalJobParamsClass = (jclass) (*env)->NewGlobalRef( in _initJNI()
391 env, (*env)->FindClass(env, "com/android/bips/jni/LocalJobParams")); in _initJNI()
[all …]
/packages/providers/MediaProvider/jni/
DMediaProviderWrapper.cpp50 static bool CheckForJniException(JNIEnv* env) { in CheckForJniException() argument
51 if (env->ExceptionCheck()) { in CheckForJniException()
52 env->ExceptionDescribe(); in CheckForJniException()
53 env->ExceptionClear(); in CheckForJniException()
62 static jfieldID CacheField(JNIEnv* env, jclass clazz, const char field_name[], const char type[]) { in CacheField() argument
65 fid = env->GetFieldID(clazz, actual_field_name.c_str(), type); in CacheField()
72 int insertFileInternal(JNIEnv* env, jobject media_provider_object, jmethodID mid_insert_file, in insertFileInternal() argument
74 ScopedLocalRef<jstring> j_path(env, env->NewStringUTF(path.c_str())); in insertFileInternal()
75 int res = env->CallIntMethod(media_provider_object, mid_insert_file, j_path.get(), uid); in insertFileInternal()
77 if (CheckForJniException(env)) { in insertFileInternal()
[all …]
/packages/inputmethods/LatinIME/native/jni/
Dcom_android_inputmethod_latin_BinaryDictionary.cpp45 static jlong latinime_BinaryDictionary_open(JNIEnv *env, jclass clazz, jstring sourceDir, in latinime_BinaryDictionary_open() argument
49 const jsize sourceDirUtf8Length = env->GetStringUTFLength(sourceDir); in latinime_BinaryDictionary_open()
55 env->GetStringUTFRegion(sourceDir, 0, env->GetStringLength(sourceDir), sourceDirChars); in latinime_BinaryDictionary_open()
66 new Dictionary(env, std::move(dictionaryStructureWithBufferPolicy)); in latinime_BinaryDictionary_open()
71 static jlong latinime_BinaryDictionary_createOnMemory(JNIEnv *env, jclass clazz, in latinime_BinaryDictionary_createOnMemory() argument
74 const jsize localeUtf8Length = env->GetStringUTFLength(locale); in latinime_BinaryDictionary_createOnMemory()
76 env->GetStringUTFRegion(locale, 0, env->GetStringLength(locale), localeChars); in latinime_BinaryDictionary_createOnMemory()
80 const int keyCount = env->GetArrayLength(attributeKeyStringArray); in latinime_BinaryDictionary_createOnMemory()
81 const int valueCount = env->GetArrayLength(attributeValueStringArray); in latinime_BinaryDictionary_createOnMemory()
86 JniDataUtils::constructAttributeMap(env, attributeKeyStringArray, in latinime_BinaryDictionary_createOnMemory()
[all …]
Dcom_android_inputmethod_latin_BinaryDictionaryUtils.cpp32 static jboolean latinime_BinaryDictionaryUtils_createEmptyDictFile(JNIEnv *env, jclass clazz, in latinime_BinaryDictionaryUtils_createEmptyDictFile() argument
35 const jsize filePathUtf8Length = env->GetStringUTFLength(filePath); in latinime_BinaryDictionaryUtils_createEmptyDictFile()
37 env->GetStringUTFRegion(filePath, 0, env->GetStringLength(filePath), filePathChars); in latinime_BinaryDictionaryUtils_createEmptyDictFile()
40 const jsize localeUtf8Length = env->GetStringUTFLength(locale); in latinime_BinaryDictionaryUtils_createEmptyDictFile()
42 env->GetStringUTFRegion(locale, 0, env->GetStringLength(locale), localeChars); in latinime_BinaryDictionaryUtils_createEmptyDictFile()
47 const int keyCount = env->GetArrayLength(attributeKeyStringArray); in latinime_BinaryDictionaryUtils_createEmptyDictFile()
48 const int valueCount = env->GetArrayLength(attributeValueStringArray); in latinime_BinaryDictionaryUtils_createEmptyDictFile()
53 JniDataUtils::constructAttributeMap(env, attributeKeyStringArray, in latinime_BinaryDictionaryUtils_createEmptyDictFile()
59 static jfloat latinime_BinaryDictionaryUtils_calcNormalizedScore(JNIEnv *env, jclass clazz, in latinime_BinaryDictionaryUtils_calcNormalizedScore() argument
61 jsize beforeLength = env->GetArrayLength(before); in latinime_BinaryDictionaryUtils_calcNormalizedScore()
[all …]
/packages/apps/Bluetooth/jni/
Dcom_android_bluetooth_btservice_AdapterService.cpp405 static jobject createClassicOobDataObject(JNIEnv* env, bt_oob_data_t oob_data) { in createClassicOobDataObject() argument
408 env->FindClass("android/bluetooth/OobData$ClassicBuilder"); in createClassicOobDataObject()
410 jbyteArray confirmationHash = env->NewByteArray(OOB_C_SIZE); in createClassicOobDataObject()
411 env->SetByteArrayRegion(confirmationHash, 0, OOB_C_SIZE, in createClassicOobDataObject()
414 jbyteArray oobDataLength = env->NewByteArray(OOB_DATA_LEN_SIZE); in createClassicOobDataObject()
415 env->SetByteArrayRegion(oobDataLength, 0, OOB_DATA_LEN_SIZE, in createClassicOobDataObject()
418 jbyteArray address = env->NewByteArray(OOB_ADDRESS_SIZE); in createClassicOobDataObject()
419 env->SetByteArrayRegion(address, 0, OOB_ADDRESS_SIZE, in createClassicOobDataObject()
423 env->GetMethodID(classicBuilderClass, "<init>", "([B[B[B)V"); in createClassicOobDataObject()
426 env->NewObject(classicBuilderClass, classicBuilderConstructor, in createClassicOobDataObject()
[all …]
Dcom_android_bluetooth_gatt.cpp79 static RawAddress str2addr(JNIEnv* env, jstring address) { in str2addr() argument
81 const char* c_address = env->GetStringUTFChars(address, NULL); in str2addr()
85 env->ReleaseStringUTFChars(address, c_address); in str2addr()
90 static jstring bdaddr2newjstr(JNIEnv* env, const RawAddress* bda) { in bdaddr2newjstr() argument
96 return env->NewStringUTF(c_address); in bdaddr2newjstr()
99 static std::vector<uint8_t> toVector(JNIEnv* env, jbyteArray ba) { in toVector() argument
100 jbyte* data_data = env->GetByteArrayElements(ba, NULL); in toVector()
101 uint16_t data_len = (uint16_t)env->GetArrayLength(ba); in toVector()
103 env->ReleaseByteArrayElements(ba, data_data, JNI_ABORT); in toVector()
433 void fillGattDbElementArray(JNIEnv* env, jobject* array, in fillGattDbElementArray() argument
[all …]
Dcom_android_bluetooth_avrcp_target.cpp173 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
174 method_getCurrentSongInfo = env->GetMethodID( in classInitNative()
177 method_getPlaybackStatus = env->GetMethodID( in classInitNative()
181 env->GetMethodID(clazz, "sendMediaKeyEvent", "(IZ)V"); in classInitNative()
184 env->GetMethodID(clazz, "getCurrentMediaId", "()Ljava/lang/String;"); in classInitNative()
187 env->GetMethodID(clazz, "getNowPlayingList", "()Ljava/util/List;"); in classInitNative()
190 env->GetMethodID(clazz, "getCurrentPlayerId", "()I"); in classInitNative()
193 env->GetMethodID(clazz, "getMediaPlayerList", "()Ljava/util/List;"); in classInitNative()
195 method_setBrowsedPlayer = env->GetMethodID(clazz, "setBrowsedPlayer", "(I)V"); in classInitNative()
197 method_getFolderItemsRequest = env->GetMethodID( in classInitNative()
[all …]
Dcom_android_bluetooth_hfpclient.cpp411 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
413 env->GetMethodID(clazz, "onConnectionStateChanged", "(III[B)V"); in classInitNative()
415 env->GetMethodID(clazz, "onAudioStateChanged", "(I[B)V"); in classInitNative()
417 env->GetMethodID(clazz, "onVrStateChanged", "(I[B)V"); in classInitNative()
418 method_onNetworkState = env->GetMethodID(clazz, "onNetworkState", "(I[B)V"); in classInitNative()
419 method_onNetworkRoaming = env->GetMethodID(clazz, "onNetworkRoaming", "(I[B)V"); in classInitNative()
420 method_onNetworkSignal = env->GetMethodID(clazz, "onNetworkSignal", "(I[B)V"); in classInitNative()
421 method_onBatteryLevel = env->GetMethodID(clazz, "onBatteryLevel", "(I[B)V"); in classInitNative()
423 env->GetMethodID(clazz, "onCurrentOperator", "(Ljava/lang/String;[B)V"); in classInitNative()
424 method_onCall = env->GetMethodID(clazz, "onCall", "(I[B)V"); in classInitNative()
[all …]
Dcom_android_bluetooth_hfp.cpp405 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
407 env->GetMethodID(clazz, "onConnectionStateChanged", "(I[B)V"); in classInitNative()
409 env->GetMethodID(clazz, "onAudioStateChanged", "(I[B)V"); in classInitNative()
411 env->GetMethodID(clazz, "onVrStateChanged", "(I[B)V"); in classInitNative()
412 method_onAnswerCall = env->GetMethodID(clazz, "onAnswerCall", "([B)V"); in classInitNative()
413 method_onHangupCall = env->GetMethodID(clazz, "onHangupCall", "([B)V"); in classInitNative()
415 env->GetMethodID(clazz, "onVolumeChanged", "(II[B)V"); in classInitNative()
417 env->GetMethodID(clazz, "onDialCall", "(Ljava/lang/String;[B)V"); in classInitNative()
418 method_onSendDtmf = env->GetMethodID(clazz, "onSendDtmf", "(I[B)V"); in classInitNative()
420 env->GetMethodID(clazz, "onNoiseReductionEnable", "(Z[B)V"); in classInitNative()
[all …]
Dcom_android_bluetooth_a2dp.cpp195 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
197 env->FindClass("android/bluetooth/BluetoothCodecConfig"); in classInitNative()
199 env->GetMethodID(jniBluetoothCodecConfigClass, "<init>", "(IIIIIJJJJ)V"); in classInitNative()
201 env->GetMethodID(jniBluetoothCodecConfigClass, "getCodecType", "()I"); in classInitNative()
203 env->GetMethodID(jniBluetoothCodecConfigClass, "getCodecPriority", "()I"); in classInitNative()
205 env->GetMethodID(jniBluetoothCodecConfigClass, "getSampleRate", "()I"); in classInitNative()
207 env->GetMethodID(jniBluetoothCodecConfigClass, "getBitsPerSample", "()I"); in classInitNative()
209 env->GetMethodID(jniBluetoothCodecConfigClass, "getChannelMode", "()I"); in classInitNative()
210 android_bluetooth_BluetoothCodecConfig.getCodecSpecific1 = env->GetMethodID( in classInitNative()
212 android_bluetooth_BluetoothCodecConfig.getCodecSpecific2 = env->GetMethodID( in classInitNative()
[all …]
Dcom_android_bluetooth_avrcp_controller.cpp795 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
797 env->GetMethodID(clazz, "handlePassthroughRsp", "(II[B)V"); in classInitNative()
800 env->GetMethodID(clazz, "handleGroupNavigationRsp", "(II)V"); in classInitNative()
803 env->GetMethodID(clazz, "onConnectionStateChanged", "(ZZ[B)V"); in classInitNative()
805 method_getRcFeatures = env->GetMethodID(clazz, "getRcFeatures", "([BI)V"); in classInitNative()
807 method_getRcPsm = env->GetMethodID(clazz, "getRcPsm", "([BI)V"); in classInitNative()
810 env->GetMethodID(clazz, "setPlayerAppSettingRsp", "([BB)V"); in classInitNative()
813 env->GetMethodID(clazz, "handlePlayerAppSetting", "([B[BI)V"); in classInitNative()
816 env->GetMethodID(clazz, "onPlayerAppSettingChanged", "([B[BI)V"); in classInitNative()
819 env->GetMethodID(clazz, "handleSetAbsVolume", "([BBB)V"); in classInitNative()
[all …]
Dcom_android_bluetooth_hid_host.cpp193 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
195 env->GetMethodID(clazz, "onConnectStateChanged", "([BI)V"); in classInitNative()
197 env->GetMethodID(clazz, "onGetProtocolMode", "([BI)V"); in classInitNative()
198 method_onGetReport = env->GetMethodID(clazz, "onGetReport", "([B[BI)V"); in classInitNative()
199 method_onHandshake = env->GetMethodID(clazz, "onHandshake", "([BI)V"); in classInitNative()
200 method_onVirtualUnplug = env->GetMethodID(clazz, "onVirtualUnplug", "([BI)V"); in classInitNative()
201 method_onGetIdleTime = env->GetMethodID(clazz, "onGetIdleTime", "([BI)V"); in classInitNative()
206 static void initializeNative(JNIEnv* env, jobject object) { in initializeNative() argument
222 env->DeleteGlobalRef(mCallbacksObj); in initializeNative()
240 mCallbacksObj = env->NewGlobalRef(object); in initializeNative()
[all …]
Dcom_android_bluetooth_hid_device.cpp155 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
159 env->GetMethodID(clazz, "onApplicationStateChanged", "([BZ)V"); in classInitNative()
161 env->GetMethodID(clazz, "onConnectStateChanged", "([BI)V"); in classInitNative()
162 method_onGetReport = env->GetMethodID(clazz, "onGetReport", "(BBS)V"); in classInitNative()
163 method_onSetReport = env->GetMethodID(clazz, "onSetReport", "(BB[B)V"); in classInitNative()
164 method_onSetProtocol = env->GetMethodID(clazz, "onSetProtocol", "(B)V"); in classInitNative()
165 method_onInterruptData = env->GetMethodID(clazz, "onInterruptData", "(B[B)V"); in classInitNative()
167 env->GetMethodID(clazz, "onVirtualCableUnplug", "()V"); in classInitNative()
170 static void initNative(JNIEnv* env, jobject object) { in initNative() argument
189 env->DeleteGlobalRef(mCallbacksObj); in initNative()
[all …]
Dcom_android_bluetooth_a2dp_sink.cpp99 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
101 env->GetMethodID(clazz, "onConnectionStateChanged", "([BI)V"); in classInitNative()
104 env->GetMethodID(clazz, "onAudioStateChanged", "([BI)V"); in classInitNative()
107 env->GetMethodID(clazz, "onAudioConfigChanged", "([BII)V"); in classInitNative()
112 static void initNative(JNIEnv* env, jobject object, in initNative() argument
128 env->DeleteGlobalRef(mCallbacksObj); in initNative()
148 mCallbacksObj = env->NewGlobalRef(object); in initNative()
151 static void cleanupNative(JNIEnv* env, jobject object) { in cleanupNative() argument
165 env->DeleteGlobalRef(mCallbacksObj); in cleanupNative()
170 static jboolean connectA2dpNative(JNIEnv* env, jobject object, in connectA2dpNative() argument
[all …]
/packages/apps/Gallery2/jni_jpegstream/src/
Djpegstream.cpp31 static jint OutputStream_setup(JNIEnv* env, jobject thiz, jobject out, in OutputStream_setup() argument
34 jclass thisClass = env->GetObjectClass(thiz); in OutputStream_setup()
35 if (env->ExceptionCheck() || thisClass == NULL) { in OutputStream_setup()
39 jfieldID fidNumber = env->GetFieldID(thisClass, "JNIPointer", "J"); in OutputStream_setup()
40 if (NULL == fidNumber || env->ExceptionCheck()) { in OutputStream_setup()
69 int32_t errorFlag = w_ptr->setup(env, out, w, h, fmt, q); in OutputStream_setup()
70 if (env->ExceptionCheck() || errorFlag != J_SUCCESS) { in OutputStream_setup()
76 env->SetLongField(thiz, fidNumber, reinterpret_cast<jlong>(w_ptr)); in OutputStream_setup()
77 if (env->ExceptionCheck()) { in OutputStream_setup()
84 static jint InputStream_setup(JNIEnv* env, jobject thiz, jobject dimens, in InputStream_setup() argument
[all …]
/packages/services/BuiltInPrintService/jni/plugins/
Dpdf_render.c34 JNIEnv *env; member
53 jstring fileNameString = (*self->env)->NewStringUTF(self->env, fileName); in openDocument()
54 int count = (*self->env)->CallIntMethod(self->env, self->obj, gPdfRenderOpenDocument, in openDocument()
66 jobject size = (*self->env)->CallObjectMethod(self->env, self->obj, gPdfRenderGetPageSize, in getPageAttributes()
71 *width = (double) (*self->env)->CallDoubleMethod(self->env, size, gSizeDGetWidth); in getPageAttributes()
72 *height = (double) (*self->env)->CallDoubleMethod(self->env, size, gSizeDGetHeight); in getPageAttributes()
84 jobject byteBuffer = (*self->env)->NewDirectByteBuffer(self->env, buffer, bufferSize); in renderPageStripe()
86 if (!(*self->env)->CallBooleanMethod(self->env, self->obj, gPdfRenderRenderPageStripe, page, in renderPageStripe()
91 (*self->env)->DeleteLocalRef(self->env, byteBuffer); in renderPageStripe()
99 (*self->env)->DeleteGlobalRef(self->env, self->obj); in destroy()
[all …]
/packages/modules/Connectivity/framework/jni/
Dandroid_net_NetworkUtils.cpp43 static inline jclass FindClassOrDie(JNIEnv* env, const char* class_name) { in FindClassOrDie() argument
44 jclass clazz = env->FindClass(class_name); in FindClassOrDie()
50 static inline T MakeGlobalRefOrDie(JNIEnv* env, T in) { in MakeGlobalRefOrDie() argument
51 jobject res = env->NewGlobalRef(in); in MakeGlobalRefOrDie()
56 static void android_net_utils_attachDropAllBPFFilter(JNIEnv *env, jobject clazz, jobject javaFd) in android_net_utils_attachDropAllBPFFilter() argument
67 int fd = AFileDescriptor_getFd(env, javaFd); in android_net_utils_attachDropAllBPFFilter()
69 jniThrowExceptionFmt(env, "java/net/SocketException", in android_net_utils_attachDropAllBPFFilter()
74 static void android_net_utils_detachBPFFilter(JNIEnv *env, jobject clazz, jobject javaFd) in android_net_utils_detachBPFFilter() argument
77 int fd = AFileDescriptor_getFd(env, javaFd); in android_net_utils_detachBPFFilter()
80 jniThrowExceptionFmt(env, "java/net/SocketException", in android_net_utils_detachBPFFilter()
[all …]
/packages/modules/Connectivity/tests/cts/net/jni/
DNativeMultinetworkJni.cpp43 #define EXPECT_GE(env, actual, expected, msg) \ argument
46 jniThrowExceptionFmt(env, "java/lang/AssertionError", \
52 #define EXPECT_GT(env, actual, expected, msg) \ argument
55 jniThrowExceptionFmt(env, "java/lang/AssertionError", \
61 #define EXPECT_EQ(env, expected, actual, msg) \ argument
64 jniThrowExceptionFmt(env, "java/lang/AssertionError", \
80 int getAsyncResponse(JNIEnv* env, int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument
88 EXPECT_EQ(env, -1, read(fd, &dummy, sizeof(dummy)), "res_nresult check for closing fd"); in getAsyncResponse()
89 EXPECT_EQ(env, EBADF, errno, "res_nresult check for errno"); in getAsyncResponse()
123 int expectAnswersValid(JNIEnv* env, int fd, int family, int expectedRcode) { in expectAnswersValid() argument
[all …]
/packages/services/Car/cpp/telemetry/script_executor/src/
DJniUtils.cpp24 void PushBundleToLuaTable(JNIEnv* env, LuaEngine* luaEngine, jobject bundle) { in PushBundleToLuaTable() argument
33 jclass bundleClass = env->FindClass("android/os/Bundle"); in PushBundleToLuaTable()
34 jmethodID getKeySetMethod = env->GetMethodID(bundleClass, "keySet", "()Ljava/util/Set;"); in PushBundleToLuaTable()
35 jobject keys = env->CallObjectMethod(bundle, getKeySetMethod); in PushBundleToLuaTable()
36 jclass setClass = env->FindClass("java/util/Set"); in PushBundleToLuaTable()
37 jmethodID iteratorMethod = env->GetMethodID(setClass, "iterator", "()Ljava/util/Iterator;"); in PushBundleToLuaTable()
38 jobject keySetIteratorObject = env->CallObjectMethod(keys, iteratorMethod); in PushBundleToLuaTable()
40 jclass iteratorClass = env->FindClass("java/util/Iterator"); in PushBundleToLuaTable()
41 jmethodID hasNextMethod = env->GetMethodID(iteratorClass, "hasNext", "()Z"); in PushBundleToLuaTable()
42 jmethodID nextMethod = env->GetMethodID(iteratorClass, "next", "()Ljava/lang/Object;"); in PushBundleToLuaTable()
[all …]
DScriptExecutorJni.cpp34 Java_com_android_car_telemetry_ScriptExecutor_nativeInitLuaEngine(JNIEnv* env, jobject object) { in Java_com_android_car_telemetry_ScriptExecutor_nativeInitLuaEngine() argument
40 JNIEnv* env, jobject object, jlong luaEnginePtr) { in Java_com_android_car_telemetry_ScriptExecutor_nativeDestroyLuaEngine() argument
72 JNIEnv* env, jobject object, jlong luaEnginePtr, jstring scriptBody, jstring functionName, in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript() argument
75 env->FatalError("luaEnginePtr parameter cannot be nil"); in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
78 env->FatalError("scriptBody parameter cannot be null"); in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
81 env->FatalError("functionName parameter cannot be null"); in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
84 env->FatalError("listener parameter cannot be null"); in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
90 const char* scriptStr = env->GetStringUTFChars(scriptBody, nullptr); in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
92 env->ReleaseStringUTFChars(scriptBody, scriptStr); in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
95 env->ThrowNew(env->FindClass("java/lang/IllegalArgumentException"), in Java_com_android_car_telemetry_ScriptExecutor_nativeInvokeScript()
[all …]
/packages/modules/Connectivity/Tethering/jni/
Dcom_android_networkstack_tethering_BpfMap.cpp34 static void throwErrnoException(JNIEnv* env, const char* functionName, int error) { in throwErrnoException() argument
38 if (env->ExceptionCheck()) { in throwErrnoException()
39 cause = env->ExceptionOccurred(); in throwErrnoException()
40 env->ExceptionClear(); in throwErrnoException()
43 ScopedLocalRef<jstring> msg(env, env->NewStringUTF(functionName)); in throwErrnoException()
46 if (msg.get() == nullptr) env->ExceptionClear(); in throwErrnoException()
50 errnoException = env->NewObject(sErrnoExceptionClass, sErrnoExceptionCtor3, msg.get(), in throwErrnoException()
53 errnoException = env->NewObject(sErrnoExceptionClass, sErrnoExceptionCtor2, msg.get(), in throwErrnoException()
56 env->Throw(static_cast<jthrowable>(errnoException)); in throwErrnoException()
59 static jint com_android_networkstack_tethering_BpfMap_closeMap(JNIEnv *env, jobject clazz, in com_android_networkstack_tethering_BpfMap_closeMap() argument
[all …]
/packages/inputmethods/LatinIME/native/jni/src/utils/
Djni_data_utils.cpp26 /* static */ void JniDataUtils::outputWordProperty(JNIEnv *const env, in outputWordProperty() argument
33 JniDataUtils::outputCodePoints(env, outCodePoints, 0 /* start */, in outputWordProperty()
41 env->SetBooleanArrayRegion(outFlags, 0 /* start */, NELEMS(flags), flags); in outputWordProperty()
45 env->SetIntArrayRegion(outProbabilityInfo, 0 /* start */, NELEMS(probabilityInfo), in outputWordProperty()
48 jclass integerClass = env->FindClass("java/lang/Integer"); in outputWordProperty()
49 jmethodID intToIntegerConstructorId = env->GetMethodID(integerClass, "<init>", "(I)V"); in outputWordProperty()
50 jclass arrayListClass = env->FindClass("java/util/ArrayList"); in outputWordProperty()
51 jmethodID addMethodId = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); in outputWordProperty()
54 jclass intArrayClass = env->FindClass("[I"); in outputWordProperty()
57 jobjectArray prevWordWordCodePointsArray = env->NewObjectArray( in outputWordProperty()
[all …]
Djni_data_utils.h34 static void jintarrayToVector(JNIEnv *env, jintArray array, std::vector<int> *const outVector) { in jintarrayToVector() argument
39 const jsize arrayLength = env->GetArrayLength(array); in jintarrayToVector()
41 env->GetIntArrayRegion(array, 0 /* start */, arrayLength, outVector->data()); in jintarrayToVector()
44 static DictionaryHeaderStructurePolicy::AttributeMap constructAttributeMap(JNIEnv *env, in constructAttributeMap() argument
47 const int keyCount = env->GetArrayLength(attributeKeyStringArray); in constructAttributeMap()
50 env->GetObjectArrayElement(attributeKeyStringArray, i)); in constructAttributeMap()
51 const jsize keyUtf8Length = env->GetStringUTFLength(keyString); in constructAttributeMap()
53 env->GetStringUTFRegion(keyString, 0, env->GetStringLength(keyString), keyChars); in constructAttributeMap()
54 env->DeleteLocalRef(keyString); in constructAttributeMap()
60 env->GetObjectArrayElement(attributeValueStringArray, i)); in constructAttributeMap()
[all …]
/packages/modules/NetworkStack/tests/unit/jni/
Dapf_jni.cpp34 JNIEnv* env, jclass, jbyteArray jprogram, jbyteArray jpacket, in com_android_server_ApfTest_apfSimulate() argument
37 ScopedByteArrayRO packet(env, jpacket); in com_android_server_ApfTest_apfSimulate()
39 uint32_t program_len = env->GetArrayLength(jprogram); in com_android_server_ApfTest_apfSimulate()
40 uint32_t data_len = jdata ? env->GetArrayLength(jdata) : 0; in com_android_server_ApfTest_apfSimulate()
43 env->GetByteArrayRegion(jprogram, 0, program_len, reinterpret_cast<jbyte*>(buf.data())); in com_android_server_ApfTest_apfSimulate()
46 env->GetByteArrayRegion(jdata, 0, data_len, in com_android_server_ApfTest_apfSimulate()
55 env->SetByteArrayRegion(jdata, 0, data_len, in com_android_server_ApfTest_apfSimulate()
86 static void throwException(JNIEnv* env, const std::string& error) { in throwException() argument
87 jclass newExcCls = env->FindClass("java/lang/IllegalStateException"); in throwException()
92 env->ThrowNew(newExcCls, error.c_str()); in throwException()
[all …]
/packages/modules/NetworkStack/jni/
Dnetwork_stack_utils_jni.cpp54 static bool checkLenAndCopy(JNIEnv* env, const jbyteArray& addr, int len, void* dst) { in checkLenAndCopy() argument
55 if (env->GetArrayLength(addr) != len) { in checkLenAndCopy()
58 env->GetByteArrayRegion(addr, 0, len, reinterpret_cast<jbyte*>(dst)); in checkLenAndCopy()
62 static void network_stack_utils_addArpEntry(JNIEnv *env, jobject thiz, jbyteArray ethAddr, in network_stack_utils_addArpEntry() argument
69 if (!checkLenAndCopy(env, ethAddr, ETH_ALEN, ethAddrStruct.sa_data)) { in network_stack_utils_addArpEntry()
70 jniThrowException(env, "java/io/IOException", "Invalid ethAddr length"); in network_stack_utils_addArpEntry()
75 if (!checkLenAndCopy(env, ipv4Addr, sizeof(in_addr), &netAddrStruct.sin_addr)) { in network_stack_utils_addArpEntry()
76 jniThrowException(env, "java/io/IOException", "Invalid ipv4Addr length"); in network_stack_utils_addArpEntry()
80 int ifLen = env->GetStringLength(ifname); in network_stack_utils_addArpEntry()
83 jniThrowException(env, "java/io/IOException", "ifname too long"); in network_stack_utils_addArpEntry()
[all …]

123456