Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15f91695 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

Merge "Allocate CallbacksObj Before Initializing A2DP JNI Interface"

am: 36ca7c34

Change-Id: I2f4cb3851fd7941bb4192aa6eded60403d67201d
parents 247f01ad 36ca7c34
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -131,6 +131,11 @@ static void initNative(JNIEnv *env, jobject object) {
         mCallbacksObj = NULL;
    }

    if ((mCallbacksObj = env->NewGlobalRef(object)) == NULL) {
        ALOGE("Failed to allocate Global Ref for A2DP Callbacks");
        return;
    }

    if ( (sBluetoothA2dpInterface = (btav_interface_t *)
          btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID)) == NULL) {
        ALOGE("Failed to get Bluetooth A2DP Interface");
@@ -142,8 +147,6 @@ static void initNative(JNIEnv *env, jobject object) {
        sBluetoothA2dpInterface = NULL;
        return;
    }

    mCallbacksObj = env->NewGlobalRef(object);
}

static void cleanupNative(JNIEnv *env, jobject object) {