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

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

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

Merge "Allocate CallbacksObj Before Initializing A2DP JNI Interface" am: b1b9ae5d am: 01df3e14 am: bb9731e1
am: 0064e9df

Change-Id: Ie16d796cbc8389caf9874ecca24c3ba40348559d
parents cd29fbf8 0064e9df
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) {