void uapi_pbap_cmd_start_client(void);
void uapi_pbap_cmd_pull_phonebook(void);
-void uapi_pbap_cmd_pull_vcard_listing(unsigned char *tell);
+void uapi_pbap_cmd_pull_vcard_listing(unsigned char *tell,uint8_t len);
void uapi_pbap_cmd_pull_vcard_entry(td_char *vcf_name);
char *name_=strtok(name_str,"\"");
name_=strtok(NULL,"\"");
OHOS:: CallerLogModel::GetInstance()->Setphonebname(name_,strlen(name_));
+ printf("name_ : %s\r\n",name_);
+ GraphicService::GetInstance()->PostGraphicEvent(
+ std::bind(calllognameupdate));
+
+
}
}
}
/* get phone vCard-Listing */
-void uapi_pbap_cmd_pull_vcard_listing(unsigned char *tell)
+void uapi_pbap_cmd_pull_vcard_listing(unsigned char *tell,uint8_t len)
{
uint8_t folder=1;
uint8_t vcf=PBAP_VCF_PB;
OHOS:: CallerLogModel::GetInstance()->Setphonebname("0",1);
+ OHOS:: CallerLogModel::GetInstance()->Setphonenumber((char *)tell,len);
+
+ unsigned char *tell_=(unsigned char *)malloc(len+1);
+ if(tell_==NULL)
+ {
+ return;
+ }
+ memset_s(tell_,30,0,len);
+ memcpy_s(tell_,30,tell,len);
+
if (!wstp_pbap_check_param_valid(folder, vcf, max_list_count, list_offset, 0)) {
printf("pbap param invalid\n");
return;
(pbap_pce_pull_vcard_listing_param_t*)(void *)malloc(sizeof(pbap_pce_pull_vcard_listing_param_t));
if (thr_par == NULL) {
printf("pbap param malloc failed\n");
+ free(tell_);
return;
}
if (thr_par->name == NULL) {
printf("pbap param name malloc failed\n");
free(thr_par);
+ free(tell_);
return;
}
(void)memset_s(thr_par->name, PBAP_APP_FOLDER_MAXLENGTH, 0, PBAP_APP_FOLDER_MAXLENGTH);
thr_par->search_property=PBAP_SEARCH_PROPERTY_NUMBER;
- thr_par->search_value=tell;
+ thr_par->search_value=tell_;
thr_par->max_list_count = max_list_count;
thr_par->list_offset = list_offset; /* index = 5 */
/* 0:索引序 1:字典序 */
}
free(thr_par->name);
free(thr_par);
+ free(tell_);
}
/* get phone vCard-Listing */
void UsingPhoneErrorCallback(PhoneServiceErrorType type);\r
void CAT1_ChangeStatusScreendisplay(int lastStatus);\r
void InitCallingTimer();\r
+\r
+void calllognameupdate(void);\r
+\r
namespace OHOS {\r
\r
\r
return call_name;\r
}\r
\r
+ std::string Getphonenumberpbap(void)\r
+ {\r
+ return call_number;\r
+ }\r
+\r
void Setphonebname(char *name,uint8_t name_len)\r
{\r
call_name.clear();\r
//printf("%s\r\n",call_name.c_str());\r
}\r
\r
+ void Setphonenumber(char *number,uint8_t number_len)\r
+ {\r
+ call_number.clear();\r
+ call_number.append(reinterpret_cast<const char*>(number), number_len);\r
+ }\r
+\r
std::string GetPhoneNumber(void);\r
void SetoperateNumber(const char *number, char number_len);\r
\r
return phoneNumberCAT1END;\r
}\r
\r
-\r
+ \r
\r
private:\r
CallerLogModel();\r
std::string phoneNumberCAT1; // 4G电话号码\r
std::string phoneNumberCAT1END; // 4G挂断电话号码\r
std ::string call_name;\r
+ std ::string call_number;\r
bool mulitplePhoneStatus{false}; // 判断是否多路通话界面\r
bool waitingStatus{false}; // 判断是否等待提醒界面\r
bool volumeStatus{false}; // 判断是否音量界面\r
#include "dial_sos_c.h"
+void calllognameupdate()
+{
+ if(MainCallingView::GetInstance())
+ {
+ MainCallingView::GetInstance()->updataCallingname();
+ }
+}
+
/* 状态复位 */
void StatusReset(void)
{
void CallerDisplayView::updataCallingname(void)
{
- if(CallerLogModel::GetInstance()->Getphonename().length()>5)
+ //if(CallerLogModel::GetInstance()->Getphonename().length()>5)
+ if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str(),CallerLogModel::GetInstance()->Getphonenumberpbap().c_str())==0)
{
+ if(CallerLogModel::GetInstance()->Getphonename().length()!=0)
callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str());
}
}
{
callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
}
- if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourcePhone)
+ // if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourcePhone)
updataCallingname();
callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER);
void CallingView::updataCallingname(void)
{
- if(CallerLogModel::GetInstance()->Getphonename().length()>5)
+ if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str(),CallerLogModel::GetInstance()->Getphonenumberpbap().c_str())==0)
{
+ if(CallerLogModel::GetInstance()->Getphonename().length()!=0)
callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str());
}
}
callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
}
- if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourcePhone)
+ // if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourcePhone)
updataCallingname();
-
callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER);
callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_DISPLAY_FONE_SIZE);
callerDisplay->SetTextColor(Color::White());
return true;
}
+void MainCallingView::updataCallingname(void)
+{
+ //if(CallerLogModel::GetInstance()->Getphonename().length()>5)
+ if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str(),CallerLogModel::GetInstance()->Getphonenumberpbap().c_str())==0)
+ {
+ if(CallerLogModel::GetInstance()->Getphonename().length()!=0)
+ {
+ if(screenView)
+ screenView->updataCallingname();
+ if(callView)
+ callView->updataCallingname();
+ if(displayView)
+ displayView->updataCallingname();
+
+ RootView::GetInstance()->Invalidate();
+
+ //callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str());
+ }
+
+
+ }
+}
+
void MainCallingView::OnStart()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingView::OnStart");
void WaitingHintsView::updataCallingname(void)
{
- if(CallerLogModel::GetInstance()->Getphonename().length()>5)
+ if(strcmp(CallerLogModel::GetInstance()->GetPhoneNumber().c_str(),CallerLogModel::GetInstance()->Getphonenumberpbap().c_str())==0)
{
+ if(CallerLogModel::GetInstance()->Getphonename().length()!=0)
callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str());
- }
+ }
+ else
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "updataCallingname 000000000000");
+ }
}
{
callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
}
- if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourcePhone)
+ // if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourcePhone)
updataCallingname();
callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER);
return;
}
#endif
+ uapi_pbap_cmd_start_client();
break;
case PROFILE_STATE_CONNECTED: // 蓝牙连接成功
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connected");
#endif
BtConnectedPro(bdAddr);
SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0);
+
uapi_pbap_cmd_start_client();
//SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0);
break;
SetCompleteCallFlag(call);
CatCallStateChangedInfo(bdAddr, call);
CallAudioHandle(call);
+
if(call->state==HFP_HF_CALL_STATE_INCOMING || call->state==HFP_HF_CALL_STATE_DIALING
|| call->state==HFP_HF_CALL_STATE_ALERTING)
- uapi_pbap_cmd_pull_vcard_listing((unsigned char *)call->number);
+ uapi_pbap_cmd_pull_vcard_listing((unsigned char *)call->number,(uint8_t )call->number_len);
if(HFP_HF_CALL_STATE_INCOMING!=call->state)
{