Merge #1118 into sdk602patch0626 from refs/changes/1118/head 1121/target/1
author罗正 <1732036298@qq.com>
Tue, 8 Oct 2024 02:47:34 +0000 (02:47 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Tue, 8 Oct 2024 02:47:34 +0000 (02:47 +0000)
Code review from 罗正

* refs/changes/1118/head: (12 commits squashed)

  - 修改音乐来源界面,蓝牙耳机连接状态错误显示

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

  - 解决恢复出厂设置后进入训练界面右滑退出进入语言界面

  - 屏蔽连接动画界面的title

  - 优化语言列表,解决语言列表最后一项被遮挡住bug

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

  - 回退音乐来源界面代码修改

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

  - 语言列表修改

  - 解决蓝牙耳机界面内存泄漏问题
    解决蓝牙耳机界面,如果进入搜索界面开启定时器后,按按键未关闭定时器问题

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1118
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp

index f945029..5be4c75 100644 (file)
@@ -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;
     }
 }
 
index aa5f2ff..5032177 100644 (file)
@@ -244,6 +244,15 @@ bool BluetoothPresenter::OnKeyAct(UIView &view, const KeyEvent &event)
     // 如果是power键就返回上一级\r
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0)\r
     {\r
+        //如果是按键退出,退出时需要做一些清理工作\r
+        BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance();\r
+        if(bluetoothEarPhoneView)\r
+        {\r
+            bluetoothEarPhoneView->BtAnimatorStop(); //停止搜索动画\r
+            bluetoothEarPhoneView->StopBtDiscovery();//停止定时器\r
+            BluetoothModel::GetInstance()->SetTagConnectView(false); //清除标志位\r
+            BluetoothModel::GetInstance()->SetTagScanDeviceClicked(false);\r
+        }\r
         NativeAbility::GetInstance().Back();\r
     }\r
     return true;\r
index 8d12587..5fdfd13 100644 (file)
@@ -46,6 +46,16 @@ namespace OHOS
                 delete tipLabel;\r
                 tipLabel = nullptr;\r
             }\r
+            if (conn_fail_Label)\r
+            {\r
+                delete conn_fail_Label;\r
+                conn_fail_Label = nullptr;\r
+            }\r
+            if (bluetoothNameLabel)\r
+            {\r
+                delete bluetoothNameLabel;\r
+                bluetoothNameLabel = nullptr;\r
+            }\r
             delete group;\r
             group = nullptr;\r
         }\r