Loading android/app/jni/com_android_bluetooth_le_audio.cpp +0 −24 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ namespace android { static jmethodID method_onConnectionStateChanged; static jmethodID method_onGroupStatus; static jmethodID method_onAudioConf; static jmethodID method_onSetMemberAvailable; static LeAudioClientInterface* sLeAudioClientInterface = nullptr; static std::shared_timed_mutex interface_mutex; Loading Loading @@ -96,27 +95,6 @@ class LeAudioClientCallbacksImpl : public LeAudioClientCallbacks { (jint)sink_audio_location, (jint)source_audio_location, (jint)avail_cont); } void OnSetMemberAvailable(const RawAddress& bd_addr, uint8_t group_id) override { LOG(INFO) << __func__ << ", group id:" << int(group_id); std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || mCallbacksObj == nullptr) return; ScopedLocalRef<jbyteArray> addr( sCallbackEnv.get(), sCallbackEnv->NewByteArray(sizeof(RawAddress))); if (!addr.get()) { LOG(ERROR) << "Failed to new jbyteArray bd addr for connection state"; return; } sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), (jbyte*)&bd_addr); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onSetMemberAvailable, addr.get(), (jint)group_id); } }; static LeAudioClientCallbacksImpl sLeAudioClientCallbacks; Loading @@ -126,8 +104,6 @@ static void classInitNative(JNIEnv* env, jclass clazz) { method_onAudioConf = env->GetMethodID(clazz, "onAudioConf", "(IIIII)V"); method_onConnectionStateChanged = env->GetMethodID(clazz, "onConnectionStateChanged", "(I[B)V"); method_onSetMemberAvailable = env->GetMethodID(clazz, "onSetMemberAvailable", "([BI)V"); } static void initNative(JNIEnv* env, jobject object) { Loading android/app/src/com/android/bluetooth/le_audio/LeAudioNativeInterface.java +0 −14 Original line number Diff line number Diff line Loading @@ -99,20 +99,6 @@ public class LeAudioNativeInterface { sendMessageToService(event); } // Callbacks from the native stack back into the Java framework. // All callbacks are routed via the Service which will disambiguate which // state machine the message should be routed to. private void onSetMemberAvailable(byte[] address, int groupId) { LeAudioStackEvent event = new LeAudioStackEvent(LeAudioStackEvent.EVENT_TYPE_SET_MEMBER_AVAILABLE); event.device = getDevice(address); event.valueInt1 = groupId; if (DBG) { Log.d(TAG, "onSetMemberAvailable: " + event); } sendMessageToService(event); } private void onGroupStatus(int groupId, int groupStatus, int groupFlags) { LeAudioStackEvent event = new LeAudioStackEvent(LeAudioStackEvent.EVENT_TYPE_GROUP_STATUS_CHANGED); Loading android/app/src/com/android/bluetooth/le_audio/LeAudioStackEvent.java +2 −7 Original line number Diff line number Diff line Loading @@ -30,9 +30,8 @@ public class LeAudioStackEvent { public static final int EVENT_TYPE_GROUP_STATUS_CHANGED = 2; public static final int EVENT_TYPE_GROUP_NODE_STATUS_CHANGED = 3; public static final int EVENT_TYPE_AUDIO_CONF_CHANGED = 4; public static final int EVENT_TYPE_SET_MEMBER_AVAILABLE = 5; // -------- DO NOT PUT ANY NEW UNICAST EVENTS BELOW THIS LINE------------- public static final int EVENT_TYPE_UNICAST_MAX = 7; public static final int EVENT_TYPE_UNICAST_MAX = 5; // Do not modify without updating the HAL bt_le_audio.h files. // Match up with GroupStatus enum of bt_le_audio.h Loading Loading @@ -91,8 +90,6 @@ public class LeAudioStackEvent { return "EVENT_TYPE_GROUP_NODE_STATUS_CHANGED"; case EVENT_TYPE_AUDIO_CONF_CHANGED: return "EVENT_TYPE_AUDIO_CONF_CHANGED"; case EVENT_TYPE_SET_MEMBER_AVAILABLE: return "EVENT_TYPE_SET_MEMBER_AVAILABLE"; default: return "EVENT_TYPE_UNKNOWN:" + type; } Loading @@ -117,8 +114,6 @@ public class LeAudioStackEvent { // same as EVENT_TYPE_GROUP_STATUS_CHANGED case EVENT_TYPE_GROUP_STATUS_CHANGED: // same as EVENT_TYPE_GROUP_STATUS_CHANGED case EVENT_TYPE_SET_MEMBER_AVAILABLE: // same as EVENT_TYPE_GROUP_STATUS_CHANGED case EVENT_TYPE_AUDIO_CONF_CHANGED: // FIXME: It should have proper direction names here return "{direction:" + value + "}"; Loading Loading
android/app/jni/com_android_bluetooth_le_audio.cpp +0 −24 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ namespace android { static jmethodID method_onConnectionStateChanged; static jmethodID method_onGroupStatus; static jmethodID method_onAudioConf; static jmethodID method_onSetMemberAvailable; static LeAudioClientInterface* sLeAudioClientInterface = nullptr; static std::shared_timed_mutex interface_mutex; Loading Loading @@ -96,27 +95,6 @@ class LeAudioClientCallbacksImpl : public LeAudioClientCallbacks { (jint)sink_audio_location, (jint)source_audio_location, (jint)avail_cont); } void OnSetMemberAvailable(const RawAddress& bd_addr, uint8_t group_id) override { LOG(INFO) << __func__ << ", group id:" << int(group_id); std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || mCallbacksObj == nullptr) return; ScopedLocalRef<jbyteArray> addr( sCallbackEnv.get(), sCallbackEnv->NewByteArray(sizeof(RawAddress))); if (!addr.get()) { LOG(ERROR) << "Failed to new jbyteArray bd addr for connection state"; return; } sCallbackEnv->SetByteArrayRegion(addr.get(), 0, sizeof(RawAddress), (jbyte*)&bd_addr); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onSetMemberAvailable, addr.get(), (jint)group_id); } }; static LeAudioClientCallbacksImpl sLeAudioClientCallbacks; Loading @@ -126,8 +104,6 @@ static void classInitNative(JNIEnv* env, jclass clazz) { method_onAudioConf = env->GetMethodID(clazz, "onAudioConf", "(IIIII)V"); method_onConnectionStateChanged = env->GetMethodID(clazz, "onConnectionStateChanged", "(I[B)V"); method_onSetMemberAvailable = env->GetMethodID(clazz, "onSetMemberAvailable", "([BI)V"); } static void initNative(JNIEnv* env, jobject object) { Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioNativeInterface.java +0 −14 Original line number Diff line number Diff line Loading @@ -99,20 +99,6 @@ public class LeAudioNativeInterface { sendMessageToService(event); } // Callbacks from the native stack back into the Java framework. // All callbacks are routed via the Service which will disambiguate which // state machine the message should be routed to. private void onSetMemberAvailable(byte[] address, int groupId) { LeAudioStackEvent event = new LeAudioStackEvent(LeAudioStackEvent.EVENT_TYPE_SET_MEMBER_AVAILABLE); event.device = getDevice(address); event.valueInt1 = groupId; if (DBG) { Log.d(TAG, "onSetMemberAvailable: " + event); } sendMessageToService(event); } private void onGroupStatus(int groupId, int groupStatus, int groupFlags) { LeAudioStackEvent event = new LeAudioStackEvent(LeAudioStackEvent.EVENT_TYPE_GROUP_STATUS_CHANGED); Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioStackEvent.java +2 −7 Original line number Diff line number Diff line Loading @@ -30,9 +30,8 @@ public class LeAudioStackEvent { public static final int EVENT_TYPE_GROUP_STATUS_CHANGED = 2; public static final int EVENT_TYPE_GROUP_NODE_STATUS_CHANGED = 3; public static final int EVENT_TYPE_AUDIO_CONF_CHANGED = 4; public static final int EVENT_TYPE_SET_MEMBER_AVAILABLE = 5; // -------- DO NOT PUT ANY NEW UNICAST EVENTS BELOW THIS LINE------------- public static final int EVENT_TYPE_UNICAST_MAX = 7; public static final int EVENT_TYPE_UNICAST_MAX = 5; // Do not modify without updating the HAL bt_le_audio.h files. // Match up with GroupStatus enum of bt_le_audio.h Loading Loading @@ -91,8 +90,6 @@ public class LeAudioStackEvent { return "EVENT_TYPE_GROUP_NODE_STATUS_CHANGED"; case EVENT_TYPE_AUDIO_CONF_CHANGED: return "EVENT_TYPE_AUDIO_CONF_CHANGED"; case EVENT_TYPE_SET_MEMBER_AVAILABLE: return "EVENT_TYPE_SET_MEMBER_AVAILABLE"; default: return "EVENT_TYPE_UNKNOWN:" + type; } Loading @@ -117,8 +114,6 @@ public class LeAudioStackEvent { // same as EVENT_TYPE_GROUP_STATUS_CHANGED case EVENT_TYPE_GROUP_STATUS_CHANGED: // same as EVENT_TYPE_GROUP_STATUS_CHANGED case EVENT_TYPE_SET_MEMBER_AVAILABLE: // same as EVENT_TYPE_GROUP_STATUS_CHANGED case EVENT_TYPE_AUDIO_CONF_CHANGED: // FIXME: It should have proper direction names here return "{direction:" + value + "}"; Loading