From a3a3917136c384a3fc2401450721d7edcf4060e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Tue, 8 Oct 2024 02:47:34 +0000 Subject: [PATCH] Merge #1118 into sdk602patch0626 from refs/changes/1118/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/1118/head: (12 commits squashed) - 修改音乐来源界面,蓝牙耳机连接状态错误显示 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 解决恢复出厂设置后进入训练界面右滑退出进入语言界面 - 屏蔽连接动画界面的title - 优化语言列表,解决语言列表最后一项被遮挡住bug - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 回退音乐来源界面代码修改 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 语言列表修改 - 解决蓝牙耳机界面内存泄漏问题 解决蓝牙耳机界面,如果进入搜索界面开启定时器后,按按键未关闭定时器问题 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1118 --- .../bluetooth/src/BluetoothDeviceCaseListAdapter.cpp | 12 ++++++++---- .../nativeui/bluetooth/src/BluetoothPresenter.cpp | 9 +++++++++ .../bluetooth/src/TipsConnFailMessageView.cpp | 10 ++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp index f945029d2..5be4c75c0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp @@ -17,10 +17,14 @@ namespace OHOS { BluetoothDeviceCaseListAdapter::~BluetoothDeviceCaseListAdapter() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothDeviceCaseListAdapter::~BluetoothDeviceCaseListAdapter"); - UIView::OnClickListener *click = item->GetOnClickListener(); - if (click != nullptr) { - delete click; - click = nullptr; + // UIView::OnClickListener *click = item->GetOnClickListener(); + // if (click != nullptr) { + // delete click; + // click = nullptr; + // } + if (listener != nullptr) { + delete listener; + listener = nullptr; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp index aa5f2ff2a..503217724 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp @@ -244,6 +244,15 @@ bool BluetoothPresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 如果是power键就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { + //如果是按键退出,退出时需要做一些清理工作 + BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance(); + if(bluetoothEarPhoneView) + { + bluetoothEarPhoneView->BtAnimatorStop(); //停止搜索动画 + bluetoothEarPhoneView->StopBtDiscovery();//停止定时器 + BluetoothModel::GetInstance()->SetTagConnectView(false); //清除标志位 + BluetoothModel::GetInstance()->SetTagScanDeviceClicked(false); + } NativeAbility::GetInstance().Back(); } return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp index 8d125872f..5fdfd13f9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp @@ -46,6 +46,16 @@ namespace OHOS delete tipLabel; tipLabel = nullptr; } + if (conn_fail_Label) + { + delete conn_fail_Label; + conn_fail_Label = nullptr; + } + if (bluetoothNameLabel) + { + delete bluetoothNameLabel; + bluetoothNameLabel = nullptr; + } delete group; group = nullptr; } -- 2.17.1