Merge #638 into sdk602patch0626 from refs/changes/638/head 648/target/1 649/target/1
author胡传军 <1224667075@qq.com>
Tue, 6 Aug 2024 04:13:36 +0000 (04:13 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Tue, 6 Aug 2024 04:13:36 +0000 (04:13 +0000)
Code review from 胡传军

* refs/changes/638/head: (5 commits squashed)

  - 增加cat1 DTMF服务

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

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

  - 修复通讯录错误添加BUG

  - 合并

Signed-off-by: aliyun8003852482 <1224667075@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/638
code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/TelephonyInitInterface.cpp
code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleANCS.c
code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp

index 79d9784..3236778 100644 (file)
@@ -232,20 +232,32 @@ namespace OHOS
             }
             RecentCallLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
             /* ------------------------- TelephoneLineImageView ------------------------- */
-            TelephonyInitInterface::ImageParams imageParam = {
-                .x = 83,
-                .y = 344,
-                .width = 300,
-                .height = 0,
-                .viewId = "TelephoneLineImageView",
-                .imgsrc = PNG_TELEPHONELINE_IMAGE,
-            };
-            TelephoneLineImageView = TelephonyInitInterface::ImageViewInit(imageParam);
-            if (TelephoneLineImageView == nullptr)
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPhoneView::TelephoneLineImageView new fail!");
-                return;
+            // TelephonyInitInterface::ImageParams imageParam = {
+            //     .x = 83,
+            //     .y = 344,
+            //     .width = 300,
+            //     .height = 3,
+            //     .viewId = "TelephoneLineImageView",
+            //     .imgsrc = NULL,
+            // };
+            // TelephoneLineImageView = TelephonyInitInterface::ImageViewInit(imageParam);
+            // if (TelephoneLineImageView == nullptr)
+            // {
+            //     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPhoneView::TelephoneLineImageView new fail!");
+            //     return;
+            // }
+            // TelephoneLineImageView->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+             // Add ImageView to App
+            if (TelephoneLineImageView == nullptr) {
+                TelephoneLineImageView = new UIImageView();
             }
+            TelephoneLineImageView->SetPosition(83, 344);         // widget's left position and top position
+            TelephoneLineImageView->Resize(300, 2);          // widget's width and height
+            TelephoneLineImageView->SetViewId("image1");// Set style
+            TelephoneLineImageView->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+            TelephoneLineImageView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+
+            
             /* ------------------------------ NoCallsLabel ------------------------------ */
             info = new CallLogInfo[sizeof(CallLogInfo) * CALL_LOG_MAX_NUM];
             if (GetCallLog(&info, &num) == -1) {
@@ -277,7 +289,7 @@ namespace OHOS
               
                 for (int i  = num; i != 0; i--) {
                   
-                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",(info + i - 1)->tel);
+                    //WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",(info + i - 1)->tel);
                     char buf[20]={0};
     
                     sprintf_s(buf,20,"%s",(const char*)(info + i - 1)->tel);
@@ -297,7 +309,7 @@ namespace OHOS
                     }
                     buttonconfig.y += 20+104;
                     MainPhoneViewScrollView->Add(button_calllog[i]);
-                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",(info + i - 1)->tel);
+                    //WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",(info + i - 1)->tel);
                     
                     time_t currtime;
                     struct tm *timeinfo;
index fab972e..9f1619a 100644 (file)
@@ -96,6 +96,7 @@ namespace OHOS
         }
         image->SetPosition(params.x, params.y, params.width, params.height);
         image->SetViewId(params.viewId);
+        if(params.imgsrc)
         image->SetSrc(params.imgsrc);
 
         return image;
index bbd3f16..6ec2695 100644 (file)
@@ -62,6 +62,7 @@ typedef enum {
     CALL_MISSED, // 未接来电
 } CallFinishStatus;
 
+#pragma pack(1)
 typedef struct {
     char name[NAME_SIZE];
     unsigned char nameLen;
@@ -72,6 +73,7 @@ typedef struct {
     uint64 callDurTime; // 通话持续时间
 } CallLogInfo;
 
+#pragma pack(0)
 // 通话状态改变回调函数
 typedef void (*PhoneServiceCallChangedCb)(const PhoneCallInfo *phoneCall);
 // 电话服务失败回调函数
index 4b29bd8..83b146b 100644 (file)
@@ -736,7 +736,7 @@ void AddToCallLog(CallLogInfo *info)
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fopen %s failed!", CALL_LOG_PATH);
         return;
     }
-
+    printf("AddToCallLog %s \r\n",info->tel);
     ret = fwrite(info, sizeof(CallLogInfo), 1, fp);
     if (ret != 1) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fwrite failed! ret:%d", ret);
@@ -860,6 +860,7 @@ void AddToCallLog_CAT1(CallLogInfo *callInfo)
             return;
         }
     }
+
     AddToCallLog(callInfo);
 
 }
index 8f0e986..1bafd01 100644 (file)
@@ -215,7 +215,7 @@ static uint8_t ble_ancs_client_at_cmd_get_notify_att(uint16_t conn_id,uint32_t n
     (notify_attr_req->attr+3)->att_max_length=64;
 
     (notify_attr_req->attr+4)->att_id=0x06;
-    (notify_attr_req->attr+4)->att_max_length=10;
+    (notify_attr_req->attr+4)->att_max_length=1;
 
     //decode_att_req_from_str(argv[BT_INDEX_4], notify_attr_req->attr);
     errcode_t ret = ble_ancs_client_send_get_notify_att_cmd(g_client_id, conn_id, notify_attr_req);
@@ -244,13 +244,12 @@ static void ble_ancs_client_setup_result_cbk(uint8_t client_id, uint16_t conn_id
 {
     printf("[ANCSClientSetupCBK]conn_id:%d status:0x%x\r\n", conn_id, status);
 
+    if(status==ERRCODE_SUCC)
+    {
+        int ret = uapi_get_timestampe_ss(&subscribe_notify_creationTime);
 
-    int ret = uapi_get_timestampe_ss(&subscribe_notify_creationTime);
-
-    ble_ancs_client_subscribe_notify(conn_id,1);
-
-
-    
+        ble_ancs_client_subscribe_notify(conn_id,1);
+    }
     //if(status==ERRCODE_BT_SUCCESS)
   
 }
@@ -290,7 +289,7 @@ static void ble_ancs_client_notify_source_cbk(uint8_t client_id, uint16_t conn_i
         uint32_t creationTime=0;
         int ret = uapi_get_timestampe_ss(&creationTime);
         //当前时间戳减去订阅通知时间戳3s以上的通知,才要求数据(过滤ios将所有未查看消息发过来)
-        if(creationTime-subscribe_notify_creationTime>3)
+        if(creationTime-subscribe_notify_creationTime>5)
         ble_ancs_client_at_cmd_get_notify_att(conn_id, notify_src->notification_uid);
        // 
 
index 5afeb27..957308e 100755 (executable)
@@ -24,6 +24,8 @@
 #include "cat1_server_hal.h"
 #include "custom_utils.h"
 #include "phoneaddressmodel.h"
+#include "components/ui_label_button.h"
+#include "bletest.h"
 // #define NOTIFY_THREE_SECONDS 3000
 // #define NOTIFY_ONE_SECOND 1000
 // #define NOTIFY_THIRTY_SECONDS 30000
@@ -77,12 +79,19 @@ UIViewGroup* g_phoneView = nullptr;
 UIViewGroup* g_multiPhoneView = nullptr;
 UIViewGroup* g_callingView = nullptr;
 UIViewGroup* g_waitingHintsView = nullptr;
+UIViewGroup* dial_group = nullptr;
+
 VolumeSettingView *g_volumeSetting = nullptr;
 UIImageView* g_imageAgree = nullptr;
 UIImageView* g_imageDissgree = nullptr;
 UIImageView* g_imageMicrophone = nullptr;
 UIImageView* g_imageHandUp = nullptr;
 UIImageView* g_imageHorns = nullptr;
+UIImageView* g_imagedial = nullptr;
+UIImageView* g_imageheadset = nullptr;
+UIImageView* g_imageperson = nullptr;
+
+
 UIImageView* g_imageDissgreeNew = nullptr;
 UILabel* g_callerNum = nullptr;
 UILabel* g_callerDisplay = nullptr;
@@ -92,7 +101,10 @@ UILabel* g_comingTimes = nullptr;
 UILabel* g_newCallHints = nullptr;
 UILabel* g_newCallNum = nullptr;
 
+UILabelButton* labelButton[12]={nullptr};
 
+UILabel* label_number = nullptr;
+UIImageView *image_line= nullptr;
 UILabel* callername = nullptr;
 UIViewGroup* calldialView = nullptr;
 UILabel *diallabel1 = nullptr;
@@ -123,7 +135,6 @@ void calllog_info_init()
     uapi_get_timestampe_ss(&tmptime);
     info.creationTime = tmptime;
     info.callDurTime=0;
-    
     info.telLen=len;
        
 
@@ -139,6 +150,7 @@ void addcalllog()
     info.status=CALL_MISSED;
     if(call_stat<=2)
     {
+        printf("写入:%s\r\b",info.tel);
         AddToCallLog_CAT1(&info);
         call_stat=3;
     }
@@ -250,7 +262,7 @@ void StartCallTimer(CallTimerType type, int32_t interval)
             }
             break;
          case CallTimerType::NOTIFY_PHONE_DIAL_DISPLAY:
-            g_calldialTime = osTimerNew((osTimerFunc_t)CallCurTimerCallBack, osTimerPeriodic, NULL, NULL);
+            g_calldialTime = osTimerNew((osTimerFunc_t)CalldialTimerCallBackProc, osTimerPeriodic, NULL, NULL);
             tick = osMs2Tick(interval);
             retTimer = osTimerStart(g_calldialTime, tick);
             if (retTimer != osOK && g_calldialTime != NULL) {
@@ -366,6 +378,21 @@ static void FreeCallingViewImage(void)
         delete g_imageHorns;
         g_imageHorns = nullptr;
     }
+    if(g_imagedial)
+    {
+        delete g_imagedial;
+        g_imagedial = nullptr;
+    }
+    if(g_imageheadset)
+    {
+        delete g_imageheadset;
+        g_imageheadset = nullptr;
+    }
+    if(g_imageperson)
+    {
+        delete g_imageperson;
+        g_imageperson = nullptr;
+    }
 }
 
 static bool DrawCallingViewImage(void)
@@ -374,8 +401,8 @@ static bool DrawCallingViewImage(void)
     if (g_imageMicrophone == nullptr) {
         return false;
     }
-    g_imageMicrophone->SetPosition(IMAGE_MIC_POSITION_X, IMAGE_ALL_POSITION_Y);
-    g_imageMicrophone->SetSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH);
+    g_imageMicrophone->SetPosition(46, 207);
+    g_imageMicrophone->SetSrc(PNG_230_MICROPHONE_OPEN_IMAGE_PATH);
     g_imageMicrophone->SetTouchable(true);
     g_imageMicrophone->SetViewId("microphoneChange");
 
@@ -384,8 +411,8 @@ static bool DrawCallingViewImage(void)
         FreeCallingViewImage();
         return false;
     }
-    g_imageHandUp->SetPosition(IMAGE_HANDUP_POSITION_X, IMAGE_ALL_POSITION_Y);
-    g_imageHandUp->SetSrc(PNG_DISSGREE_IMAGE_PATH);
+    g_imageHandUp->SetPosition(188, 340);
+    g_imageHandUp->SetSrc(PNG_230_VECTOR_IMAGE_PATH);
     g_imageHandUp->SetTouchable(true);
     g_imageHandUp->SetViewId("callingHandUp");
 
@@ -394,11 +421,41 @@ static bool DrawCallingViewImage(void)
         FreeCallingViewImage();
         return false;
     }
-    g_imageHorns->SetPosition(IMAGE_HONRS_POSITION_X, IMAGE_HONRS_POSITION_Y);
-    g_imageHorns->SetSrc(PNG_SOUNDBUTTON2);
+    g_imageHorns->SetPosition(369, 207);
+    g_imageHorns->SetSrc(PNG_230_VOICE_OPEN_IMAGE_PATH);
     g_imageHorns->SetTouchable(true);
     g_imageHorns->SetViewId("volumeSwitch");
 
+    
+    g_imagedial = new UIImageView();
+    if (g_imagedial == nullptr) {
+        return false;
+    }
+    g_imagedial->SetPosition(80, 296); // 30 :  offset
+    g_imagedial->SetSrc(PNG_230_DIAL_IMAGE_PATH);
+    g_imagedial->SetTouchable(true);
+    g_imagedial->SetViewId("dial");
+
+    
+    g_imageheadset = new UIImageView();
+    if (g_imageheadset == nullptr) {
+        return false;
+    }
+    g_imageheadset->SetPosition(296, 296); // 30 :  offset
+    g_imageheadset->SetSrc(PNG_230_HEADSET_1_IIMAGE_PATH);
+    g_imageheadset->SetTouchable(true);
+    g_imageheadset->SetViewId("headset");
+
+    g_imageperson = new UIImageView();
+    if (g_imageperson == nullptr) {
+        return false;
+    }
+    g_imageperson->SetPosition(158, 158); // 30 :  offset
+    g_imageperson->SetSrc(PNG_230_PERSON_IMAGE_PATH);
+    g_imageperson->SetTouchable(true);
+    g_imageperson->SetViewId("headset");
+
+
     return true;
 }
 
@@ -424,39 +481,44 @@ static bool DrawCallingViewUILabel(void)
     if (g_callerDisplay == nullptr) {
         return false;
     }
-    g_callerDisplay->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y,
-        Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT);
+    g_callerDisplay->SetPosition(88, 81,
+        289, 40);
     g_callerDisplay->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
     g_callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
     g_callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER);
     g_callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE);
     g_callerDisplay->SetTextColor(Color::White());
+    g_callerDisplay->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
 
     g_callDuration = new UILabel();
     if (g_callDuration == nullptr) {
         FreeCallingViewUILabel();
         return false;
     }
-    g_callDuration->SetPosition(LABEL_CALLERD_POSITION_X, LABEL_CALLERD_POSITION_Y,
-        Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT);
+
+    g_callDuration->SetPosition(194, 38,
+        79, 35);
     g_callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
     g_callDuration->SetAlign(TEXT_ALIGNMENT_CENTER);
     g_callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str());
-    g_callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE);
-    g_callDuration->SetTextColor(Color::White());
+    g_callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+    g_callDuration->SetTextColor(Color::GetColorFromRGBA(0xaa, 0xaa, 0xaa, 0xff));
+
+    // g_currentTimes = new UILabel();
+    // if (g_currentTimes == nullptr) {
+    //     FreeCallingViewUILabel();
+    //     return false;
+    // }
+    // g_currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y,
+    //     Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT);
+    // g_currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
+    // g_currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER);
+    // g_currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str());
+    // g_currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE);
+    // g_currentTimes->SetTextColor(Color::White());
+
+
 
-    g_currentTimes = new UILabel();
-    if (g_currentTimes == nullptr) {
-        FreeCallingViewUILabel();
-        return false;
-    }
-    g_currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y,
-        Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT);
-    g_currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
-    g_currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER);
-    g_currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str());
-    g_currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE);
-    g_currentTimes->SetTextColor(Color::White());
 
     return true;
 }
@@ -677,6 +739,10 @@ void FreeCalldialView(void)
 {
     if (calldialView != nullptr) {
         DisableCallTimer(CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY);
+        DisableCallTimer(CallTimerType::NOTIFY_PHONE_DIAL_DISPLAY);
+
+        RootView::GetInstance()->Remove(calldialView);
+
         calldialView->RemoveAll();
         if(diallabel1!=NULL)
         {
@@ -695,8 +761,8 @@ void FreeCalldialView(void)
             delete button1dial;
             button1dial =nullptr;
         }
-        DisableCallTimer(CallTimerType::NOTIFY_PHONE_DIAL_DISPLAY);
-        RootView::GetInstance()->Remove(calldialView);
+       
+      
         delete calldialView;
         calldialView = nullptr;
     }
@@ -742,13 +808,23 @@ UIViewGroup* CreateCalldialView(void)
             diallabl2 = new UILabel();
         }
 
-     diallabl2->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y,
-        Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT);
-    diallabl2->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
-    diallabl2->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
-    diallabl2->SetAlign(TEXT_ALIGNMENT_CENTER);
-    diallabl2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE);
-    diallabl2->SetTextColor(Color::White());
+        diallabl2->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y,
+            Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT);
+        diallabl2->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
+
+        char name_buf[30]={0};
+
+        if(get_phone_addrss_name(name_buf,CallerLogModel::GetInstance()->GetPhoneNumber().c_str()))
+        {
+            diallabl2->SetText(name_buf);
+        }
+        else
+        diallabl2->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
+
+
+        diallabl2->SetAlign(TEXT_ALIGNMENT_CENTER);
+        diallabl2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE);
+        diallabl2->SetTextColor(Color::White());
 
 
         // Add to rootView
@@ -820,8 +896,9 @@ UIViewGroup* CreateMultiplePhoneView(void)
     g_multiPhoneView->Add(g_imageMicrophone);
     g_multiPhoneView->Add(g_imageHandUp);
     g_multiPhoneView->Add(g_imageHorns);
+
     g_multiPhoneView->Add(g_callerDisplay);
-    g_multiPhoneView->Add(g_callDuration);
+    //g_multiPhoneView->Add(g_callDuration);
     g_multiPhoneView->Add(g_currentTimes);
     g_multiPhoneView->SetDraggable(true);
     g_multiPhoneView->SetTouchable(true);
@@ -852,6 +929,119 @@ void FreeMultiplePhoneCallView(void)
         g_volumeSetting = nullptr;
     }
 }
+static char *dial_id_str[]={"1","2","3","4","5","6","7","8","9","*","0","#"};
+
+
+
+bool Initshowdial()
+{
+    dial_group = new UIViewGroup();
+    if (dial_group == nullptr) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::UIViewGroup::new group error");
+        return false;
+    }
+    dial_group->SetPosition(MATH_ZERO, MATH_ZERO);
+    dial_group->Resize(466, 466); // 454 : value
+    dial_group->SetViewId("dialing");
+    dial_group->SetTouchable(true);
+    dial_group->SetDraggable(true);
+ 
+    uint8_t showdial_i=0;
+    for(int i=0;i<4;i++)
+    {
+        for(int j=0;j<3;j++)
+        {
+            if (labelButton[showdial_i] == nullptr) {
+                labelButton[showdial_i] = new UILabelButton();
+            }
+            if(labelButton[showdial_i]==nullptr)
+            {
+                    return false;
+            }
+            labelButton[showdial_i]->SetPosition(69+(j*111), 107+(i*78));         // widget's left position and top position
+
+            labelButton[showdial_i]->Resize(107, 70);          // widget's width and height
+            labelButton[showdial_i]->SetViewId(dial_id_str[showdial_i]);// Set style
+            labelButton[showdial_i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+
+            labelButton[showdial_i]->SetText(dial_id_str[showdial_i]);
+            labelButton[showdial_i]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);
+            labelButton[showdial_i]->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+
+            dial_group->Add(labelButton[showdial_i]);
+            labelButton[showdial_i]->SetVisible(true);
+            showdial_i++;
+        }
+    }
+
+    if (image_line == nullptr) {
+        image_line = new UIImageView();
+    }
+    if(image_line == nullptr)
+    {
+            return false;
+    }
+    image_line->SetPosition(193, 25);         // widget's left position and top position
+    image_line->Resize(80, 8);          // widget's width and height
+    image_line->SetViewId("image1");// Set style
+    image_line->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+    image_line->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+    image_line->SetStyle(STYLE_BORDER_RADIUS, 100);
+
+    dial_group->Add(image_line);
+    image_line->SetVisible(true);
+
+    // Add Label to App
+    if (label_number == nullptr) {
+        label_number = new UILabel();
+    }
+    if(label_number == nullptr)
+    {
+            return false;
+    }
+    label_number->SetPosition(100, 43);         // widget's left position and top position
+    label_number->Resize(265, 60);          // widget's width and height
+    label_number->SetViewId("label3");// Set style
+    label_number->SetStyle(STYLE_TEXT_FONT, 40);
+
+    // Set additional property
+    label_number->SetText("");
+    label_number->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);
+    label_number->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+    label_number->SetRollSpeed(0);
+    label_number->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);
+    dial_group->Add(label_number);
+    dial_group->SetVisible(false);
+
+    return true;
+}
+
+void showdial(bool flag)
+{
+    if(flag)
+    {
+        label_number->SetText("");
+        dial_group->SetVisible(true);  
+    }
+    else
+    {
+        dial_group->SetVisible(false); 
+    }
+   return;
+}
+
+void text_updata_buf(const char *buf)
+{
+    char new_buf[16]={0};
+    SendDtfmStrNumberToCat1(buf[0]);
+    const char*text_buf=label_number->GetText();
+    sprintf_s(new_buf,16,"%s%s",text_buf,buf);
+    label_number->SetText(new_buf);
+    RootView::GetInstance()->Invalidate();
+    return;
+}
+
+
 UIViewGroup* CreateCallingView(void)
 {
     g_callingView = new UIViewGroup();
@@ -874,19 +1064,40 @@ UIViewGroup* CreateCallingView(void)
         g_callingView = nullptr;
         return nullptr;
     }
+    Initshowdial();
+
     g_callingView->Add(g_imageMicrophone);
     g_callingView->Add(g_imageHandUp);
     g_callingView->Add(g_imageHorns);
+
+    g_callingView->Add(g_imagedial);
+    g_callingView->Add(g_imageheadset);
+    g_callingView->Add(g_imageperson);
+
     g_callingView->Add(g_callerDisplay);
-    g_callingView->Add(g_callDuration);
+    //g_callingView->Add(g_callDuration);
     g_callingView->Add(g_currentTimes);
     g_callingView->SetDraggable(true);
     g_callingView->SetTouchable(true);
+    g_callingView->Add(dial_group);
     UIView::OnClickListener *clickListener = static_cast<UIView::OnClickListener *>\
-        (OHOS::CallViewEventListener::GetInstance());
+    (OHOS::CallViewEventListener::GetInstance());
+    
+       
+    UIView::OnDragListener * dragListener = (UIView::OnDragListener*)OHOS::CallViewEventListener::GetInstance();
+    dial_group->SetOnDragListener(dragListener);
+    
     g_imageMicrophone->SetOnClickListener(clickListener);
     g_imageHandUp->SetOnClickListener(clickListener);
     g_imageHorns->SetOnClickListener(clickListener);
+    g_imagedial->SetOnClickListener(clickListener);
+
+    
+    for( int i=0;i<12;i++)
+    {
+        labelButton[i]->SetOnClickListener(clickListener);
+    }
+
     StartCallTimer(CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY, NOTIFY_ONE_SECOND);
     StartCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY, NOTIFY_THIRTY_SECONDS);
     NotificationManager::GetInstance()->SetVolumeScreenStatus(false);
@@ -910,6 +1121,25 @@ void FreeCallingView(void)
         RootView::GetInstance()->Remove(g_callingView);
         delete g_callingView;
         g_callingView = nullptr;
+
+        if(dial_group)
+        {
+            dial_group->RemoveAll();
+            for( int i=0;i<12;i++)
+            {
+                delete labelButton[i];
+                labelButton[i]=nullptr;
+            }
+            delete image_line;
+            image_line= nullptr;
+
+            
+            delete label_number;
+            label_number= nullptr;
+            
+            delete dial_group;
+            dial_group = nullptr;
+        }
     }
     if (g_volumeSetting != nullptr) {
         delete g_volumeSetting;
@@ -1026,10 +1256,15 @@ bool CallViewEventListener::OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent&
     if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) 
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxxxx");
-        g_volumeSetting->SetVisible(false);
-        unsigned char volumeValue;
-        volumeValue = (unsigned char) ((double) (g_volumeSetting->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换
-        SetSpeakerVolume(volumeValue);
+        if((strcmp(view.GetViewId(), "dialing") == 0))
+        showdial(false);
+        else
+        {
+            g_volumeSetting->SetVisible(false);
+            unsigned char volumeValue;
+            volumeValue = (unsigned char) ((double) (g_volumeSetting->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换
+            SetSpeakerVolume(volumeValue);
+        }
         return true;
     }
 
@@ -1115,11 +1350,11 @@ bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event)
     else if (strcmp(view.GetViewId(), "microphoneChange") == 0) {
         if (g_changeImage == 0) {
             g_changeImage = 1;
-            RefreshMicrophoneImageSrc(PNG_MICROPHONE_CLOSE_IMAGE_PATH);
+            RefreshMicrophoneImageSrc(PNG_230_MICROPHONE_CLOSE_IMAGE_PATH);
             SetMicMute(true);
         } else {
             g_changeImage = 0;
-            RefreshMicrophoneImageSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH);
+            RefreshMicrophoneImageSrc(PNG_230_MICROPHONE_OPEN_IMAGE_PATH);
             SetMicMute(false);
         }
         return true;
@@ -1130,6 +1365,60 @@ bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event)
             return false;
         }
     }
+    else if ((strcmp(view.GetViewId(), "dial") == 0))
+    {
+        showdial(true);
+    }
+    if (strcmp(view.GetViewId(), "0") == 0)
+    {
+       text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "1") == 0)
+    {
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "2") == 0)
+    {
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "3") == 0)
+    {
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "4") == 0)
+    {
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "5") == 0)
+    {
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "6") == 0)
+    {   
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "7") == 0)
+    {
+       text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "8") == 0)
+    {
+        text_updata_buf(view.GetViewId()); 
+    }
+    else if (strcmp(view.GetViewId(), "9") == 0)
+    {
+       text_updata_buf(view.GetViewId()); 
+    }else if (strcmp(view.GetViewId(), "*") == 0)
+    {
+        text_updata_buf(view.GetViewId());  /* code */
+    }
+    else if (strcmp(view.GetViewId(), "#") == 0)
+    {
+       text_updata_buf(view.GetViewId()); 
+    }
+
+
+
     return true;
 }
 }  // namespace OHOS
\ No newline at end of file
index d9e617d..33ded6b 100644 (file)
@@ -366,6 +366,8 @@ void udp_send_msg_toCat1(uint8_t cmd,char *content)
     if( sourceAddr.sin_port != 0 ) {
         
         udp_send_response(station_tx_buffer, cmd, content);
+        if(cmd==UDP_CMD_DIAL_NUMB)
+        uapi_cat1_start_volte_voice();
     }
      uapi_cat1_wakeup_cat1(0);
 }
@@ -1150,7 +1152,7 @@ void set_dmp_cm_address_toCat1(char *address)//设置保存移动入库下发的
 }
 void send_dtfm_number_toCat1(char ch)//发送dtfm 
 {
-    // printf("ch:%s\r\n",&ch);
+    printf("ch:%c\r\n",ch);
     udp_send_msg_toCat1(UDP_MSG_SEND_DTMF_NUMBER,&ch);
 }
 void send_volte_switch_toCat1(void)//发送VOLTE->CAT1