Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created December 6, 2016 19:21
Show Gist options
  • Save invisiblek/b2e73ac728d41f63861b48dba18c60ea to your computer and use it in GitHub Desktop.
Save invisiblek/b2e73ac728d41f63861b48dba18c60ea to your computer and use it in GitHub Desktop.
diff --git a/jni/com_android_bluetooth_a2dp.cpp b/jni/com_android_bluetooth_a2dp.cpp
index bd6e584..deb1861 100644
--- a/jni/com_android_bluetooth_a2dp.cpp
+++ b/jni/com_android_bluetooth_a2dp.cpp
@@ -257,6 +257,7 @@ static void initNative(JNIEnv *env, jobject object, jint maxA2dpConnections,
env->DeleteGlobalRef(mCallbacksObj);
mCallbacksObj = NULL;
}
+ mCallbacksObj = env->NewGlobalRef(object);
pthread_mutex_unlock(&mMutex);
if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks,
diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapReceiver.java b/src/com/android/bluetooth/pbap/BluetoothPbapReceiver.java
index fbf3778..d5f0cef 100644
--- a/src/com/android/bluetooth/pbap/BluetoothPbapReceiver.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapReceiver.java
@@ -42,7 +42,7 @@ public class BluetoothPbapReceiver extends BroadcastReceiver {
private static final String TAG = "BluetoothPbapReceiver";
- private static final boolean D = BluetoothPbapService.DEBUG;
+ private static final boolean D = Log.isLoggable(BluetoothPbapService.LOG_TAG, Log.DEBUG);
@Override
public void onReceive(Context context, Intent intent) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment