From: hcj <1224667075@qq.com> Date: Wed, 17 Dec 2025 07:07:15 +0000 (+0800) Subject: ln去除部分不必要服务 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=57df6ef665a284db5ddf8170bd51efcb6ef0c186;p=mirrors%2FFD230.git ln去除部分不必要服务 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index 2137417c3..565b2711b 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -104,7 +104,7 @@ void BluetoothModel::InitBluetoothInfo(void) uint32_t currentUs = uapi_tcxo_get_us(); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "currentUs 0x%x", currentUs); // 设置蓝牙名称 - (void)sprintf_s(watchName, sizeof(watchName), "Watch%x", (currentUs & 0xFFFF)); + (void)sprintf_s(watchName, sizeof(watchName), "LN%x", (currentUs & 0xFFFF)); ret = bluetooth_set_local_name((unsigned char*)watchName, strlen((char*)watchName) + 1); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bluetooth_set_local_name %s ret = %u", watchName, ret); @@ -135,26 +135,12 @@ void BluetoothModel::Init() ret = enable_bt_stack(); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt enable_bt_stack ret = %u", ret); - // 设置安全连接 - gap_ble_sec_params_t sec_param = { 1, GAP_BLE_IO_CAPABILITY_NOINPUTNOOUTPUT, 1, GAP_BLE_GAP_SECURITY_MODE1_LEVEL3 }; - ret = gap_ble_set_sec_param(&sec_param); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt gap_ble_set_sec_param ret = %u", ret); - InitBluetoothInfo(); BtInitCallBacks(); - wrapper_ble_register(); - BtInitCallBacksEx(); - BtInitGatts(); - BtInitSpp(); InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 PhoneServiceInit(); - // gap_remove_all_pairs(); BtA2dpInit(); - - /* 实验室测试需要,开机开广播 */ - BleAdvStart(); - #endif } @@ -1203,12 +1189,15 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState) } if (connState == PROFILE_STATE_DISCONNECTED) { + + + if(AI_IsVoiceServiceRunning()){ ln_ws_audio_deinit(); } - PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_DISCONNECTED); + set_a2dp_is_connect(false);