拨号完善部分可能BUG 1171/2
authorhcj <1224667075@qq.com>
Sat, 12 Oct 2024 09:24:45 +0000 (17:24 +0800)
committerhcj <1224667075@qq.com>
Sat, 12 Oct 2024 09:24:45 +0000 (17:24 +0800)
code/sdk/application/wearable/fd230app/nativeui/phone/src/DialingMethodPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp

index 10f5143..2ee861d 100644 (file)
@@ -56,7 +56,7 @@ namespace OHOS
     void DialingMethodPresenter::OnStop(void)
     {
         Presenter<DialingMethodView>::OnStop();
-        set_address_number(NULL);
+        //set_address_number(NULL);
     }
 
     bool DialingMethodPresenter::OnClick(UIView &view, const ClickEvent &event)
@@ -174,7 +174,7 @@ namespace OHOS
             {
                 NativeAbility::GetInstance().Back();
                 TelephonyInitInterface::X_DRAG_FLAG = false;
-                set_address_number(NULL);
+                //set_address_number(NULL);
             }
            
         }
@@ -192,7 +192,7 @@ namespace OHOS
         if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0)
         {
             NativeAbility::GetInstance().Back();
-            set_address_number(NULL);
+            //set_address_number(NULL);
         }
         return true;
     }
index 3754a5d..2d73f10 100644 (file)
@@ -62,13 +62,26 @@ namespace OHOS
         Presenter<MainPhoneView>::OnStop();
     }
 
+    static uint8_t MainPhonePresenter_atoi(const char* buf)
+    {
+        if(strstr(buf,"D_"))
+        {
+            return atoi(buf+2);
+        }
+        else
+        {
+            return 0;
+        }
+    }
     bool MainPhonePresenter::OnClick(UIView &view, const ClickEvent &event)
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPhonePresenter::OnClick");
 
         std::string curViewId = view.GetViewId();
-        int8_t id= atoi(view.GetViewId());//MainPhoneView::GetInstance()->get_delete_id(&view);
-        if(id!=0 && id<=20 && curViewId.length()<=2)
+
+        int8_t id= MainPhonePresenter_atoi(view.GetViewId());//MainPhoneView::GetInstance()->get_delete_id(&view);
+
+        if(id!=0 && id<=20 && curViewId.length()<=5)
         {
             MainPhoneView::GetInstance()->deletecallloginfo(id);
             return true;
@@ -76,6 +89,7 @@ namespace OHOS
         if (curViewId == DIALINGMETHODBUTTON_VIEWID)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s OnClick", curViewId.c_str());
+            set_address_number(NULL);
             NativeAbility::GetInstance().EnterSlice(VIEW_DIALING_METHOD);
         }
         else if (curViewId == FREQUENTLYCONTACTEDBUTTON_VIEWID)
index 383d136..a368a73 100644 (file)
@@ -275,7 +275,7 @@ namespace OHOS
        
     }
 
-    static char *str_id[]={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
+    static char *str_id[]={"D_0","D_1","D_2","D_3","D_4","D_5","D_6","D_7","D_8","D_9","D_10","D_11","D_12","D_13","D_14","D_15","D_16","D_17","D_18","D_19","D_20"};
 
     void MainPhoneView:: NewcalllogButtonExtupdata(CallLogInfo *data, uint8_t index,uint8_t i)
     {
index 3d50e64..e9f5947 100644 (file)
@@ -127,6 +127,12 @@ namespace OHOS
             //NativeAbility::GetInstance().ChangeSlice(VIEW_PHONERING);\r
             //calldial_event_sendmsg_toUI((char *)phoneNumber.c_str());\r
             //PhoneCallView::GetInstance()->container_child_SetVisible(true);\r
+\r
+            if(phoneNumber.length()<=2)\r
+            {\r
+                return false;\r
+            }\r
+\r
             if(TelephonyInitInterface::DIALINGMETHOD == DIALINGMETHOD_USINGWATCHSIM)\r
             {\r
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DIALINGMETHOD_USINGWATCHSIM");\r