mrp_phonebook(09b).c
17.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
#include "phbcuigprot.h"
#include "phbsrvgprot.h"
static mmi_id dsm_phoneBook_cui_id = GRP_ID_INVALID;
///////////////////////////////////////////////////////////////////////////////////////////////////
static void _mmi_dsm_phb_get_entry(U16 store_index, T_MR_PHB_ENTRY *phb_entry);
static void mmi_dsm_phb_GoBackHistory(void)
{
mr_app_send_event_wrapper(MR_LOCALUI_EVENT, MR_LOCALUI_KEY_CANCEL, 0);
}
static void mmi_dsm_phb_send_entry(void)
{
mr_app_send_event_wrapper(MR_LOCALUI_EVENT, MR_LOCALUI_KEY_OK, 0);
}
static mmi_ret mmi_dsm_select_from_phb(mmi_event_struct *evt)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
cui_phb_select_contact_result_struct* select_contact_result;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch(evt->evt_id)
{
case EVT_ID_GROUP_DEINIT:
/* need addd code to release buffer */
dsm_phoneBook_cui_id = GRP_ID_INVALID;
break;
case EVT_ID_PHB_SELECT_CONTACT:
select_contact_result = (cui_phb_select_contact_result_struct*)evt;
memset(&phb_entry,0,sizeof(phb_entry));
_mmi_dsm_phb_get_entry(select_contact_result->store_index,&phb_entry);
mr_phonebook_destroy_contact_list();
mmi_dsm_phb_send_entry();
break;
case EVT_ID_PHB_SELECT_CONTACT_CANCEL:
mr_phonebook_destroy_contact_list();
mmi_dsm_phb_GoBackHistory();
break;
case EVT_ID_GROUP_EXIT:
mmi_dsm_phb_GoBackHistory();
break;
default:
break;
}
return MMI_RET_OK;
}
static void dsm_phb_op_single_cb(S32 result, U16 store_index, void *user_data)
{
int32 action = (int32)user_data;
if (result >= 0)
result = MR_SUCCESS;
else
result = MR_FAILED;
mr_event(MR_PHB_EVENT, action, result);
}
static void _mmi_dsm_phb_copy_entry_from_phb(U16 store_index, T_MR_PHB_ENTRY* entry)
{
mmi_phb_num_type_enum type ;
mmi_phb_wcs_num_struct contact;
int32 i = SRV_PHB_ENTRY_FIELD_OPT_NUM_1;
if(!entry ||store_index >= MMI_PHB_ENTRIES)
return;
//需要有个'\0'
srv_phb_get_name(store_index,(U16 *)entry->name,(MR_PHB_MAX_NAME-2)/2);
srv_phb_get_number(store_index, (U16 *) entry->number,(MR_PHB_MAX_NUMBER-2)/2);
#if (!defined(__MMI_PHB_NO_OPTIONAL_FIELD__)) && (!defined(MT6261))
//#if !defined(MT6261) // inkleak.zhao
//number 1
while(i <= SRV_PHB_ENTRY_FIELD_OPT_NUM_3)
{
if(MMI_TRUE == srv_phb_get_optional_number( store_index, i, (U16 *) contact.number, &type, MMI_PHB_NUMBER_PLUS_LENGTH))
{
switch(type)
{
case MMI_PHB_NUM_TYPE_HOME:
memcpy(entry->homeNumber,contact.number,MMI_PHB_NUMBER_PLUS_LENGTH);
break;
case MMI_PHB_NUM_TYPE_OFFICE:
memcpy(entry->officeNumber,contact.number,MMI_PHB_NUMBER_PLUS_LENGTH);
break;
case MMI_PHB_NUM_TYPE_FAX:
memcpy(entry->faxNumber,contact.number,MMI_PHB_NUMBER_PLUS_LENGTH);
break;
}
}
i <<= 1;
}
#endif
#if (!defined(__MMI_PHB_NO_OPTIONAL_FIELD__)) && (!defined(MT6261))
//#if !defined(MT6261) // inkleak.zhao
srv_phb_get_email_address(store_index, (U16 *) entry->emailAddress,(MR_PHB_MAX_NUMBER)/2);
#endif
}
int32 _mmi_dsm_phb_search_entry(T_MR_PHB_SEARCH_REQ *phb_search_req,T_MR_PHB_SEARCH_RSP *phb_search_rsq)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 store_index;
U16 index;
S32 distance;
U8 same_count;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
kal_prompt_trace(MOD_MMI,"search %s: %d, %d, %d", phb_search_req->pattern, phb_search_req->search_type, phb_search_req->storage);
if(!srv_phb_startup_is_phb_ready()||mmi_phb_check_processing())
{
return MR_PHB_NOT_READY;
}
if(mmi_ucs2strlen((S8*)phb_search_req->pattern) == 0)
{
return MR_PHB_NOT_FOUND;
}
if(phb_search_req->search_type == MR_PHB_BY_NAME)
{
index = srv_phb_oplib_search((U16*)phb_search_req->pattern,SRV_PHB_SEARCH_TYPE_NAME);
}
else if(phb_search_req->search_type == MR_PHB_BY_NUMBER)
{
index = srv_phb_oplib_search((U16*)phb_search_req->pattern,SRV_PHB_SEARCH_TYPE_NUM);
}
if(index <0)
{
return MR_PHB_NOT_FOUND;
}
else
{
if(phb_search_req->search_type == MR_PHB_BY_NAME)
{
phb_search_rsq->index = index;
phb_search_rsq->store_index = srv_phb_sse_sort_index_to_store_index(PHB_STORAGE_MAX,index);
}
else
{
phb_search_rsq->store_index = index;
phb_search_rsq->index = srv_phb_sse_store_index_to_sort_index(PHB_STORAGE_MAX,index)-1;
}
kal_prompt_trace(MOD_MMI,"%s: %d, %d", __FILE__, phb_search_rsq->index, phb_search_rsq->store_index);
if(phb_search_rsq->store_index >= MMI_PHB_ENTRIES)
return MR_PHB_NOT_FOUND;
_mmi_dsm_phb_copy_entry_from_phb(phb_search_rsq->store_index, &(phb_search_rsq->phb_entry));
return MR_PHB_SUCCESS;
}
}
void _mmi_dsm_phb_free_memory(srv_phb_contact_info_struct* pcontact)
{
int32 i = 0;
if(pcontact != 0)
{
for( i = 0;i< 3;i++)
{
if(pcontact->field_data.opt_num[i] != 0)
{
srv_phb_mem_free(pcontact->field_data.opt_num[i] );
pcontact->field_data.opt_num[i] = 0;
}
}
}
}
static int32 _mmi_dsm_phb_add_field(srv_phb_contact_info_struct* pcontact_info ,T_MR_PHB_SET_ENTRY_REQ* phb_set_entry_req)
{
int32 i = 0;
int32 tpye[3] = {MMI_PHB_NUM_TYPE_HOME,MMI_PHB_NUM_TYPE_OFFICE,MMI_PHB_NUM_TYPE_FAX};
char* address[3] = {0};
if((0 == pcontact_info)||(0 == phb_set_entry_req))
{
return MR_FAILED;
}
pcontact_info->field_data.opt_num[0] = NULL;
pcontact_info->field_data.opt_num[1] = NULL;
pcontact_info->field_data.opt_num[2] = NULL;
address[0] = (char*)phb_set_entry_req->entry.homeNumber;
address[1] = (char*)phb_set_entry_req->entry.officeNumber;
address[2] = (char*)phb_set_entry_req->entry.faxNumber;
for(i = 0;i < 3;i++)
{
pcontact_info->field_data.opt_num[i] = srv_phb_mem_malloc(sizeof(mmi_phb_wcs_num_struct), SRV_PHB_MEMORY_TYPE_ADM);
if (pcontact_info->field_data.opt_num[i] == NULL)
{
_mmi_dsm_phb_free_memory(pcontact_info);
return MR_FAILED;
}
pcontact_info->field_data.opt_num[i]->type = tpye[i];
mmi_ucs2ncpy((char *)pcontact_info->field_data.opt_num[i]->number, (const char *)address[i], MMI_PHB_NUMBER_PLUS_LENGTH);
}
return MR_SUCCESS;
}
static int32 _mmi_dsm_phb_add_entry(T_MR_PHB_SET_ENTRY_REQ* phb_set_entry_req)
{
U8 storage;
srv_phb_contact_info_struct contact_info;
if(0 == phb_set_entry_req)
{
return MR_PHB_ERROR;
}
/*
* Check if name and number are both empty and all numbers are valid.
*/
// if ((!mmi_ucs2strlen(phb_set_entry_req->entry.name) ||
// !mmi_ucs2strlen(phb_set_entry_req->entry.number)) ||
//不再判断空数据,只判断数据是否是错误.
if ( !srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.number) ||
!srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.homeNumber) ||
!srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.officeNumber) ||
!srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.faxNumber))
{
return MR_PHB_ERROR;
}
memset(&contact_info, 0, sizeof(srv_phb_contact_info_struct));
contact_info.field_mask =
SRV_PHB_ENTRY_FIELD_NAME |
SRV_PHB_ENTRY_FIELD_NUMBER |
SRV_PHB_ENTRY_FIELD_HOME |
SRV_PHB_ENTRY_FIELD_OFFICE |
SRV_PHB_ENTRY_FIELD_FAX |
SRV_PHB_ENTRY_FIELD_EMAIL1;
contact_info.field_data.name = (U16 *)phb_set_entry_req->entry.name;
contact_info.field_data.number = (U16*)phb_set_entry_req->entry.number;
contact_info.field_data.email_address = (U16*)phb_set_entry_req->entry.emailAddress;
if (phb_set_entry_req->storage == MR_PHB_BOTH)
{
if (srv_phb_get_used_contact(PHB_STORAGE_MAX) >= (srv_phb_get_total_contact(PHB_STORAGE_MAX)))
{
return MR_PHB_STORAGE_FULL;
}
else if (srv_phb_get_used_contact(PHB_STORAGE_NVRAM) < (srv_phb_get_total_contact(PHB_STORAGE_NVRAM)))
{
storage = PHB_STORAGE_NVRAM;
}
else if (srv_phb_get_used_contact(mr_sim_active_id_dsm2phb()) < (srv_phb_get_total_contact(mr_sim_active_id_dsm2phb())))
{
storage = mr_sim_active_id_dsm2phb();
}
else
{
return MR_PHB_STORAGE_FULL;
}
}
else if (phb_set_entry_req->storage == MR_PHB_SIM)
{
if(srv_phb_get_used_contact(mr_sim_active_id_dsm2phb()) < (srv_phb_get_total_contact(mr_sim_active_id_dsm2phb())))
{
storage = mr_sim_active_id_dsm2phb();
}
else
{
return MR_PHB_STORAGE_FULL;
}
}
else
{
if (srv_phb_get_used_contact(PHB_STORAGE_NVRAM) < (srv_phb_get_total_contact(PHB_STORAGE_NVRAM)))
{
storage = PHB_STORAGE_NVRAM;
}
else
{
return MR_PHB_STORAGE_FULL;
}
}
//注意该函数有内存申请
if(MR_FAILED == _mmi_dsm_phb_add_field(&contact_info,phb_set_entry_req))
{
return MR_PHB_ERROR;
}
srv_phb_oplib_add_contact(
storage,
SRV_PHB_INVALID_INDEX,
&contact_info,
dsm_phb_op_single_cb,
(void *)MR_PHB_OP_WRITE);
//释放内存
_mmi_dsm_phb_free_memory(&contact_info);
return MR_PHB_SUCCESS;
}
static int32 _mmi_dsm_phb_delete_entry(T_MR_PHB_SET_ENTRY_REQ* phb_set_entry_req)
{
S32 store_index;
U8 storage;
if(0 ==phb_set_entry_req)
{
return MR_PHB_ERROR;
}
if (phb_set_entry_req->storage == MR_PHB_SIM)
{
storage = mr_sim_active_id_dsm2phb();
}
else if (phb_set_entry_req->storage == MR_PHB_NVM)
{
storage = PHB_STORAGE_NVRAM;
}
else
{
storage = PHB_STORAGE_MAX;
}
if (storage != PHB_STORAGE_MAX)
{
store_index = srv_phb_sse_sort_index_to_store_index(storage, phb_set_entry_req->index + 1);
}
else
{
store_index = srv_phb_sse_sort_index_to_store_index(storage, phb_set_entry_req->index);
}
if (store_index < 0)
{
return MR_PHB_ERROR;
}
srv_phb_oplib_delete_contact(
store_index,
dsm_phb_op_single_cb,
(void *)MR_PHB_OP_DELETE);
return MR_PHB_SUCCESS;
}
static int32 _mmi_dsm_phb_update_entry(T_MR_PHB_SET_ENTRY_REQ* phb_set_entry_req)
{
int index;
U16 store_index;
U8 storage;
srv_phb_contact_info_struct contact_info;
if(0 ==phb_set_entry_req)
{
return MR_PHB_ERROR;
}
/*
* Check if name and number are both empty and all numbers are valid.
*/
//不再检查是否是空数据,只检查是否数据出错
// if ((!mmi_ucs2strlen(phb_set_entry_req->entry.name) ||
// !mmi_ucs2strlen(phb_set_entry_req->entry.number)) ||
if ( !srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.number) ||
!srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.homeNumber) ||
!srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.officeNumber) ||
!srv_phb_check_valid_number((U16 *)phb_set_entry_req->entry.faxNumber))
{
return MR_PHB_ERROR;
}
memset(&contact_info, 0, sizeof(srv_phb_contact_info_struct));
contact_info.field_mask =
SRV_PHB_ENTRY_FIELD_NAME |
SRV_PHB_ENTRY_FIELD_NUMBER |
SRV_PHB_ENTRY_FIELD_HOME |
SRV_PHB_ENTRY_FIELD_OFFICE |
SRV_PHB_ENTRY_FIELD_FAX |
SRV_PHB_ENTRY_FIELD_EMAIL1;
contact_info.field_data.name = (U16 *)phb_set_entry_req->entry.name;
contact_info.field_data.number = (U16 *)phb_set_entry_req->entry.number;
contact_info.field_data.email_address = (U16*)phb_set_entry_req->entry.emailAddress;
if (phb_set_entry_req->storage == MR_PHB_SIM)
{
storage = mr_sim_active_id_dsm2phb();
}
else if (phb_set_entry_req->storage == MR_PHB_NVM)
{
storage = PHB_STORAGE_NVRAM;
}
else
{
storage = PHB_STORAGE_MAX;
}
if (storage != PHB_STORAGE_MAX)
{
store_index = srv_phb_sse_sort_index_to_store_index(storage, phb_set_entry_req->index + 1);
}
else
{
store_index = srv_phb_sse_sort_index_to_store_index(storage, phb_set_entry_req->index);
}
//注意该函数有内存申请
if(MR_FAILED == _mmi_dsm_phb_add_field(&contact_info,phb_set_entry_req))
{
return MR_PHB_ERROR;
}
srv_phb_oplib_update_contact(
store_index,
&contact_info,
dsm_phb_op_single_cb,
(void*)MR_PHB_OP_EDIT);
//释放内存
_mmi_dsm_phb_free_memory(&contact_info);
return MR_PHB_SUCCESS;
}
int32 _mmi_dsm_phb_write_entry(T_MR_PHB_SET_ENTRY_REQ* phb_set_entry_req)
{
if(!srv_phb_startup_is_phb_ready()||mmi_phb_check_processing())
{
return MR_PHB_NOT_READY;
}
kal_prompt_trace(MOD_MMI,"write: %d, %d, %s, %s", phb_set_entry_req->index, phb_set_entry_req->storage, phb_set_entry_req->entry.name, phb_set_entry_req->entry.number);
/*
* This is an [Add] operation.
*/
if (phb_set_entry_req->index == 0xffff)
{
return _mmi_dsm_phb_add_entry(phb_set_entry_req);
}
/*
* Suppose [Delete] here.
*/
else if (!mmi_ucs2strlen(phb_set_entry_req->entry.name) && !mmi_ucs2strlen(phb_set_entry_req->entry.number))
{
return _mmi_dsm_phb_delete_entry(phb_set_entry_req);
}
/*
* Suppose [Update] here.
*/
else
{
return _mmi_dsm_phb_update_entry(phb_set_entry_req);
}
}
int32 _mmi_dsm_phb_read_entry(T_MR_PHB_GET_ENTRY_REQ* phb_get_entry_req,T_MR_PHB_GET_ENTRY_RSP *phb_get_entry_rsp)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 pos;
U16 count = 0;
U16 store_index = 0;
U16 storage;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if(!srv_phb_startup_is_phb_ready()||mmi_phb_check_processing())
{
return MR_PHB_NOT_READY;
}
if( phb_get_entry_req->storage == MR_PHB_BOTH)
{
if(phb_get_entry_req->index >= srv_phb_get_used_contact(PHB_STORAGE_MAX))
return MR_PHB_OUT_OF_INDEX;
else
storage = PHB_STORAGE_MAX;
}
else if( phb_get_entry_req->storage == MR_PHB_NVM)
{
if(phb_get_entry_req->index >= srv_phb_get_used_contact(PHB_STORAGE_NVRAM))
return MR_PHB_OUT_OF_INDEX;
else
storage = PHB_STORAGE_NVRAM;
}
else
{
storage = mr_sim_active_id_dsm2phb();
count= srv_phb_get_used_contact(storage);
if(phb_get_entry_req->index >= count)
return MR_PHB_OUT_OF_INDEX;
}
if(storage != PHB_STORAGE_MAX)
{
store_index = srv_phb_sse_sort_index_to_store_index(storage,phb_get_entry_req->index+1);
}
else
{
store_index = srv_phb_sse_sort_index_to_store_index(storage,phb_get_entry_req->index);
}
if(store_index <0)
return MR_PHB_ERROR;
_mmi_dsm_phb_copy_entry_from_phb(store_index, &phb_get_entry_rsp->entry);
return MR_PHB_SUCCESS;
}
int32 _mmi_dsm_phb_get_count(T_MR_PHB_GET_COUNT_REQ* phb_get_count_req,T_MR_PHB_GET_COUNT_RSP *phb_get_count_rsp)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if(!srv_phb_startup_is_phb_ready()||mmi_phb_check_processing())
{
return MR_PHB_NOT_READY;
}
if(phb_get_count_req->storage == MR_PHB_BOTH)
{
phb_get_count_rsp->count = srv_phb_get_used_contact(PHB_STORAGE_MAX);
return MR_PHB_SUCCESS;
}
else
{
if(phb_get_count_req->storage == MR_PHB_NVM)
{
phb_get_count_rsp->count = srv_phb_get_used_contact(PHB_STORAGE_NVRAM);
return MR_PHB_SUCCESS;
}
else
{
if(phb_get_count_req->storage == MR_PHB_SIM)
{
phb_get_count_rsp->count = srv_phb_get_used_contact(mr_sim_active_id_dsm2phb());
return MR_PHB_SUCCESS;
}
return MR_PHB_NOT_SUPPORT;
}
}
}
void mmi_dsm_entry_phone_book(void)
{
mr_phone_win = 1;
if(srv_phb_startup_is_phb_ready()||!mmi_phb_check_processing())
{
mmi_frm_group_create(GRP_ID_ROOT, GRP_ID_MYTHROAD, mmi_dsm_select_from_phb, NULL);
mmi_frm_group_enter(GRP_ID_MYTHROAD, MMI_FRM_NODE_SMART_CLOSE_FLAG);
dsm_phoneBook_cui_id = cui_phb_list_select_contact_create(GRP_ID_MYTHROAD);
if (dsm_phoneBook_cui_id != GRP_ID_INVALID)
{
cui_phb_list_select_contact_set_field_filter(dsm_phoneBook_cui_id, SRV_PHB_ENTRY_FIELD_GSM_NUM);
cui_phb_list_select_contact_run(dsm_phoneBook_cui_id);
}
else
{
dsm_phoneBook_cui_id = GRP_ID_INVALID;
mmi_frm_group_close(GRP_ID_MYTHROAD);
mr_phone_win = 0;
}
}
else
{
mr_phone_win = 0;
}
}
int32 mr_phonebook_destroy_contact_list(void)
{
#ifndef __MR_CFG_FEATURE_NO_PHB__
if(dsm_phoneBook_cui_id != GRP_ID_INVALID)
{
cui_phb_list_select_contact_close(dsm_phoneBook_cui_id);
mmi_frm_group_close(GRP_ID_MYTHROAD);
dsm_phoneBook_cui_id = GRP_ID_INVALID;
}
return MR_SUCCESS;
#else
return MR_IGNORE;
#endif
}
static void _mmi_dsm_phb_get_entry(U16 store_index, T_MR_PHB_ENTRY *phb_entry)
{
_mmi_dsm_phb_copy_entry_from_phb(store_index, phb_entry);
mr_str_convert_endian(phb_entry->name);
mr_str_convert_endian(phb_entry->number);
mr_str_convert_endian(phb_entry->homeNumber);
mr_str_convert_endian(phb_entry->officeNumber);
mr_str_convert_endian(phb_entry->faxNumber);
mr_str_convert_endian(phb_entry->emailAddress);
}
int32 mr_phonebook_get_status(void)
{
#ifndef __MR_CFG_FEATURE_NO_PHB__
if(!srv_phb_startup_is_phb_ready()||mmi_phb_check_processing())
return MR_PHB_NOT_READY;
else
return MR_PHB_READY;
#else
return MR_IGNORE;
#endif
}