Loading android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +7 −2 Original line number Diff line number Diff line Loading @@ -622,10 +622,11 @@ public class BluetoothInCallService extends InCallService { @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE}) public void onCallAdded(BluetoothCall call) { if (call.isExternalCall()) { Log.d(TAG, "onCallAdded: external call"); return; } if (!mBluetoothCallHashMap.containsKey(call.getId())) { Log.d(TAG, "onCallAdded"); Log.i(TAG, "onCallAdded"); CallStateCallback callback = new CallStateCallback(call.getState()); mCallbacks.put(call.getId(), callback); call.registerCallback(callback); Loading @@ -640,6 +641,8 @@ public class BluetoothInCallService extends InCallService { if (mBluetoothLeCallControl != null && tbsCall != null) { mBluetoothLeCallControl.onCallAdded(tbsCall); } } else { Log.i(TAG, "onCallAdded: call already exists"); } } Loading Loading @@ -688,7 +691,7 @@ public class BluetoothInCallService extends InCallService { */ @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE}) public void onCallRemoved(BluetoothCall call, boolean forceRemoveCallback) { Log.d(TAG, "onCallRemoved"); Log.i(TAG, "onCallRemoved, forceRemoveCallback=" + forceRemoveCallback); CallStateCallback callback = getCallback(call); if (callback != null && (forceRemoveCallback || !call.isExternalCall())) { call.unregisterCallback(callback); Loading Loading @@ -1334,6 +1337,8 @@ public class BluetoothInCallService extends InCallService { ringingName); mHeadsetUpdatedRecently = true; } else { Log.i(TAG, "updateHeadsetWithCallState skipped"); } } Loading flags/a2dp.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -152,3 +152,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "a2dp_fix_codec_type_in_java" namespace: "bluetooth" description: "Mask out codec IDs such that they properly reflect unsigned value" bug: "361742051" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file system/gd/rust/linux/service/src/main.rs +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(1000); // Time bt_stack_manager waits for cleanup profiles const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); // Extra time to wait before terminating the process const EXTRA_WAIT_BEFORE_KILL_MS: Duration = Duration::from_millis(1000); const INIT_LOGGING_MAX_RETRY: u8 = 3; Loading Loading @@ -307,6 +309,10 @@ extern "C" fn handle_sigterm(_signum: i32) { log::debug!("Waiting for stack to clean up for {:?}", STACK_CLEANUP_TIMEOUT_MS); let _ = notifier.thread_notify.wait_timeout(guard, STACK_CLEANUP_TIMEOUT_MS); } // Extra delay to give the rest of the cleanup processes some time to finish after // finishing btif cleanup. std::thread::sleep(EXTRA_WAIT_BEFORE_KILL_MS); } log::debug!("Sigterm completed"); Loading system/stack/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -1553,6 +1553,7 @@ cc_test { ], include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/bta", "packages/modules/Bluetooth/system/gd", ], generated_headers: [ Loading @@ -1564,6 +1565,7 @@ cc_test { ":TestCommonStackConfig", ":TestMockMainShim", ":TestMockMainShimEntry", ":TestStubOsi", "eatt/eatt.cc", "test/common/mock_btif_storage.cc", "test/common/mock_btm_api_layer.cc", Loading @@ -1577,6 +1579,7 @@ cc_test { "libcutils", ], static_libs: [ "bluetooth_flags_c_lib_for_test", "libbase", "libbluetooth-types", "libbluetooth_gd", Loading @@ -1593,6 +1596,7 @@ cc_test { "libosi", "libprotobuf-cpp-lite", "libstatslog_bt", "server_configurable_flags", ], target: { android: { Loading system/stack/eatt/eatt_impl.h +7 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ */ #include <bluetooth/log.h> #include <com_android_bluetooth_flags.h> #include <map> #include <vector> Loading Loading @@ -710,9 +711,13 @@ struct eatt_impl { EattChannel* channel = (EattChannel*)data; tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(channel->bda_, BT_TRANSPORT_LE); log::warn("disconnecting..."); log::warn("disconnecting channel {:#x} for {}", channel->cid_, channel->bda_); if (com::android::bluetooth::flags::gatt_disconnect_fix()) { EattExtension::GetInstance()->Disconnect(channel->bda_, channel->cid_); } else { gatt_disconnect(p_tcb); } } void start_indication_confirm_timer(const RawAddress& bd_addr, uint16_t cid) { EattChannel* channel = find_eatt_channel_by_cid(bd_addr, cid); Loading Loading
android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +7 −2 Original line number Diff line number Diff line Loading @@ -622,10 +622,11 @@ public class BluetoothInCallService extends InCallService { @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE}) public void onCallAdded(BluetoothCall call) { if (call.isExternalCall()) { Log.d(TAG, "onCallAdded: external call"); return; } if (!mBluetoothCallHashMap.containsKey(call.getId())) { Log.d(TAG, "onCallAdded"); Log.i(TAG, "onCallAdded"); CallStateCallback callback = new CallStateCallback(call.getState()); mCallbacks.put(call.getId(), callback); call.registerCallback(callback); Loading @@ -640,6 +641,8 @@ public class BluetoothInCallService extends InCallService { if (mBluetoothLeCallControl != null && tbsCall != null) { mBluetoothLeCallControl.onCallAdded(tbsCall); } } else { Log.i(TAG, "onCallAdded: call already exists"); } } Loading Loading @@ -688,7 +691,7 @@ public class BluetoothInCallService extends InCallService { */ @RequiresPermission(allOf = {BLUETOOTH_CONNECT, MODIFY_PHONE_STATE}) public void onCallRemoved(BluetoothCall call, boolean forceRemoveCallback) { Log.d(TAG, "onCallRemoved"); Log.i(TAG, "onCallRemoved, forceRemoveCallback=" + forceRemoveCallback); CallStateCallback callback = getCallback(call); if (callback != null && (forceRemoveCallback || !call.isExternalCall())) { call.unregisterCallback(callback); Loading Loading @@ -1334,6 +1337,8 @@ public class BluetoothInCallService extends InCallService { ringingName); mHeadsetUpdatedRecently = true; } else { Log.i(TAG, "updateHeadsetWithCallState skipped"); } } Loading
flags/a2dp.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -152,3 +152,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "a2dp_fix_codec_type_in_java" namespace: "bluetooth" description: "Mask out codec IDs such that they properly reflect unsigned value" bug: "361742051" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file
system/gd/rust/linux/service/src/main.rs +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(1000); // Time bt_stack_manager waits for cleanup profiles const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); // Extra time to wait before terminating the process const EXTRA_WAIT_BEFORE_KILL_MS: Duration = Duration::from_millis(1000); const INIT_LOGGING_MAX_RETRY: u8 = 3; Loading Loading @@ -307,6 +309,10 @@ extern "C" fn handle_sigterm(_signum: i32) { log::debug!("Waiting for stack to clean up for {:?}", STACK_CLEANUP_TIMEOUT_MS); let _ = notifier.thread_notify.wait_timeout(guard, STACK_CLEANUP_TIMEOUT_MS); } // Extra delay to give the rest of the cleanup processes some time to finish after // finishing btif cleanup. std::thread::sleep(EXTRA_WAIT_BEFORE_KILL_MS); } log::debug!("Sigterm completed"); Loading
system/stack/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -1553,6 +1553,7 @@ cc_test { ], include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/bta", "packages/modules/Bluetooth/system/gd", ], generated_headers: [ Loading @@ -1564,6 +1565,7 @@ cc_test { ":TestCommonStackConfig", ":TestMockMainShim", ":TestMockMainShimEntry", ":TestStubOsi", "eatt/eatt.cc", "test/common/mock_btif_storage.cc", "test/common/mock_btm_api_layer.cc", Loading @@ -1577,6 +1579,7 @@ cc_test { "libcutils", ], static_libs: [ "bluetooth_flags_c_lib_for_test", "libbase", "libbluetooth-types", "libbluetooth_gd", Loading @@ -1593,6 +1596,7 @@ cc_test { "libosi", "libprotobuf-cpp-lite", "libstatslog_bt", "server_configurable_flags", ], target: { android: { Loading
system/stack/eatt/eatt_impl.h +7 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ */ #include <bluetooth/log.h> #include <com_android_bluetooth_flags.h> #include <map> #include <vector> Loading Loading @@ -710,9 +711,13 @@ struct eatt_impl { EattChannel* channel = (EattChannel*)data; tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(channel->bda_, BT_TRANSPORT_LE); log::warn("disconnecting..."); log::warn("disconnecting channel {:#x} for {}", channel->cid_, channel->bda_); if (com::android::bluetooth::flags::gatt_disconnect_fix()) { EattExtension::GetInstance()->Disconnect(channel->bda_, channel->cid_); } else { gatt_disconnect(p_tcb); } } void start_indication_confirm_timer(const RawAddress& bd_addr, uint16_t cid) { EattChannel* channel = find_eatt_channel_by_cid(bd_addr, cid); Loading