下拉界面去掉4G和蓝牙耳机相关代码 2740/1 2740/head 2741/target/1
authorluozheng <1732036298@qq.com>
Thu, 13 Nov 2025 09:50:40 +0000 (17:50 +0800)
committerluozheng <1732036298@qq.com>
Thu, 13 Nov 2025 09:50:40 +0000 (17:50 +0800)
13 files changed:
code/sdk/application/wearable/fd272/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/dnotdisturb/src/DnotDisturbModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/ConnectedStatusView.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/PullUpDownView.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage1.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPageUiConfig.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/ConnectedStatusView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/PullUpDownView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage1.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/settings/include/SettingModel.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/settings/src/SettingModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/uiservice/include/ui_service.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/uiservice/src/ui_service.cpp

index 1e41788..e662144 100644 (file)
@@ -1307,7 +1307,6 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState)
         GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionSuss, *bdAddr));\r
 \r
         #ifdef SUPPORT_CAT1_HFP_AG_SERV\r
-        SendMsgToUIService(EARPHONE_CONNECTED_TO_UI, 0, nullptr, 0);\r
       \r
          uapi_dev_runtime_set_earphone_connect_stat(1);\r
          uapi_save_runtime_log(RUNTIME_LOG_BR_CONNECT_A2DP_HEADSET);\r
@@ -1322,10 +1321,6 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState)
         PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_DISCONNECTED);\r
         GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionFail, *bdAddr));\r
 \r
-        #ifdef SUPPORT_BLE_SERVICE\r
-        // SendMsgToUIService(EARPHONE_DISCONNECTED_TO_UI, 0, nullptr, 0);\r
-        #endif\r
-\r
         uapi_save_runtime_log(RUNTIME_LOG_BR_DISCONNECT_A2DP_HEADSET);\r
         /* 实验室测试耳机回连场景,用户根据需要调整策略 */\r
         bool ret = gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE, 60); // start scan\r
index c033891..5f13191 100644 (file)
@@ -48,12 +48,10 @@ namespace OHOS
         if (PullUpDownView::GetInstance() != nullptr)
         {
             /*更新主界面下拉界面配置*/
-            if(DropDownCardPage1::GetInstance() && DropDownCardPage1::GetInstance()->GetDropDownCardPage1_ToggleButton(DropDownCardPage1::toggleButton_DNOTDISTURB))
+            if(DropDownCardPage1::GetInstance() && DropDownCardPage1::GetInstance()->GetDropDownCardPage1_ToggleButton(DropDownCardPage1::toggleButton_6))
             {
-                // DropDownCardPage1::GetInstance()->GetDropDownCardPage1_ToggleButton(DropDownCardPage1::toggleButton_DNOTDISTURB)->SetState(GetDoNotDisturbModeEnabled());
                 DropDownCardPage1::GetInstance()->UpdateDnotdisturbState(GetDoNotDisturbModeEnabled());
             }
-            PullUpDownView::GetInstance()->UpdateDnotDisturbStatus(GetDoNotDisturbModeEnabled());
             /*更新主界面配置*/
             MainModel::GetInstance().setDialState(DialState::DO_NOT_DISTURB, GetDoNotDisturbModeEnabled());
         }
index ab1a069..530d89e 100644 (file)
@@ -18,7 +18,6 @@ namespace OHOS
     typedef enum : uint8_t
     {
         PHONECONNECTEDSTATUS_ID = 0,
-        EARPHONECONNECTESTATUS_ID,
         BLUETOOTHCONNECTEDSTATUS,
         MAX_CONNECTEDSTATUS_ID,
     } CONNECTEDSTATUS_ID;
@@ -33,7 +32,6 @@ namespace OHOS
         UIViewGroup *ConnectedStatusViewInit(void);
         UIButton *GetCloseButton();
         void UpdatePhoneConnectedStatus(int status);
-        void UpdateEarPhoneConnectedStatus(int status);
         void UpdateBlueToothConnectedStatus(int status);
 
         struct LabelConfig
@@ -87,7 +85,6 @@ namespace OHOS
         UIImageView *background[MAX_CONNECTEDSTATUS_ID]{nullptr};
 
         UIImageView *PhoneConnectedStatusImage{nullptr};     // 显示手机连接状态
-        UIImageView *EarPhoneConnectedStatusImage{nullptr};  // 显示耳机连接状态
         UIImageView *BluetoothConnectedStatusImage{nullptr}; // 显示蓝牙连接状态
         UILabelExt *ConnectedStatusLabel[MAX_CONNECTEDSTATUS_ID]{nullptr};
 
index a956666..9732fd5 100644 (file)
@@ -69,10 +69,8 @@ namespace OHOS
         /* ---------------------------------- 1.连接状态 ---------------------------------- */
     public:
         bool GetPhoneConnectedStatus(void);
-        bool GetEarPhoneConnectedStatus(void);
         bool GetBlueToothConnectedStatus(void);
         void UpdatePhoneStatus(int status);
-        void UpdateEarPhoneStatus(int status);
         void UpdateBlueToothStatus(int status);
         void SetPhoneConnectedIsVisible(bool state);
 
@@ -82,7 +80,6 @@ namespace OHOS
         void ClearAll_1(void);
         UIButton *connectedStatusBackgroundButton{nullptr}; // 放置连接状态icon的背景按钮
         UIImageView *showPhoneConnectedStatus{nullptr};     // 显示手机连接状态
-        UIImageView *showEarPhoneConnectedStatus{nullptr};  // 显示耳机连接状态
         UIImageView *showBluetoothConnectedStatus{nullptr}; // 显示蓝牙连接状态
         /* --------------------------------- 2.基本数据显示-------------------------------- */
     public:
@@ -99,16 +96,10 @@ namespace OHOS
         void UpdateSignalBarDisplay(int signalBars, bool state);
         void updateSignalDisplay();
         void UpdateCat1NoSignalisplay(bool state);
-        void UpdateCat14GDisplay(bool state);
         void UpdateHDDisplay(bool state);
         void UpdateCat1MobileDataDisplay(bool state);
         void UpdateXPosition(void);
         UIViewGroup *group1{nullptr};
-        UIImageView *showSignalStrength[4]{nullptr}; // 信号强度
-        UILabel *Singal_4{nullptr};                  // 4G图标
-        UIImageView *NoSignal{nullptr};              // 无信号
-        UIImageView *MobileData{nullptr};            // 移动数据
-        UIImageView *HD{nullptr};                    // HD
         UIImageView *batteryimage{nullptr};          // 电池图片
         UIBoxProgress *progress{nullptr};            // 电池进度条
         UILabel *showDateAndWeekLabel{nullptr};      // 显示日期和星期
index 33ff556..18b0524 100644 (file)
@@ -30,13 +30,13 @@ namespace OHOS
         };
         enum toggleButtonid : uint8_t
         {
-            toggleButton_BT = 0,      // 蓝牙开关
-            toggleButton_4G,          // 4G开关
-            toggleButton_ALIPAY,      // 支付宝
-            toggleButton_SAVEPOWER,   // 省电模式开关
-            toggleButton_SLEEP,       // 睡眠开关
-            toggleButton_DNOTDISTURB, // 勿扰开关
-            toggleButton_SETTING,     // 设置
+            toggleButton_1 = 0, // 蓝牙开关
+            toggleButton_2,     // 查找手机
+            toggleButton_3,     // list切换
+            toggleButton_4,     // 省电模式开关
+            toggleButton_5,     // 睡眠开关
+            toggleButton_6,     // 勿扰开关
+            toggleButton_7,     // 设置
             toggleButton_MAX,
         };
 
index c13fbe8..5520205 100644 (file)
@@ -5,14 +5,13 @@ namespace OHOS
 {
     // viewId
     static constexpr const char *DROPDOWN_BT_TOGGLEBUTTON_VIEWID = "dropdown_bt";                           // 蓝牙
-    static constexpr const char *DROPDOWN_4G_TOGGLEBUTTON_VIEWID = "dropdown_4g";                           // 4g
     static constexpr const char *DROPDOWN_ALIPAY_TOGGLEBUTTON_VIEWID = "dropdown_ALIPAY";                   // 支付宝
     static constexpr const char *DROPDOWN_SAVEPOWER_TOGGLEBUTTON_VIEWID = "dropdown_savepower";             // 省电模式
     static constexpr const char *DROPDOWN_SLEEP_TOGGLEBUTTON_VIEWID = "dropdown_sleep";                     // 睡眠模式
     static constexpr const char *DROPDOWN_DNOTDISTURB_TOGGLEBUTTON_VIEWID = "dropdown_dnotdisturb";         // 勿扰模式
     static constexpr const char *DROPDOWN_SETTING_TOGGLEBUTTON_VIEWID = "dropdown_setting";                 // 设置
     static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_findphone";             // 查找手机
-    static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g";                     // 手电筒
+    static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_lighting";              // 手电筒
     static constexpr const char *DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID = "dropdown_applist_display"; // 列表样式
 
     // 蓝牙
index 7771d58..2acfd06 100644 (file)
@@ -11,7 +11,6 @@ namespace OHOS
 {
     static OHOS::ColorType connectedColor[MAX_CONNECTEDSTATUS_ID] = {
         Color::GetColorFromRGBA(0xff, 0x8a, 0x36, 0xff),
-        Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff),
         Color::GetColorFromRGBA(0x0d, 0x62, 0xff, 0xff),
     };
     static OHOS::ColorType disconnectedColor = Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff);
@@ -20,10 +19,6 @@ namespace OHOS
     static const char *DROPDOWN_PHONECONNECTED_ = "/user/res/connectstatus/phone_bt_connected.bin";
     static const char *DROPDOWN_PHONEDISCONNECTED_ = "/user/res/connectstatus/phone_bt_disconnected.bin";
 
-    //耳机
-    static const char *DROPDOWN_EARPHONESCONNECTED_ = "/user/res/connectstatus/earphone_connected.bin";
-    static const char *DROPDOWN_EARPHONESDISCONNECTED_ = "/user/res/connectstatus/earphone_disconnected.bin";
-
     //蓝牙
     static const char *DROPDOWN_BLUETOOTHCONNECTED_ = "/user/res/connectstatus/bt_connected.bin";
     static const char *DROPDOWN_BLUETOOTHDISCONNECTED_ = "/user/res/connectstatus/bt_disconnected.bin";
@@ -72,9 +67,6 @@ namespace OHOS
             delete PhoneConnectedStatusImage;
             PhoneConnectedStatusImage = nullptr;
 
-            delete EarPhoneConnectedStatusImage;
-            EarPhoneConnectedStatusImage = nullptr;
-
             delete BluetoothConnectedStatusImage;
             BluetoothConnectedStatusImage = nullptr;
 
@@ -181,7 +173,7 @@ namespace OHOS
     bool ConnectedStatusView::initBackground(void)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnectedStatusView::initBackground");
-        int background_position_x = 33;
+        int background_position_x = 97;
         for (int i = 0; i < MAX_CONNECTEDSTATUS_ID; i++)
         {
             background[i] = new UIImageView();
@@ -190,7 +182,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "background[%d] new fail!!", i);
                 return false;
             }
-            background[i]->SetPosition(background_position_x + i * 140, 113, 120, 200);
+            background[i]->SetPosition(background_position_x + i * 152, 113, 120, 200);
             background[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
             background[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
             background[i]->SetStyle(STYLE_BORDER_RADIUS, 40);
@@ -211,7 +203,7 @@ namespace OHOS
         }
 
         StatusImageParams params = {
-            .x = 63,
+            .x = 127,
             .y = 135,
             .width = 60,
             .height = 60,
@@ -223,19 +215,7 @@ namespace OHOS
         group->Add(PhoneConnectedStatusImage);
 
         params = {
-            .x = 203,
-            .y = 135,
-            .width = 60,
-            .height = 60,
-            .connectedImage = DROPDOWN_EARPHONESCONNECTED_,
-            .disconnectedImage = DROPDOWN_EARPHONESDISCONNECTED_,
-            .isConnected = pullUpDownView->GetEarPhoneConnectedStatus(),
-        };
-        EarPhoneConnectedStatusImage = InitStatusImage(params);
-        group->Add(EarPhoneConnectedStatusImage);
-
-        params = {
-            .x = 343,
+            .x = 279,
             .y = 135,
             .width = 60,
             .height = 60,
@@ -248,16 +228,15 @@ namespace OHOS
 
         uint16_t deviceName[MAX_CONNECTEDSTATUS_ID] = {
             STR_PHONE,     // 手机
-            STR_HEADSET,   // 耳机
             STR_BLUETOOTH, // 蓝牙
         }; // 初始化设备名称数组
 
-        int PhoneAndEarAndBluetooth_position_x = 53;
-        int ConnectedStatusLabel_position_x = 59;
+        int PhoneAndEarAndBluetooth_position_x = 117;
+        int ConnectedStatusLabel_position_x = 123;
 
         for (int i = 0; i < MAX_CONNECTEDSTATUS_ID; i++)
         {
-            LabelConfig titleConfig = {PhoneAndEarAndBluetooth_position_x + i * 140, 220, 80, 35, 30, 35, deviceName[i]};
+            LabelConfig titleConfig = {PhoneAndEarAndBluetooth_position_x + i * 152, 220, 80, 35, 30, 35, deviceName[i]};
             PhoneAndEarAndBluetooth[i] = InitLabel(titleConfig);
             group->Add(PhoneAndEarAndBluetooth[i]);
 
@@ -267,7 +246,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectedStatusLabel[%d] new fail!!", i);
                 return false;
             }
-            ConnectedStatusLabel[i]->SetPosition(ConnectedStatusLabel_position_x + i * 140, 258, 70, 27);
+            ConnectedStatusLabel[i]->SetPosition(ConnectedStatusLabel_position_x + i * 152, 258, 70, 27);
             ConnectedStatusLabel[i]->SetStyle(STYLE_TEXT_FONT, 23);
             ConnectedStatusLabel[i]->SetStyle(STYLE_LINE_HEIGHT, 27);
             ConnectedStatusLabel[i]->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
@@ -276,7 +255,6 @@ namespace OHOS
             group->Add(ConnectedStatusLabel[i]);
         }
         UpdatePhoneConnectedStatus(pullUpDownView->GetPhoneConnectedStatus());
-        UpdateEarPhoneConnectedStatus(pullUpDownView->GetEarPhoneConnectedStatus());
         UpdateBlueToothConnectedStatus(pullUpDownView->GetBlueToothConnectedStatus());
 
         return true;
@@ -351,26 +329,6 @@ namespace OHOS
         updateConnectionStatus(params);
     }
 
-    // 更新蓝牙耳机连接状态
-    void ConnectedStatusView::UpdateEarPhoneConnectedStatus(int status)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnectedStatusView::UpdateEarPhoneConnectedStatus");
-
-        ConnectionStatusParams params = {
-            .statusImage = EarPhoneConnectedStatusImage,
-            .statusLabel = ConnectedStatusLabel[EARPHONECONNECTESTATUS_ID],
-            .status = status,
-            .connectedImage = DROPDOWN_EARPHONESCONNECTED_,
-            .disconnectedImage = DROPDOWN_EARPHONESDISCONNECTED_,
-            .connectedText = STR_CONNECTED,
-            .disconnectedText = STR_DISCONNECTED,
-            .connectedColor = connectedColor[EARPHONECONNECTESTATUS_ID],
-            .disconnectedColor = disconnectedColor,
-        };
-
-        updateConnectionStatus(params);
-    }
-
     // 更新蓝牙连接状态
     void ConnectedStatusView::UpdateBlueToothConnectedStatus(int status)
     {
index f7b1c65..13a5743 100644 (file)
@@ -27,19 +27,15 @@ extern "C"
 {
 #ifdef SUPPORT_BATTERY_SERVICE
 #include "battery_hal.h"
-extern uint8_t get_charge_stat(void);
+    extern uint8_t get_charge_stat(void);
 #endif
 }
 namespace OHOS
 {
-
     /* ---------------------------------- 坐标位置 ---------------------------------- */
     // 手机连接状态
     static constexpr const char *DROPDOWN_PHONECONNECTED_IMAGE = "/user/res/dropdown/phone_connect.bin";
     static constexpr const char *DROPDOWN_PHONEDISCONNECTED_IMAGE = "/user/res/dropdown/phone_disconnect.bin";
-    // 耳机连接状态
-    static constexpr const char *DROPDOWN_EARPHONESCONNECTED_IMAGE = "/user/res/dropdown/earphones_connect.bin";
-    static constexpr const char *DROPDOWN_EARPHONESDISCONNECTED_IMAGE = "/user/res/dropdown/earphones_disconnect.bin";
     // 蓝牙连接状态
     static constexpr const char *DROPDOWN_BLUETOOTHCONNECTED_IMAGE = "/user/res/dropdown/bluetooth_connect.bin";
     static constexpr const char *DROPDOWN_BLUETOOTHDISCONNECTED_IMAGE = "/user/res/dropdown/bluetooth_disconnect.bin";
@@ -122,46 +118,19 @@ namespace OHOS
     bool PullUpDownView::GetPhoneConnectedStatus(void)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetPhoneConnectedStatus");
-        // uint8_t ret = uapi_dev_runtime_get_ble_connect_stat();
-        // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "ble phone connect stat = %d", ret);
-        // if (ret == 1)
-        //     return true;
-        // else
-        // return false;
-
         return SettingModel::GetInstance().GetPhoneConnectStatus();
     }
-    // 获取蓝牙耳机连接状态
-    bool PullUpDownView::GetEarPhoneConnectedStatus(void)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetEarPhoneConnectedStatus");
-        // uint8_t ret = uapi_dev_runtime_get_earphone_connect_stat();
-        // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "earphone connect stat = %d", ret);
-        // if (ret == 1)
-        //     return true;
-        // else
-        // return false;
-
-        return SettingModel::GetInstance().GetEarPhoneConnectStatus();
-    }
     // 获取蓝牙连接状态
     bool PullUpDownView::GetBlueToothConnectedStatus(void)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetBlueToothConnectedStatus");
-        // uint8_t ret = uapi_dev_runtime_get_br_connect_stat();
-        // WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "br connect stat = %d [0 no connect, 1 a2dp, 2 hfp, 3 both]", ret);
-        // if (ret != 0)
-        //     return true;
-        // else
-        // return false;
-
         return SettingModel::GetInstance().GetBlueToothConnectStatus();
     }
 
     // 设置蓝牙连接状态是否显示
     void PullUpDownView::SetPhoneConnectedIsVisible(bool state)
     {
-        if (connectedStatusBackgroundButton && showPhoneConnectedStatus && showEarPhoneConnectedStatus && showBluetoothConnectedStatus)
+        if (connectedStatusBackgroundButton && showPhoneConnectedStatus && showBluetoothConnectedStatus)
         {
             if (!state)
             {
@@ -169,8 +138,7 @@ namespace OHOS
                 int x = connectedStatusBackgroundButton->GetX();
                 int y = connectedStatusBackgroundButton->GetY();
                 showPhoneConnectedStatus->SetVisible(true);
-                showEarPhoneConnectedStatus->SetPosition(x + 68, y + 13);
-                showBluetoothConnectedStatus->SetPosition(x + 110, y + 13);
+                showBluetoothConnectedStatus->SetPosition(x + 68, y + 13);
             }
             else
             {
@@ -178,12 +146,10 @@ namespace OHOS
                 int x = connectedStatusBackgroundButton->GetX();
                 int y = connectedStatusBackgroundButton->GetY();
                 showPhoneConnectedStatus->SetVisible(false);
-                showEarPhoneConnectedStatus->SetPosition(x + 22, y + 13);
-                showBluetoothConnectedStatus->SetPosition(showEarPhoneConnectedStatus->GetX() + showEarPhoneConnectedStatus->GetWidth() + 18, y + 13);
+                showBluetoothConnectedStatus->SetPosition(x + 22, y + 13);
             }
             connectedStatusBackgroundButton->Invalidate();
             showPhoneConnectedStatus->Invalidate();
-            showEarPhoneConnectedStatus->Invalidate();
             showBluetoothConnectedStatus->Invalidate();
         }
     }
@@ -208,23 +174,6 @@ namespace OHOS
 
         return;
     }
-    // 更新蓝牙耳机连接状态
-    void PullUpDownView::UpdateEarPhoneStatus(int status)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UpdateEarPhoneStatus");
-        if (showEarPhoneConnectedStatus == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showEarPhoneConnectedStatus nullptr");
-            return;
-        }
-        showEarPhoneConnectedStatus->SetSrc(status ? DROPDOWN_EARPHONESCONNECTED_IMAGE : DROPDOWN_EARPHONESDISCONNECTED_IMAGE);
-        showEarPhoneConnectedStatus->Invalidate();
-
-        if (GetConnectedStatusView() != nullptr)
-            GetConnectedStatusView()->UpdateEarPhoneConnectedStatus(status);
-
-        return;
-    }
     // 更新蓝牙连接状态
     void PullUpDownView::UpdateBlueToothStatus(int status)
     {
@@ -293,16 +242,6 @@ namespace OHOS
                 return;
             }
         }
-        /* -------------------------------- 显示耳机连接状态 -------------------------------- */
-        if (showEarPhoneConnectedStatus == nullptr)
-        {
-            showEarPhoneConnectedStatus = DropDownConnectedStatusImageViweInit(x + 68, y + 13, 24, 24);
-            if (showEarPhoneConnectedStatus == nullptr)
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showEarPhoneConnectedStatus new fail");
-                return;
-            }
-        }
         /* -------------------------------- 显示蓝牙连接状态 -------------------------------- */
         if (showBluetoothConnectedStatus == nullptr)
         {
@@ -315,12 +254,10 @@ namespace OHOS
         }
         /* -------------------------------------------------------------------------- */
         UpdatePhoneStatus(GetPhoneConnectedStatus());
-        UpdateEarPhoneStatus(GetEarPhoneConnectedStatus());
         UpdateBlueToothStatus(GetBlueToothConnectedStatus());
         /* -------------------------------------------------------------------------- */
         group[DROPDOWNVIEW]->Add(connectedStatusBackgroundButton);
         group[DROPDOWNVIEW]->Add(showPhoneConnectedStatus);
-        group[DROPDOWNVIEW]->Add(showEarPhoneConnectedStatus);
         group[DROPDOWNVIEW]->Add(showBluetoothConnectedStatus);
     }
 
@@ -336,11 +273,6 @@ namespace OHOS
             delete showPhoneConnectedStatus;
             showPhoneConnectedStatus = nullptr;
         }
-        if (showEarPhoneConnectedStatus != nullptr)
-        {
-            delete showEarPhoneConnectedStatus;
-            showEarPhoneConnectedStatus = nullptr;
-        }
         if (showBluetoothConnectedStatus != nullptr)
         {
             delete showBluetoothConnectedStatus;
@@ -366,104 +298,7 @@ namespace OHOS
         }
         group1->SetPosition(132, 80, 202, 40);
         group1->SetStyle(STYLE_BACKGROUND_OPA, 0);
-        /* -------------------------------- NoSignal -------------------------------- */
-        if (NoSignal == nullptr)
-        {
-            NoSignal = new UIImageView();
-            if (NoSignal == nullptr)
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NoSignal new fail");
-                return;
-            }
-        }
-        NoSignal->SetPosition(0, (group1->GetHeight() - 38) / 2, 36, 38);
-        NoSignal->SetAutoEnable(false);
-        NoSignal->SetResizeMode(UIImageView::CENTER);
-        NoSignal->SetSrc(DROPDOWN_NOSIGNAL_IMAGE);
-        NoSignal->SetVisible(false);
-        group1->Add(NoSignal);
-        /* ------------------------------- MobileData ------------------------------- */
-        if (MobileData == nullptr)
-        {
-            MobileData = new UIImageView();
-            if (MobileData == nullptr)
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MobileData new fail");
-                return;
-            }
-        }
-        MobileData->SetPosition(1, 4, 13, 15);
-        MobileData->SetAutoEnable(false);
-        MobileData->SetResizeMode(UIImageView::CENTER);
-        MobileData->SetSrc(DROPDOWN_MOBILE_DATA_IMAGE);
-        MobileData->SetVisible(false);
-        group1->Add(MobileData);
-        /* -------------------------------------------------------------------------- */
-        // 定义一个结构体,用于存储 ImageView 的信息
-        struct ImageViewInfo
-        {
-            int posX;
-            int posY;
-            int width;
-            int height;
-        };
-        // 待添加的 ImageView 信息列表
-        std::vector<ImageViewInfo> imageViewList = {
-            {0, 28, 6, 6},
-            {10, 20, 6, 14},
-            {20, 12, 6, 22},
-            {30, 4, 6, 30},
-        };
-
-        // 循环添加 ImageView 到相应的容器中
-        for (int i = 0; i < 4; i++)
-        {
-            if (showSignalStrength[i] == nullptr)
-            {
-                showSignalStrength[i] = new UIImageView();
-                if (showSignalStrength[i] == nullptr)
-                {
-                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d] new fail", i);
-                    return;
-                }
-            }
-            showSignalStrength[i]->SetPosition(imageViewList[i].posX, imageViewList[i].posY, imageViewList[i].width, imageViewList[i].height);
-            showSignalStrength[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
-            showSignalStrength[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
-            showSignalStrength[i]->SetStyle(STYLE_BORDER_RADIUS, 10);
-            group1->Add(showSignalStrength[i]);
-            showSignalStrength[i]->SetVisible(false);
-        }
-        /* -------------------------------- Singal_4 -------------------------------- */
-        if (Singal_4 == nullptr)
-        {
-            Singal_4 = new UILabel();
-        }
-        Singal_4->SetPosition(0, 0, 40, 47);
-        Singal_4->SetStyle(STYLE_TEXT_FONT, 34);
-        Singal_4->SetStyle(STYLE_LINE_HEIGHT, 40);
-        Singal_4->SetText("4G");
-        Singal_4->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
-        Singal_4->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
-        Singal_4->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 34);
-        Singal_4->SetVisible(false);
-        group1->Add(Singal_4);
-        /* ----------------------------------- HD ----------------------------------- */
-        if (HD == nullptr)
-        {
-            HD = new UIImageView();
-            if (HD == nullptr)
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HD new fail");
-                return;
-            }
-        }
-        HD->SetPosition(88 + 10, (group1->GetHeight() - 30) / 2, 46, 30);
-        HD->SetAutoEnable(false);
-        HD->SetResizeMode(UIImageView::CENTER);
-        HD->SetSrc(DROPDOWN_HD_IMAGE);
-        HD->SetVisible(false);
-        group1->Add(HD);
+        group[DROPDOWNVIEW]->Add(group1);
         /* ----------------------------------- 电池 ----------------------------------- */
         batteryimage = new UIImageView();
         if (batteryimage == nullptr)
@@ -471,7 +306,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryimage new fail");
             return;
         }
-        batteryimage->SetPosition(HD->GetX() + HD->GetWidth() + 10, (group1->GetHeight() - 30) / 2, 48, 30);
+        batteryimage->SetPosition((group1->GetWidth() - 48) / 2, (group1->GetHeight() - 30) / 2, 48, 30);
         std::string batteryimagesPath = "/user/res/Battery/Battery_White.bin";
         batteryimage->SetSrc(batteryimagesPath.c_str());
         group1->Add(batteryimage);
@@ -506,8 +341,6 @@ namespace OHOS
         chargeBatteryicon->SetResizeMode(UIImageView::CONTAIN);
         chargeBatteryicon->SetVisible(false);
         group1->Add(chargeBatteryicon);
-        /* -------------------------------------------------------------------------- */
-        group[DROPDOWNVIEW]->Add(group1);
         /* --------------------------------- 显示日期和星期 -------------------------------- */
         showDateAndWeekLabel = new UILabel();
         if (showDateAndWeekLabel == nullptr)
@@ -524,8 +357,6 @@ namespace OHOS
         showDateAndWeekLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30);
         group[DROPDOWNVIEW]->Add(showDateAndWeekLabel);
         /* -------------------------------------------------------------------------- */
-        UpdateSignalStrengthStatusAndBatteryPosition();
-/* -------------------------------------------------------------------------- */
         MainPresenterSample::GetInstance()->UpdataBaseData();
         /* -------------------------------------------------------------------------- */
         UpdateBatteryProcess();
@@ -535,34 +366,6 @@ namespace OHOS
         if (group1 != nullptr)
         {
             group1->RemoveAll();
-            for (int i = 0; i < 4; i++)
-            {
-                if (showSignalStrength[i] != nullptr)
-                {
-                    delete showSignalStrength[i];
-                    showSignalStrength[i] = nullptr;
-                }
-            }
-            if (Singal_4 != nullptr)
-            {
-                delete Singal_4;
-                Singal_4 = nullptr;
-            }
-            if (NoSignal != nullptr)
-            {
-                delete NoSignal;
-                NoSignal = nullptr;
-            }
-            if (MobileData != nullptr)
-            {
-                delete MobileData;
-                MobileData = nullptr;
-            }
-            if (HD != nullptr)
-            {
-                delete HD;
-                HD = nullptr;
-            }
             if (batteryimage != nullptr)
             {
                 delete batteryimage;
@@ -589,298 +392,10 @@ namespace OHOS
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::ClearAll_2 over!!");
     }
 
-    // 获取信号强度
-    int PullUpDownView::GetSignalStrength(void)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetSignalStrength");
-        int SignalStrength = 0;
-        #ifdef SUPPORT_CAT1_SERVICE
-        SignalStrength = uapi_dev_runtime_get_cat1_signal(); // 信号强度
-        #endif
-        return CalculateSignalBars(SignalStrength);
-    }
-
-    // 计算信号格
-    int PullUpDownView::CalculateSignalBars(int signalStrength)
-    {
-#if 0
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::CalculateSignalBars");
-        if (signalStrength < 0 || signalStrength > 31 || signalStrength == 0)
-            return 99; // 无信号 or Invalid signal strength
-
-        // if (signalStrength == 32)
-        //     return 4; // Edge case where signalStrength is exactly at the upper boundary
-
-        return (signalStrength / 8) + 1;
-#else
-        if (signalStrength >= 1 && signalStrength <= 8) // 0信号
-        {
-            return 0;
-        }
-        else if (signalStrength >= 9 && signalStrength <= 16) // 1格信号,信号很弱偶尔可以接打电话,很容易失败
-        {
-            return 1;
-        }
-        else if (signalStrength >= 17 && signalStrength <= 21) // 2格信号,信号一般
-        {
-            return 2;
-        }
-        else if (signalStrength >= 22 && signalStrength <= 26) // 3格信号,信号较强
-        {
-            return 3;
-        }
-        else if (signalStrength >= 27 && signalStrength <= 31) // 4格信号,信号很强
-        {
-            return 4;
-        }
-        else
-        {
-            return 99; // Invalid signal strength
-        }
-#endif
-    }
-
-    // 函数用于更新信号显示的UI
-    void PullUpDownView::updateSignalDisplay()
-    {
-         #ifdef SUPPORT_CAT1_SERVICE
-        int sim = uapi_dev_runtime_get_cat1_simstat();
-        int cat1_powerOn = uapi_dev_runtime_get_cat1_powerstat();
-        int signal = uapi_dev_runtime_get_cat1_signal();
-        int network_on = uapi_dev_runtime_get_cat1_networkstat();
-        int cat1_network_type = uapi_dev_runtime_get_cat1_networtype();
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sim = %d", sim);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cat1_powerOn = %d", cat1_powerOn);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "signal = %d", signal);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "network_on = %d", network_on);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cat1_network_type = %d", cat1_network_type);
-
-        const int SIGNAL_NO_SIGNAL = 99;
-        const int NETWORK_TYPE_NO_NETWORK = 0;
-        const int NETWORK_TYPE_4G = 4;
-
-        if (sim == 0 || cat1_powerOn == 0)
-        {
-            // 无信号,无4G图标
-            UpdateCat1NoSignalisplay(true);
-            UpdateCat14GDisplay(false);
-            UpdateSignalBarDisplay(CalculateSignalBars(signal), false);
-            UpdateCat1MobileDataDisplay(false);
-        }
-        else if (cat1_powerOn == 1 && sim != 0)
-        {
-            if (signal == SIGNAL_NO_SIGNAL) // 计算信号强度
-            {
-                // 无信号UI显示
-                UpdateCat1NoSignalisplay(true);
-                UpdateCat14GDisplay(false);
-                UpdateSignalBarDisplay(CalculateSignalBars(signal), false);
-            }
-            else
-            {
-                // 信号强度显示
-                UpdateCat1NoSignalisplay(false);
-                // UpdateCat14GDisplay(true);
-                UpdateSignalBarDisplay(CalculateSignalBars(signal), true);
-            }
-
-            if (network_on == 0)
-            {
-                // 无信号,无4G图标 显示
-                if (signal == SIGNAL_NO_SIGNAL)
-                {
-                    UpdateCat1NoSignalisplay(true);
-                }
-                UpdateCat14GDisplay(false);
-                UpdateCat1MobileDataDisplay(false);
-                // UpdateSignalBarDisplay(CalculateSignalBars(signal), false);
-            }
-            else
-            {
-                if (cat1_network_type == NETWORK_TYPE_NO_NETWORK)
-                {
-                    // 无信号,无4G图标 显示
-                    if (signal == SIGNAL_NO_SIGNAL)
-                    {
-                        UpdateCat1NoSignalisplay(true);
-                    }
-                    UpdateCat14GDisplay(false);
-                    UpdateCat1MobileDataDisplay(false);
-                    // UpdateSignalBarDisplay(CalculateSignalBars(signal), false);
-                }
-                else if (cat1_network_type == NETWORK_TYPE_4G)
-                {
-                    // 有4G图标,正常显示信号
-                    UpdateCat1NoSignalisplay(false);
-                    UpdateCat14GDisplay(true);
-                    UpdateCat1MobileDataDisplay(true);
-                    // UpdateSignalBarDisplay(CalculateSignalBars(signal), true);
-                }
-                else
-                {
-                    // 无4G图标,正常显示信号
-                    UpdateCat1NoSignalisplay(false);
-                    UpdateCat14GDisplay(false);
-                    UpdateCat1MobileDataDisplay(true);
-                    // UpdateSignalBarDisplay(CalculateSignalBars(signal), true);
-                }
-            }
-        }
-        #endif
-    }
-    // 更新信号强度显示
-    void PullUpDownView::UpdateSignalBarDisplay(int signalBars, bool state)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UpdateSignalBarDisplay");
-        for (int i = 0; i < 4; i++)
-        {
-            showSignalStrength[i]->SetStyle(STYLE_BACKGROUND_COLOR, (i < signalBars) ? COLOR_SIGNAL_ON : COLOR_SIGNAL_OFF);
-            showSignalStrength[i]->Invalidate();
-            showSignalStrength[i]->SetVisible(state);
-        }
-    }
-
-    // 更新无信号图标显示
-    void PullUpDownView::UpdateCat1NoSignalisplay(bool state)
-    {
-        if (NoSignal != nullptr)
-        {
-            NoSignal->SetVisible(state);
-        }
-    }
-
-    // 更新4G图标显示
-    void PullUpDownView::UpdateCat14GDisplay(bool state)
-    {
-        if (Singal_4 != nullptr)
-        {
-            Singal_4->SetVisible(state);
-        }
-        UpdateHDDisplay(state && ConfigModel::GetInstance()->GetVoLTE_Call());
-    }
-
-    // 有HD一定有4G
-    void PullUpDownView::UpdateHDDisplay(bool state)
-    {
-        if (HD != nullptr)
-        {
-            HD->SetVisible(state);
-        }
-    }
-
-    /*更新移动数据图标显示*/
-    void PullUpDownView::UpdateCat1MobileDataDisplay(bool state)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UpdateCat1MobileDataDisplay %d", state);
-        if (MobileData != nullptr)
-        {
-            MobileData->SetVisible(state);
-        }
-    }
-
-    void PullUpDownView::UpdateXPosition(void)
-    {
-        // 判断相关组件是否有效
-        if (MobileData && HD && Singal_4 && NoSignal && batteryimage && progress && chargeBatteryicon)
-        {
-            // 获取各个组件的可见状态
-            bool mobileDataVisible = MobileData->IsVisible(); // 移动数据
-            bool hdVisible = HD->IsVisible();                 // HD [VoLTE开关]
-            bool signal4Visible = Singal_4->IsVisible();      // 4G
-            bool noSignalVisible = NoSignal->IsVisible();     // 无信号
-
-            int x;
-            int signalWidth = NoSignal->GetWidth();
-            int batteryWidth = batteryimage->GetWidth();
-            int spacing = 10;
-
-            if (noSignalVisible) // 无信号时的处理
-            {
-                x = (group1->GetWidth() - (signalWidth + batteryWidth + spacing)) / 2;
-                NoSignal->SetX(x);
-                batteryimage->SetX(x + signalWidth + spacing);
-                progress->SetX(batteryimage->GetX() + 7);
-            }
-            else // 有信号时的处理
-            {
-                if (!signal4Visible) // 无 4G
-                {
-                    x = (group1->GetWidth() - (signalWidth + batteryWidth + spacing)) / 2;
-                    for (int i = 0; i < 4; i++)
-                    {
-                        if (showSignalStrength[i] != nullptr)
-                        {
-                            if (i != 0)
-                            {
-                                showSignalStrength[i]->SetX(showSignalStrength[i - 1]->GetX() + 10);
-                                WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d]", showSignalStrength[i]->GetX());
-                            }
-                            else
-                            {
-                                showSignalStrength[i]->SetX(x);
-                            }
-                        }
-                    }
-                    batteryimage->SetX(showSignalStrength[3]->GetX() + spacing);
-                    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d]", batteryimage->GetX());
-                    progress->SetX(batteryimage->GetX() + 7);
-                }
-                else // 有 4G
-                {
-                    int additionalWidth = hdVisible ? HD->GetWidth() : 0;
-                    x = (group1->GetWidth() - (signalWidth + Singal_4->GetWidth() + additionalWidth + batteryWidth + spacing * (2 + hdVisible))) / 2;
-                    for (int i = 0; i < 4; i++)
-                    {
-                        if (showSignalStrength[i] != nullptr)
-                        {
-                            if (i != 0)
-                            {
-                                showSignalStrength[i]->SetX(showSignalStrength[i - 1]->GetX() + 10);
-                                WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d]", showSignalStrength[i]->GetX());
-                            }
-                            else
-                            {
-                                showSignalStrength[i]->SetX(x);
-                            }
-                        }
-                    }
-                    Singal_4->SetX(showSignalStrength[3]->GetX() + spacing);
-                    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d]", batteryimage->GetX());
-                    if (hdVisible) // 有 HD
-                    {
-                        HD->SetX(Singal_4->GetX() + Singal_4->GetWidth() + spacing);
-                        batteryimage->SetX(HD->GetX() + HD->GetWidth() + spacing);
-                        progress->SetX(batteryimage->GetX() + 7);
-                    }
-                    else // 无 HD
-                    {
-                        batteryimage->SetX(Singal_4->GetX() + Singal_4->GetWidth() + spacing);
-                        progress->SetX(batteryimage->GetX() + 7);
-                    }
-                }
-                if (mobileDataVisible) // 如果有移动数据图标,设置其位置
-                {
-                    MobileData->SetX(showSignalStrength[0]->GetX());
-                }
-            }
-            chargeBatteryicon->SetPosition(progress->GetX() + 6, batteryimage->GetY() + 2);
-            // 使相关组件无效化以触发重绘
-            MobileData->Invalidate();
-            HD->Invalidate();
-            Singal_4->Invalidate();
-            NoSignal->Invalidate();
-            batteryimage->Invalidate();
-            progress->Invalidate();
-            chargeBatteryicon->Invalidate();
-        }
-    }
-
     // 更新信号强度和电池位置
     void PullUpDownView::UpdateSignalStrengthStatusAndBatteryPosition()
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UpdateSignalStrengthStatusAndBatteryPosition");
-        updateSignalDisplay(); // 函数用于更新信号显示的UI
-        UpdateXPosition();
 
         /*更新蓝牙连接状态*/
         int a2dp = uapi_a2dp_snk_get_device_connect_state();
@@ -898,9 +413,9 @@ namespace OHOS
         }
 
         bool isCharging = false;
-        #ifdef SUPPORT_BATTERY_SERVICE
+#ifdef SUPPORT_BATTERY_SERVICE
         isCharging = get_charge_stat(); // 获取充电状态
-        #endif
+#endif
 
         if (isCharging)
         {
@@ -1136,12 +651,6 @@ namespace OHOS
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UnLoad");
     }
 
-    /*更新勿扰模式状态*/
-    void PullUpDownView::UpdateDnotDisturbStatus(int status)
-    {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::UpdateDnotDisturbStatus");
-    }
-
     UIBoxProgress *PullUpDownView::GetProgress()
     {
         return progress;
index a4f38b4..e6d0a94 100644 (file)
@@ -74,7 +74,6 @@ namespace OHOS
         else if (viewId == DROPDOWN_SAVEPOWER_TOGGLEBUTTON_VIEWID) // 省电模式开关
         {
 
-            state = toggleButton[DropDownCardPage1::toggleButton_SAVEPOWER]->GetState();
             NativeAbility::GetInstance().EnterSlice(VIEW_SAVEELE);
         }
         else if (viewId == DROPDOWN_SLEEP_TOGGLEBUTTON_VIEWID) // 睡眠开关
@@ -82,7 +81,6 @@ namespace OHOS
 
             if (uapi_sleep_mode_flag_get())
             {
-                state = toggleButton[DropDownCardPage1::toggleButton_SLEEP]->GetState();
                 SleepModeModel::GetInstance().SetSleepModeDisabled();
             }
             else
@@ -99,8 +97,8 @@ namespace OHOS
             }
             else
             {
-                state = toggleButton[DropDownCardPage1::toggleButton_DNOTDISTURB]->GetState();
-                UpdateDnotdisturbState(state);
+                state = toggleButton[DropDownCardPage1::toggleButton_6]->GetState();
+                UpdateDnotdisturbState(false);
                 DnotDisturbModel::GetInstance().SetDoNotDisturbModeEnabled(state);
             }
         }
@@ -264,10 +262,10 @@ namespace OHOS
 
     void DropDownCardPage1::UpdateDnotdisturbState(bool state)
     {
-        if (toggleButton[DropDownCardPage1::toggleButton_DNOTDISTURB] != nullptr)
+        if (toggleButton[DropDownCardPage1::toggleButton_6] != nullptr)
         {
             const char *ImageSrc = state ? DROPDOWN_DNOTDISTURB_ON_IMAGE : DROPDOWN_DNOTDISTURB_OFF_IMAGE;
-            toggleButton[DropDownCardPage1::toggleButton_DNOTDISTURB]->SetImages(ImageSrc, ImageSrc);
+            toggleButton[DropDownCardPage1::toggleButton_6]->SetImages(ImageSrc, ImageSrc);
         }
     }
 
@@ -275,10 +273,10 @@ namespace OHOS
     void DropDownCardPage1::UpdateSleepModelState(bool state)
     {
         // 睡眠icon
-        if (toggleButton[DropDownCardPage1::toggleButton_SLEEP] != nullptr)
+        if (toggleButton[DropDownCardPage1::toggleButton_5] != nullptr)
         {
             const char *ImageSrc = state ? DROPDOWN_SLEEP_ON_IMAGE : DROPDOWN_SLEEP_OFF_IMAGE;
-            toggleButton[DropDownCardPage1::toggleButton_SLEEP]->SetImages(ImageSrc, ImageSrc);
+            toggleButton[DropDownCardPage1::toggleButton_5]->SetImages(ImageSrc, ImageSrc);
         }
     }
 }
\ No newline at end of file
index f5030e4..704356f 100644 (file)
@@ -36,7 +36,6 @@ namespace OHOS
         bool GetEarPhoneConnectStatus(void);
         bool GetBlueToothConnectStatus(void);
         void UpdatePhoneConnectStatus(bool status);
-        void UpdateEarPhoneConnectStatus(bool status);
         void UpdateBlueToothConnectStatus(bool status);
 
     private:
index 6470d1a..06763b5 100644 (file)
@@ -134,24 +134,6 @@ namespace OHOS
 
     }
 
-    // 更新耳机连接状态
-    void SettingModel::UpdateEarPhoneConnectStatus(bool status)
-    {
-        earphoneConnectStatus = status;
-        if (PullUpDownView::GetInstance() != nullptr)
-        {
-            PullUpDownView::GetInstance()->UpdateEarPhoneStatus(status);
-        }
-        if (BluetoothServiceOptionsView::GetInstance())
-        {
-            BluetoothServiceOptionsView::GetInstance()->Button_UPdata();
-        }
-        if(MusicPlayerSourceView::GetInstance())
-        {
-            MusicPlayerSourceView::GetInstance()->UpdateBluetoothHeadsetConnectLabel();
-        }
-    }
-
     // 更新蓝牙连接状态
     void SettingModel::UpdateBlueToothConnectStatus(bool status)
     {
index 5993928..3e04365 100644 (file)
@@ -44,8 +44,6 @@ typedef enum {
     JS_UNINSTALL_SUCESS_TO_UI,
     PHONE_CONNECTED_TO_UI,      //手机连接成功
     PHONE_DISCONNECTED_TO_UI,   //手机断开连接
-    EARPHONE_CONNECTED_TO_UI,   //耳机连接成功
-    EARPHONE_DISCONNECTED_TO_UI,//耳机断开连接
     BT_CONNECTED_TO_UI,         //蓝牙连接成功
     BT_DISCONNECTED_TO_UI,      //蓝牙断开连接
     UI_ADD_SLEEP_VETO,
index 16fe7b1..234ef6d 100644 (file)
@@ -105,8 +105,6 @@ static void HandleJSInstallSuccess(Request *request);
 static void HandleJSUninstallSuccess(Request *request);
 static void HandlePhoneConnected(Request *request);
 static void HandlePhoneDisconnected(Request *request);
-static void HandleEarphoneConnected(Request *request);
-static void HandleEarphoneDisconnected(Request *request);
 static void HandleBluetoothConnected(Request *request);
 static void HandleBluetoothDisconnected(Request *request);
 static void HandleAddSleepVeto(Request *request);
@@ -144,8 +142,6 @@ MsgHandlerEntry msgHandlers[] = {
     {JS_UNINSTALL_SUCESS_TO_UI, HandleJSUninstallSuccess},
     {PHONE_CONNECTED_TO_UI, HandlePhoneConnected},
     {PHONE_DISCONNECTED_TO_UI, HandlePhoneDisconnected},
-    {EARPHONE_CONNECTED_TO_UI, HandleEarphoneConnected},
-    {EARPHONE_DISCONNECTED_TO_UI, HandleEarphoneDisconnected},
     {BT_CONNECTED_TO_UI, HandleBluetoothConnected},
     {BT_DISCONNECTED_TO_UI, HandleBluetoothDisconnected},
     {UI_ADD_SLEEP_VETO, HandleAddSleepVeto},
@@ -434,22 +430,6 @@ void HandlePhoneDisconnected(Request *request)
         std::bind(&OHOS::SettingModel::UpdatePhoneConnectStatus, &OHOS::SettingModel::GetInstance(), false));
 }
 
-// 处理耳机连接成功
-void HandleEarphoneConnected(Request *request)
-{
-    WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleEarphoneConnected");
-    GraphicService::GetInstance()->PostGraphicEvent(
-        std::bind(&OHOS::SettingModel::UpdateEarPhoneConnectStatus, &OHOS::SettingModel::GetInstance(), true));
-}
-
-// 处理耳机断开连接
-void HandleEarphoneDisconnected(Request *request)
-{
-    WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleEarphoneConnected");
-    GraphicService::GetInstance()->PostGraphicEvent(
-        std::bind(&OHOS::SettingModel::UpdateEarPhoneConnectStatus, &OHOS::SettingModel::GetInstance(), false));
-}
-
 // 处理蓝牙连接成功
 void HandleBluetoothConnected(Request *request)
 {