Lines Matching refs:env
195 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()
214 android_bluetooth_BluetoothCodecConfig.getCodecSpecific3 = env->GetMethodID( in classInitNative()
216 android_bluetooth_BluetoothCodecConfig.getCodecSpecific4 = env->GetMethodID( in classInitNative()
220 env->GetMethodID(clazz, "onConnectionStateChanged", "([BI)V"); in classInitNative()
223 env->GetMethodID(clazz, "onAudioStateChanged", "([BI)V"); in classInitNative()
226 env->GetMethodID(clazz, "onCodecConfigChanged", in classInitNative()
232 env->GetMethodID(clazz, "isMandatoryCodecPreferred", "([B)Z"); in classInitNative()
238 JNIEnv* env, jobject object, jobjectArray codecConfigArray) { in prepareCodecPreferences() argument
241 int numConfigs = env->GetArrayLength(codecConfigArray); in prepareCodecPreferences()
243 jobject jcodecConfig = env->GetObjectArrayElement(codecConfigArray, i); in prepareCodecPreferences()
245 if (!env->IsInstanceOf(jcodecConfig, in prepareCodecPreferences()
250 jint codecType = env->CallIntMethod( in prepareCodecPreferences()
252 jint codecPriority = env->CallIntMethod( in prepareCodecPreferences()
254 jint sampleRate = env->CallIntMethod( in prepareCodecPreferences()
256 jint bitsPerSample = env->CallIntMethod( in prepareCodecPreferences()
258 jint channelMode = env->CallIntMethod( in prepareCodecPreferences()
260 jlong codecSpecific1 = env->CallLongMethod( in prepareCodecPreferences()
262 jlong codecSpecific2 = env->CallLongMethod( in prepareCodecPreferences()
264 jlong codecSpecific3 = env->CallLongMethod( in prepareCodecPreferences()
266 jlong codecSpecific4 = env->CallLongMethod( in prepareCodecPreferences()
288 static void initNative(JNIEnv* env, jobject object, in initNative() argument
309 env->DeleteGlobalRef(mCallbacksObj); in initNative()
313 if ((mCallbacksObj = env->NewGlobalRef(object)) == nullptr) { in initNative()
318 android_bluetooth_BluetoothCodecConfig.clazz = (jclass)env->NewGlobalRef( in initNative()
319 env->FindClass("android/bluetooth/BluetoothCodecConfig")); in initNative()
335 prepareCodecPreferences(env, object, codecConfigArray); in initNative()
338 prepareCodecPreferences(env, object, codecOffloadingArray); in initNative()
351 static void cleanupNative(JNIEnv* env, jobject object) { in cleanupNative() argument
366 env->DeleteGlobalRef(android_bluetooth_BluetoothCodecConfig.clazz); in cleanupNative()
370 env->DeleteGlobalRef(mCallbacksObj); in cleanupNative()
375 static jboolean connectA2dpNative(JNIEnv* env, jobject object, in connectA2dpNative() argument
384 jbyte* addr = env->GetByteArrayElements(address, nullptr); in connectA2dpNative()
386 jniThrowIOException(env, EINVAL); in connectA2dpNative()
396 env->ReleaseByteArrayElements(address, addr, 0); in connectA2dpNative()
400 static jboolean disconnectA2dpNative(JNIEnv* env, jobject object, in disconnectA2dpNative() argument
409 jbyte* addr = env->GetByteArrayElements(address, nullptr); in disconnectA2dpNative()
411 jniThrowIOException(env, EINVAL); in disconnectA2dpNative()
421 env->ReleaseByteArrayElements(address, addr, 0); in disconnectA2dpNative()
425 static jboolean setSilenceDeviceNative(JNIEnv* env, jobject object, in setSilenceDeviceNative() argument
434 jbyte* addr = env->GetByteArrayElements(address, nullptr); in setSilenceDeviceNative()
448 env->ReleaseByteArrayElements(address, addr, 0); in setSilenceDeviceNative()
452 static jboolean setActiveDeviceNative(JNIEnv* env, jobject object, in setActiveDeviceNative() argument
461 jbyte* addr = env->GetByteArrayElements(address, nullptr); in setActiveDeviceNative()
474 env->ReleaseByteArrayElements(address, addr, 0); in setActiveDeviceNative()
478 static jboolean setCodecConfigPreferenceNative(JNIEnv* env, jobject object, in setCodecConfigPreferenceNative() argument
488 jbyte* addr = env->GetByteArrayElements(address, nullptr); in setCodecConfigPreferenceNative()
490 jniThrowIOException(env, EINVAL); in setCodecConfigPreferenceNative()
497 prepareCodecPreferences(env, object, codecConfigArray); in setCodecConfigPreferenceNative()
504 env->ReleaseByteArrayElements(address, addr, 0); in setCodecConfigPreferenceNative()
523 int register_com_android_bluetooth_a2dp(JNIEnv* env) { in register_com_android_bluetooth_a2dp() argument
525 env, "com/android/bluetooth/a2dp/A2dpNativeInterface", sMethods, in register_com_android_bluetooth_a2dp()