Home
last modified time | relevance | path

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

1234567891011

/packages/services/BuiltInPrintService/jni/lib/
DwprintJNI.c203 static void stringToJava(JNIEnv *env, jobject obj, jfieldID id, const char *str);
355 static void _get_pdf_page_range(JNIEnv *env, jobject javaJobParams, int *pages_ary, int num_pages, in _get_pdf_page_range() argument
358 jstring pageRangeObject = (jstring) (*env)->GetObjectField(env, javaJobParams, in _get_pdf_page_range()
361 int page_range_size = (*env)->GetStringLength(env, pageRangeObject); in _get_pdf_page_range()
362 const jbyte *pageRange = (jbyte *) (*env)->GetStringUTFChars(env, pageRangeObject, 0); in _get_pdf_page_range()
374 (*env)->ReleaseStringUTFChars(env, pageRangeObject, (const char *) pageRange); in _get_pdf_page_range()
457 static void _initJNI(JNIEnv *env, jobject callbackReceiver, jstring fakeDir) { in _initJNI() argument
458 _fakeDir = (jstring) (*env)->NewGlobalRef(env, fakeDir); in _initJNI()
461 _LocalJobParamsClass = (jclass) (*env)->NewGlobalRef( in _initJNI()
462 env, (*env)->FindClass(env, "com/android/bips/jni/LocalJobParams")); in _initJNI()
[all …]
/packages/providers/MediaProvider/jni/
DMediaProviderWrapper.cpp57 static bool CheckForJniException(JNIEnv* env) { in CheckForJniException() argument
58 if (env->ExceptionCheck()) { in CheckForJniException()
59 env->ExceptionDescribe(); in CheckForJniException()
60 env->ExceptionClear(); in CheckForJniException()
69 static jfieldID CacheField(JNIEnv* env, jclass clazz, const char field_name[], const char type[]) { in CacheField() argument
72 fid = env->GetFieldID(clazz, actual_field_name.c_str(), type); in CacheField()
79 int insertFileInternal(JNIEnv* env, jobject media_provider_object, jmethodID mid_insert_file, in insertFileInternal() argument
81 ScopedLocalRef<jstring> j_path(env, env->NewStringUTF(path.c_str())); in insertFileInternal()
82 int res = env->CallIntMethod(media_provider_object, mid_insert_file, j_path.get(), uid); in insertFileInternal()
84 if (CheckForJniException(env)) { in insertFileInternal()
[all …]
Dcom_android_providers_media_FuseDaemon.cpp41 JNIEnv* env, jobjectArray java_object_array, const std::string& element_description) { in convert_object_array_to_string_vector() argument
42 ScopedLocalRef<jobjectArray> j_ref_object_array(env, java_object_array); in convert_object_array_to_string_vector()
45 const int object_array_length = env->GetArrayLength(j_ref_object_array.get()); in convert_object_array_to_string_vector()
48 env, (jstring)env->GetObjectArrayElement(j_ref_object_array.get(), i)); in convert_object_array_to_string_vector()
49 ScopedUtfChars utf_chars(env, j_ref_string.get()); in convert_object_array_to_string_vector()
62 static jobjectArray convert_string_vector_to_object_array(JNIEnv* env, in convert_string_vector_to_object_array() argument
64 jclass stringClass = env->FindClass("java/lang/String"); in convert_string_vector_to_object_array()
65 jobjectArray arr = env->NewObjectArray(string_vector.size(), stringClass, NULL); in convert_string_vector_to_object_array()
67 ScopedLocalRef<jstring> path(env, env->NewStringUTF(string_vector.at(i).c_str())); in convert_string_vector_to_object_array()
68 env->SetObjectArrayElement(arr, i, path.get()); in convert_string_vector_to_object_array()
[all …]
Dcom_android_providers_media_leveldb_LevelDBInstance.cpp26 static jobject createLevelDBResult(JNIEnv* env, leveldb::Status status, std::string value) { in createLevelDBResult() argument
28 jclass levelDbResultClass = env->FindClass("com/android/providers/media/leveldb/LevelDBResult"); in createLevelDBResult()
29 jobject levelDbResultData = env->AllocObject(levelDbResultClass); in createLevelDBResult()
32 jfieldID codeField = env->GetFieldID(levelDbResultClass, "mCode", "Ljava/lang/String;"); in createLevelDBResult()
34 env->GetFieldID(levelDbResultClass, "mErrorMessage", "Ljava/lang/String;"); in createLevelDBResult()
35 jfieldID valueField = env->GetFieldID(levelDbResultClass, "mValue", "Ljava/lang/String;"); in createLevelDBResult()
38 env->SetObjectField(levelDbResultData, codeField, env->NewStringUTF(statusCode.c_str())); in createLevelDBResult()
39 env->SetObjectField(levelDbResultData, messageField, in createLevelDBResult()
40 env->NewStringUTF(status.ToString().c_str())); in createLevelDBResult()
41 env->SetObjectField(levelDbResultData, valueField, env->NewStringUTF(value.c_str())); in createLevelDBResult()
[all …]
/packages/providers/MediaProvider/pdf/framework/libs/pdfClient/
Djni_conversion.cc86 inline jclass GetPermClassRef(JNIEnv* env, const std::string& classname) { in GetPermClassRef() argument
88 return (jclass)env->NewGlobalRef(env->FindClass(classname.c_str())); in GetPermClassRef()
92 jobject ToJavaInteger(JNIEnv* env, const int& i) { in ToJavaInteger() argument
93 static jclass integer_class = GetPermClassRef(env, kInteger); in ToJavaInteger()
95 env->GetStaticMethodID(integer_class, "valueOf", funcsig(kInteger, "I").c_str()); in ToJavaInteger()
96 return env->CallStaticObjectMethod(integer_class, value_of, i); in ToJavaInteger()
99 jobject ToJavaString(JNIEnv* env, const std::string& s) { in ToJavaString() argument
100 return env->NewStringUTF(s.c_str()); in ToJavaString()
105 jobject ToJavaList(JNIEnv* env, const vector<T>& input, in ToJavaList() argument
106 jobject (*ToJavaObject)(JNIEnv* env, const T&)) { in ToJavaList() argument
[all …]
Dpdf_document_jni.cc81 JNIEnv* env, jobject obj, jint jfd, jstring jpassword) { in Java_android_graphics_pdf_PdfDocumentProxy_createFromFd() argument
84 const char* password = jpassword == NULL ? NULL : env->GetStringUTFChars(jpassword, NULL); in Java_android_graphics_pdf_PdfDocumentProxy_createFromFd()
94 env->ReleaseStringUTFChars(jpassword, password); in Java_android_graphics_pdf_PdfDocumentProxy_createFromFd()
97 return convert::ToJavaLoadPdfResult(env, status, std::move(doc), pdfSizeInBytes); in Java_android_graphics_pdf_PdfDocumentProxy_createFromFd()
100 JNIEXPORT void JNICALL Java_android_graphics_pdf_PdfDocumentProxy_destroy(JNIEnv* env, in Java_android_graphics_pdf_PdfDocumentProxy_destroy() argument
103 Document* doc = convert::GetPdfDocPtr(env, jPdfDocument); in Java_android_graphics_pdf_PdfDocumentProxy_destroy()
109 JNIEXPORT jboolean JNICALL Java_android_graphics_pdf_PdfDocumentProxy_saveToFd(JNIEnv* env, in Java_android_graphics_pdf_PdfDocumentProxy_saveToFd() argument
114 Document* doc = convert::GetPdfDocPtr(env, jPdfDocument); in Java_android_graphics_pdf_PdfDocumentProxy_saveToFd()
121 JNIEnv* env, jobject jPdfDocument, jint pageNum) { in Java_android_graphics_pdf_PdfDocumentProxy_getPageDimensions() argument
123 Document* doc = convert::GetPdfDocPtr(env, jPdfDocument); in Java_android_graphics_pdf_PdfDocumentProxy_getPageDimensions()
[all …]
/packages/services/Car/packages/ScriptExecutor/src/
DJniUtils.cpp29 void pushBundleToLuaTable(JNIEnv* env, lua_State* lua, jobject bundle) { in pushBundleToLuaTable() argument
38 ScopedLocalRef<jclass> persistableBundleClass(env, in pushBundleToLuaTable()
39 env->FindClass("android/os/PersistableBundle")); in pushBundleToLuaTable()
41 env->GetMethodID(persistableBundleClass.get(), "keySet", "()Ljava/util/Set;"); in pushBundleToLuaTable()
42 ScopedLocalRef<jobject> keys(env, env->CallObjectMethod(bundle, getKeySetMethod)); in pushBundleToLuaTable()
43 ScopedLocalRef<jclass> setClass(env, env->FindClass("java/util/Set")); in pushBundleToLuaTable()
45 env->GetMethodID(setClass.get(), "iterator", "()Ljava/util/Iterator;"); in pushBundleToLuaTable()
46 ScopedLocalRef<jobject> keySetIteratorObject(env, in pushBundleToLuaTable()
47 env->CallObjectMethod(keys.get(), iteratorMethod)); in pushBundleToLuaTable()
49 ScopedLocalRef<jclass> iteratorClass(env, env->FindClass("java/util/Iterator")); in pushBundleToLuaTable()
[all …]
DScriptExecutorListener.cpp30 JNIEnv* env = getCurrentJNIEnv(); in ~ScriptExecutorListener() local
32 env->DeleteGlobalRef(mScriptExecutorListener); in ~ScriptExecutorListener()
36 ScriptExecutorListener::ScriptExecutorListener(JNIEnv* env, jobject scriptExecutorListener) { in ScriptExecutorListener() argument
37 mScriptExecutorListener = env->NewGlobalRef(scriptExecutorListener); in ScriptExecutorListener()
38 env->GetJavaVM(&mJavaVM); in ScriptExecutorListener()
42 JNIEnv* env = getCurrentJNIEnv(); in onSuccess() local
43 ScopedLocalRef<jclass> listenerClassRef(env, env->GetObjectClass(mScriptExecutorListener)); in onSuccess()
44 jmethodID onSuccessMethod = env->GetMethodID(listenerClassRef.get(), "onSuccess", in onSuccess()
46 env->CallVoidMethod(mScriptExecutorListener, onSuccessMethod, bundle); in onSuccess()
50 JNIEnv* env = getCurrentJNIEnv(); in onScriptFinished() local
[all …]
/packages/modules/Connectivity/service-t/jni/
Dcom_android_server_net_NetworkStatsFactory.cpp63 static jobjectArray get_string_array(JNIEnv* env, jobject obj, jfieldID field, int size, bool grow) in get_string_array() argument
66 jobjectArray array = (jobjectArray)env->GetObjectField(obj, field); in get_string_array()
71 return env->NewObjectArray(size, gStringClass, NULL); in get_string_array()
74 static jintArray get_int_array(JNIEnv* env, jobject obj, jfieldID field, int size, bool grow) in get_int_array() argument
77 jintArray array = (jintArray)env->GetObjectField(obj, field); in get_int_array()
82 return env->NewIntArray(size); in get_int_array()
85 static jlongArray get_long_array(JNIEnv* env, jobject obj, jfieldID field, int size, bool grow) in get_long_array() argument
88 jlongArray array = (jlongArray)env->GetObjectField(obj, field); in get_long_array()
93 return env->NewLongArray(size); in get_long_array()
96 static int statsLinesToNetworkStats(JNIEnv* env, jclass clazz, jobject stats, in statsLinesToNetworkStats() argument
[all …]
/packages/modules/AdServices/adservices/service-core/jni/cpp/
Dohttp_jni.cpp38 JNIEnv *env, jclass) { in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeKemDhkemX25519HkdfSha256() argument
47 Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeKdfHkdfSha256(JNIEnv *env, in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeKdfHkdfSha256() argument
56 Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeAeadAes256Gcm(JNIEnv *env, in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeAeadAes256Gcm() argument
66 JNIEnv *env, jclass) { in Java_com_android_adservices_ohttp_OhttpJniWrapper_hkdfSha256MessageDigest() argument
75 JNIEnv *env, jclass, jlong hpkeCtxRef) { in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxFree() argument
85 Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxNew(JNIEnv *env, in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxNew() argument
102 JNIEnv *env, jclass, jlong senderHpkeCtxRef, jlong evpKemRef, in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxSetupSenderWithSeed() argument
137 jbyte *peer_public_key = env->GetByteArrayElements(publicKeyArray, 0); in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxSetupSenderWithSeed()
138 jbyte *seed = env->GetByteArrayElements(seedArray, 0); in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxSetupSenderWithSeed()
144 infoArrayBytes = env->GetByteArrayElements(infoArray, 0); in Java_com_android_adservices_ohttp_OhttpJniWrapper_hpkeCtxSetupSenderWithSeed()
[all …]
Dact_jni.cpp33 JNIEnv *env, in Java_com_android_adservices_ActJniWrapper_generateClientParameters() argument
39 if(!jni_util::JniUtil::BytesToCppProto(env, &scheme_parameter_proto, scheme_parameter_bytes)) { in Java_com_android_adservices_ActJniWrapper_generateClientParameters()
41 env, IllegalArgumentExceptionClass, "Error while parsing SchemeParameters Proto"); in Java_com_android_adservices_ActJniWrapper_generateClientParameters()
45 if(!jni_util::JniUtil::BytesToCppProto(env, &server_public_parameters_proto, in Java_com_android_adservices_ActJniWrapper_generateClientParameters()
48 env, in Java_com_android_adservices_ActJniWrapper_generateClientParameters()
63 env, IllegalArgumentExceptionClass, status_or.status().ToString().c_str()); in Java_com_android_adservices_ActJniWrapper_generateClientParameters()
67 jni_util::JniUtil::SerializeProtoToJniByteArray(env, client_parameters); in Java_com_android_adservices_ActJniWrapper_generateClientParameters()
73 JNIEnv *env, in Java_com_android_adservices_ActJniWrapper_generateTokensRequest() argument
82 if(!jni_util::JniUtil::BytesToCppProto(env, &messagesProto, messagesInBytes)) { in Java_com_android_adservices_ActJniWrapper_generateTokensRequest()
84 env, IllegalArgumentExceptionClass, "Error parsing MessagesSet Proto"); in Java_com_android_adservices_ActJniWrapper_generateTokensRequest()
[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/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/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 …]
/packages/modules/Connectivity/framework/jni/
Dandroid_net_NetworkUtils.cpp46 static inline jclass FindClassOrDie(JNIEnv* env, const char* class_name) { in FindClassOrDie() argument
47 jclass clazz = env->FindClass(class_name); in FindClassOrDie()
53 static inline T MakeGlobalRefOrDie(JNIEnv* env, T in) { in MakeGlobalRefOrDie() argument
54 jobject res = env->NewGlobalRef(in); in MakeGlobalRefOrDie()
59 static void android_net_utils_attachDropAllBPFFilter(JNIEnv *env, jclass clazz, jobject javaFd) in android_net_utils_attachDropAllBPFFilter() argument
69 int fd = AFileDescriptor_getFd(env, javaFd); in android_net_utils_attachDropAllBPFFilter()
71 jniThrowExceptionFmt(env, "java/net/SocketException", in android_net_utils_attachDropAllBPFFilter()
76 static void android_net_utils_detachBPFFilter(JNIEnv *env, jclass clazz, jobject javaFd) in android_net_utils_detachBPFFilter() argument
79 int fd = AFileDescriptor_getFd(env, javaFd); in android_net_utils_detachBPFFilter()
82 jniThrowExceptionFmt(env, "java/net/SocketException", in android_net_utils_detachBPFFilter()
[all …]
/packages/modules/Permission/tests/cts/permission/jni/
Dandroid_permission_cts_FileUtils.cpp52 jboolean android_permission_cts_FileUtils_getFileStatus(JNIEnv* env, in android_permission_cts_FileUtils_getFileStatus() argument
55 ScopedUtfChars cPath(env, path); in android_permission_cts_FileUtils_getFileStatus()
65 env->SetIntField(fileStatus, gFileStatusDevFieldID, s.st_dev); in android_permission_cts_FileUtils_getFileStatus()
66 env->SetIntField(fileStatus, gFileStatusInoFieldID, s.st_ino); in android_permission_cts_FileUtils_getFileStatus()
67 env->SetIntField(fileStatus, gFileStatusModeFieldID, s.st_mode); in android_permission_cts_FileUtils_getFileStatus()
68 env->SetIntField(fileStatus, gFileStatusNlinkFieldID, s.st_nlink); in android_permission_cts_FileUtils_getFileStatus()
69 env->SetIntField(fileStatus, gFileStatusUidFieldID, s.st_uid); in android_permission_cts_FileUtils_getFileStatus()
70 env->SetIntField(fileStatus, gFileStatusGidFieldID, s.st_gid); in android_permission_cts_FileUtils_getFileStatus()
71 env->SetLongField(fileStatus, gFileStatusSizeFieldID, s.st_size); in android_permission_cts_FileUtils_getFileStatus()
72 env->SetIntField(fileStatus, gFileStatusBlksizeFieldID, s.st_blksize); in android_permission_cts_FileUtils_getFileStatus()
[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 …]
/packages/modules/Bluetooth/android/app/jni/
Dcom_android_bluetooth_btservice_AdapterService.cpp541 static jobject createClassicOobDataObject(JNIEnv* env, bt_oob_data_t oob_data) { in createClassicOobDataObject() argument
556 GET_JAVA_METHODS(env, "android/bluetooth/OobData$ClassicBuilder", in createClassicOobDataObject()
559 jbyteArray confirmationHash = env->NewByteArray(OOB_C_SIZE); in createClassicOobDataObject()
560 env->SetByteArrayRegion(confirmationHash, 0, OOB_C_SIZE, in createClassicOobDataObject()
563 jbyteArray oobDataLength = env->NewByteArray(OOB_DATA_LEN_SIZE); in createClassicOobDataObject()
564 env->SetByteArrayRegion(oobDataLength, 0, OOB_DATA_LEN_SIZE, in createClassicOobDataObject()
567 jbyteArray address = env->NewByteArray(OOB_ADDRESS_SIZE); in createClassicOobDataObject()
568 env->SetByteArrayRegion(address, 0, OOB_ADDRESS_SIZE, in createClassicOobDataObject()
572 env->FindClass("android/bluetooth/OobData$ClassicBuilder"); in createClassicOobDataObject()
575 env->NewObject(classicBuilderClass, classicBuilderConstructor, in createClassicOobDataObject()
[all …]
Dcom_android_bluetooth_le_audio.cpp115 jobject prepareCodecConfigObj(JNIEnv* env, in prepareCodecConfigObj() argument
125 jobject codecConfigObj = env->NewObject( in prepareCodecConfigObj()
136 JNIEnv* env, std::vector<btle_audio_codec_config_t> codecConfigs) { in prepareArrayOfCodecConfigs() argument
138 jobjectArray CodecConfigArray = env->NewObjectArray( in prepareArrayOfCodecConfigs()
143 jobject Obj = prepareCodecConfigObj(env, cap); in prepareArrayOfCodecConfigs()
145 env->SetObjectArrayElement(CodecConfigArray, i++, Obj); in prepareArrayOfCodecConfigs()
146 env->DeleteLocalRef(Obj); in prepareArrayOfCodecConfigs()
382 JNIEnv* env, jobject /* object */, jobjectArray codecConfigArray) { in prepareCodecPreferences() argument
385 int numConfigs = env->GetArrayLength(codecConfigArray); in prepareCodecPreferences()
387 jobject jcodecConfig = env->GetObjectArrayElement(codecConfigArray, i); in prepareCodecPreferences()
[all …]
/packages/modules/Connectivity/service/jni/
Dcom_android_server_connectivity_ClatCoordinator.cpp140 static void throwIOException(JNIEnv* env, const char* msg, int error) { in throwIOException() argument
141 jniThrowExceptionFmt(env, "java/io/IOException", "%s: %s", msg, strerror(error)); in throwIOException()
144 jstring com_android_server_connectivity_ClatCoordinator_selectIpv4Address(JNIEnv* env, in com_android_server_connectivity_ClatCoordinator_selectIpv4Address() argument
148 ScopedUtfChars address(env, v4addr); in com_android_server_connectivity_ClatCoordinator_selectIpv4Address()
151 throwIOException(env, "invalid address", EINVAL); in com_android_server_connectivity_ClatCoordinator_selectIpv4Address()
162 jniThrowExceptionFmt(env, "java/io/IOException", "No free IPv4 address in %s/%d", in com_android_server_connectivity_ClatCoordinator_selectIpv4Address()
169 throwIOException(env, "invalid address", EADDRNOTAVAIL); in com_android_server_connectivity_ClatCoordinator_selectIpv4Address()
172 return env->NewStringUTF(addrstr); in com_android_server_connectivity_ClatCoordinator_selectIpv4Address()
177 JNIEnv* env, jclass clazz, jstring ifaceStr, jstring v4Str, jstring prefix64Str, in com_android_server_connectivity_ClatCoordinator_generateIpv6Address() argument
179 ScopedUtfChars iface(env, ifaceStr); in com_android_server_connectivity_ClatCoordinator_generateIpv6Address()
[all …]
/packages/services/Car/packages/ScriptExecutor/tests/unit/src/com/android/car/scriptexecutortest/unit/
DJniUtilsTestHelper.cpp34 bool hasValidNumberArray(JNIEnv* env, jobject object, jlong luaEnginePtr, jstring key, in hasValidNumberArray() argument
36 const char* rawKey = env->GetStringUTFChars(key, nullptr); in hasValidNumberArray()
42 env->ReleaseStringUTFChars(key, rawKey); in hasValidNumberArray()
76 bool hasValidBooleanArray(JNIEnv* env, jobject object, jlong luaEnginePtr, jstring key, in hasValidBooleanArray() argument
78 const char* rawKey = env->GetStringUTFChars(key, nullptr); in hasValidBooleanArray()
84 env->ReleaseStringUTFChars(key, rawKey); in hasValidBooleanArray()
118 Java_com_android_car_scriptexecutortest_unit_JniUtilsTest_nativeCreateLuaEngine(JNIEnv* env, in Java_com_android_car_scriptexecutortest_unit_JniUtilsTest_nativeCreateLuaEngine() argument
126 JNIEnv* env, jobject object, jlong luaEnginePtr) { in Java_com_android_car_scriptexecutortest_unit_JniUtilsTest_nativeDestroyLuaEngine() argument
132 JNIEnv* env, jobject object, jlong luaEnginePtr, jobject bundle) { in Java_com_android_car_scriptexecutortest_unit_JniUtilsTest_nativePushBundleToLuaTableCaller() argument
135 scriptexecutor::pushBundleToLuaTable(env, engine->getLuaState(), bundle); in Java_com_android_car_scriptexecutortest_unit_JniUtilsTest_nativePushBundleToLuaTableCaller()
[all …]
/packages/modules/Connectivity/tests/cts/net/jni/
DNativeMultinetworkJni.cpp48 #define EXPECT_GE(env, actual_stmt, expected_stmt, msg) \ argument
52 if (actual < expected && !env->ExceptionCheck()) { \
53 jniThrowExceptionFmt(env, "java/lang/AssertionError", \
59 #define EXPECT_GT(env, actual_stmt, expected_stmt, msg) \ argument
63 if (actual <= expected && !env->ExceptionCheck()) { \
64 jniThrowExceptionFmt(env, "java/lang/AssertionError", \
70 #define EXPECT_EQ(env, expected_stmt, actual_stmt, msg) \ argument
74 if (actual != expected && !env->ExceptionCheck()) { \
75 jniThrowExceptionFmt(env, "java/lang/AssertionError", \
91 int getAsyncResponse(JNIEnv* env, int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument
[all …]
/packages/modules/Uwb/service/uci/jni/src/
Duci_jni_android_new.rs75 env: JNIEnv, in Java_com_android_server_uwb_jni_NativeUwbManager_nativeInit()
85 boolean_result_helper(native_init(env), function_name!()) in Java_com_android_server_uwb_jni_NativeUwbManager_nativeInit()
88 fn native_init(env: JNIEnv) -> Result<()> { in native_init()
89 let jvm = env.get_java_vm().map_err(|_| Error::ForeignFunctionInterface)?; in native_init()
93 fn create_device_info_response(rsp: GetDeviceInfoResponse, env: JNIEnv) -> Result<jobject> { in create_device_info_response()
94 let device_info_response_class = env in create_device_info_response()
98 let vendor_spec_info_jbytearray = env in create_device_info_response()
104 match env.new_object( in create_device_info_response()
124 env: JNIEnv, in Java_com_android_server_uwb_jni_NativeUwbManager_nativeDoInitialize()
129 match option_result_helper(native_do_initialize(env, obj, chip_id), function_name!()) { in Java_com_android_server_uwb_jni_NativeUwbManager_nativeDoInitialize()
[all …]
/packages/modules/OnDevicePersonalization/federatedcompute/jni/cpp/
Dlog_manager_wrapper_impl.cc51 JNIEnv* env = scoped_env.env(); in LogManagerWrapperImpl() local
52 jthis_ = env->NewGlobalRef(java_log_manager); in LogManagerWrapperImpl()
56 env, env->GetObjectClass(java_log_manager)); in LogManagerWrapperImpl()
60 env, java_log_manager_class.get(), LogManagerClassDesc::kLogProdDiag); in LogManagerWrapperImpl()
63 env, java_log_manager_class.get(), LogManagerClassDesc::kLogDebugDiag); in LogManagerWrapperImpl()
66 MoreJniUtil::GetMethodIdOrAbort(env, java_log_manager_class.get(), in LogManagerWrapperImpl()
70 env, java_log_manager_class.get(), in LogManagerWrapperImpl()
76 JNIEnv* env = scoped_env.env(); in ~LogManagerWrapperImpl() local
77 env->DeleteGlobalRef(jthis_); in ~LogManagerWrapperImpl()
82 JNIEnv* env = scoped_env.env(); in LogDiag() local
[all …]
/packages/modules/NetworkStack/tests/unit/jni/
Dapf_jni.cpp50 com_android_server_ApfTest_apfSimulate(JNIEnv* env, jclass, jint apf_version, in com_android_server_ApfTest_apfSimulate() argument
54 ScopedByteArrayRO packet(env, jpacket); in com_android_server_ApfTest_apfSimulate()
56 uint32_t program_len = env->GetArrayLength(jprogram); in com_android_server_ApfTest_apfSimulate()
57 uint32_t data_len = jdata ? env->GetArrayLength(jdata) : 0; in com_android_server_ApfTest_apfSimulate()
69 env->GetByteArrayRegion(jprogram, 0, program_len, jbuf); in com_android_server_ApfTest_apfSimulate()
72 env->GetByteArrayRegion(jdata, 0, data_len, jbuf + ram_len - data_len); in com_android_server_ApfTest_apfSimulate()
81 env->SetByteArrayRegion(jdata, 0, data_len, jbuf + ram_len - data_len); in com_android_server_ApfTest_apfSimulate()
111 static void throwException(JNIEnv* env, const std::string& error) { in throwException() argument
112 jclass newExcCls = env->FindClass("java/lang/IllegalStateException"); in throwException()
117 env->ThrowNew(newExcCls, error.c_str()); in throwException()
[all …]

1234567891011