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

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

Merge "Allocate CallbacksObj Before Initializing A2DP JNI Interface" am: b1b9ae5d

am: 01df3e14

Change-Id: Ifc4fd59e9edcc78ecca9d9b8a474302319680ebe
parents 375ea5b2 01df3e14
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) {