comparison src/ui/bmi/mmiIdle.c @ 3:67bfe9f274f6

src/ui: import of src/ui3 from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:33:10 +0000
parents
children eca2202f630f
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI (6349)
14 $Module: Idle
15 $File: MmiIdle.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25 Handling for the idle screen
26
27 ********************************************************************************
28 $History: MmiIdle.c
29
30 May 09, 2007 DR: OMAPS00129014
31 Description: COMBO: unable to send SMS during midi playing
32 Solution: Removed the phlock check status code in idle_draw_main_idle.
33 Added a flag to identify whether autophonelock is enabled or not and start the timer
34 based on the flag status
35
36 Apr 03, 2007 ER: OMAPS00122561 x0pleela
37 Description: [ACI] Phone lock feature has to be supported by ACI
38 Solution: Phone Lock ER implementation
39
40 Mar 30, 2007 OMAPS00123019 a0393213(R.Prabakar)
41 Description : Reboot of the target when you unplug/plug USB cable using camera application
42
43 28th Mar 2007 OMAPS00121870 a0393213(R.Prabakar)
44 Description : In Limited service mode unable to access idle screen options menu and Names/Read
45
46 Jan 24, 2007 OMAPS00112312 a0393213(R.Prabakar)
47 Description:MMI causes system freeze
48
49 Jan 05, 2007 OMAPS00084665 x0039928(sumanth)
50 Description: Boot time exceed UCSD estimations
51
52 Dec 08, 2006 OMAPS00106744 a0393213(R.Prabakar)
53 Description : Wrong string is displayed when pressing long [1]
54
55 Oct 13, 2006 OMAPS00095266 a0393213(R.Prabakar)
56 Description : CT-GCF[27.22.4.22.1]-Incorrect string display
57 Solution : The DCS attribute is set dynamically
58
59
60 Oct 30, 2006 ER:OMAPS00091029 x0039928(sumanth)
61 Bootup time measurement
62
63 Oct 11, 2006 REF:OMAPS00098287 x0039928
64 Description : CPHS 4.2: MMI variable als_status is not updated proplery with the SIM contents.
65 Solution : als_status update is deffered until the idle screen is displayed.
66
67 xashmic 27 Sep 2006, OMAPS00096389
68 ENH - a) Providing static menu for re-selection of enum options for enumeration
69 b) Popup menu displayed on connect event, can be enabled or disabled via menu option
70
71
72 xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
73 Ports are automatically enumerated if user does not select any option with in 5 seconds.
74
75 xrashmic 9 Sep 2006, OMAPS00092732
76 USBMS ER
77
78 Aug 31, 2006 DR: OMAPS00083503 x0pleela
79 Description: Result of ss_check_ss_string may be ignored
80 Solution: - Removed the definition of new function GLOBAL USHORT get_nm_status(void).
81 this function is not requierd as we are removing the new code added in callnumber() : MFW_SS_USSD
82 switch case to send the USSD string through at+cusd command. Instead sending through ATDn command
83
84
85 Aug 30, 2006 DR: OMAPS00083503 x0pleela
86 Description: Result of ss_check_ss_string may be ignored
87 Solution: - Defined a new function GLOBAL USHORT get_nm_status(void) as per the review
88 comments to avoid the usage of the global variable gnm_status
89
90
91 Aug 28, 2006 DR: OMAPS00083503 x0pleela
92 Description: Result of ss_check_ss_string may be ignored
93 Solution: - Defined a new global variable gnm_status to hold the network status which will be
94 used in mmicall.c
95 - idle_dialling_kbd_cb(): Copy the nm_status which is used during initiating the
96 USSD transaction
97
98
99 July 12, 2006 REF:DR OMAPS00081477 x0047075
100 Description: SMS (with SMS Report Indicator +CDS Enabled) Reset Issue.
101 Solution: Added a window handler for the sms status editor.
102 If sms status editor does not exist, create it.If it already exists Update the same.
103 Jun 30, 2006 REF : OMAPS00083503 R.Prabakar
104 Description : When USSD string is sent, MMI shows requesting screen forever
105 Solution : We will send USSD string or call number only when we are in full service, unless it's an emergency number
106
107 10 Jul 2006, Ref OMAPS00077654, R.Prabakar(a0393213)
108 Description : Cyrillic character support in MMI to pass GCF/PTCRB UCS2 TC (SATK)
109 Solution : The attribute of ATB editor is set to unicode
110
111 July 04, 2006 REF:OMAPS00083759 a0393213(R.Prabakar)
112 Description : Roaming indicator icon shown during searching
113 Solution : Roaming icon display condition will be checked only when we are in full network
114
115 Jun 23, 2006 DR: OMAPS00082374 x0pleela
116 Description: EONS Failures - unexpected output from the MMI: 2 carriers; on the top always T-Mobile
117 Solution: a) Removed the usage of global variable gEons_alloc_active
118 b) In func, idle_draw_main_idle(), getting network logo statement is remoevd and replaced by NULL to pass the EONs test cases
119 c) Added a check to display SPN if PLMN anme and numeric names are NULL
120
121 Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)
122 Description : CPHS Roaming indication feature implementation
123 Solution : As part of the implementation, in this file, Roaming icon is displayed on idle screen based on a condition
124
125 Jun 06, 2006 DR: OMAPS00080543 - xreddymn
126 Changes to display long SAT messages correctly on idle screen.
127
128 May 30, 2006 DR: OMAPS00070657 x0pleela
129 Description: CPHS feature on Locosto-Lite
130 Solution: For ALS feature,
131 a) Added "IDLE_ALS_DATA" to display Current line indicator on the idle screen
132 b) Modified the function "idle_displayData()", "idle_draw_main_idle()" to display
133 Current active line indicator on the idle screen
134
135 Jun 02, 2006 DR: OMAPS00079699 - xreddymn
136 Description: Long CB messages are not displayed completely.
137 Solution: Allow user to navigate up / down to scroll through the message.
138
139 May 15, 2006 DR: OMAPS00075852 - xreddymn
140 Description: New SMS and Message Full indications will not be seen by user
141 when CB is enabled, because CB messages have higher priority.
142 Solution: CB messages and New SMS or Message Full indications are displayed
143 in two different zones on the Idle screen.
144
145 Apr 17, 2006 REF: ER OMAPS00075178 x0pleela
146 Description: When the charger connect to phone(i-sample), the charger driver works, but the MMI and App don't work
147 Solution: Created Timer handler for Battery charging indication
148
149 Feb 15, 2006 ER: OMAPS00065203 x0pleela
150 Description: Cingular Operator Name Prioritization implementation required
151 Solution: Incorporated review comments
152 Removed the code added in earlier version from function idle_kbd_cb()
153 Registering for MfwWinResume event in idle_create()
154 Handling MfwWinResume event in idle_win_cb()
155
156 Feb 09, 2006 ER: OMAPS00065203 x0pleela
157 Description: Cingular Operator Name Prioritization implementation required
158 Solution: "idle_opername_timer_cb" callback for timer to display opername on idle screen
159 Display of the operator name on idle screen based on the following:
160 a. If SPN and plmn name are not NULL, SPN is displayed for 5 seconds and then plmn name
161 For the above scenario, display_condition of SPN is not checked as per Cingular's requirement
162 In spite of display_condition being FALSE, we go ahead and display SPN
163 b. If SPN is NULL and plmn name is not NULL, then plmn name is displayed
164
165 Feb 02, 2006 DR: OMAPS00061468 - x0035544.
166 Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails
167 Solution : SAT SET UP IDLE MODE TEXT (Icon) support added.
168
169 Nov 24, 2005 DR: OMAPS00045909 - Shashi Shekar B.S.
170 Description: Improve IMEI control mechanism
171 Solution : When MMI calls sAT_PLUSCFUN, if an IMEI invalid error is returned,
172 we will block on that screen & will not allow the user to browse menus further,
173 since the PS will not be booted at all!!!
174
175 Nov 17, 2005 DR: OMAPS00050447 - nekkareb
176 Description: Even after removing the SIM , Hutch or Airtel network is seen
177 Solution : Sim removal event is now being handled and appropriate display shown.
178
179 Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
180 Description: Mp3 Ringer Implementation
181 Solution: The Midi Ringer application has been enhanced to support mp3 as ringer.
182 The interface function names have been modified.
183
184 xrashmic 22 Aug, 2004 MMI-SPR-32798
185 Adding the support for screen capture using a dynamically assigned key.
186
187 Sept 15, 2005 REF: CRR 32410 x0021334
188 Description: The keypad unlocks even though the unlocking sequence is not executed in quick succession.
189 Fix: A new timer expiry event is added and handled.
190
191 Jul 08, 2005 REF: ENH 32642 x0018858
192 Description: The date time string should at all times be displayed on the idle scree.
193 Solution: Code to display the date time if already not displayed, has been added.
194
195 Jun 14, 2005 REF: MMI-FIX-30439 x0018858
196 Description: The homezone/cityzone tags were not being displayed properly.
197 Solution: Modified to save the tags properly in caches and also made the
198 appropriate modifications to update the same properly during mobility.
199
200
201 Jun 24, 2005 MMI-FIX-30973 x0018858
202 Issue Description :- The homezone/cityzone tag disappears when the HUP button is pressed or after
203 "new CB" arrives indication is received and processed.
204 Fix: Modified the code to display the homezone/cityzone tag after the HUP is processed.
205
206 May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
207 Description: IMEI retreival by posting a call to ACI sAT_xx API
208 Solution: The direct call to cl_get_imeisv() is replaced with the
209 call to the mmi_imei_store() which inturn calls sAT_Dn() and
210 retrieves the IMEI info and stores it onto the global
211 variable "imei"
212
213 Apr 05, 2005 REF: ENH 29994 xdeepadh
214 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application
215 Solution: Generic Midi Ringer and Midi Test Application were implemented.
216
217 x0018858 24 Mar, 2005 MMI-FIX-11321
218 Issue Description :- If the inbox is full and a new message is receivd, no indication is received.
219 Fix: Added support for handling indication when message box is full and
220 there is a pending message.
221
222 Nov 3, 2004 REF: CRR 25887 xkundadu
223 Description: Unable to make an emergency call.
224 Fix: Changed the code to make the emergency call when the screen is locked.
225 Also, a check is done to confirm whether the keypad buffer contains any ECC.
226
227 CRR 25268: 13 Oct 2004 - xpradipg
228 Description: Unable to see the Number / name and the status read/unread of
229 the received EMS/MMS
230 Solution: The status of each message is updated as soon as the Message is
231 read, and "old"/"new" is appended based on the status flag
232
233 CRR 25270: 13 Oct 2004 - xpradipg
234 Description: EMS: Titles such as "no name" is added to EMSs with no titles
235 Solution: The corresponding name is retrieved from the phone book for the
236 number from which EMS is received, if name is not present number is
237 displayed in Inbox
238
239 Sep 22, 2004 REF: CRR 23871 xkundadu
240 Description: Screen Locking: Unlocking screen is happening by other keys
241 Fix: handled the other key events except '*' not to unlock the keypad.
242
243 Sep 2, 2004 REF: CRR 21370 xkundadu
244 Description: Giving wrong expected result by long press on "#" key
245 Fix: When user presses long on '#' key it will display 'p'.
246 Changed the long press of '*' key to display 'w'
247
248 May 21, 2004 REF: CRR 16084 Deepa M.D
249 Fix: SMSFull message string is displayed,in the clean Idle Screen .
250
251 Apr 27, 2004 REF: ENH 12646 Deepa M.D
252 Fix: When the SMS memory is full,the SMS icon is made to blink.
253 Apr 14, 2004 REF: CRR 12653 xvilliva
254 Fix: The FPLMN selection shows "No Service" on idle screen.
255 The current mode of "limited service" is queried and the screen is updated
256 accordingly. The LSK and RSK also work in sync.
257 May 26, 2004 REF: CRR 19656 Sandip and Deepa M.D
258 Fix: when a SETUP IDLE TEXT command is sent with a long text ( 239 characters ), instead of discarding the message
259 the message will be displayed.The CR is handled properly by converting it to Space.
260
261 Jul 23,2004 CRR:20895 xrashmic - SASKEN
262 Description: The keypad should not be unlocked by SEND and *, it should be
263 unlocked only by Menu and *
264 Fix: SEND key is now handled the same way as rest of the number keys.
265 Keypad unlock can be done only through MENU and *.
266
267 Apr 14, 2004 REF: CRR 12653 xvilliva
268 The FPLMN selection shows "No Service" on idle screen.
269 The current mode of "limited service" is queried and the screen is updated
270 accordingly. The LSK and RSK also work in sync.
271 xrashmic 26 Aug, 2004 MMI-SPR-23931
272 To display the indication of new EMS in the idle screen
273
274 25/10/00 Original Condat(UK) BMI version.
275
276 Dec 23, 2005 REF:SR13873 x0020906
277 Description: SMS Play tones to be stopped during button press in idle
278 FIX : Called for audio_stopSoundById () in the key press event.
279
280 Apr 05,2006 REF:OMAPS00061046 x0043641
281 Description: On pressing the KCD_HUP key in searching state the menu displays
282 'No Network' with 'Name' and 'Menu' as softkeys instead of 'Searching'.
283 FIX: called network_start_full_service() in the key press of KCD_HUP.
284
285 Apr 24, 2006 ERT: OMAPS00067603 x0043642
286 Description: Engineering mode
287 Solution: Added functionalities to handle the magic sequence to access engineering mode
288
289 $End
290
291 *******************************************************************************/
292
293 /*******************************************************************************
294
295 Include Files
296
297 *******************************************************************************/
298
299
300
301 #define ENTITY_MFW
302
303 /* includes */
304 #include <string.h>
305 #include <stdio.h>
306 #include <stdlib.h>
307
308 #if defined (NEW_FRAME)
309
310 #include "typedefs.h"
311 #include "vsi.h"
312 #include "pei.h"
313 #include "custom.h"
314 #include "gsm.h"
315
316 #else
317
318 #include "STDDEFS.H"
319 #include "custom.h"
320 #include "gsm.h"
321 #include "vsi.h"
322
323 #endif
324
325
326 #include "prim.h"
327 #include "mfw_mfw.h"
328 #include "mfw_win.h"
329 #include "mfw_kbd.h"
330 #include "mfw_lng.h"
331 /* SPR#1428 - SH - New Editor changes */
332 #ifndef NEW_EDITOR
333 #include "mfw_edt.h"
334 #endif
335 #include "mfw_cm.h"
336 #include "mfw_phb.h"
337 #include "mfw_sms.h"
338 #include "mfw_icn.h"
339 #include "mfw_mnu.h"
340 #include "mfw_tim.h"
341 #include "mfw_sim.h"
342 #include "mfw_nm.h"
343 #include "mfw_simi.h" // NH : put after mfw_nm.h as it contains a definition required by mfw_simi.h
344 #include "mfw_sat.h"
345 //Apr 05, 2005 REF: ENH 29994 xdeepadh
346 #ifdef FF_MIDI_RINGER
347 #include "mfw_midi.h"
348 #endif
349
350
351 #include "dspl.h"
352 #include "MmiMmi.h"
353
354 #include "ksd.h"
355 #include "psa.h"
356 #include "pwr.h" /*OMAPS00091029 x0039928(sumanth)*/
357
358 #include "MmiDummy.h"
359 #include "MmiDialogs.h"
360 #include "MmiLists.h"
361
362 #include "MmiMain.h"
363 #include "MmiStart.h"
364
365 #include "MmiMenu.h"
366
367 #include "MmiBookController.h"
368 #include "MmiBookUtils.h"
369
370 #include "mmiSmsRead.h"
371
372 #include "mmiCall.h"
373 #include "MmiNetwork.h"
374 #include "Mmiicons.h"
375 /* SPR#1428 - SH - New Editor changes */
376 #ifdef NEW_EDITOR
377 #include "ATBCommon.h"
378 #include "ATBDisplay.h"
379 #include "ATBEditor.h"
380 #include "AUIEditor.h"
381 #else
382 #include "MmiEditor.h"
383 #endif
384 #if 0 //(BOARD != 71) && !defined(NEPTUNE_BOARD) /*a0393213 warnings removal-Don't include for locosto and neptune*/
385 #include "mmimmsmenu.h" //xrashmic 26 Aug, 2004 MMI-SPR-23931
386 #endif
387 #include "MmiSounds.h"
388 #include "MmiUserData.h"
389 #include "MmiSoftKeys.h"
390 #include "MmiPins.h"
391
392 #include "MmiDialogs.h"
393 #include "MmiIdle.h"
394 #include "MmiNetwork.h"
395 #include "MmiSettings.h"
396 #include "mmiSmsIdle.h"
397 #include "mfw_ffs.h"
398 #include "mmiSmsBroadcast.h"
399 #include "MmiCPHS.h"
400
401 #include "Mfw_td.h"/*SPR 1725*/
402 #ifdef MMI_HOMEZONE_ENABLED
403 #include "MmiHomezone.h" /* SPR759 - SH*/
404 #endif
405 #include "gdi.h"
406 #include "audio.h"
407
408 #include "cus_aci.h"
409
410 #include "MmiResources.h" //for LINE_HEIGHT
411 #include "mmiColours.h"
412
413 #undef JVJ_USSD_TEST
414 #include "MmiBookShared.h"
415 #include "MmiBookUtils.h"
416
417 #include "mfw_mme.h"//xashmic 9 Sep 2006, OMAPS00092732
418 #if defined (TI_PS_FF_EM) || defined (MMI_EM_ENABLED)
419 #include "MmiEm.h"
420 #endif
421 /* Power management */
422 #ifdef NEPTUNE_BOARD
423 #ifdef MMI_POWER_MANAGEMENT_TEST
424 int pm_on = 2; /*Neither PM is ON nor PM is OFF */
425 #endif
426 #endif
427
428 //x0pleela 16 Mar, 2007 ER: OMAPS00122561
429 #ifdef FF_PHONE_LOCK
430 #include "usb/usb_api.h"
431 #endif /* FF_PHONE_LOCK */
432
433 #if 0 /* FreeCalypso */
434 #include "mfw_camapp.h"
435 #include "MmiCameraApp.h"
436 T_AUDIO_MMS_PLAY_FROM_FFS_PARAMETER *wefilename=NULL;
437 T_WCHAR me_uc[40];
438
439 //extern void rfs_test_01(void);
440 extern T_AUDIO_RET audio_mms_play_from_ffs_start (T_AUDIO_MMS_PLAY_FROM_FFS_PARAMETER *p_play_parameter, T_RV_RETURN return_path);
441
442 static UBYTE modem_boot_done; /*OMAPS00091029 x0039928(sumanth) - flag to indicate modem boot has happenned*/
443 static UBYTE network_sync_done; /*OMAPS00091029 x0039928(sumanth) - flag to indicate network sync has happenned*/
444 #endif
445
446 /*********************************************************************
447 **********************************************************************
448
449 IDLE WINDOW. DECLARATION
450
451 *********************************************************************
452 **********************************************************************/
453
454 /*
455 * This is a static window (also called dialog), it remains always, so that we dont have to worry a memory allocation
456 */
457 /*
458 The typedef for T_idle has been moved into the MmiIdle.h file.
459 */
460
461 T_idle idle_data; // This is a static window, and the related data are also static.
462
463 /*
464 * These are common functions xxx_create and xxx_destroy
465 */
466 T_MFW_HND idle_create (T_MFW_HND parent_window);
467 void idle_destroy (T_MFW_HND own_window);
468
469 // ADDED BY RAVI - 28-11-2005
470 EXTERN void icon_setMainBgdBitmap (int bmpId);
471 extern T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
472 extern UBYTE getcurrentVoiceTone(void);
473 // END RAVI - 28-11-2005
474
475 /*
476 * This dialog function (the same name as the window)
477 * is used to handle the comunication between different windows. The global macro SEND_EVENT can be used with parameter win
478 * and the corresponding events to send from one mmi dialog to another.
479 */
480
481 void idle (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
482
483
484 /*
485 * These are common optional functions handler
486 */
487
488
489 static int idle_win_cb(MfwEvt e, MfwWin *w);
490 static int idle_kbd_cb (MfwEvt e, MfwKbd *k);
491 static int idle_kbd_long_cb (MfwEvt e, MfwKbd *k);
492
493
494 static int idleLine( int lineNo );
495
496
497
498 static int idleExeSendMessage(MfwMnu* m, MfwMnuItem* i);
499 MfwHnd VOS_Idle_Win; /* our window */
500
501 extern UBYTE getCurrentRingerSettings(void );
502
503 void idle_Ciphering (UBYTE gsm_ciph, UBYTE gprs_ciph);
504
505 U16 AlarmStatus = 0;
506
507 extern UBYTE HUPKeyOrigin; // SH - set to 1 if POWER_KEY is pressed in idle screen
508 UBYTE test_sim; // SH
509 static UBYTE LimitedService;// Apr 14, 2004 REF: CRR 12653 xvilliva
510 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
511 extern MfwHnd sms_animate; //Timer for blinking SMS Icon
512 /* Power management Changes*/
513 #ifdef NEPTUNE_BOARD
514 #ifdef MMI_POWER_MANAGEMENT_TEST
515 MfwHnd Pm_timer; /* Timer power management */
516 #endif
517 #endif
518
519 //x0pleela 11 Apr, 2006 ER: OMAPS00075178
520 //Timer for battery charging animation
521 extern MfwHnd battery_charging_animate;
522 static int homezoneFlag = 0; //Jun 14, 2005 REF: MMI-FIX-30439 x0018858
523 // Added a flag.
524
525 //Jun 24, 2005 MMI-FIX-30973 x0018858
526 //Global to copy the New CB msg tag.
527 char tag_zone[94];
528
529 //x0pleela 09 Feb, 2006 ER: OMAPS00065203
530 #define SPN 0 /* SPN to be displayed on Idle screen*/
531 #define PLMN 1 /* PLMN name to be displayed on Idle screen*/
532
533 static MfwHnd plmn_display; /* timer handle */
534 static UBYTE timer_start_flag = FALSE; /* Timer start flag */
535 static UBYTE opername_disp_flag=SPN; /* Opertor name display flag : SPN or PLMN*/
536
537 // Oct 11, 2006 REF:OMAPS00098287 x0039928
538 extern T_MFW_CPHS_ALS_STATUS als_status;
539 extern BOOL als_bootup;
540 //x0pleela 23 Aug, 2006 DR: OMAPS00083503
541 GLOBAL USHORT get_nm_status(void); //returns the nm_status
542
543 //x0pleela 23 Mar, 2007 ER: OMAPS00122561
544 #ifdef FF_PHONE_LOCK
545 static MfwHnd autoPhLock_timer; /* timer handle */
546 static UBYTE autoPhLock_timer_flag = FALSE; /* Timer start flag */
547 extern T_MFW_HND phlock_win_handle; /* to hold the win handle of phone unlock editor window */
548 #endif /*FF_PHONE_LOCK*/
549 /*********************************************************************
550 **********************************************************************
551
552 DIALLING WINDOW. DECLARATION
553
554 *********************************************************************
555 **********************************************************************/
556
557 /*
558 * This is a dinamic dialog, it must be created only when dialling in idle screen, and destroyed automatically after calling
559 * or clearing
560 */
561
562 // Nov 3, 2004 REF: CRR 25887 xkundadu
563 // Description: Unable to make an emergency call.
564 // Fix: Check whether the keypad buffer contains any ECC.
565
566 // This is the maximum length of ECC number.
567 #define ECC_LENGTH 3
568 #define WIN_DIALLING_ORG_X 0
569 #define WIN_CENTRALIZE_ORG_X 30
570
571 #define XOFFSET 1
572 #define YOFFSET 1
573
574
575 #ifndef LSCREEN
576 #define YLINE 9
577 #else
578 #define YLINE (12*2+2)
579 #endif
580
581
582 #define KEYPADLOCK_BUF_SIZE 4
583
584 /*
585 * The information related to every window must be encapsulated in such an structure
586 */
587
588 typedef struct
589 {
590 T_MMI_CONTROL mmi_control; // common control parameter
591 T_MFW_HND win;
592 T_MFW_HND kbd;
593 T_MFW_HND kbd_long;
594 #ifdef NEW_EDITOR
595 T_ED_DATA *editor; /* SPR#1428 - SH - New Editor changes */
596 #else /* NEW_EDITOR */
597 T_MFW_HND edt;
598 #endif /* NEW_EDITOR */
599 } T_idle_dialling;
600
601 typedef struct
602 {
603 /* administrative data */
604
605 T_MMI_CONTROL mmi_control;
606 T_MFW_HND win;
607 T_MFW_HND parent_win;
608 #ifdef NEW_EDITOR
609 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
610 #else
611 T_EDITOR_DATA editor_data;
612 #endif
613
614 /* internal data */
615 char buffer[160];
616 UBYTE status;
617
618 } tShowVerion;
619
620
621 EXTERN T_MFW_HND USB_CAMERA_win;
622
623 /*
624 * These are common functions xxx_create and xxx_destroy
625 */
626
627 T_MFW_HND idle_dialling_create(MfwHnd parent);
628 void idle_dialling_exit (void);
629
630
631 /*
632 * This dialog function (the same name as the window)
633 * is used to handle the comunication between different windows. The global macro SEND_EVENT can be used with parameter win
634 * and the corresponding events to send from one mmi dialog to another.
635 */
636
637 void idle_dialling (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
638
639 /*
640 * These are common optional functions handler
641 */
642
643
644 static int idle_dialling_kbd_cb (MfwEvt e, MfwKbd *k);
645 static int idle_dialling_kbd_long_cb (MfwEvt e, MfwKbd *k);
646 static int idle_dialling_win_cb (MfwEvt e, MfwWin *w);
647
648 /*
649 * This an optional function, used often to call, create and init a new dialog, with different parameters depending
650 * on the context
651 */
652
653
654 T_MFW_HND idle_dialling_start (T_MFW_HND win_parent,char *character);
655
656
657
658 /*********************************************************************
659 **********************************************************************
660
661 OPTIONS DIALLING WINDOW. DECLARATION
662
663 *********************************************************************
664 **********************************************************************/
665
666
667
668 #define WIN_OPTIONS_DIALLING_ORG_X 0
669 #define WIN_OPTIONS_DIALLING_ORG_Y SECOND_LINE
670
671 #define WIN_OPTIONS_DIALLING_X_OFFSET 1
672 #define WIN_OPTIONS_DIALLING_Y_OFFSET 1
673
674
675
676 T_MFW_HND idle_dialling_options_create(MfwHnd parent);
677 void idle_dialling_options_destroy (T_MFW_HND own_window);
678
679 static int idle_dialling_options_kbd_cb (MfwEvt e, MfwKbd *k);
680 static int idle_dialling_options_kbd_long_cb (MfwEvt e, MfwKbd *k);
681 static int idle_dialling_options_win_cb (MfwEvt e, MfwWin *w);
682 static int idle_dialling_options_mnu_cb (MfwEvt e, MfwMnu *m);
683
684 typedef struct
685 {
686 T_MMI_CONTROL mmi_control;
687 T_MFW_HND win; // window handle
688 T_MFW_HND kbd;
689 T_MFW_HND kbd_long;
690 T_MFW_HND menu;
691 } T_idle_dialling_options;
692
693
694
695
696
697 /*********************************************************************
698 **********************************************************************
699
700 KEYPADLOCKED WINDOW. DECLARATION
701
702 *********************************************************************
703 **********************************************************************/
704
705
706 T_MFW_HND idle_key_pad_locked_create(MfwHnd parent);
707 void idle_key_pad_locked_destroy (T_MFW_HND own_window);
708
709 static int idle_key_pad_locked_kbd_cb (MfwEvt e, MfwKbd *k);
710 static int idle_key_pad_locked_kbd_long_cb (MfwEvt e, MfwKbd *k);
711 static int idle_key_pad_locked_win_cb (MfwEvt e, MfwWin *w);
712
713 typedef struct
714 {
715 T_MMI_CONTROL mmi_control;
716 T_MFW_HND win; // window handle
717 T_MFW_HND kbd;
718 T_MFW_HND kbd_long;
719 #ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
720 T_ED_DATA *editor;
721 #else
722 T_MFW_HND edt;
723 #endif
724 T_MFW_HND win_info; // window handle
725 UBYTE menuPressed;
726 UBYTE keyPadLockBuf[KEYPADLOCK_BUF_SIZE];
727 UBYTE TempkeyPadLockBuf[KEYPADLOCK_BUF_SIZE];
728 } T_idle_key_pad_locked;
729
730 void idle_key_pad_locked (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
731
732
733
734 static void (*showKeyPadLocked) (void);
735 static void showSOSCallKeyPadLocked(void);
736 void idle_info_destroy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
737
738
739 /*********************************************************************
740 **********************************************************************
741
742 Information WINDOW. DECLARATION
743
744 *********************************************************************
745 **********************************************************************/
746
747
748
749 static int lockTimerEvent(MfwEvt e, MfwTim *t);
750 static void showPressMenuStar(void);
751 /* x0039928 -Lint warning removal
752 static void showSMSNewMessage(void); */
753 static void showNothing(void);
754
755
756
757 T_MFW_HND idle_information_create(MfwHnd parent);
758 void idle_information_destroy (T_MFW_HND own_window);
759
760 static int idle_information_kbd_cb (MfwEvt e, MfwKbd *k);
761 /* x0039928 - lint warning removal
762 static int idle_information_kbd_long_cb (MfwEvt e, MfwKbd *k); */
763 static int idle_information_win_cb (MfwEvt e, MfwWin *w);
764
765 typedef struct
766 {
767 T_MMI_CONTROL mmi_control;
768 T_MFW_HND win; // window handle
769 T_MFW_HND parent_win;
770 T_MFW_HND timer;
771 T_VOID_FUNC info_cb;
772 T_MFW_HND kbd;
773 } T_idle_information;
774
775
776
777 void idle_information (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
778 T_MFW_HND idle_information_start(MfwHnd win_parent,S32 time,void (*show)(void),T_VOID_FUNC info_cb);
779
780
781
782
783
784 static void (*showInformation)(void);
785
786
787 static int idle_information_tim_cb(MfwEvt e, MfwTim *t);
788 static int idle_imei_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);
789
790
791 T_MFW_HND ShowVersion(T_MFW_HND parent_window);
792 static T_MFW_HND ShowVersion_create(MfwHnd parent_window);
793 static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier, void *parameter);
794 void ShowVersionSetEditor(T_MFW_HND win);
795 static void ShowVerionCB( T_MFW_HND win, USHORT Identifier,UBYTE reason);
796 void showVersion_destroy(MfwHnd own_window);
797
798 #if 0 /* FreeCalypso */
799 const char * date = "20080812";
800 const char * bmi = "01.06.01";
801 const char * gprs = "XX.XX.XX";
802 const char * ti = "N5.24M18V1.9";
803 #endif
804
805 extern const char firmware_version_str[];
806
807 //API - 13-01-03 - 1310 - Create a variable for idle instead of using global pin_emergency_call
808 UBYTE pin_idle_emerg_call;
809 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
810 extern int smsFullEventTim( MfwEvt e, MfwTim *tc );
811
812 #if defined (TI_PS_FF_EM) || defined (MMI_EM_ENABLED)
813 #ifndef NEPTUNE_BOARD
814 //xrashmic 22 Aug, 2004 MMI-SPR-32798
815 U8 screenCaptureKey=KCD_NONE;
816 #endif
817 T_MFW_HND screen_capture_win;
818 #endif
819 //xashmic 9 Sep 2006, OMAPS00092732
820 #ifdef FF_MMI_USBMS
821 USHORT USB_Mode = FALSE;
822 T_MFW_HND usb_opt_win;
823 T_MFW_HND usb_dialog_win;
824 MfwHnd usb_auto_enum_timer;//xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
825 #define AUTO_USB_ENUMERATION_TIMER 5000 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
826 #endif
827
828 //x0pleela 09 Feb, 2006 ER: OMAPS00065203
829 //callback for timer to display opername on idle screen
830 int idle_opername_timer_cb( MfwEvt e, MfwTim *tc );
831
832 //x0pleela 23 Mar, 2007 ER: OMAPS00122561
833 #ifdef FF_PHONE_LOCK
834 //callback for timer to display phone unlock screen
835 int idle_autoPhoneLock_timer_cb( MfwEvt e, MfwTim *tc );
836 EXTERN int phLock_UnLock (void);
837 //x0pleela 09 May, 2007 DR: OMAPS00129014
838 EXTERN UBYTE phlock_auto;
839 #endif /*FF_PHONE_LOCK*/
840 /*********************************************************************
841 **********************************************************************
842
843 IDLE WINDOW. IMPLEMENTATION
844
845 *********************************************************************/
846 /*******************************************************************************
847
848 $Function: idleInit
849
850 $Description: init MMI idle handling
851
852 $Returns:
853
854 $Arguments:
855
856 *******************************************************************************/
857
858
859
860
861 void idleInit (MfwHnd parent)
862 {
863 /* x0045876, 14-Aug-2006 (WR - "hnd" was set but never used) */
864 /* T_MFW_HND hnd; */
865
866 winAutoFocus(TRUE);
867 idle_data.nm_status = 0;
868 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
869 //Timer created to blink the SMS icon , when SMS memory is full
870 sms_animate= timCreate(0,500,(MfwCb) smsFullEventTim);
871
872 // x0pleela 11 Apr, 2006 ER: OMAPS00075178
873 //Timer created to animate battery charging
874 battery_charging_animate= timCreate(0,1000,(MfwCb) BattChargeEventTim);
875
876 //x0pleela 10 Feb, 2006 ER: OMAPS00065203
877 //Create timer to display SPN for 5 secs and then display PLMN name
878 plmn_display = timCreate(0, 5000, (MfwCb)idle_opername_timer_cb);
879
880 //x0pleela 23 Mar, 2007 ER: OMAPS00122561
881 #ifdef FF_PHONE_LOCK
882 //Create timer to display Phone lock unlock screen - timer is 10 secs duration
883 autoPhLock_timer = timCreate(0, 10000, (MfwCb)idle_autoPhoneLock_timer_cb);
884 #endif /*FF_PHONE_LOCK*/
885
886 /* x0045876, 14-Aug-2006 (WR - "hnd" was set but never used) */
887 /* hnd = idle_create (parent); */
888 idle_create (parent);
889
890 TRACE_EVENT_P1("FFS_flashData.IdleScreenBgd = %d", FFS_flashData.IdleScreenBgd);
891
892 if( FFS_flashData.ProviderNetworkShow != TRUE )
893 FFS_flashData.ProviderNetworkShow = FFS_flashData.ProviderNetworkShow;
894 else
895 FFS_flashData.ProviderNetworkShow = TRUE;
896
897 /* x0045876, 14-Aug-2006 (WR - pointless comparison of unsigned integer with zero) */
898 /* if((FFS_flashData.IdleScreenBgd >= BGD_NONE) && (FFS_flashData.IdleScreenBgd < BGD_LAST)) */
899 if (FFS_flashData.IdleScreenBgd < BGD_LAST)
900 idle_setBgdBitmap(FFS_flashData.IdleScreenBgd);
901 else
902 idle_setBgdBitmap(BGD_TI_LOGO);
903
904 /* x0045876, 14-Aug-2006 (WR - pointless comparison of unsigned integer with zero) */
905 /* if((FFS_flashData.MainMenuBgd >= BGD_NONE) && (FFS_flashData.MainMenuBgd < BGD_LAST)) */
906 if (FFS_flashData.MainMenuBgd < BGD_LAST)
907 icon_setMainBgdBitmap(FFS_flashData.MainMenuBgd);
908 else
909 icon_setMainBgdBitmap(BGD_SQUARE);
910
911
912 /* Power management */
913 /* create power management timer*/
914 #ifdef NEPTUNE_BOARD
915 #ifdef MMI_POWER_MANAGEMENT_TEST
916 ; /* Don't do anything */
917 /* Pm_timer = timCreate(0, (FFS_flashData.pm_duration * 1000),(MfwCb) powerManagementEvent); */
918 /* mmi_update_pm_timer_duration (); */ /* Update the global variable pm_on depending on the value set in flash */
919 #endif
920 #endif
921 }
922
923
924 /*******************************************************************************
925
926 $Function: idleExit
927
928 $Description: exit MMI idle handling
929
930 $Returns:
931
932 $Arguments:
933
934 *******************************************************************************/
935
936
937 void idleExit (void)
938 {
939 TRACE_EVENT("IdleExit");
940 // Apr 27, 2004 REF: ENH 12646 Deepa M.D
941 //Delete the timer for blinking SMS Icon ,when memory is full.
942 if (sms_animate)
943 {
944 timStop(sms_animate);
945 timDelete(sms_animate);
946 }
947 sms_animate = 0;
948
949 //x0pleela 11 Apr, 2006 ER: OMAPS00075178
950 //Delete the timer of battery charging
951 if (battery_charging_animate)
952 {
953 timStop(battery_charging_animate);
954 timDelete(battery_charging_animate);
955 }
956 battery_charging_animate = 0;
957
958 //x0pleela 14 Feb, 2006 ER: OMAPS00065203
959 //Delete the timer of operator name display
960 if( plmn_display)
961 {
962 timDelete(plmn_display);
963 plmn_display = 0;
964 }
965
966 //x0pleela 23 Mar, 2007 ER: OMAPS00122561
967 #ifdef FF_PHONE_LOCK
968 //Delete the timer for Phone unlock screen
969 if( autoPhLock_timer)
970 {
971 timDelete(autoPhLock_timer);
972 autoPhLock_timer = 0;
973 }
974 #endif /*FF_PHONE_LOCK*/
975 mfwSetSatIdle(0);
976
977 /* Power management */
978 #ifdef NEPTUNE_BOARD
979 #ifdef MMI_POWER_MANAGEMENT_TEST
980
981 /*Delete timer*/
982 if(Pm_timer)
983 {
984 timStop(Pm_timer);
985 timDelete(Pm_timer);
986 }
987 #endif
988 #endif
989 idle_destroy (idle_data.win);
990 }
991
992
993
994 /*******************************************************************************
995
996 $Function: idle_create
997
998 $Description: Creation of an instance for the Idle dialog.
999
1000 $Returns:
1001
1002 $Arguments:
1003
1004 *******************************************************************************/
1005
1006
1007 T_MFW_HND idle_create (T_MFW_HND parent_window)
1008 {
1009 T_idle * data = &idle_data;
1010 T_MFW_WIN * win;
1011 UBYTE result;
1012
1013 TRACE_FUNCTION ("idle_create");
1014
1015 memset(&idle_data,'\0',sizeof(idle_data));
1016 idle_data.defTextOffset= SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()-6*Mmi_layout_line_height();
1017
1018 /* xreddymn OMAPS00075852 May-15-2006
1019 * Set the default value for dialer_visible.
1020 */
1021 idle_data.dialer_visible = FALSE;
1022
1023 /*
1024 * Create window handler
1025 */
1026
1027 //x0pleela 05 Apr, 2007 ER: OMAPS00122561
1028 //register for MfwWinSuspend also for Automatic phone lock
1029 //x0pleela 15 Feb, 2006 ER:OMAPs00065203
1030 //Register MfwWinResume event also
1031 data->win = win_create (parent_window, 0, E_WIN_VISIBLE|MfwWinResume
1032 #ifdef FF_PHONE_LOCK
1033 |MfwWinSuspend
1034 #endif //FF_PHONE_LOCK
1035 , (T_MFW_CB)idle_win_cb);
1036
1037 if (data->win EQ 0)
1038 {
1039 mfwSetSatIdle(0);
1040 return 0;
1041 }
1042
1043 VOS_Idle_Win = data->win;
1044
1045
1046 /*
1047 * These assignments are necessary to attach the data to the window, and to handle the mmi event communication.
1048 */
1049
1050
1051 data->mmi_control.dialog = (T_DIALOG_FUNC)idle;
1052 data->mmi_control.data = data;
1053 win = ((T_MFW_HDR *)data->win)->data;
1054 win->user = (void *) data;
1055
1056 /*
1057 * Create any other handler
1058 */
1059
1060 data->kbd = kbd_create (data->win,KEY_ALL|KEY_MAKE,(T_MFW_CB)idle_kbd_cb);
1061 data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_kbd_long_cb);
1062 /* SPR#1428 - SH - New Editor changes */
1063 #ifdef NEW_EDITOR
1064 data->editor = 0;
1065 data->editor_sat = 0;
1066 AUI_edit_SetAttr(&data->editor_attr2, WIN_DIALLING_CB, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE*)data->incoming_cb_msg, MAX_CBMSG_LEN);
1067 AUI_edit_SetAttr(&data->editor_attr3, WIN_DIALLING_SMS, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE*)data->incoming_sms_msg, MAX_MSG_LEN_SGL);
1068
1069 /* 09-May-2006, x0045876 (OMAPS00064076) */
1070 /*10 Jul 2006, Ref OMAPS00077654, R.Prabakar(a0393213)
1071 Description : Cyrillic character support in MMI to pass GCF/PTCRB UCS2 TC (SATK)
1072 Solution : The attribute of ATB editor is set to unicode*/
1073 /*13 Oct 2006 OMAPS00095266 a0393213(R.Prabakar)
1074 Description : CT-GCF[27.22.4.22.1]-Incorrect string display
1075 Solution : changes done as part of OMAPS00077654 reverted back. The attribute of ATB editor is set to ASCII itself*/
1076 AUI_edit_SetAttr(&data->editor_attr_sat, WIN_DIALLING_SAT, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE*)data->incoming_sat_msg, MAX_SATMSG_LEN);
1077
1078 // July 12, 2006 REF:DR OMAPS00081477 x0047075
1079 //Fix:Assigning the sms_status_editor window handle to NULL
1080 idle_data.sms_status_editor = NULL;
1081 #else /* NEW_EDITOR */
1082 data->edt = 0;
1083 data->edt_sat = 0; /* SPR759 - SH*/
1084 bookSetEditAttributes(WIN_DIALLING_CB, COLOUR_EDITOR_XX,0,edtCurNone,0,(char*)data->incoming_cb_msg, MAX_CBMSG_LEN,&data->edt_attr2);
1085 bookSetEditAttributes(WIN_DIALLING_SMS, COLOUR_EDITOR_XX,0,edtCurNone,0,(char*)data->incoming_sms_msg, MAX_MSG_LEN_SGL,&data->edt_attr3);
1086 /* xreddymn OMAPS00080543 Jun-06-2006 */
1087 bookSetEditAttributes(WIN_DIALLING_SAT, COLOUR_EDITOR_XX,0,edtCurNone,0,(char*)data->incoming_sat_msg, MAX_SATMSG_LEN,&data->edt_attr_sat);
1088 // July 12, 2006 REF:DR OMAPS00081477 x0047075
1089 //Fix:Assigning the sms_status_editor window handle to NULL
1090 idle_data.sms_status_edt = NULL;
1091 #endif /* NEW_EDITOR */
1092
1093 /*
1094 * In the new design the are created and automatically shown.
1095 */
1096
1097 winShow(data->win);
1098 data->search=FALSE;
1099 data->missedCalls = 0;
1100 //API - 23/09/02 - Emergency Call Define
1101 pin_idle_emerg_call = FALSE;
1102 data->flagIdle=FALSE;
1103 data->right_key_pressed = FALSE;
1104 addCBCH(NULL, IdleNewCBImmediateMessage);
1105 data->new_cbch= FALSE;
1106 data->clean_screen = FALSE; //for clean the DISPLAY ZONE 3
1107 data->ciphering = DONT_SHOW_CPRS; //use as a default
1108 data->starting_up = TRUE; /*SPR#1662 JVJ New flag for the start up procedure */
1109
1110
1111 //init the Ciphering indication
1112 result = sim_init_CPRS ((CallbackCPRI) idle_Ciphering, MFW_SIM_CPRI_SHOW );
1113
1114 if (result == FALSE)
1115 TRACE_EVENT("Cant show Ciphering");
1116
1117 /*
1118 ** CQ16435 : Set the Mfw Sat window to this value.
1119 */
1120 mfwSetSatIdle(data->win);
1121
1122 /*
1123 * return window handle
1124 */
1125 return data->win;
1126 }
1127
1128
1129 /*******************************************************************************
1130
1131 $Function: idle_destroy
1132
1133 $Description: Destroy the idle dialog.
1134
1135 $Returns:
1136
1137 $Arguments:
1138
1139 *******************************************************************************/
1140
1141
1142 void idle_destroy (T_MFW_HND own_window)
1143 {
1144 T_MFW_WIN * win;
1145 T_idle * data;
1146
1147 /*
1148 * The destruction of this dialog is trivial, because the information contained is not dynamic. A better example
1149 * of dialog destruction can be found in dialling_destroy
1150 */
1151 TRACE_FUNCTION ("idle_destroy");
1152
1153
1154 if (own_window)
1155 {
1156 win = ((T_MFW_HDR *)own_window)->data;
1157 data = (T_idle *)win->user;
1158
1159 if (data)
1160 {
1161 /*
1162 * Exit Keyboard Handler
1163 */
1164 /*
1165 * Delete WIN Handler
1166 */
1167 win_delete (data->win);
1168 data->win=0;
1169 }
1170 }
1171 }
1172
1173
1174 /*******************************************************************************
1175
1176 $Function: idle
1177
1178 $Description: Dialog function for idle top window.
1179
1180 $Returns:
1181
1182 $Arguments:
1183
1184 *******************************************************************************/
1185
1186
1187 void idle (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
1188 {
1189 U8 * key_code;
1190 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1191 T_idle * data = (T_idle *)win_data->user;
1192
1193
1194 /*
1195 * This function is called by the SEND_EVENT macro, when the parameter win is the idle window. the different events
1196 * come from another mmi modules.
1197 */
1198
1199
1200 TRACE_FUNCTION ("idle()");
1201
1202 switch (event)
1203 {
1204 case NETWORK_NO_SERVICE:
1205 case NETWORK_NO_PLMN_XXX_AVAIL:
1206 /*
1207 * Network management indicates no or limited service
1208 */
1209 data->nm_status = event;
1210 data->search=TRUE;
1211
1212 /*NM, p020*/
1213 if(idleIsFocussed())
1214 windowsUpdate();
1215 break;
1216 case NETWORK_SEARCH_NETWORK:
1217 case NETWORK_FULL_SERVICE:
1218 /*
1219 * Network will be searched or is available
1220 */
1221
1222 #ifdef MMI_HOMEZONE_ENABLED
1223 //Jun 14, 2005 REF: MMI-FIX-30439 x0018858
1224 //Modified the conditional statement to read only once.Rest of the code will be performed everytime.
1225 //begin 30439
1226 if (event==NETWORK_FULL_SERVICE && !homezoneFlag)
1227 {
1228 homezoneFlag = 1; /* only read one time from SIM for FULL SERVICE */
1229 homezoneReadSim(HZ_READ_ONCE_ONLY); // Read in homezone data. Will do nothing on repeated calls.
1230 }
1231 //end 30439
1232 #endif
1233 data->search=FALSE;
1234 data->nm_status = event;
1235
1236 /*NM, p020*/
1237 if(idleIsFocussed())
1238 windowsUpdate();
1239 break;
1240
1241 case IDLE_UPDATE:
1242 /*NM, p020*/
1243 if ((idleIsFocussed()) || (idle_data.klck_win != NULL))
1244 {
1245 if ((mmiStart_animationComplete()!=TRUE) && (mmiPinsEmergencyCall() == TRUE))
1246 {
1247 mmiPinsResetEmergencyCall();
1248 mfwSimRestartPinEntry();
1249 }
1250 else
1251 windowsUpdate();
1252 }
1253 break;
1254
1255 case IDLE_NEW_SMS:
1256 // show the info about incoming sms on the idle screen
1257 idle_data.clean_screen = FALSE;
1258 /*NM, p020*/
1259 if(idleIsFocussed())
1260 windowsUpdate();
1261 else if (idle_data.klck_win != NULL)
1262 SEND_EVENT(idle_data.klck_win,IDLE_NEW_SMS,0,0);
1263 break;
1264 case IDLE_ACTIVE_KEY_PAD_LOCKED:
1265 idle_data.klck_win = idle_key_pad_locked_create(win);
1266 windowsUpdate();
1267 break;
1268
1269 case IDLE_DETAILS_NUMBER:
1270 idle_dialling_create(win);
1271 windowsUpdate();
1272 break;
1273
1274 case IDLE_START_DIALLING_NUMBER:
1275 key_code = (U8*)parameter;
1276 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
1277 idle_data.edt_buf[0]=editControls[*key_code];
1278 idle_dialling_start(idle_data.win,NULL);
1279 break;
1280
1281 default:
1282 return;
1283 }
1284
1285 }
1286
1287 /*******************************************************************************
1288
1289 $Function: idleExec
1290
1291 $Description:
1292
1293 $Returns:
1294
1295 $Arguments:
1296
1297 *******************************************************************************/
1298
1299
1300 void idleExec (int reason, MmiState next)
1301 {
1302 MmiModuleSet (ModuleIdle); /* Set the global status of Idle */
1303 switch (reason)
1304 {
1305 case IdleNormal: /* enter normal idle mode */
1306 winShow(idle_data.win);
1307 break;
1308 default:
1309 break;
1310 }
1311 }
1312
1313
1314 /*******************************************************************************
1315
1316 $Function: idleEvent
1317
1318 $Description:
1319
1320 $Returns:
1321
1322 $Arguments:
1323
1324 *******************************************************************************/
1325
1326
1327 void idleEvent (int reason)
1328 {
1329 TRACE_EVENT_P1("IDLE event reason: %d",reason);
1330
1331 switch (reason)
1332 {
1333 case IdleSearchNetwork:
1334 if (idle_data.win)
1335 SEND_EVENT(idle_data.win,IDLE_NO_NETWORK,0,0);
1336 break;
1337 case IdleUpdate:
1338 if (idle_data.win)
1339 SEND_EVENT(idle_data.win,IDLE_UPDATE,0,0);
1340 break;
1341 case IdleNewSmsMessage:
1342 if (idle_data.win)
1343 SEND_EVENT(idle_data.win,IDLE_NEW_SMS,0,0);
1344 break;
1345 case IdleActiveKeyPadLocked:
1346 if (idle_data.win)
1347 SEND_EVENT(idle_data.win,IDLE_ACTIVE_KEY_PAD_LOCKED,0,0);
1348 break;
1349 case PhbkDetailListToIdle:
1350 if (idle_data.win)
1351 SEND_EVENT(idle_data.win,IDLE_DETAILS_NUMBER,0,0);
1352 break;
1353 default:
1354 break;
1355 }
1356 }
1357
1358
1359
1360 /*******************************************************************************
1361
1362 $Function: idle_setBgdBitmap
1363
1364 $Description: This procedure is called when the idle background bitmap is to be changed
1365
1366 $Returns: None
1367
1368 $Arguments: bmp - pointer to the bitmap structure.
1369
1370 *******************************************************************************/
1371 void idle_setBgdBitmap(int bmpId)
1372 {
1373 idle_data.idleBgd = icon_getBitmapFromId(bmpId, NULL);
1374
1375 }
1376
1377
1378 /*******************************************************************************
1379
1380 $Function: idle_initDisplayData
1381
1382 $Description: initialises the display data
1383
1384 $Returns:
1385
1386 $Arguments:
1387
1388 $History
1389 GW 09/10/02 - Created
1390
1391 *******************************************************************************/
1392 enum {
1393 IDLE_CHARGING_MODE,
1394 IDLE_NETWORK_NAME,
1395 #ifdef FF_CPHS
1396 IDLE_ALS_DATA, //x0pleela 25 May, 2006 DR: OMAPS00070657
1397 #endif
1398 IDLE_CALL_SMS_INFO,
1399 IDLE_CLOCK_STR,
1400 IDLE_DATE_STR,
1401 IDLE_LOCKED_ECC,
1402 IDLE_LOCKED,
1403 IDLE_MENU_PRESS,
1404 IDLE_CB_INFO,
1405 IDLE_END
1406 };
1407
1408 static int idlePosition[IDLE_END];
1409 /*******************************************************************************
1410
1411 $Function:
1412
1413 $Description:
1414
1415 $Returns:
1416
1417 $Arguments:
1418
1419 $History
1420 GW 09/10/02 - Created
1421
1422 *******************************************************************************/
1423 int idle_initDisplayData( void )
1424 {
1425 int i;
1426 for (i=0;i<IDLE_END;i++)
1427 idlePosition[i] = 0;
1428
1429 // ADDED BY RAVI - 28-11-2005
1430 return 0;
1431 // END RAVI - 28-11-2005
1432 }
1433
1434
1435 /*******************************************************************************
1436
1437 $Function: idle_displayData
1438
1439 $Description: Procedure to allow different layouts of the idle screen data depending on
1440 hardware configuration.
1441 Each bit of text that can be displayed is given a value in the enumerated type.
1442 For some h/w configurations, different enumerated type values are displayed in
1443 the same position. By checking the 'idlePosition' array we can tell if we can display
1444 a particular bit of text. This allows a C-sample to display either the SMS information
1445 or the clock and for the D-sample to always display the clock (and the date).
1446
1447 $Returns: None.
1448
1449 $Arguments: dataId - value form the enumerated type that indicates what the data is
1450 txtId - text identifier (can be set to TxtNull if not used)
1451 strId - pointer to a char array to be displayed. Array is assumed to be ascii.
1452 NB If both txtId and strId are used, the string is displayed first followed by
1453 1 or 2 spaces, then the text id allowing display of "1 New Message" etc.
1454 $History
1455 GW 09/10/02 - Created
1456
1457 *******************************************************************************/
1458 int idle_displayData( int dataId , int txtId, char* txtStr)
1459 {
1460 int xPos, yPos;
1461 int lenStr,lenId,lenSpace;
1462 int txtWidth = 0; // RAVI
1463 char *txtSpace = ""; //EF must initialise. 03/02/2003
1464 char *idStr;
1465
1466 /* x0045876, 14-Aug-2006 (WR - "txtFormat" was set but never used) */
1467 /* int txtFormat = 0; // RAVI */
1468
1469 int noRoom = 0;
1470
1471 if (txtStr != NULL)
1472 lenStr = dspl_GetTextExtent( txtStr, 0);
1473 else
1474 lenStr = 0;
1475 if (txtId!=TxtNull)
1476 {
1477 idStr = (char*)MmiRsrcGetText(txtId);
1478 lenId = dspl_GetTextExtent( idStr, 0);
1479 }
1480 else
1481 {
1482 lenId = 0;
1483 idStr = "";
1484 }
1485 if ((lenId > 0 ) && (lenStr >0))
1486 {
1487 #ifndef LSCREEN
1488
1489 txtSpace=" ";
1490
1491 #else
1492 txtSpace=" ";
1493
1494 #endif
1495 lenSpace = dspl_GetTextExtent( txtSpace, 0);
1496 }
1497 else
1498 {
1499 lenSpace = 0;
1500 }
1501 txtWidth = lenStr+lenId+lenSpace;
1502 if (idlePosition[dataId] == 0)
1503 idlePosition[dataId] = 1;
1504 else
1505 {
1506 //We have already output something here - do not overwrite it
1507 noRoom = 1;
1508 }
1509 #ifndef LSCREEN
1510 xPos = 0;
1511 yPos = 0;
1512
1513 /* x0045876, 14-Aug-2006 (WR - "txtFormat" was set but never used) */
1514 /* txtFormat = 0; */
1515
1516 switch (dataId)
1517 {
1518 case IDLE_NETWORK_NAME:
1519 xPos = 16;
1520 yPos = Mmi_layout_line_icons(1);
1521 break;
1522
1523 case IDLE_CHARGING_MODE:
1524 xPos = 16;
1525 yPos = Mmi_layout_line_icons(2);
1526 break;
1527
1528 case IDLE_CALL_SMS_INFO:
1529 xPos = 0;
1530 yPos = Mmi_layout_line_icons(3);
1531 break;
1532
1533 case IDLE_CLOCK_STR:
1534 /* Marcus: Issue 1614: 23/01/2003: Start */
1535 #ifdef NEW_EDITOR
1536 if ((idlePosition[IDLE_CALL_SMS_INFO] == 0) &&
1537 (idle_data.editor == NULL))
1538 #else
1539 if ((idlePosition[IDLE_CALL_SMS_INFO] == 0) &&
1540 (idle_data.edt == NULL))
1541 #endif
1542 /* Marcus: Issue 1614: 23/01/2003: End */
1543 {
1544 xPos = 30;
1545 yPos = 24;
1546 }
1547 else
1548 { //no room to display the time
1549 noRoom = 1;
1550 }
1551 break;
1552 case IDLE_DATE_STR:
1553 noRoom = 1; //date not displayed in B-sample/C-sample
1554 break;
1555 case IDLE_LOCKED_ECC:
1556 case IDLE_LOCKED:
1557 xPos = 0;
1558 yPos = idleLine(2);
1559 /* xreddymn OMAPS00075852 May-15-2006
1560 * Set the color values for keypad locked message.
1561 */
1562 dspl_SetBgdColour( COL_White );
1563 dspl_SetFgdColour( COL_Black );
1564 dspl_Clear(0, yPos, SCREEN_SIZE_X, yPos + Mmi_layout_line_height());
1565 break;
1566 case IDLE_MENU_PRESS:
1567 xPos = 0;
1568 yPos = idleLine(3);
1569 /* xreddymn OMAPS00075852 May-15-2006
1570 * Set the color values for unlock key-press sequence message.
1571 */
1572 dspl_SetBgdColour( COL_White );
1573 dspl_SetFgdColour( COL_Black );
1574 dspl_Clear(0, yPos, SCREEN_SIZE_X, yPos + Mmi_layout_line_height());
1575 break;
1576
1577 /* xreddymn OMAPS00075852 May-15-2006
1578 * Calculate the display position.
1579 */
1580 case IDLE_CB_INFO:
1581 yPos = idleLine(4);
1582 break;
1583
1584 default:
1585 break;
1586 }
1587 #else
1588 xPos = (SCREEN_SIZE_X - txtWidth)/2;
1589 yPos = idle_data.defTextOffset;
1590
1591 /* x0045876, 14-Aug-2006 (WR - "txtFormat" was set but never used) */
1592 /* txtFormat = 0; */
1593
1594 switch (dataId)
1595 {
1596 case IDLE_NETWORK_NAME:
1597 if (idle_data.idleNetLogo == NULL)
1598 yPos = Mmi_layout_line_height()*4;
1599 else
1600 yPos = yPos + Mmi_layout_line_height()*3;
1601 break;
1602
1603 //x0pleela 25 May, 2006 DR:OMAPS00070657
1604 #ifdef FF_CPHS
1605 case IDLE_ALS_DATA:
1606 yPos = Mmi_layout_line_height()*6;
1607 break;
1608 #endif
1609
1610 case IDLE_CHARGING_MODE:
1611 yPos = yPos + Mmi_layout_line_height()*4;
1612 break;
1613
1614 case IDLE_CALL_SMS_INFO:
1615 yPos = yPos + Mmi_layout_line_height()*5;
1616 break;
1617
1618 case IDLE_CLOCK_STR:
1619 /* Marcus: Issue 1614: 23/01/2003: Start */
1620 #ifdef NEW_EDITOR
1621 if (idle_data.editor == NULL)
1622 #else
1623 if (idle_data.edt == NULL)
1624 #endif
1625 /* Marcus: Issue 1614: 23/01/2003: End */
1626 {
1627 xPos = 10;
1628 yPos = yPos + Mmi_layout_line_height();
1629 }
1630 else
1631 {
1632 noRoom = 1;
1633 }
1634 break;
1635 case IDLE_DATE_STR:
1636 /* Marcus: Issue 1614: 23/01/2003: Start */
1637 #ifdef NEW_EDITOR
1638 if (idle_data.editor == NULL)
1639 #else
1640 if (idle_data.edt == NULL)
1641 #endif
1642 {
1643 xPos = SCREEN_SIZE_X - txtWidth - 10;
1644 yPos = yPos + Mmi_layout_line_height();
1645 }
1646 else
1647 {
1648 noRoom = 1;
1649 }
1650 /* Marcus: Issue 1614: 23/01/2003: End */
1651 break;
1652 case IDLE_LOCKED_ECC:
1653 xPos = 0; /*SPR#2026 - DS - Changed from 10 */
1654 yPos = yPos + Mmi_layout_line_height()*4;
1655 dspl_Clear(xPos,yPos,mmiScrX,mmiScrY);
1656 dspl_Clear(xPos,yPos+ Mmi_layout_line_height()*5,mmiScrX,mmiScrY);
1657 break;
1658 case IDLE_LOCKED:
1659 xPos = 10;
1660 yPos = yPos + Mmi_layout_line_height()*3;
1661 /* xreddymn OMAPS00075852 May-15-2006
1662 * Set the color values for keypad locked message.
1663 */
1664 dspl_SetBgdColour( COL_White );
1665 dspl_SetFgdColour( COL_Black );
1666 dspl_Clear(0, yPos, SCREEN_SIZE_X, yPos + Mmi_layout_line_height());
1667 break;
1668 case IDLE_MENU_PRESS:
1669 xPos = 10;
1670 yPos = yPos + Mmi_layout_line_height()*4;
1671 /* xreddymn OMAPS00075852 May-15-2006
1672 * Set the color values for unlock key-press sequence message.
1673 */
1674 dspl_SetBgdColour( COL_White );
1675 dspl_SetFgdColour( COL_Black );
1676 dspl_Clear(0, yPos, SCREEN_SIZE_X, yPos + Mmi_layout_line_height());
1677 break;
1678
1679 /* xreddymn OMAPS00075852 May-15-2006
1680 * Calculate the display position.
1681 */
1682 case IDLE_CB_INFO:
1683 yPos = yPos + Mmi_layout_line_height()*4;
1684 break;
1685
1686 default:
1687 break;
1688
1689 }
1690 #endif
1691
1692 if (!noRoom)
1693 {
1694 //GW 28/11/02 - Only display a non-null string
1695
1696 /*MC SPR 1526, using dspl_TextOut rather than dspl_ScrText*/
1697 if (txtStr != NULL)
1698 dspl_TextOut(xPos, yPos, 0, txtStr);
1699 if (lenSpace!= NULL)
1700 dspl_TextOut(xPos+lenStr, yPos, 0, txtSpace);
1701 dspl_TextOut(xPos+lenStr+lenSpace,yPos, 0, idStr);
1702 }
1703
1704 // ADDED BY RAVI - 28-11-2005
1705 return 0;
1706 //END RAVI - 28-11-2005
1707 }
1708
1709 #ifndef LSCREEN
1710 /*******************************************************************************
1711
1712 $Function:
1713
1714 $Description: Returns a pixel position for a line number on the idle screen
1715
1716 $Returns: y pixel position for the line
1717
1718 $Arguments: lineNo - line number
1719
1720 $History
1721 GW 09/10/02 - Created
1722
1723 *******************************************************************************/
1724 static int idleLine( int lineNo )
1725 {
1726 // int yPos; // RAVI
1727 #ifndef LSCREEN
1728 return (Mmi_layout_line_icons(lineNo));
1729 #else
1730 return (Mmi_layout_line(lineNo)*3/2+Mmi_layout_IconHeight());
1731 #endif
1732 }
1733 #endif
1734 /*SPR 1725, removed getClockString() and getDateString() functions*/
1735
1736 /*******************************************************************************
1737
1738 $Function:
1739
1740 $Description:
1741
1742 $Returns:
1743
1744 $Arguments:
1745
1746 $History
1747 GW 09/10/02 - Created
1748
1749 *******************************************************************************/
1750 //Fix for 19656
1751 void idle_show_cb_editor_scrollbar(T_ED_DATA *e)
1752 {
1753 int editX, editY, editWidth, editHeight;
1754 int scrollBarSize, scrollBarPos;
1755
1756 if(e->viewHeight>=e->totalHeight)
1757 return;
1758
1759 editX=e->attr->win_size.px;
1760 editY=e->attr->win_size.py;
1761 editWidth=e->attr->win_size.sx-3;
1762 editHeight=e->attr->win_size.sy;
1763
1764 dspl_DrawLine(editX+editWidth, editY, editX+editWidth, editY+editHeight-1);
1765 scrollBarSize = e->viewHeight * editHeight / e->totalHeight;
1766 if (scrollBarSize>editHeight)
1767 scrollBarSize = editHeight;
1768 scrollBarPos = e->viewStartPos * editHeight / e->totalHeight;
1769
1770 /* xreddymn OMAPS00079699 Jun-02-2006 */
1771 dspl_DrawLine(editX+editWidth+1, editY+scrollBarPos, editX+editWidth+1,
1772 editY+scrollBarPos+scrollBarSize-1);
1773 dspl_DrawLine(editX+editWidth+2, editY+scrollBarPos, editX+editWidth+2,
1774 editY+scrollBarPos+scrollBarSize-1);
1775 }
1776
1777 void idle_draw_main_idle( void )
1778 {
1779 T_CURRENT_NETWORK current_network;
1780 char text[20];
1781 int txtStrId; //Id of text string to be displayed
1782 int txtNo; //Numeric value to be displayed (0=no value)
1783 //int xOfs; //used to offset text id when a number is to be displayed // RAVI
1784 // int lenStr, txtFormat; // RAVI
1785 // static int nTimes=0; // RAVI
1786 int oldborderSize;
1787 int localborderSize;
1788 // Jul 08, 2005 REF: ENH 32642 x0018858
1789 char dt_str[20]; //date string
1790 char time_str[20]; //time string
1791 /* x0045876, 14-Aug-2006 (WR - "xPos" was set but never used) */
1792 /* int xPos,yPos; //x and y position on screen */
1793 int yPos;
1794
1795 // Nov 24, 2005, a0876501, DR: OMAPS00045909
1796 int sim_status;
1797
1798 // Apr 14, 2004 REF: CRR 12653 xvilliva
1799 CHAR oper[MAX_ALPHA_OPER_LEN]; /* operator name */
1800
1801 /* x0045876, 14-Aug-2006 (WR - "mode" was declared but never referenced) */
1802 /* T_ACI_COPS_MOD mode; */ /* COPS mode */
1803
1804 /* x0045876, 14-Aug-2006 (WR - "mode" was declared but never referenced) */
1805 /* T_ACI_COPS_FRMT frmt; */ /* COPS format */
1806 T_ACI_NRG_RGMD regMode;
1807 T_ACI_NRG_SVMD srvMode;
1808 T_ACI_NRG_FRMT oprFrmt;
1809 T_ACI_NRG_SVMD srvStat;
1810 LimitedService = 0;//end of crr12653
1811
1812
1813 // Nov 24, 2005, a0876501, DR: OMAPS00045909
1814 sim_status = sim_status_check();
1815 memset(&current_network,'\0',sizeof(T_CURRENT_NETWORK)); /*x0039928 - Lint warning fix */
1816 memset(&srvStat, '\0',sizeof(srvStat));
1817 TRACE_FUNCTION("idle_draw_main_idle()");
1818
1819 /* If we have not finished animation, do not draw any of the idle screen */
1820 if (mmiStart_animationComplete()!=TRUE)
1821 return;
1822
1823 TRACE_FUNCTION("idle_draw_main_idle");
1824
1825 resources_setColour( COLOUR_IDLE );
1826 dspl_ClearAll();
1827 idle_initDisplayData();
1828
1829 if (idle_data.starting_up) /*SPR#1662 - NH Show please wait since the phone is not ready yet*/
1830 {
1831 idle_displayData(IDLE_NETWORK_NAME,TxtPleaseWait,NULL);
1832 return;
1833 }
1834
1835 /* GW SPR#1721 - Add a border round all the text on the idle screen */
1836 #ifdef COLOURDISPLAY
1837 oldborderSize = dspl_setBorderWidth(1);
1838 #endif
1839 if (dspl_GetFgdColour()==dspl_GetBorderColour())
1840 {
1841 //Get a colour that contrasts with the foreground colour
1842 dspl_SetBorderColour(dspl_GetContrastColour(dspl_GetFgdColour()));
1843 //If this is the same as the background colour... too bad
1844 }
1845
1846 if(idle_data.idleBgd != NULL)
1847 dspl_BitBlt2(idle_data.idleBgd->area.px,idle_data.idleBgd->area.py,idle_data.idleBgd->area.sx,idle_data.idleBgd->area.sy,(void *)idle_data.idleBgd->icons,0,idle_data.idleBgd->icnType);
1848
1849 // Jul 08, 2005 REF: ENH 32642 x0018858
1850 // Set the back ground and foreground colour.
1851 dspl_SetFgdColour( COL_BLK );
1852 dspl_SetBgdColour( COL_TRANSPARENT );
1853
1854 if (idle_data.nm_status == NETWORK_FULL_SERVICE)
1855 {
1856 network_get_name (&current_network);
1857 #ifdef COLOURDISPLAY
1858 //x0pleela 22 june, 2006 DR: OMAPs00082374
1859 //commented this as it is not required for EONs test cases
1860 idle_data.idleNetLogo = NULL; //icon_getNetworkIcon(current_network.network_name);
1861 #else
1862 idle_data.idleNetLogo = NULL;
1863 #endif
1864 }
1865 else
1866 idle_data.idleNetLogo = NULL;
1867
1868 //The animation complete will provide a better
1869
1870 if (idle_data.idleNetLogo)
1871 {
1872 int xOfs,yOfs;
1873 T_BITMAP* icn=idle_data.idleNetLogo;
1874
1875 if (icn->area.sy < SCREEN_SIZE_Y - Mmi_layout_IconHeight())
1876 {
1877 yOfs = Mmi_layout_IconHeight();
1878 if (icn->area.sy + yOfs < idle_data.defTextOffset)
1879 yOfs = yOfs + (idle_data.defTextOffset - icn->area.sy)/2;
1880 }
1881 else
1882 yOfs = 0;
1883
1884 if (icn->area.sx < SCREEN_SIZE_X)
1885 xOfs = (SCREEN_SIZE_X - icn->area.sx)/2;
1886 else
1887 xOfs = 0;
1888 #ifdef COLOURDISPLAY
1889 dspl_BitBlt2(xOfs,yOfs,icn->area.sx,icn->area.sy,icn->icons,0,icn->icnType);
1890 #endif
1891 }
1892
1893 if (smsidle_get_unread_sms_available())
1894 iconsSetState(iconIdSMS);/* Indicate SMS delivery to MS-User. */
1895 else
1896 iconsDeleteState(iconIdSMS);
1897 /* Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)
1898 Description : CPHS Roaming indication feature implementation
1899 Solution : If current_network.roaming_indicator is set, the roaming icon is set*/
1900 /* July 04, 2006 REF:OMAPS00083759 a0393213(R.Prabakar)
1901 Description : Roaming indicator icon shown during searching
1902 Solution : Roaming icon display condition will be checked only when we are in full network*/
1903 if(idle_data.nm_status == NETWORK_FULL_SERVICE && current_network.roaming_indicator)
1904 {
1905 iconsSetState(iconIdRoaming);
1906 }
1907 else
1908 {
1909 iconsDeleteState(iconIdRoaming);
1910 }
1911 /*
1912 DISPLAY ZONE 1
1913 */
1914 GlobalIconStatus = GlobalSignalIconFlag | GlobalBatteryIconFlag
1915 | GlobalSMSIconFlag| GlobalVoiceMailIconFlag
1916 | GlobalCallForwardingIconFlag| GlobalKeyplockIconFlag
1917 | GlobalRingerIconFlag | GlobalRingVibrIconFlag
1918 | GlobalVibratorIconFlag | GlobalAlarmIconFlag
1919 | GlobalSilentRingerIconFlag|GlobalCipheringActivIconFlag
1920 | GlobalCipheringDeactivIconFlag
1921 /* SH 18/01/02. Flag for GPRS On icon. */
1922 #ifdef MMI_GPRS_ENABLED
1923 | GlobalGPRSOnIconFlag
1924 #endif
1925 /* SPR759 - SH - Flag for Homezone icon */
1926 #ifdef MMI_HOMEZONE_ENABLED
1927 | GlobalHomezoneIconFlag
1928 #endif
1929 /* SPR#1352 - SH - Flag for TTY icon */
1930 #ifdef MMI_TTY_ENABLED
1931 | GlobalTTYIconFlag
1932 #endif
1933 /* SH end */
1934
1935 | GlobalRoamingIconFlag /*Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)*/
1936 ;
1937
1938 /* OMAPS00050447: a0393130, handle removal of sim card */
1939 /* In case of no network service icon display is handled in */
1940 /* switch case below */
1941 if(idle_data.nm_status == NETWORK_NO_SERVICE && sim_status == SIM_NOT_ACTIVE)
1942 /* OMAPS00050447: a0393130, handle removal of sim card */
1943 {
1944 TRACE_EVENT("ICON display handled below");
1945 }
1946 else
1947 {
1948 TRACE_EVENT("Normal ICON display handled");
1949 iconsShow();
1950 }
1951
1952 /*
1953 DISPLAY ZONE 2
1954 */
1955 switch (idle_data.nm_status)
1956 {
1957 case NETWORK_FULL_SERVICE :
1958 if (globalMobileMode == (GlobalMobileOn|GlobalCharging))
1959 {
1960 if(globalBatteryMode == GlobalBatteryFull)
1961 {
1962 idle_displayData(IDLE_CHARGING_MODE,TxtChargComplete,NULL);
1963
1964 }
1965 else
1966 {
1967 idle_displayData(IDLE_CHARGING_MODE,TxtCharging,NULL);
1968 }
1969 break;
1970 }
1971 else
1972 {
1973 if (DivertStatus == MFW_CFLAG_SET)
1974 {
1975 idle_displayData(IDLE_CHARGING_MODE,TxtCallDivert,NULL);
1976 }
1977 }
1978 /*NM p032
1979 set the flag when the TEST SIM is inserted*/
1980 if (!strcmp((char *)current_network.network_name,"00101"))
1981 {
1982 test_sim = TRUE;
1983 }
1984 else
1985 {
1986 test_sim = FALSE;
1987 }
1988 /*p032 end */
1989
1990 //x0pleela 9 Feb, 2006 ER:OMAPS00065203
1991
1992 //If SPN and plmn name are not NULL, display SPN for 5 seconds and the plmn name
1993 //For the above scenario, display_condition of SPN is not checked as per Cingular's requirement
1994 //In spite of display_condition being FALSE, we go ahead and display SPN
1995
1996 //If SPN is NULL and plmn name is not NULL, then display plmn name
1997
1998 /* Marcus: Issue 1618: 24/01/2003: Start *
1999 *
2000 * If we have a service provider name, show that,
2001 * else show the PLMN name
2002 */
2003
2004 if(!timer_start_flag)
2005 {
2006 timStart(plmn_display);
2007 timer_start_flag = TRUE;
2008 }
2009
2010 if( ( opername_disp_flag EQ SPN ) AND
2011 (strlen((char*)current_network.service_provider_name)) ) //SPN name
2012 {
2013 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.service_provider_name);
2014 }
2015 else
2016 {
2017 if(strlen((char*)current_network.plmn_name)) //PLMN name
2018 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.plmn_name);
2019 else if(strlen((char*)current_network.network_name)) //Numeric name
2020 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.network_name);
2021 else //SPN name
2022 idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.service_provider_name);
2023 }
2024
2025 #if 0 /* FreeCalypso */
2026 if(network_sync_done==0)
2027 {
2028 /*OMAPS00091029 x0039928(sumanth) - to mark the end of network sync event*/
2029 boot_time_snapshot(ENetworkSync);
2030 TRACE_EVENT("Boot Time Snapshot - ENetworkSync");
2031 network_sync_done=1;
2032 }
2033 #endif
2034 /* Marcus: Issue 1618: 24/01/2003: End */
2035
2036 //x0pleela 25 May, 2006 DR: OMAPS00070657
2037 #ifdef FF_CPHS
2038 if (mmi_cphs_get_als_value() )
2039 {
2040 switch( FFS_flashData.als_selLine)
2041 {
2042 case MFW_SERV_LINE1:
2043 {
2044 TRACE_EVENT("als_status: Line1");
2045 idle_displayData(IDLE_ALS_DATA, TxtLine1, NULL);
2046 // Oct 11, 2006 REF:OMAPS00098287 x0039928
2047 // Fix: Update the als_status variable
2048 if(als_bootup == TRUE)
2049 {
2050 als_status.selectedLine = MFW_SERV_LINE1;
2051 sAT_PercentALS(CMD_SRC_LCL, ALS_MOD_SPEECH);
2052 }
2053 }
2054 break;
2055
2056 case MFW_SERV_LINE2:
2057 {
2058 TRACE_EVENT("als_status: Line2");
2059 idle_displayData(IDLE_ALS_DATA, TxtLine2, NULL);
2060 // Oct 11, 2006 REF:OMAPS00098287 x0039928
2061 // Fix: Update the als_status variable
2062 if(als_bootup == TRUE)
2063 {
2064 als_status.selectedLine = MFW_SERV_LINE2;
2065 sAT_PercentALS(CMD_SRC_LCL, ALS_MOD_AUX_SPEECH);
2066 }
2067 }
2068 break;
2069
2070 default:
2071 idle_displayData(IDLE_ALS_DATA, TxtNull, NULL);
2072 break;
2073 }
2074 // Oct 11, 2006 REF:OMAPS00098287 x0039928
2075 // Fix: Update the als_status variable
2076 if(als_bootup == TRUE)
2077 {
2078 als_status.status = (T_MFW_LINE_STATUS)FFS_flashData.als_statLine;
2079 als_bootup = FALSE;
2080 }
2081 }
2082
2083 #endif
2084
2085 break;
2086
2087 case NETWORK_SEARCH_NETWORK :
2088 idle_displayData(IDLE_NETWORK_NAME,TxtSearching,NULL);
2089 #if 0 /* FreeCalypso */
2090 if(modem_boot_done==0)
2091 {
2092 /*OMAPS00091029 x0039928(sumanth) - to mark the end of modem boot event*/
2093 boot_time_snapshot(EModemBoot);
2094 TRACE_EVENT("Boot Time Snapshot - EModemBoot");
2095 modem_boot_done=1;
2096 }
2097 #endif
2098 break;
2099 case NETWORK_NO_SERVICE :
2100 if (sim_status == SIM_NOT_ACTIVE)
2101 {
2102 /* OMAPS00050447: a0393130, handle removal of sim card */
2103 globalSignalPicNumber =0; /* updating signal strength */
2104 iconsShow();
2105 /* OMAPS00050447: a0393130, handle removal of sim card */
2106 idle_displayData(IDLE_NETWORK_NAME,TxtNoCard,NULL);
2107 }
2108 // Nov 24, 2005, a0876501, DR: OMAPS00045909
2109 else if (sim_status == IMEI_NOT_VALID)
2110 idle_displayData(IDLE_NETWORK_NAME,TxtInvalidIMEI,NULL);
2111 else
2112 {// Apr 14, 2004 REF: CRR 12653 xvilliva
2113 /*a0393213 warnings removal - srvStat initialized with NRG_SVMD_NotPresent(-1) instead of -2*/
2114 srvStat = NRG_SVMD_NotPresent;
2115 qAT_PercentNRG( CMD_SRC_LCL,
2116 &regMode,
2117 &srvMode,
2118 &oprFrmt,
2119 &srvStat,
2120 oper);
2121 if(srvStat == NRG_SVMD_Limited && globalSignalPicNumber > iconSigStat49)
2122 {//xvilliva checking signal and limited service status.
2123 idle_displayData(IDLE_NETWORK_NAME,TxtLimService,NULL);
2124 LimitedService = 1;
2125 }
2126 else
2127 idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
2128 }
2129 break;
2130 case NETWORK_NO_PLMN_XXX_AVAIL:
2131 if (sim_status == SIM_NOT_ACTIVE)
2132 idle_displayData(IDLE_NETWORK_NAME,TxtNoCard,NULL);
2133 // Nov 24, 2005, a0876501, DR: OMAPS00045909
2134 else if (sim_status == IMEI_NOT_VALID)
2135 idle_displayData(IDLE_NETWORK_NAME,TxtInvalidIMEI,NULL);
2136 else
2137 idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
2138 default:
2139 idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
2140 break;
2141 }
2142
2143 /*
2144 DISPLAY ZONE 3
2145 */
2146
2147 TRACE_EVENT("DISPLAY ZONE 3");
2148 txtStrId = TxtNull;
2149 txtNo= 0;
2150 // xOfs= 0; // RAVI
2151 if (!idle_data.clean_screen) //for clean the DISPLAY ZONE 3
2152 //dont show the following information when the user pressed
2153 // the HUP key once in the idle screen
2154 {
2155 TRACE_EVENT("Not clean screen");
2156 idle_data.new_sms = FALSE;
2157
2158 /* xreddymn OMAPS00075852 May-15-2006
2159 * Display messages on idle screen only if dialer is not visible.
2160 */
2161 if(idle_data.dialer_visible == FALSE)
2162 {
2163 /*
2164 ** NDH : 15/05/2003 : Change the priority for the idle display, such that
2165 ** CB, SAT Idle Display Text or Class 0 SMS are displayed with
2166 ** the highest priority
2167 */
2168 /* SPR#1428 - SH - New Editor changes */
2169 #ifdef NEW_EDITOR
2170 /* Normal incoming cell broadcast */
2171 if (idle_data.new_cbch)
2172 {
2173 if (idle_data.editor)
2174 {
2175 ATB_edit_Hide(idle_data.editor);
2176 }
2177
2178 /* SPR759 - SH. Hide SAT idle mode text if present */
2179 if (idle_data.editor_sat)
2180 {
2181 ATB_edit_Hide(idle_data.editor_sat);
2182 }
2183 txtStrId = TxtNewCbMessage;
2184 TRACE_EVENT("new_cbch");
2185 }
2186
2187 /* SPR759 - SH - Display SAT idle mode text */
2188 else if (idle_data.editor_sat)
2189 {
2190 /* xreddymn OMAPS00080543 Jun-06-2006 */
2191 localborderSize = dspl_setBorderWidth(0);
2192 ATB_edit_Unhide(idle_data.editor_sat);
2193 ATB_edit_Show(idle_data.editor_sat);
2194 idle_show_cb_editor_scrollbar(idle_data.editor_sat); //Fix for 19656
2195 dspl_setBorderWidth(localborderSize);
2196 TRACE_EVENT("editor_sat");
2197 }
2198
2199 /* Dialling editor, Immediate incoming cell broadcast */
2200 else if (idle_data.editor)
2201 {
2202 TRACE_EVENT("*** Displaying number editor *");
2203 /* MZ issue 1948, Modify the text boarder settings before displaying the message. */
2204 localborderSize = dspl_setBorderWidth(0);
2205 ATB_edit_Unhide(idle_data.editor);
2206 ATB_edit_Show(idle_data.editor);
2207 /* xreddymn OMAPS00079699 Jun-02-2006
2208 * Display scrollbar for the Cell Broadcast message viewer.
2209 */
2210 idle_show_cb_editor_scrollbar(idle_data.editor);
2211 dspl_setBorderWidth(localborderSize);
2212 }
2213 #else /* NEW_EDITOR */
2214 /* Normal incoming cell broadcast */
2215 if (idle_data.new_cbch)
2216 {
2217 if (idle_data.edt)
2218 {
2219 edtHide(idle_data.edt);
2220 }
2221
2222 /* SPR759 - SH. Hide SAT idle mode text if present */
2223 if (idle_data.edt_sat)
2224 {
2225 edtHide(idle_data.edt_sat);
2226 }
2227 txtStrId = TxtNewCbMessage;
2228 }
2229
2230 /* SPR759 - SH - Display SAT idle mode text */
2231 else if (idle_data.edt_sat)
2232 {
2233 edtUnhide(idle_data.edt_sat);
2234 edtShow(idle_data.edt_sat);
2235 }
2236
2237 /* Immediate incoming cell broadcast */
2238 else if (idle_data.edt)
2239 {
2240 edtUnhide(idle_data.edt);
2241 edtShow(idle_data.edt);
2242 }
2243 #endif /* NEW_EDITOR */
2244 }/* end: if(idle_data.dialer_visible == FALSE) */
2245
2246 /* xreddymn OMAPS00075852 May-15-2006
2247 * Inform user the arrival of a new CB message.
2248 */
2249 if (txtStrId != TxtNull)
2250 {
2251 if (idle_data.new_cbch)
2252 {
2253 dspl_SetFgdColour( COL_BLK );
2254 dspl_SetBgdColour( COL_TRANSPARENT );
2255 idle_displayData(IDLE_CB_INFO, txtStrId, NULL);
2256 }
2257 txtStrId = TxtNull;
2258 }
2259
2260 /* xreddymn OMAPS00075852 May-15-2006
2261 * Display Missed Call, New SMS, Message full --etc messages in a
2262 * different zone from CB or SAT messages.
2263 */
2264 if (idle_data.missedCalls)
2265 {
2266 txtNo = idle_data.missedCalls;
2267 if(txtNo <= 1)
2268 {
2269 txtStrId = TxtMissedCall;
2270 }
2271 else
2272 {
2273 txtStrId = TxtMissedCalls;
2274 }
2275 TRACE_EVENT("missed calls");
2276 }
2277 //xrashmic 26 Aug, 2004 MMI-SPR-23931
2278 // To display the indication of new EMS in the idle screen
2279 else if (idle_data.ems)
2280 {
2281 #if defined (FF_MMI_MMS) || defined (FF_MMI_EMS)//MMI-SPR 49811 - x0035544 07 nov 2005
2282 txtStrId = TxtEMSNew;
2283 #endif //MMI-SPR 49811 - x0035544 07 nov 2005
2284 }
2285 else if (sms_message_count(MFW_SMS_UNREAD) > 0 )
2286 {
2287 txtStrId = smsidle_display_sms_status(&txtNo );
2288 idle_data.new_sms = TRUE;
2289 }
2290 else if(FFS_flashData.settings_status & SettingsSilentMode)
2291 {
2292 txtStrId = TxtSilentMode;
2293 TRACE_EVENT("Silent mode");
2294 }
2295 /* Marcus: Issue 1604: 23/01/2003: Start */
2296 else if (smsidle_get_ready_state() && smsidle_get_memory_full())
2297 {
2298 /* x0018858 24 Mar, 2005 MMI-FIX-11321
2299 Added a condition to check for any pending message on the server.
2300 */
2301 //begin -x0018858 24 Mar, 2005 MMI-FIX-11321
2302 if(TRUE == sms_check_message_pending())
2303 {
2304 TRACE_EVENT("Pending SMS, but list is full");
2305 txtStrId = TxtSmsWaiting;
2306 }//end -x0018858 24 Mar, 2005 MMI-FIX-11321
2307 else
2308 {
2309 TRACE_EVENT("No unread SMS, but list is full");
2310 txtStrId = TxtSmsListFull;
2311 }
2312 }
2313 /* Marcus: Issue 1604: 23/01/2003: End */
2314 else
2315 {
2316 TRACE_EVENT("None of the above!");
2317 }
2318 }
2319 else //(!idle_data.clean_screen)
2320 {
2321 TRACE_EVENT("Clean screen");
2322
2323 /* xreddymn OMAPS00075852 May-15-2006
2324 * Display messages on idle screen only if dialer is not visible.
2325 */
2326 if(idle_data.dialer_visible == FALSE)
2327 {
2328
2329 /* SPR#1428 - SH - New Editor changes */
2330 #ifdef NEW_EDITOR
2331 //this is for the immediate incoming cell broadcast
2332 if (idle_data.editor)
2333 { /* MZ Issue 1948, modify the text border settings before displaying the message.*/
2334 localborderSize = dspl_setBorderWidth(0);
2335 ATB_edit_Unhide(idle_data.editor);
2336 ATB_edit_Show(idle_data.editor);
2337 /* xreddymn OMAPS00079699 Jun-02-2006
2338 * Display scrollbar for the Cell Broadcast message viewer.
2339 */
2340 idle_show_cb_editor_scrollbar(idle_data.editor);
2341 dspl_setBorderWidth(localborderSize);
2342 }
2343 #else /* NEW_EDITOR */
2344 //this is for the immediate incoming cell broadcast
2345 if (idle_data.edt)
2346 {
2347 edtUnhide(idle_data.edt);
2348 edtShow(idle_data.edt);
2349 }
2350 #endif /* NEW_EDITOR */
2351 }/* end: if(idle_data.dialer_visible == FALSE) */
2352
2353 //20/4/01 MZ check for silent_mode status.
2354 if(FFS_flashData.settings_status & SettingsSilentMode)
2355 {
2356 txtStrId = TxtSilentMode;
2357 }
2358 // May 21, 2004 REF: CRR 16084 Deepa M.D
2359 //Display the Message Full String, when the Idle screen is clean.
2360 else if (smsidle_get_ready_state() && smsidle_get_memory_full())
2361 {
2362 /* x0018858 24 Mar, 2005 MMI-FIX-11321
2363 Added a condition to check for any pending message on the server.
2364 */
2365 //begin -x0018858 24 Mar, 2005 MMI-FIX-11321
2366 if(TRUE == sms_check_message_pending())
2367 {
2368 TRACE_EVENT("Pending SMS, but list is full");
2369 txtStrId = TxtSmsWaiting;
2370 }//end -x0018858 24 Mar, 2005 MMI-FIX-11321
2371 else
2372 {
2373 TRACE_EVENT("No unread SMS, but list is full");
2374 txtStrId = TxtSmsListFull;
2375 }
2376 }
2377 else
2378 {
2379 TRACE_EVENT("None of the above 2");
2380 }
2381 }
2382 //If data has been set up, then show it
2383 if (txtStrId != TxtNull)
2384 {
2385 /* xreddymn OMAPS00075852 May-15-2006
2386 * Set the color values to display the text.
2387 */
2388 dspl_SetFgdColour( COL_BLK );
2389 dspl_SetBgdColour( COL_TRANSPARENT );
2390 if (txtNo != 0)
2391 {
2392 sprintf((char*)text,"%d",txtNo);
2393 idle_displayData(IDLE_CALL_SMS_INFO,txtStrId,text);
2394 }
2395 else
2396 idle_displayData(IDLE_CALL_SMS_INFO,txtStrId,NULL);
2397 }
2398
2399 idle_displayData(IDLE_CLOCK_STR, TxtNull, mfw_td_get_clock_str());/*SPR 1725*/
2400 idle_displayData(IDLE_DATE_STR, TxtNull, mfw_td_get_date_str()); /*SPR 1725*///Only displayed on D-sample
2401
2402 /*
2403 DISPLAY ZONE 4
2404 */
2405
2406 TRACE_EVENT("DISPLAY ZONE 4");
2407 resources_setSKColour( COLOUR_IDLE );
2408
2409 /* GW SPR#1721 - Changed from a case statement so we restore colour/border info */
2410 if ((idle_data.search) && ((idle_data.nm_status==NETWORK_NO_SERVICE) ||
2411 (idle_data.nm_status==NETWORK_NO_PLMN_XXX_AVAIL)))
2412 {
2413 TRACE_EVENT("idle_win_cb()-no network yet");
2414 // Apr 14, 2004 REF: CRR 12653 xvilliva
2415 // Here we are setting the softkey names if there are missedCalls/SMS/CBCH
2416 // we set the left key as "Read" else it is "Names".
2417 /*28th Mar 2007 OMAPS00121870 a0393213(R.Prabakar)
2418 Network signal indicator is also taken into account to show the soft keys*/
2419 if(srvStat == NRG_SVMD_Limited && globalSignalPicNumber > iconSigStat49)
2420 {
2421 if(idle_data.new_sms || idle_data.missedCalls > 0 || idle_data.new_cbch)
2422 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
2423 else
2424 softKeys_displayId(TxtNames,TxtSoftMenu,0,COLOUR_IDLE);
2425 }
2426 else
2427 {
2428 /*28th Mar 2007 OMAPS00121870 a0393213(R.Prabakar)
2429 "Menu" is mapped to right softkey*/
2430 softKeys_displayId(TxtSearchName,TxtSoftMenu,0,COLOUR_IDLE);
2431 }
2432 }
2433 //xrashmic 26 Aug, 2004 MMI-SPR-23931
2434 // To display the 'read' softkey for the indication of new EMS in the idle screen
2435 //CRR 25268 & 25270: 14 Oct 2004 - xpradipg
2436 //display the read softkey only if there are no new cb message or sat messsage on idle screen
2437 else if (idle_data.ems && !idle_data.missedCalls && !idle_data.clean_screen)
2438 {
2439 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
2440 }
2441 else if ( smsidle_get_unread_sms_available()
2442 && (!idle_data.clean_screen)
2443 && idle_data.new_sms )
2444 {
2445 TRACE_EVENT("idle_win_cb()-unread SMS");
2446 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
2447 }
2448 else if ((!idle_data.clean_screen) && idle_data.new_cbch)
2449 {
2450 TRACE_EVENT("idle_win_cb()-new CBCH");
2451 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
2452 }
2453 else if ((!idle_data.clean_screen) && (idle_data.missedCalls > 0))
2454 {
2455 TRACE_EVENT("idle_win_cb()-missed calls");
2456 softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
2457 }
2458 else
2459 {
2460 TRACE_EVENT("idle_win_cb()-phonebook");
2461 softKeys_displayId(TxtNames,TxtSoftMenu,0,COLOUR_IDLE);
2462 }
2463
2464 // Jul 08, 2005 REF: ENH 32642 x0018858
2465 //Code to display the date/time even if the idle_data editor is being displayed.
2466 //Begin 32642
2467 #ifdef NEW_EDITOR
2468 if (idle_data.editor != NULL)
2469 #else
2470 if (idle_data.edt != NULL)
2471 #endif
2472 {
2473 dspl_SetFgdColour( COL_BLK );
2474 dspl_SetBgdColour( COL_TRANSPARENT );
2475
2476 strcpy((char *)dt_str, mfw_td_get_date_str());
2477 strcpy((char *)time_str, mfw_td_get_clock_str());
2478
2479
2480 /* x0045876, 14-Aug-2006 (WR - "xPos" was set but never used) */
2481 /* xPos = 10; */
2482
2483 yPos = Mmi_layout_line_height()*7;
2484
2485 dspl_Clear(10, Mmi_layout_line_height()*7,mmiScrX,mmiScrY);
2486 dspl_TextOut (10,Mmi_layout_line_height()*7, 0, time_str);
2487
2488 dspl_Clear(125, Mmi_layout_line_height()*7,mmiScrX,mmiScrY);
2489 //x0pleela 09 Nov, 2006 ER: OMAPS00099966
2490 //resizing for Endurance Font support
2491 #ifdef FF_ENDURANCE_FONT
2492 dspl_TextOut( 65, yPos, 0, dt_str );
2493 #else
2494 dspl_TextOut( 100, yPos, 0, dt_str );
2495 #endif
2496
2497 }
2498 //End 32642
2499
2500 resources_restoreMnuColour();//required only if other menu items are to be drawn afterwards
2501
2502 resources_restoreColour();
2503
2504 #ifdef COLOURDISPLAY
2505 dspl_setBorderWidth(oldborderSize);
2506 #endif
2507
2508 //Debug - output how much memory is left.
2509 mfwCheckMemoryLeft();
2510
2511 //x0pleela 09 May, 2007 DR: OMAPS00129014
2512 #ifdef FF_PHONE_LOCK
2513 //for Automatic Phone lock check
2514 if( phlock_auto )
2515 {
2516 //start timer to display unlock screen
2517 if( (!autoPhLock_timer_flag) && idleIsFocussed() )
2518 {
2519 timStart(autoPhLock_timer);
2520 autoPhLock_timer_flag= TRUE;
2521 }
2522 }
2523 #endif //FF_PHONE_LOCK
2524 TRACE_FUNCTION("end of idle_draw_main_idle()");
2525 }
2526
2527 /*******************************************************************************
2528
2529 $Function: idle_win_cb
2530
2531 $Description:
2532
2533 $Returns:
2534
2535 $Arguments:
2536
2537 $History
2538 GW 09/10/02 - Removed display code to separate procedure.
2539
2540 *******************************************************************************/
2541 static int idle_win_cb (MfwEvt e, MfwWin *w)
2542 {
2543 TRACE_FUNCTION("idle_win_cb");
2544 switch (e)
2545 {
2546 case MfwWinVisible:
2547
2548 /* Mar 08, 2006 REF:ER OMAPS00065168 */
2549 /* Destroy the editor to make the messages like 'new message' visible */
2550 #ifdef NEPTUNE_BOARD
2551 /* June 23, 2006 Ref: OMAPS00079445 */
2552 /* Destroy the editor if there is no cell broadcast message */
2553 if(tag_zone == NULL)
2554 statusCBCH(FALSE);
2555 #endif
2556 idle_draw_main_idle();
2557 break;
2558 //x0pleela 15 Feb, 2006 ER:OMAPS00065203
2559 //Handling MfwWinResume event
2560 case MfwWinResume: /* window is resumed */
2561 opername_disp_flag = SPN;
2562 timer_start_flag = FALSE;
2563
2564 break;
2565 //x0pleela 05 Apr, 2007 ER: OMAPS00122561
2566 //Handling Win suspend event
2567 #ifdef FF_PHONE_LOCK
2568 case MfwWinSuspend :
2569 timStop(autoPhLock_timer);
2570 autoPhLock_timer_flag= FALSE;
2571 break;
2572
2573 #endif /*FF_PHONE_LOCK*/
2574
2575 case MfwWinFocussed: /* input focus / selected*/
2576 case MfwWinDelete:/* window will be deleted*/
2577 default:
2578 return MFW_EVENT_REJECTED;
2579 }
2580
2581 return MFW_EVENT_CONSUMED;
2582
2583 }
2584
2585
2586 /*******************************************************************************
2587
2588 $Function: keyEvent
2589
2590 $Description: keyboard event handler
2591
2592 $Returns:
2593
2594 $Arguments:
2595
2596 *******************************************************************************/
2597
2598 static int idle_kbd_cb (MfwEvt e, MfwKbd *k)
2599 {
2600
2601 // static UBYTE right_key_pressed=FALSE; // RAVI
2602 UBYTE currentRinger = getCurrentRingerSettings();
2603
2604 T_MFW_SMS_STAT sms_list_type = MFW_SMS_ALL;
2605 // UBYTE Temp_edt_buf[KEYPADLOCK_BUF_SIZE]; // RAVI
2606
2607 // char debug[50]; // RAVI - Not Used.
2608
2609 TRACE_FUNCTION("idle_kbd_cb");
2610
2611 TRACE_EVENT_P1("Key: %d", k->code);
2612 #ifdef NEPTUNE_BOARD
2613 TRACE_EVENT_P1("pm_duration = %d ", FFS_flashData.pm_duration);
2614 /* Power management */
2615
2616
2617 #ifdef MMI_POWER_MANAGEMENT_TEST
2618
2619 mmi_pm_enable(0); /*First, disable PM*/
2620
2621 mmi_pm_enable(1); /*then enable it.*/
2622 #endif
2623 #endif
2624 if (idle_data.starting_up) /*NH Do nothing when starting up */
2625 {
2626 return MFW_EVENT_CONSUMED;
2627 }
2628
2629 if (!(e & KEY_MAKE))
2630 {
2631 TRACE_EVENT_P1("!(e & KEY_MAKE)::: k->code = %d", k->code);
2632 switch (k->code)
2633 {
2634 case KCD_RIGHT:
2635 pin_idle_emerg_call = FALSE;
2636 break;
2637
2638 // sbh - power key pressed in idle screen, we can shut down
2639 case KCD_POWER:
2640 pin_idle_emerg_call = FALSE;
2641 HUPKeyOrigin = 1;
2642 break;
2643
2644 case KCD_LEFT:
2645 break;
2646
2647 default:
2648 break;
2649 }
2650 idle_data.right_key_pressed = FALSE;
2651
2652 return MFW_EVENT_CONSUMED;
2653 }
2654
2655 idle_data.right_key_pressed = FALSE;
2656
2657 if(idle_data.missedCalls > 0)
2658 {
2659 TRACE_EVENT_P1("idle_data.missedCalls > 0::: k->code = %d", k->code);
2660 switch (k->code)
2661 {
2662 case KCD_MNUSELECT:
2663 case KCD_LEFT:
2664 idle_data.missedCalls = 0;
2665 bookPhonebookStart(idle_data.win,PhbkMissedCallsListNormal);
2666 /* Power management */
2667 #ifdef NEPTUNE_BOARD
2668 #ifdef MMI_POWER_MANAGEMENT_TEST
2669
2670 /* mmi_pm_enable(0); */ /* Disable PM*/
2671 #endif
2672 #endif
2673 return MFW_EVENT_CONSUMED;
2674 default:
2675 break;
2676 }
2677 }
2678
2679 #if defined (FF_MMI_EMS) && defined (FF_GPF_TCPIP)
2680 //xrashmic 26 Aug, 2004 MMI-SPR-23931
2681 // To launch the EMS inbox on pressing the "read" left softkey in idle
2682 // screen after receving the new EMS indication in the idle screen.
2683 if(idle_data.ems)
2684 {
2685 TRACE_EVENT_P1("idle_data.ems::: k->code = %d", k->code);
2686 switch (k->code)
2687 {
2688 case KCD_MNUSELECT:
2689 case KCD_LEFT:
2690 /* Power management */
2691 #ifdef NEPTUNE_BOARD
2692 #ifdef MMI_POWER_MANAGEMENT_TEST
2693
2694 /* mmi_pm_enable(0); */ /*Disable PM*/
2695 #endif
2696 #endif
2697 MMSBox_start(idle_data.win, (MfwMnuAttr*)MMS_INBOX);
2698 return MFW_EVENT_CONSUMED;
2699 default:
2700 break;
2701 }
2702 }
2703 #endif
2704
2705
2706 if(LimitedService == 0 && idle_data.search)// Apr 14, 2004 REF: CRR 12653 xvilliva
2707 //if (idle_data.search)
2708 {
2709 TRACE_EVENT_P1("LimitedService == 0 && idle_data.search::: idle_data.nm_status = %d", idle_data.nm_status);
2710 switch (idle_data.nm_status)
2711 {
2712 case NETWORK_NO_SERVICE :
2713 case NETWORK_NO_PLMN_XXX_AVAIL:
2714 TRACE_EVENT_P1("k->code = %d", k->code);
2715 switch (k->code)
2716 {
2717 case KCD_MNUSELECT:
2718 case KCD_LEFT:
2719 /* Power management */
2720 #ifdef NEPTUNE_BOARD
2721 #ifdef MMI_POWER_MANAGEMENT_TEST
2722 /* mmi_pm_enable(0); */ /*Disable PM*/
2723 #endif
2724 #endif
2725 network_start_full_service();
2726 winShow(idle_data.win);
2727 case KCD_HUP:
2728 idle_data.search=FALSE;
2729 /* On pressing the KCD_HUP key in searching state the menu displays
2730 *'No Network' with 'Name' and 'Menu' as softkeys instead of
2731 *'Searching'.
2732 */
2733 #ifdef NEPTUNE_BOARD
2734 network_start_full_service();
2735 #endif
2736 winShow(idle_data.win);
2737 break;
2738 /*28th Mar 2007 OMAPS00121870 a0393213(R.Prabakar)
2739 "Menu" is mapped to right softkey*/
2740 case KCD_RIGHT:
2741 bookPhonebookStart(idle_data.win,PhbkMainMenu);
2742 break;
2743 /*CONQ 6436, MC allow entry of emergency number*/
2744 /*API - 13-09-02 -Add all KCD_0 and KCD_8 */
2745 /*CQ10659 - API - 20/06/03 - Added KCD_STAR, KCD_HASH, KCD_6*/
2746 case KCD_0:
2747 case KCD_1:
2748 case KCD_2:
2749 case KCD_6:
2750 case KCD_8:
2751 case KCD_9:
2752 case KCD_STAR:
2753 case KCD_HASH:
2754 #ifdef NEPTUNE_BOARD
2755 #ifdef MMI_POWER_MANAGEMENT_TEST
2756
2757 /* mmi_pm_enable(0); */ /*Disable PM*/
2758 #endif
2759 #endif
2760 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
2761 idle_data.edt_buf[0]=editControls[k->code];
2762 TRACE_EVENT_P2("Idle_data.edt_buf[0] = %d, [1] = %d", idle_data.edt_buf[0], idle_data.edt_buf[1]);
2763 idle_dialling_start(idle_data.win,NULL);
2764 break;
2765
2766 default:
2767 break;
2768 }
2769 return MFW_EVENT_CONSUMED;
2770
2771 default:
2772 break;
2773 }
2774 }
2775
2776 if (smsidle_get_unread_sms_available()
2777 && (!idle_data.clean_screen)
2778 && idle_data.new_sms )
2779
2780 {
2781 TRACE_EVENT_P1(" smsidle_get_unread_sms_available::: k->code = %d", k->code);
2782
2783 switch (k->code)
2784 {
2785 case KCD_MNUSELECT:
2786 case KCD_LEFT:
2787 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2788 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
2789 // terminate the ringing
2790 #ifdef FF_MIDI_RINGER
2791 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2792 #else
2793 /* Stop playing ring tone on key press - RAVI -23-12-2005 */
2794 #ifdef NEPTUNE_BOARD
2795 currentRinger = getcurrentSMSTone();
2796 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2797 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2798 #else
2799 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2800 #endif
2801
2802 vsi_t_sleep(0,10); /* small delay */
2803 #else
2804 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2805 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2806 #else
2807 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2808 #endif
2809 #endif /*END RAVI */
2810 #endif
2811
2812 idle_data.new_sms = FALSE;
2813 /* Power management */
2814 #ifdef NEPTUNE_BOARD
2815 #ifdef MMI_POWER_MANAGEMENT_TEST
2816 /* mmi_pm_enable(0); */ /*Disable PM*/
2817 #endif
2818 #endif
2819 /*SPR 2512, removed setting of clean_screen flag here*/
2820 SmsRead_R_start(idle_data.win, (MfwMnuAttr *)&sms_list_type);
2821
2822 return MFW_EVENT_CONSUMED;
2823 default:
2824 break;
2825 }
2826 }
2827
2828 //this is for cell broadcast
2829 if ((!idle_data.clean_screen) && idle_data.new_cbch )
2830 {
2831 TRACE_EVENT_P1("if ((!idle_data.clean_screen) && idle_data.new_cbch ) k->code = %d", k->code);
2832 switch (k->code)
2833 {
2834 case KCD_MNUSELECT:
2835 case KCD_LEFT:
2836 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2837 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
2838 // terminate the ringing
2839 #ifdef FF_MIDI_RINGER
2840 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
2841 #else
2842 /* Stop Playing Ring tone on Key press - RAVI - 23-12-2005 */
2843 #ifdef NEPTUNE_BOARD
2844 currentRinger = getcurrentSMSTone();
2845 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2846 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2847 #else
2848 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2849 #endif
2850
2851 vsi_t_sleep(0,10); /* small delay */
2852 #else
2853 #ifdef FF_MMI_RINGTONE /*Stop MSL */
2854 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
2855 #else
2856 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
2857 #endif
2858 #endif /* END RAVI */
2859 #endif
2860
2861 idle_data.new_cbch = FALSE;
2862 idle_data.clean_screen = TRUE;
2863 /* Power management */
2864 #ifdef NEPTUNE_BOARD
2865 #ifdef MMI_POWER_MANAGEMENT_TEST
2866 /* mmi_pm_enable(0); */ /*Disable PM*/
2867 #endif
2868 #endif
2869 sms_cb_read_msg (ALL_MESSAGE);
2870 return MFW_EVENT_CONSUMED;
2871 default:
2872 break;
2873 }
2874 }
2875
2876
2877
2878 switch (k->code)
2879 {
2880
2881 case KCD_MNUUP:
2882 /* xreddymn OMAPS00080543 Jun-06-2006 */
2883 //Fix for 19656
2884 #ifdef NEW_EDITOR
2885 if((idle_data.editor_sat) && (!idle_data.new_cbch))
2886 {
2887 TRACE_EVENT("sat menu up");
2888 ATB_edit_MoveCursor(idle_data.editor_sat,ctrlUp, TRUE);
2889 ATB_edit_Show(idle_data.editor_sat);
2890 idle_show_cb_editor_scrollbar(idle_data.editor_sat);
2891 }
2892 #else /* NEW_EDITOR */
2893 if((idle_data.edt_sat) && (!idle_data.new_cbch))
2894 {
2895 TRACE_EVENT("CB menu up");
2896 edtChar(idle_data.edt,ecUp);
2897 }
2898 #endif /*NEW_EDITOR */
2899 /* SPR#1428 - SH - New Editor changes */
2900 #ifdef NEW_EDITOR
2901 else if(idle_data.editor)
2902 {
2903 TRACE_EVENT("CB menu up");
2904 ATB_edit_MoveCursor(idle_data.editor,ctrlUp, TRUE);
2905 /* xreddymn OMAPS00079699 Jun-02-2006
2906 * Display Cell Broadcast message viewer and its scrollbar.
2907 */
2908 ATB_edit_Show(idle_data.editor);
2909 idle_show_cb_editor_scrollbar(idle_data.editor);
2910 }
2911 #else /* NEW_EDITOR */
2912 else if(idle_data.edt)
2913 {
2914 TRACE_EVENT("CB menu up");
2915 edtChar(idle_data.edt,ecUp);
2916 }
2917 #endif /*NEW_EDITOR */
2918 else
2919 {
2920 /*
2921 Indicate that the volume settings menu has been invoked from the
2922 incoming call screen.
2923 //Apr 05, 2005 REF: ENH 29994 xdeepadh */
2924 #ifdef FF_MIDI_RINGER
2925 IdleScreenVolumeTimer();
2926 #endif
2927 setSoundsReason(SettingVolume);
2928 /* Power management */
2929 #ifdef NEPTUNE_BOARD
2930 #ifdef MMI_POWER_MANAGEMENT_TEST
2931 /* mmi_pm_enable(0); */ /*Disable PM*/
2932 #endif
2933 #endif
2934 idle_data.info_win=bookMenuStart(idle_data.win, ringerVolumeSetting(), SettingVolume);
2935 }
2936 break;
2937
2938 case KCD_MNUDOWN:
2939 /* xreddymn OMAPS00080543 Jun-06-2006 */
2940 //Fix for 19656
2941 #ifdef NEW_EDITOR
2942 if((idle_data.editor_sat) && (!idle_data.new_cbch))
2943 {
2944 TRACE_EVENT("sat menu up");
2945 ATB_edit_MoveCursor(idle_data.editor_sat,ctrlDown, TRUE);
2946 ATB_edit_Show(idle_data.editor_sat);
2947 idle_show_cb_editor_scrollbar(idle_data.editor_sat);
2948 }
2949 #else /* NEW_EDITOR */
2950 if((idle_data.edt_sat) && (!idle_data.new_cbch))
2951 {
2952 TRACE_EVENT("CB menu up");
2953 edtChar(idle_data.edt,ecUp);
2954 }
2955 #endif /*NEW_EDITOR */
2956 /* SPR#1428 - SH - New Editor changes */
2957 #ifdef NEW_EDITOR
2958 else if(idle_data.editor)
2959 {
2960 TRACE_EVENT("CB menu down");
2961 ATB_edit_MoveCursor(idle_data.editor,ctrlDown, TRUE);
2962 /* xreddymn OMAPS00079699 Jun-02-2006
2963 * Display Cell Broadcast message viewer and its scrollbar.
2964 */
2965 ATB_edit_Show(idle_data.editor);
2966 idle_show_cb_editor_scrollbar(idle_data.editor);
2967 }
2968 #else /* NEW_EDITOR */
2969 else if(idle_data.edt)
2970 {
2971 TRACE_EVENT("CB menu down");
2972 edtChar(idle_data.edt,ecDown);
2973 }
2974 #endif /*NEW_EDITOR */
2975 else
2976 {
2977 /*
2978 Indicate that the volume settings menu has been invoked from the
2979 incoming call screen.
2980 */
2981 //Apr 05, 2005 REF: ENH 29994 xdeepadh
2982 #ifdef FF_MIDI_RINGER
2983 IdleScreenVolumeTimer();
2984 #endif
2985 setSoundsReason(SettingVolume);
2986 /* Power management */
2987 #ifdef NEPTUNE_BOARD
2988 #ifdef MMI_POWER_MANAGEMENT_TEST
2989 /* mmi_pm_enable(0); */ /*Disable PM*/
2990 #endif
2991 #endif
2992 idle_data.info_win=bookMenuStart(idle_data.win, ringerVolumeSetting(), SettingVolume);
2993 }
2994 break;
2995 // break; // RAVI
2996 case KCD_MNUSELECT:
2997 case KCD_LEFT: /* main menu */
2998 /* Power management */
2999 #ifdef NEPTUNE_BOARD
3000 #ifdef MMI_POWER_MANAGEMENT_TEST
3001 /* mmi_pm_enable(0); */ /*Disable PM*/
3002 #endif
3003 #endif
3004 /* Stop Playing Audio on Key press - RAVI - 23-12-2005 */
3005 #ifdef NEPTUNE_BOARD
3006 if (idle_data.new_sms == TRUE)
3007 {
3008 /*Apr 05, 2005 REF: ENH 29994 xdeepadh */
3009 /*Terminate ringing */
3010 #ifdef FF_MIDI_RINGER
3011 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
3012 #else
3013 currentRinger = getcurrentSMSTone();
3014 #ifdef FF_MMI_RINGTONE /*Stop MSL */
3015 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
3016 #else
3017 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
3018 #endif
3019
3020 vsi_t_sleep(0,10); /* Small Delay */
3021 #endif
3022 }
3023 #else
3024 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
3025 /* Terminate ringing */
3026 #ifdef FF_MIDI_RINGER
3027 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
3028 #endif
3029 #endif
3030 /* END RAVI - 23-12-2005 */
3031
3032
3033 bookPhonebookStart(idle_data.win,PhbkNormal);
3034 break;
3035 case KCD_CALL:
3036 /* Power management */
3037 #ifdef NEPTUNE_BOARD
3038 #ifdef MMI_POWER_MANAGEMENT_TEST
3039 /* mmi_pm_enable(0); */ /*Disable PM*/
3040 #endif
3041 #endif
3042 bookPhonebookStart(idle_data.win,PhbkRedialListNormal);
3043 break;
3044 case KCD_RIGHT: /* contacts (ADN) */
3045 /* SPR#1449 - SH - Remove, as terminates GPRS connection.
3046 * Seems to be unnecessary. */
3047 /*cm_force_disconnect();
3048 terminate the ringing */
3049 /* audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
3050 */
3051 /* Stop playing audio on key press - RAVI - 23-12-2005 */
3052 #ifdef NEPTUNE_BOARD
3053 if (idle_data.new_sms == TRUE)
3054 {
3055 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
3056 /* Terminate ringing */
3057 #ifdef FF_MIDI_RINGER
3058 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
3059 #else
3060 currentRinger = getcurrentSMSTone();
3061 #ifdef FF_MMI_RINGTONE /*Stop MSL */
3062 audio_StopSoundbyID( AUDIO_BUZZER, SMSTONE_SELECT);
3063 #else
3064 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
3065 #endif
3066
3067 vsi_t_sleep(0,10); /* Small delay */
3068 #endif
3069 }
3070 #else
3071 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
3072 /* Terminate ringing */
3073 #ifdef FF_MIDI_RINGER
3074 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
3075 #endif
3076 #endif
3077 /* END RAVI - 23-12-2005 */
3078 /* Power management */
3079 #ifdef NEPTUNE_BOARD
3080 #ifdef MMI_POWER_MANAGEMENT_TEST
3081 /* mmi_pm_enable(0); */ /*Disable PM*/
3082 #endif
3083 #endif
3084 bookPhonebookStart(idle_data.win,PhbkMainMenu);
3085 break;
3086 case KCD_HUP:
3087 //Apr 05, 2005 REF: ENH 29994 xdeepadh
3088 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
3089 //Terminate ringing
3090 #ifdef FF_MIDI_RINGER
3091 mfw_ringer_stop(sounds_midi_ringer_stop_cb);
3092 #endif
3093
3094 /*
3095 ** NDH : 15/05/2003 : If the Idle editor is being displayed the only way to
3096 ** remove it is by pressing the Hangup Key, if it is active, do not set
3097 ** "Clean Screen" so that the previous "Missed Calls" etc will be displayed
3098 */
3099 if (!idle_data.editor)
3100 {
3101 //for clean the DISPLAY ZONE 3
3102 //information like "missed calls" and "receive messages"
3103 //disappear if the user press the HUP key
3104 idle_data.clean_screen = TRUE;
3105 }
3106
3107
3108 /* delete the message buffer plus the editor */
3109 statusCBCH(FALSE);
3110 windowsUpdate();
3111 break;
3112
3113 // sbh - power key pressed in idle screen, we can shut down
3114 case KCD_POWER:
3115 HUPKeyOrigin = 1;
3116 break;
3117
3118 case KCD_0:
3119 case KCD_1:
3120 case KCD_2:
3121 case KCD_3:
3122 case KCD_4:
3123 case KCD_5:
3124 case KCD_6:
3125 case KCD_7:
3126 case KCD_8:
3127 case KCD_9:
3128 case KCD_STAR:
3129 case KCD_HASH:
3130 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
3131 idle_data.edt_buf[0]=editControls[k->code];
3132 idle_dialling_start(idle_data.win,NULL);
3133 break;
3134
3135 default:
3136 break;
3137 }
3138 //Jun 24, 2005 MMI-FIX-30973 x0018858
3139 //Added code to handle the display of homezone/cityzone tag.
3140 //Begin 30973
3141 //Check to see if there are any new sms/ missed calls and confirm that the screen is clean.
3142 if ( ((smsidle_get_unread_sms_available() == 0)
3143 && ( idle_data.new_sms <= 0) && ( idle_data.missedCalls == 0)) || (idle_data.clean_screen))
3144 {
3145 TRACE_EVENT_P1(" smsidle_get_unread_sms_available() == 0::: tag_zone = %d", tag_zone );
3146 if (tag_zone != NULL)
3147 {
3148
3149 addCBCH((char*)tag_zone, IdleNewCBImmediateMessage);
3150 winShow(idle_data.win);
3151
3152 }
3153 }
3154 //End 30973
3155
3156 return MFW_EVENT_CONSUMED;
3157 }
3158
3159
3160
3161
3162
3163 /*******************************************************************************
3164
3165 $Function: idle_kbd_long_cb
3166
3167 $Description: Creation of an instance for the Idle dialog.
3168
3169 $Returns:
3170
3171 $Arguments:
3172
3173 *******************************************************************************/
3174
3175
3176 static int idle_kbd_long_cb(MfwEvt e, MfwKbd *k)
3177 {
3178
3179 TRACE_FUNCTION ("idle_kbd_long_cb");
3180 if ((e & KEY_RIGHT) && (e & KEY_LONG) && (idle_data.right_key_pressed == TRUE))
3181 {
3182 }
3183
3184 return MFW_EVENT_CONSUMED;
3185 }
3186
3187
3188 /*******************************************************************************
3189
3190 $Function: idle_get_window
3191
3192 $Description:
3193
3194 $Returns:
3195
3196 $Arguments:
3197
3198 *******************************************************************************/
3199
3200
3201
3202
3203 MfwHnd idle_get_window (void)
3204 {
3205 return idle_data.win;
3206 }
3207
3208 /*******************************************************************************
3209
3210 $Function: idle_set_starting_up
3211
3212 $Description: Sets a flag that indicates to Idle that the phone is starting up
3213
3214 $Returns:
3215
3216 $Arguments:
3217
3218 *******************************************************************************/
3219
3220
3221
3222
3223 void idle_set_starting_up (UBYTE set)
3224 {
3225 idle_data.starting_up = set;
3226 }
3227
3228
3229 /*******************************************************************************
3230
3231 $Function: idleIsFocussed
3232
3233 $Description:
3234
3235 $Returns:
3236
3237 $Arguments:
3238
3239 *******************************************************************************/
3240
3241
3242
3243
3244 int idleIsFocussed(void)
3245 {
3246
3247 if (winIsFocussed(idle_data.win))
3248 {
3249 TRACE_EVENT("idleIsFocussed");
3250 return 1;
3251 }
3252 else
3253 return 0;
3254
3255
3256 }
3257
3258 /*******************************************************************************
3259
3260 $Function: addMissedCall
3261
3262 $Description:
3263
3264 $Returns:
3265
3266 $Arguments:
3267
3268 *******************************************************************************/
3269
3270
3271
3272
3273 void addMissedCall(void)
3274 {
3275 idle_data.missedCalls++;
3276
3277 // show the info about missed calls on the idle screen
3278 idle_data.clean_screen = FALSE;
3279 }
3280 /*******************************************************************************
3281
3282 $Function: class0_editor_cb Added for issue 2512
3283
3284 $Description: CAllback for the class 0 editor. frees memory
3285
3286 $Returns: none
3287
3288 $Arguments: window(cast to string pointer), id, reason
3289
3290 *******************************************************************************/
3291 void class0_editor_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
3292 { U8* message_buffer;
3293 /*cast the window pointer to string buffer*/
3294 message_buffer = (U8*)win;
3295 /*free the memory*/
3296 FREE_MEMORY(message_buffer, MAX_EDITOR_LEN);
3297 message_buffer = NULL;
3298 // July 12, 2006 REF:DR OMAPS00081477 x0047075
3299 //Fix:Assigning the sms_status_editor window handle to NULL
3300 #ifdef NEW_EDITOR
3301 idle_data.sms_status_editor = NULL;
3302 #else/* NEW_EDITOR */
3303 idle_data.sms_status_edt = NULL;
3304 #endif /* NEW_EDITOR */
3305 /*redraw the windows*/
3306 windowsUpdate();
3307
3308
3309 }
3310 /*******************************************************************************
3311
3312 $Function: addCBCH
3313
3314 $Description: this indicates the incoming cell-info cellbroadcast
3315 or incoming sms class 0 message
3316 The Status tells about to show or not on the Idle screen
3317
3318 $Returns:
3319
3320 $Arguments:
3321
3322 *******************************************************************************/
3323 void addCBCH(char* cbch_string, UBYTE type)
3324 {
3325 /*SPR 2512*/
3326 #ifdef NEW_EDITOR
3327 T_AUI_EDITOR_DATA editor_data;
3328 #else /* NEW_EDITOR */
3329 T_EDITOR_DATA editor_data;
3330 #endif /* NEW_EDITOR */
3331 /*SPR 2512, end*/
3332 switch(type)
3333 {
3334 case IdleNewCBImmediateMessage:
3335 if(cbch_string NEQ NULL)
3336 {
3337 memset(idle_data.incoming_cb_msg, '\0',MAX_CBMSG_LEN);
3338 strncpy((char *)idle_data.incoming_cb_msg, (char *)cbch_string, MAX_CBMSG_LEN);
3339
3340 //Jun 24, 2005 MMI-FIX-30973 x0018858
3341 // Copy the tag string on to a global variable for display later.
3342 //Begin 30973
3343 memset(tag_zone, '\0',MAX_CBMSG_LEN);
3344 strncpy((char *)tag_zone, (char *)idle_data.incoming_cb_msg, MAX_CBMSG_LEN);
3345 tag_zone[MAX_CBMSG_LEN -1]= '\0';
3346 //End 30973
3347 /* SPR#1428 - SH - New Editor changes */
3348 #ifdef NEW_EDITOR
3349 if (!idle_data.editor)
3350 {
3351 idle_data.editor = ATB_edit_Create (&idle_data.editor_attr2,0);
3352 }
3353 /* xreddymn OMAPS00079699 Jun-02-2006
3354 * Do not re-initialize editor if it already exists.
3355 */
3356 else break;
3357 #else /* NEW_EDITOR */
3358 if (!idle_data.edt)
3359 {
3360 idle_data.edt = edtCreate (idle_data.win,&idle_data.edt_attr2,0,0);
3361 }
3362 /* xreddymn OMAPS00079699 Jun-02-2006
3363 * Do not re-initialize editor if it already exists.
3364 */
3365 else break;
3366 #endif /* NEW_EDITOR */
3367
3368 //this is centralize the cb message if it's a short one
3369 //12 cos CB messages have some space character after the string
3370 //it is just a estimate
3371 /* SPR#1428 - SH - New Editor changes. Use centralise
3372 * editor feature. */
3373 #ifdef NEW_EDITOR
3374 if ((strlen(cbch_string)) < 12)
3375 idle_data.editor_attr2.startFormat.attr |= DS_ALIGN_CENTRE;
3376 ATB_edit_Init(idle_data.editor);
3377 #else /* NEW_EDITOR */
3378 if ((strlen(cbch_string)) < 12)
3379 idle_data.edt_attr2.win.px = WIN_CENTRALIZE_ORG_X;
3380 else
3381 idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
3382 #endif /*NEW_EDITOR*/
3383 }
3384 else
3385 {
3386 /* SPR#1428 - SH - New Editor changes */
3387 #ifdef NEW_EDITOR
3388 if (idle_data.editor)
3389 {
3390 ATB_edit_Destroy(idle_data.editor);
3391 }
3392
3393 idle_data.editor_attr2.startFormat.attr = 0;
3394
3395 idle_data.editor = 0;
3396 #else /* NEW_EDITOR */
3397 if (idle_data.edt)
3398 {
3399 edtDelete(idle_data.edt);
3400 }
3401
3402 //set the centralize for the cb message to default
3403 idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
3404
3405 idle_data.edt = 0;
3406 #endif /*NEW_EDITOR */
3407 memset(idle_data.incoming_cb_msg, '\0',MAX_CBMSG_LEN);
3408 }
3409 break;
3410
3411 case IdleNewCBNormalMessage:
3412
3413 //set back to default
3414 idle_data.clean_screen = FALSE;
3415
3416 idle_data.new_cbch = TRUE;
3417 break;
3418
3419 /*NM p019*/
3420 case IdleNewSmsMessage:
3421 /*SPR 2512, show class 0 message as a pop-up*/
3422 #ifdef NEW_EDITOR
3423 // July 12, 2006 REF:DR OMAPS00081477 x0047075
3424 //Fix:Creating a new sms status editor, if it already exists just update the editor
3425 if(idle_data.sms_status_editor == NULL)
3426 {
3427 AUI_edit_SetDefault(&editor_data);
3428 AUI_edit_SetDisplay(&editor_data, ZONE_FULLSOFTKEYS, COLOUR_EDITOR_XX, EDITOR_FONT);
3429 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)cbch_string, strlen(cbch_string));
3430 AUI_edit_SetMode(&editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
3431 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtNull, TxtNull, NULL);
3432 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)class0_editor_cb);
3433 /*this casting of the message buffer allows it to be passed back via the editor callback function
3434 so we can free the memory when it's no longer needed. Yes, I know it's dodgy.*/
3435
3436 // July 12, 2006 REF:DR OMAPS00081477 x0047075
3437 //Fix:Creating a new sms status editor, if it already exists just update the editor
3438 idle_data.sms_status_editor = AUI_edit_Start((T_MFW_HND)cbch_string, &editor_data);
3439 }
3440 else
3441 {
3442 winShow (idle_data.sms_status_editor);
3443 }
3444
3445
3446 #else
3447 // July 12, 2006 REF:DR OMAPS00081477 x0047075
3448 //Fix:Creating a new sms status editor, if it already exists just update the editor
3449 if(idle_data.sms_status_edt == NULL)
3450 {
3451 editor_data.editor_attr.win.px = 0;
3452 editor_data.editor_attr.win.py = 0;
3453 editor_data.editor_attr.win.sx =
3454 SCREEN_SIZE_X-editor_data.editor_attr.win.px;
3455 editor_data.editor_attr.win.sy = SCREEN_SIZE_Y-2*Mmi_layout_first_line();
3456 editor_data.editor_attr.edtCol = COLOUR_EDITOR_XX,
3457 editor_data.editor_attr.font = 0;
3458 editor_data.editor_attr.mode = edtCurNone;
3459 editor_data.editor_attr.controls = 0;
3460 editor_data.hide = FALSE;
3461
3462 editor_data.editor_attr.text = (char*)cbch_string;
3463
3464 editor_data.editor_attr.size = strlen(cbch_string);
3465 editor_data.LeftSoftKey = TxtSoftOK;
3466 editor_data.RightSoftKey = TxtNull;
3467 editor_data.AlternateLeftSoftKey = TxtNull;
3468 editor_data.TextString = '\0';
3469 editor_data.TextId = TxtNull;
3470 editor_data.Identifier = NULL;
3471 editor_data.mode = READ_ONLY_MODE;
3472 editor_data.timeout = FOREVER;
3473 editor_data.min_enter = 1;
3474 editor_data.Callback = (T_EDIT_CB)NULL;
3475 editor_data.destroyEditor = TRUE;
3476 // July 12, 2006 REF:DR OMAPS00081477 x0047075
3477 //Fix:Creating a new sms status editor, if it already exists just update the editor
3478 idle_data.sms_status_edt = editor_start(idle_get_window(), &editor_data);
3479 }
3480 else
3481 {
3482 winShow (idle_data.sms_status_edt);
3483 }
3484
3485 #endif
3486 break;
3487
3488 }
3489
3490
3491 }
3492
3493 /*******************************************************************************
3494
3495 $Function: statusCBCH
3496
3497 $Description: if True -> keep it on the idle screen
3498 if FALSE -> remove the message (CB or SMS)
3499 and destroy the editor
3500
3501 $Returns:
3502
3503 $Arguments:
3504
3505 *******************************************************************************/
3506
3507 void statusCBCH(UBYTE status)
3508 {
3509 if(status)
3510 {
3511
3512 windowsUpdate();
3513
3514 }
3515 else
3516 {
3517
3518 //Dont show the CB on the Idle screen
3519
3520 idle_data.new_cbch = FALSE;
3521 /* SPR#1428 - SH - New Editor changes */
3522 #ifdef NEW_EDITOR
3523 if (idle_data.editor)
3524 ATB_edit_Destroy(idle_data.editor);
3525 idle_data.editor = 0;
3526
3527 //set the centralize for the cb message to default
3528 idle_data.editor_attr2.startFormat.attr = 0;
3529
3530 #else /* NEW_EDITOR */
3531 if (idle_data.edt)
3532 edtDelete(idle_data.edt);
3533 idle_data.edt = 0;
3534
3535 //set the centralize for the cb message to default
3536 idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
3537 #endif /*NEW_EDITOR */
3538 }
3539
3540
3541 }
3542
3543
3544 //xashmic 9 Sep 2006, OMAPS00092732
3545 #ifdef FF_MMI_USBMS
3546 /*******************************************************************************
3547
3548 $Function: mmi_usb_display_info
3549
3550 $Description: information dialog
3551
3552 $Returns: none
3553
3554 $Arguments: parent_win - parent window
3555 lsk - left softkey lable
3556 rsk - Right softkey lable
3557 str1 - String ID1
3558 str1 - String ID2
3559 *******************************************************************************/
3560 T_MFW_HND mmi_usb_display_info(T_MFW_HND parent_win,int lsk, int rsk, int str1, int str2, int timer)
3561 {
3562 T_MFW_HND win;
3563 T_DISPLAY_DATA display_info;
3564 TRACE_FUNCTION("mmi_usb_display_info()");
3565 dlg_initDisplayData_TextId( &display_info, lsk, rsk, str1, str2, COLOUR_STATUS);
3566 dlg_initDisplayData_events( &display_info, NULL, timer, 0 );
3567 win=info_dialog (parent_win, &display_info);
3568 return win;
3569 }
3570
3571 /*******************************************************************************
3572
3573 $Function: mmi_usbms_mode_disconnect
3574
3575 $Description: Disconnect event handler
3576
3577 $Returns: none
3578
3579 $Arguments: none
3580
3581 *******************************************************************************/
3582 void mmi_usbms_mode_disconnect(void)
3583 {
3584 T_MFW_HND parent_win = mfwParent(mfw_header());
3585 TRACE_FUNCTION("mmi_usbms_mode_disconnect()");
3586
3587 //xashmic 27 Sep 2006, OMAPS00096389
3588 //xashmic 21 Sep 2006, OMAPS00095831
3589 //Skip the disconnect dialog display when ports are enumerated automatically
3590 if( getBootUpState() > 0 && (getUSBMSFlags() & MFW_USBMS_POPUP_ENABLE))
3591 mmi_usb_display_info(parent_win,TxtNull,TxtNull,TxtUSBDisconnect,TxtUSB,THREE_SECS);
3592 if(usb_opt_win)
3593 {
3594 //User has not selected any option, destroy the menu
3595 bookMenuDestroy(usb_opt_win);
3596 usb_opt_win=NULL;
3597 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
3598 //Stop the timer and delete it.
3599 if(usb_auto_enum_timer)
3600 {
3601 timStop(usb_auto_enum_timer);
3602 timDelete(usb_auto_enum_timer);
3603 usb_auto_enum_timer=NULL;
3604 }
3605 }
3606 //If PS was shutdown, enable it
3607 if(USB_Mode==TRUE)
3608 {
3609 sim_enable();
3610 SEND_EVENT(usb_dialog_win,DIALOG_DESTROY,0,0);
3611 }
3612 USB_Mode= FALSE;
3613 }
3614
3615 /*******************************************************************************
3616
3617 $Function: mmi_usbms_mode_connect
3618
3619 $Description: Connect event handler
3620
3621 $Returns: none
3622
3623 $Arguments: usbms_enum - contains information as to proceed with enumeration or to
3624 discontinue enumeration: MFW_USB_ENUM or MFW_USB_NO_ENUM
3625 usb_enum_type - Contains information about which all port to be enumerated
3626 *******************************************************************************/
3627 void mmi_usbms_mode_connect(T_MFW_USB_ENUM_CONTROL usbms_enum,T_MFW_USB_ENUM_TYPE usb_enum_type)
3628 {
3629 T_MFW_HND parent_win = mfwParent(mfw_header());
3630 TRACE_FUNCTION("mmi_usbms_mode_connect()");
3631
3632 //xashmic 27 Sep 2006, OMAPS00096389
3633 //When enumerating USB MS individually or with a combination of other ports,
3634 if( (usbms_enum == MFW_USB_ENUM) &&
3635 ( ( usb_enum_type == MFW_USB_TYPE_MS) || (usb_enum_type == MFW_USB_TYPE_AT_MS) ||
3636 ( usb_enum_type == MFW_USB_TYPE_MS_TRACE) || (usb_enum_type == MFW_USB_TYPE_ALL) ) )
3637 {
3638 //For USBMS enumeration, if PS Shutdown option is set to TRUE, disable the PS
3639 if(FFS_flashData.usb_ms_flags & MFW_USBMS_PS_SHUTDOWN)
3640 {
3641 sim_disable();
3642 USB_Mode= TRUE;
3643 idle_set_starting_up(TRUE);
3644 //When PS shutdown is enabled, on enumerating USB MS, user is retricted for accessing any menu
3645 usb_dialog_win=mmi_usb_display_info( parent_win, TxtNull , TxtNull, TxtUSBMode, TxtNull,FOREVER );
3646 }
3647 else
3648 mmi_usb_display_info( parent_win, TxtNull , TxtNull, TxtUSBEnumeration, TxtPleaseWait,THREE_SECS );
3649 }
3650 else
3651 mmi_usb_display_info( parent_win, TxtNull , TxtNull, TxtUSBEnumeration, TxtPleaseWait,THREE_SECS );
3652 mfw_usbms_enum_control( usbms_enum,usb_enum_type );
3653 }
3654
3655 /*******************************************************************************
3656
3657 $Function: mmi_usb_enumeration_options_cb
3658
3659 $Description: Event handler for the option screen ( contains list of ports for enumeration on connect event)
3660
3661 $Returns: none
3662
3663 $Arguments: parent_win - Parent Window
3664 Identifier -
3665 Reason -
3666
3667 *******************************************************************************/
3668 void mmi_usb_enumeration_options_cb(T_MFW_HND parent_win, USHORT identifier, SHORT reason)
3669 {
3670 TRACE_FUNCTION("mmi_usb_enumeration_options_cb()");
3671
3672 mfw_usbms_enum_control(MFW_USB_NO_ENUM,MFW_USB_TYPE_ALL);
3673 usb_opt_win=NULL;
3674
3675 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
3676 //Stop the timer and delete it. User has pressed back in the options menu
3677 if(usb_auto_enum_timer)
3678 {
3679 timStop(usb_auto_enum_timer);
3680 timDelete(usb_auto_enum_timer);
3681 usb_auto_enum_timer=NULL;
3682 }
3683 }
3684 /*******************************************************************************
3685
3686 $Function: mmi_usb_enumeration_timer_cb
3687
3688 $Description: Event handler for the timer in option screen
3689
3690 $Returns: none
3691
3692 $Arguments: parent_win - Parent Window
3693 Identifier -
3694 Reason -
3695 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
3696 *******************************************************************************/
3697 static void mmi_usb_enumeration_timer_cb(T_MFW_HND parent_win, USHORT identifier, SHORT reason)
3698 {
3699
3700 T_MFW_HND window = mfwParent( mfw_header() );
3701 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
3702 tBookStandard *data = (tBookStandard *) win_data->user;
3703 MfwMnu *mnu;
3704
3705 TRACE_FUNCTION("mmi_usb_enumeration_timer_cb()");
3706 if(usb_opt_win && data->menu==((tBookStandard*)(((MfwWin*)(((T_MFW_HDR *)usb_opt_win)->data))->user))->menu) // OMAPS00149237 Added by Sameer & Geetha
3707 {
3708 mnuSelect( data->menu ); //OMAPS00149237
3709 bookMenuDestroy(usb_opt_win);
3710 usb_opt_win=NULL;
3711 }
3712
3713 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
3714 //Timer has expired, need to enumerate all ports automatically
3715 if(usb_auto_enum_timer)
3716 {
3717 timDelete(usb_auto_enum_timer);
3718 usb_auto_enum_timer=NULL;
3719 }
3720 mmi_usbms_mode_connect(MFW_USB_ENUM,MFW_USB_TYPE_ALL);
3721 }
3722
3723 /*******************************************************************************
3724
3725 $Function: mmi_usb_enumeration_options
3726
3727 $Description: Displays a list of ports that can be enumerated
3728
3729 $Returns: none
3730
3731 $Arguments: none
3732
3733 *******************************************************************************/
3734 void mmi_usb_enumeration_options(void)
3735 {
3736 TRACE_FUNCTION("mmi_usb_enumeration_options()");
3737
3738 usb_opt_win=bookMenuStart(idle_data.win, USBMenuAttributes(),0);
3739 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
3740 //Enumerate all the ports if user does not select any option/exit this menu within 5 Sec
3741 usb_auto_enum_timer=timCreate(usb_opt_win, AUTO_USB_ENUMERATION_TIMER, (MfwCb)mmi_usb_enumeration_timer_cb);
3742 timStart(usb_auto_enum_timer);
3743
3744 SEND_EVENT(usb_opt_win, ADD_CALLBACK, NULL, (void *)mmi_usb_enumeration_options_cb);
3745 }
3746
3747 /*******************************************************************************
3748
3749 $Function: setUSBMS
3750
3751 $Description: Updates the FFs with user selected option for PS shutdwon on / off
3752
3753 $Returns: none
3754
3755 $Arguments: m - pointer to current menu
3756 i - pointer to current menu item
3757
3758 xashmic 27 Sep 2006, OMAPS00096389
3759 *******************************************************************************/
3760 GLOBAL int setUSBMSPS (MfwMnu* m, MfwMnuItem* i)
3761 {
3762 T_MFW_HND parent_win = mfwParent(mfw_header());
3763
3764 TRACE_FUNCTION("setUSBMSPS()");
3765 switch (m->lCursor[m->level])
3766 {
3767 case 0:
3768 //Turn on the last bit in the byte
3769 FFS_flashData.usb_ms_flags = FFS_flashData.usb_ms_flags|MFW_USBMS_PS_SHUTDOWN;
3770 break;
3771 case 1:
3772 default:
3773 //Turn off the last bit in the byte
3774 FFS_flashData.usb_ms_flags = FFS_flashData.usb_ms_flags & MFW_USBMS_PS_NO_SHUTDOWN;
3775
3776 }
3777 TRACE_EVENT_P1(" %x",FFS_flashData.usb_ms_flags);
3778 mmi_usb_display_info(parent_win,TxtNull, TxtNull, TxtSaved, TxtNull,THREE_SECS);
3779 flash_write();
3780 return MFW_EVENT_CONSUMED;
3781 }
3782 /*******************************************************************************
3783
3784 $Function: setUSBMSPopup
3785
3786 $Description: Updates the FFs with user selected option for poping up menu on connect event
3787
3788 $Returns: none
3789
3790 $Arguments: m - pointer to current menu
3791 i - pointer to current menu item
3792 xashmic 27 Sep 2006, OMAPS00096389
3793 *******************************************************************************/
3794 GLOBAL int setUSBMSPopup (MfwMnu* m, MfwMnuItem* i)
3795 {
3796 T_MFW_HND parent_win = mfwParent(mfw_header());
3797
3798 TRACE_FUNCTION("setUSBMSPopup()");
3799 switch (m->lCursor[m->level])
3800 {
3801 case 0:
3802 FFS_flashData.usb_ms_flags = FFS_flashData.usb_ms_flags | MFW_USBMS_POPUP_ENABLE;
3803 break;
3804 case 1:
3805 default:
3806 FFS_flashData.usb_ms_flags = FFS_flashData.usb_ms_flags & MFW_USBMS_POPUP_DISABLE;
3807
3808 }
3809 TRACE_EVENT_P1(" %x",FFS_flashData.usb_ms_flags);
3810 mmi_usb_display_info(parent_win,TxtNull, TxtNull, TxtSaved, TxtNull,THREE_SECS);
3811 flash_write();
3812 return MFW_EVENT_CONSUMED;
3813 }
3814 /*******************************************************************************
3815
3816 $Function: mmi_usb_enumeration
3817
3818 $Description: Based on the user selection the USB ports are enumerated
3819
3820 $Returns: none
3821
3822 $Arguments: m - pointer to current menu
3823 i - pointer to current menu item
3824 *******************************************************************************/
3825 GLOBAL int mmi_usb_enumeration (MfwMnu* m, MfwMnuItem* i)
3826 {
3827 T_MFW_HND parent_win = mfwParent(mfw_header());
3828 T_MFW_USB_ENUM_CONTROL usbms_enum=MFW_USB_NO_ENUM;
3829 T_MFW_USB_ENUM_TYPE usb_enum_type=MFW_USB_TYPE_ALL;
3830 TRACE_FUNCTION("mmi_usb_enumeration()");
3831 //xashmic 14 Sep 2006, OMAPS00092732 HOT_FIX
3832 //Stop the timer and delete it. User has selected a option
3833 if(usb_auto_enum_timer)
3834 {
3835 timStop(usb_auto_enum_timer);
3836 timDelete(usb_auto_enum_timer);
3837 usb_auto_enum_timer=NULL;
3838 }
3839
3840 usbms_enum=MFW_USB_ENUM;
3841 switch (m->lCursor[m->level])
3842 {
3843 case 0:
3844 TRACE_EVENT("USB MS");
3845 usb_enum_type=MFW_USB_TYPE_MS;
3846 break;
3847 case 1:
3848 TRACE_EVENT("USB TRACE");
3849 usb_enum_type=MFW_USB_TYPE_TRACE;
3850 break;
3851 case 2:
3852 TRACE_EVENT("USB FAX");
3853 usb_enum_type=MFW_USB_TYPE_AT;
3854 break;
3855 case 3://xashmic 27 Sep 2006, OMAPS00096389
3856 TRACE_EVENT("USB MS FAX n TRACE");
3857 usb_enum_type=MFW_USB_TYPE_AT_TRACE;
3858 break;
3859 case 4://xashmic 27 Sep 2006, OMAPS00096389
3860 TRACE_EVENT("USB MS n TRACE");
3861 usb_enum_type=MFW_USB_TYPE_MS_TRACE;
3862 break;
3863 case 5://xashmic 27 Sep 2006, OMAPS00096389
3864 TRACE_EVENT("USB FAX n MS");
3865 usb_enum_type=MFW_USB_TYPE_AT_MS;
3866 break;
3867 case 6://xashmic 27 Sep 2006, OMAPS00096389
3868 TRACE_EVENT("USB ALL");
3869 usb_enum_type=MFW_USB_TYPE_ALL;
3870 break;
3871 }
3872 /*OMAPS00123019 a0393213(R.Prabakar)
3873 The menu is not destroyed here. It would be destroyed in the key board handler*/
3874 mmi_usbms_mode_connect(usbms_enum,usb_enum_type);
3875 return MFW_EVENT_CONSUMED;
3876 }
3877 /*******************************************************************************
3878
3879 $Function: getUSBMSFlags
3880
3881 $Description: return the current USB flags
3882
3883 $Returns: USB MS flags
3884
3885 $Arguments: None
3886 //xashmic 27 Sep 2006, OMAPS00096389
3887 *******************************************************************************/
3888 UBYTE getUSBMSFlags(void)
3889 {
3890 TRACE_EVENT_P1("getUSBMSFlags %x",FFS_flashData.usb_ms_flags);
3891 return FFS_flashData.usb_ms_flags;
3892 }
3893 #endif
3894
3895
3896 /*******************************************************************************
3897 $Function: addSatMessage
3898
3899 $Description: Store a SAT message to display on the idle screen.
3900 SPR759 - SH.
3901
3902 $Returns:
3903
3904 $Arguments: satMessage - the text of the message
3905
3906 *******************************************************************************/
3907
3908 // 09-Dec-2005, Shashi Shekar B.S., a0876501, START
3909 #ifdef FF_MMI_SAT_ICON
3910 void addSatMessage(char *satMessage, UBYTE width, UBYTE height,
3911 char *dst, UBYTE selfExplanatory, T_DISPLAY_TYPE display_type)
3912 #else
3913 void addSatMessage(char *satMessage)
3914 #endif
3915 {
3916 // 09-Dec-2005, Shashi Shekar B.S., a0876501, START
3917 #ifdef FF_MMI_SAT_ICON
3918 USHORT icon_length;
3919 #endif
3920
3921 /* SPR#1428 - SH - New Editor changes */
3922 #ifdef NEW_EDITOR
3923 if(satMessage NEQ NULL)
3924 {
3925 if(!idle_data.editor_sat)
3926 {
3927 idle_data.editor_sat = ATB_edit_Create(&idle_data.editor_attr_sat,0); /* Create the editor to hold it */
3928 }
3929
3930 // 09-Dec-2005, Shashi Shekar B.S., a0876501, START
3931 #ifdef FF_MMI_SAT_ICON
3932 if(selfExplanatory == FALSE)
3933 {
3934 /* xreddymn OMAPS00080543 Jun-06-2006 */
3935 memset(idle_data.incoming_sat_msg, '\0', MAX_SATMSG_LEN);
3936 strncpy((char *)idle_data.incoming_sat_msg, (char *)satMessage, MAX_SATMSG_LEN);
3937
3938 /* Centralize sat message if below 12 characters (so it doesn't look odd on the screen) */
3939
3940 if ((strlen(satMessage)) < 12)
3941 idle_data.editor_attr_sat.startFormat.attr |= DS_ALIGN_CENTRE;
3942 }
3943 else
3944 {
3945 /* Icon is self-explanatory. No need to display text for this case.
3946 Fill the idle text buffer with NULL*/
3947 /* xreddymn OMAPS00080543 Jun-06-2006 */
3948 memset(idle_data.incoming_sat_msg, '\0', MAX_SATMSG_LEN);
3949 }
3950
3951 /* Copy the data to the Editor title field & ATB editor will
3952 take care of displaying the Icon */
3953 if(dst != NULL)
3954 {
3955 idle_data.editor_sat->attr->TitleIcon.width = width;
3956 idle_data.editor_sat->attr->TitleIcon.height = height;
3957
3958 icon_length = width * height;
3959
3960 idle_data.editor_sat->attr->TitleIcon.data = (char *)ALLOC_MEMORY (icon_length);
3961
3962 memcpy(idle_data.editor_sat->attr->TitleIcon.data, dst, icon_length);
3963 idle_data.editor_sat->attr->TitleIcon.display_type = display_type; //x0035544 02-Feb-2006 DR:61468
3964 idle_data.editor_sat->attr->TitleIcon.isTitle = FALSE;
3965
3966 }
3967 #else
3968 /* xreddymn OMAPS00080543 Jun-06-2006 */
3969 memset(idle_data.incoming_sat_msg, '\0', MAX_SATMSG_LEN);
3970 strncpy((char *)idle_data.incoming_sat_msg, (char *)satMessage, MAX_SATMSG_LEN);
3971
3972 /* Centralize sat message if below 12 characters (so it doesn't look odd on the screen) */
3973
3974 if ((strlen(satMessage)) < 12)
3975 idle_data.editor_attr_sat.startFormat.attr |= DS_ALIGN_CENTRE;
3976
3977 #endif
3978
3979 ATB_edit_Init(idle_data.editor_sat);
3980
3981 }
3982 else /* If a null string is passed, get rid of the message */
3983 {
3984 if (idle_data.editor_sat)
3985 {
3986 // 02-Feb-2006, Sudha.V., x0035544
3987 #ifdef FF_MMI_SAT_ICON
3988 /* Check if a Idle mode text malloc was done for icon support, if Yes, free it*/
3989 if (idle_data.editor_sat->attr->TitleIcon.data != NULL)
3990 {
3991 FREE_MEMORY((U8 *)idle_data.editor_sat->attr->TitleIcon.data, idle_data.editor_sat->attr->TitleIcon.width *
3992 idle_data.editor_sat->attr->TitleIcon.height);
3993 idle_data.editor_sat->attr->TitleIcon.data = NULL;
3994 }
3995 #endif
3996 ATB_edit_Destroy(idle_data.editor_sat);
3997 }
3998
3999 //set the centralize for the cb message to default
4000 idle_data.editor_attr_sat.startFormat.attr = 0;
4001
4002 idle_data.editor_sat = NULL;
4003 /* xreddymn OMAPS00080543 Jun-06-2006 */
4004 memset(idle_data.incoming_sat_msg, '\0', MAX_SATMSG_LEN);
4005 }
4006 #else /* NEW_EDITOR */
4007 if(satMessage NEQ NULL)
4008 {
4009 if(!idle_data.edt_sat)
4010 {
4011 idle_data.edt_sat = edtCreate(idle_data.win,&idle_data.edt_attr_sat,0,0); // Create the editor to hold it
4012 }
4013 /* xreddymn OMAPS00080543 Jun-06-2006 */
4014 memset(idle_data.incoming_sat_msg, '\0', MAX_SATMSG_LEN);
4015 strncpy((char *)idle_data.incoming_sat_msg, (char *)satMessage, MAX_SATMSG_LEN);
4016
4017 //Centralize sat message if below 12 characters (so it doesn't look odd on the screen)
4018
4019 if ((strlen(satMessage)) < 12)
4020 idle_data.edt_attr_sat.win.px = (SCREEN_SIZE_X-strlen(idle_data.edt_attr_sat.text)*6)/2;
4021 else
4022 idle_data.edt_attr_sat.win.px = WIN_DIALLING_ORG_X;
4023 }
4024 else // If a null string is passed, get rid of the message
4025 {
4026 if (idle_data.edt_sat)
4027 {
4028 edtDelete(idle_data.edt_sat);
4029 }
4030
4031 //set the centralize for the cb message to default
4032 idle_data.edt_attr_sat.win.px = WIN_DIALLING_ORG_X;
4033
4034 idle_data.edt_sat = NULL;
4035 /* xreddymn OMAPS00080543 Jun-06-2006 */
4036 memset(idle_data.incoming_sat_msg, '\0', MAX_SATMSG_LEN);
4037 }
4038 #endif /* NEW_EDITOR */
4039 return;
4040 }
4041
4042 /*******************************************************************************
4043
4044 $Function: idleDialBuffer
4045
4046 $Description:
4047
4048 $Returns:
4049
4050 $Arguments:
4051
4052 *******************************************************************************/
4053
4054
4055 void idleDialBuffer(char* dialBuffer)
4056 {
4057 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
4058 strncpy((char*)idle_data.edt_buf,(char*)dialBuffer,sizeof(idle_data.edt_buf)-1);
4059 idle_dialling_start(idle_data.win,NULL);
4060 }
4061
4062
4063 /*******************************************************************************
4064
4065 $Function: windowsUpdate
4066
4067 $Description:
4068
4069 $Returns:
4070
4071 $Arguments:
4072
4073 *******************************************************************************/
4074
4075
4076 void windowsUpdate(void)
4077 {
4078 TRACE_FUNCTION("Idle_update()");
4079 winShow(idle_data.win);
4080
4081
4082 }
4083
4084
4085
4086 /*******************************************************************************
4087
4088 $Function: idle_dialling_create
4089
4090 $Description:
4091
4092 $Returns:
4093
4094 $Arguments:
4095
4096 *******************************************************************************/
4097
4098
4099 T_MFW_HND idle_dialling_create (T_MFW_HND parent_window)
4100 {
4101 T_MFW_WIN * win;
4102
4103 /*
4104 * This window is dynamic, for that reason the associated data are allocated in the mfw heap
4105 */
4106
4107 T_idle_dialling * data = (T_idle_dialling *)ALLOC_MEMORY (sizeof (T_idle_dialling));
4108
4109 TRACE_FUNCTION ("idle_dialling_create");
4110
4111 /*
4112 * Create window handler
4113 */
4114
4115 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_dialling_win_cb);
4116
4117 if (data->win EQ 0)
4118 return 0;
4119
4120 /*
4121 * These assignments are necessary to attach the data to the window, and to handle the mmi event communication.
4122 */
4123
4124 data->mmi_control.dialog = (T_DIALOG_FUNC)idle_dialling;
4125 data->mmi_control.data = data;
4126 win = ((T_MFW_HDR *)data->win)->data;
4127 win->user = (void *) data;
4128
4129 /*
4130 * Create any other handler
4131 */
4132 /* SPR#1428 - SH - New Editor changes */
4133 #ifdef NEW_EDITOR
4134 data->editor = ATB_edit_Create(&idle_data.editor_attr, 0);
4135 #else /* NEW_EDITOR */
4136 data->edt = edtCreate (data->win,&idle_data.edt_attr,0,0);
4137 #endif /* NEW_EDITOR */
4138 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)idle_dialling_kbd_cb);
4139 data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_dialling_kbd_long_cb);
4140
4141
4142 //winShow(data->win);
4143 /*
4144 * return window handle
4145 */
4146 return data->win;
4147 }
4148
4149
4150
4151 /*******************************************************************************
4152
4153 $Function: idle_dialling_destroy
4154
4155 $Description:
4156
4157 $Returns:
4158
4159 $Arguments:
4160
4161 *******************************************************************************/
4162
4163
4164
4165 void idle_dialling_destroy (T_MFW_HND own_window)
4166 {
4167 T_MFW_WIN * win;
4168 T_idle_dialling * data;
4169
4170 TRACE_FUNCTION("idle_dialling_destroy");
4171
4172 /*SPR 2500*/
4173 win = ((T_MFW_HDR *)own_window)->data;
4174 data = (T_idle_dialling *)win->user;
4175
4176 #ifdef NEPTUNE_BOARD
4177 memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf)); /* OMAPS00033660 */
4178 #endif
4179
4180 if ((own_window) &&
4181 (win) &&
4182 (data))
4183 {
4184 /* xreddymn OMAPS00075852 May-15-2006
4185 * When destroying the dialer, set the dialer_visible flag to FALSE.
4186 */
4187 idle_data.dialer_visible = FALSE;
4188
4189 /*
4190 * Exit Keyboard Handler
4191 */
4192 /*NM, 26.3.02*/
4193 /* SPR#1428 - SH - New Editor changes */
4194 #ifdef NEW_EDITOR
4195 ATB_edit_Destroy(data->editor);
4196 #else/* NEW_EDITOR */
4197 edt_delete(data->edt);
4198 #endif /* NEW_EDITOR */
4199 kbd_delete(data->kbd);
4200 kbd_delete(data->kbd_long);
4201 /*
4202 * Delete WIN Handler
4203 */
4204 win_delete (data->win);
4205
4206 /*
4207 * In this case the data attached to window must be also deleted.
4208 */
4209 FREE_MEMORY ((void *)data, sizeof (T_idle_dialling));
4210 }
4211 else
4212 {/*SPR2500*/
4213 TRACE_ERROR("idle_dialling_destory : Invalid pointer");
4214 }
4215
4216 }
4217
4218
4219 /*******************************************************************************
4220
4221 $Function: idle_dialling_start
4222
4223 $Description: This function just creates and inits the new dialog
4224
4225 $Returns:
4226
4227 $Arguments:
4228
4229 *******************************************************************************/
4230
4231
4232
4233
4234 T_MFW_HND idle_dialling_start (T_MFW_HND win_parent,char *character)
4235 {
4236
4237
4238 T_MFW_HND win = idle_dialling_create (win_parent);
4239
4240 TRACE_FUNCTION("idle_dialling_start");
4241
4242 /* xreddymn OMAPS00075852 May-15-2006
4243 * When creating the dialer, set the dialer_visible flag to TRUE.
4244 */
4245 idle_data.dialer_visible = TRUE;
4246
4247 if (win NEQ NULL)
4248 {
4249 SEND_EVENT(win,IDLE_DIALLING_INIT,0,(char*)character);
4250 }
4251 return win;
4252
4253 }
4254
4255
4256
4257 /*******************************************************************************
4258
4259 $Function: idle_dialling
4260
4261 $Description:
4262
4263 $Returns:
4264
4265 $Arguments:
4266
4267 *******************************************************************************/
4268
4269
4270
4271 void idle_dialling (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
4272 {
4273 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
4274 T_idle_dialling * data = (T_idle_dialling *)win_data->user;
4275
4276 TRACE_FUNCTION ("idle_dialling()");
4277 /*
4278 * In this case the communication is very simple (only one intern event)
4279 */
4280
4281 //GW Use macros for screen size
4282 switch (event)
4283 {
4284 case IDLE_DIALLING_INIT:
4285 /* SPR#1428 - SH - New Editor changes */
4286 #ifdef NEW_EDITOR
4287 AUI_edit_SetAttr(&idle_data.editor_attr, WIN_DIALLING, COLOUR_EDITOR_XX, EDITOR_FONT, 0, ED_CURSOR_UNDERLINE, ATB_DCS_ASCII, (UBYTE*)idle_data.edt_buf,EDITOR_SIZE);
4288
4289 ATB_edit_Init(data->editor);
4290
4291 ATB_edit_Unhide(data->editor);
4292 ATB_edit_Char(data->editor, ctrlBottom, TRUE);
4293 #else /* NEW_EDITOR */
4294 bookSetEditAttributes(WIN_DIALLING,COLOUR_EDITOR_XX,0,edtCurBar1,0,(char*)idle_data.edt_buf,EDITOR_SIZE,&idle_data.edt_attr);
4295
4296 /* NM 13.03 fast-edit */
4297 editActivate (data->edt,FALSE);
4298
4299 edtUnhide(data->edt);
4300 edtChar(data->edt,ecBottom);
4301 #endif /* NEW_EDITOR */
4302 winShow(data->win);
4303 break;
4304 default:
4305 return;
4306 }
4307
4308 }
4309
4310
4311
4312 /*******************************************************************************
4313
4314 $Function: idle_dialling_win_cb
4315
4316 $Description:
4317
4318 $Returns:
4319
4320 $Arguments:
4321
4322 *******************************************************************************/
4323
4324
4325 static int idle_dialling_win_cb (MfwEvt evt, MfwWin *win)
4326 {
4327 T_idle_dialling * data = (T_idle_dialling *)win->user;
4328
4329 TRACE_FUNCTION ("idle_dialling_win_cb()");
4330 switch (evt)
4331 {
4332 case MfwWinVisible:
4333 /* SPR#1428 - SH - New Editor changes */
4334 #ifdef NEW_EDITOR
4335 /* If update is trivial, don't update what's underneath */
4336 if (data->editor->update!=ED_UPDATE_TRIVIAL)
4337 {
4338 idle_draw_main_idle();
4339 displaySoftKeys(TxtNames,TxtDelete);
4340 }
4341 ATB_edit_Show(data->editor);
4342
4343 data->editor->update = ED_UPDATE_DEFAULT;
4344 #else /* NEW_EDITOR */
4345 idle_draw_main_idle();
4346 edtShow(data->edt);
4347 displaySoftKeys(TxtNames,TxtDelete);
4348 #endif /* NEW_EDITOR */
4349 break;
4350 default:
4351 return 0;
4352 }
4353
4354 return 1;
4355 }
4356
4357
4358 //#if defined (MMI_EM_ENABLED)
4359 #ifdef MMI_EM_ENABLED
4360 //#ifndef (NEPTUNE_BOARD)
4361 #ifndef NEPTUNE_BOARD
4362 /* This is not valid for Neptune Engineering Mode, hence*/
4363
4364 /*******************************************************************************
4365
4366 $Function: screen_capture_dialog_cb
4367
4368 $Description: Call back for the screen capture key assignment dialog
4369 xrashmic 22 Aug, 2004 MMI-SPR-32798
4370
4371 $Returns:
4372
4373 $Arguments:
4374
4375 *******************************************************************************/
4376 static void screen_capture_dialog_cb( T_MFW_HND win, USHORT Identifier,UBYTE reason)
4377 {
4378 switch(reason)
4379 {
4380 case INFO_KCD_LEFT:
4381 screenCaptureKey=KCD_LEFT;
4382 break;
4383 case INFO_KCD_RIGHT:
4384 screenCaptureKey=KCD_RIGHT;
4385 break;
4386 case INFO_KCD_HUP:
4387 screenCaptureKey=KCD_HUP;
4388 break;
4389 case INFO_KCD_UP:
4390 dialog_info_destroy (screen_capture_win);
4391 screenCaptureKey=KCD_MNUUP;
4392 break;
4393 case INFO_KCD_DOWN:
4394 dialog_info_destroy (screen_capture_win);
4395 screenCaptureKey=KCD_MNUDOWN;
4396 break;
4397 case INFO_KCD_OFFHOOK:
4398 screenCaptureKey=KCD_CALL;
4399 break;
4400 case INFO_KCD_ALL:
4401 screenCaptureKey=Identifier;
4402 break;
4403 default:
4404 screenCaptureKey=KCD_NONE;
4405 }
4406
4407 }
4408
4409 /*******************************************************************************
4410
4411 $Function: screen_capture_dialog
4412
4413 $Description: Dialog to set a key for screen capture
4414 xrashmic 22 Aug, 2004 MMI-SPR-32798
4415
4416
4417 $Returns:
4418
4419 $Arguments:
4420
4421 *******************************************************************************/
4422
4423 void screen_capture_dialog(void)
4424 {
4425 T_DISPLAY_DATA display_info;
4426 T_MFW_HND parent_win = mfwParent(mfw_header());
4427
4428 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull, TxtNull, COLOUR_WAP_POPUP);
4429 display_info.TextString="Press a key";
4430 display_info.TextString2="For screen capture";
4431 dlg_initDisplayData_events( &display_info,(T_VOID_FUNC)screen_capture_dialog_cb, FOREVER,KEY_ALL );
4432 display_info.Identifier = 0;
4433 screen_capture_win=info_dialog(parent_win, &display_info);
4434 dspl_Enable(0);
4435 win_show(screen_capture_win);
4436 dspl_Enable(1);
4437 }
4438 #endif /* NEPTUNE_BOARD */
4439 #endif
4440
4441 /*******************************************************************************
4442
4443 $Function: idle_dialling_kbd_cb
4444
4445 $Description:
4446
4447 $Returns:
4448
4449 $Arguments:
4450
4451 *******************************************************************************/
4452
4453
4454 static int idle_dialling_kbd_cb (MfwEvt e, MfwKbd *k)
4455 {
4456 /*
4457 * The following lines describe the common method to extract the data from the window. This mfw_parent(mfw_header())
4458 * construction captures the current mfw handled window.
4459 */
4460 T_MFW_HND win = mfw_parent (mfw_header());
4461 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
4462 T_idle_dialling *data = (T_idle_dialling *)win_data->user;
4463 T_MFW_SS_RETURN ssRes;
4464 // T_MFW_PHB_ENTRY p_pEntry; // RAVI
4465 tMmiPhbData *current = (tMmiPhbData *)ALLOC_MEMORY (sizeof (tMmiPhbData ));
4466 U8 finishedHere = FALSE; /* SH- used to skip out part of function */
4467 int position = 0;
4468 char edt_buf_prov[EDITOR_SIZE];
4469 /* try to establish if we have information in the phone book
4470 */
4471
4472 #if 0 /* FreeCalypso */
4473 T_RV_RETURN_PATH return_path = {0, NULL};
4474 T_AUDIO_RET ret;
4475 int wei;
4476
4477 char *str1 = "/FFS/mmi/tones/a.amr";
4478 #endif
4479
4480 TRACE_FUNCTION ("idle_dialling_kbd_cb()");
4481
4482 /* SPR#1428 - SH - New Editor changes - By default, set this flag
4483 * so that only editor portion of idle screen is updated when a key is pressed. */
4484 #ifdef NEW_EDITOR
4485 data->editor->update = ED_UPDATE_TRIVIAL;
4486 #endif
4487
4488 switch (k->code)
4489 {
4490 case KCD_MNURIGHT:
4491 case KCD_MNUUP:
4492 /* SPR#1428 - SH - New Editor changes */
4493 #ifdef NEW_EDITOR
4494 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE);
4495 win_show(data->win);
4496 #else /* NEW_EDITOR */
4497 edtChar(data->edt,ecRight);
4498 #endif /* NEW_EDITOR */
4499 break;
4500
4501 case KCD_MNULEFT:
4502 case KCD_MNUDOWN:
4503 /* SPR#1428 - SH - New Editor changes */
4504 #ifdef NEW_EDITOR
4505 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE);
4506 win_show(data->win);
4507 #else /* NEW_EDITOR */
4508 edtChar(data->edt,ecLeft);
4509 #endif /* NEW_EDITOR */
4510 break;
4511
4512 case KCD_CALL:
4513 #ifdef JVJ_USSD_TEST
4514 {
4515 T_MFW_SS_USSD prov_ussd;
4516
4517 prov_ussd.len = strlen((char*)idle_data.edt_buf);
4518 memcpy(prov_ussd.ussd,(char*)idle_data.edt_buf,prov_ussd.len);
4519 prov_ussd.dcs = MFW_DCS_7bits;
4520 /* Jun 30, 2006 REF : OMAPS00083503 R.Prabakar
4521 Description : When USSD string is sent, MMI shows requesting screen forever
4522 Solution : We will send USSD string or call number only when we are in full service, unless it's an emergency number*/
4523 if(idle_data.nm_status == NETWORK_FULL_SERVICE || cm_check_emergency((UBYTE*)idle_data.edt_buf))
4524 ss_send_ussd(&prov_ussd);
4525 else
4526 bookInfoDialog("No network", NULL);
4527
4528 }
4529 #else
4530 /* Jun 30, 2006 REF : OMAPS00083503 R.Prabakar
4531 Description : When USSD string is sent, MMI shows requesting screen forever
4532 Solution : We will send USSD string or call number only when we are in full service, unless it's an emergency number*/
4533 if(idle_data.nm_status == NETWORK_FULL_SERVICE || cm_check_emergency((UBYTE*)idle_data.edt_buf))
4534 {
4535 callNumber((UBYTE*)idle_data.edt_buf);
4536 }
4537 else
4538 bookInfoDialog("No network", NULL);
4539 #endif
4540 idle_dialling_destroy(data->win);
4541 break;
4542
4543 case KCD_LEFT: /* call establishment */
4544 /* Ensure next update is a full update */
4545 #ifdef NEW_EDITOR
4546 data->editor->update = ED_UPDATE_DEFAULT;
4547 #endif
4548 if (bookPhoneBookLoading()==BOOK_SUCCESS)
4549 {
4550 T_MFW_HND phbk_win;
4551 phbk_win = bookPhonebookStart(idle_data.win,PhbkNameEnterIdle);
4552 SEND_EVENT( phbk_win, PHBK_SEND_NUMBER, 0,(char*)idle_data.edt_buf );
4553 }
4554 break;
4555
4556 case KCD_RIGHT:
4557 /* SPR#1428 - SH - New Editor changes */
4558 #ifdef NEW_EDITOR
4559 ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */
4560 win_show(data->win);
4561 #else /* NEW_EDITOR */
4562 edtChar(data->edt,ecBack);
4563 #endif /* NEW_EDITOR */
4564
4565 if (strlen(idle_data.edt_buf) <= 0)
4566 idle_dialling_destroy(data->win);
4567 break;
4568
4569 /* SPR#2342 - SH - HUP detroys editor */
4570 case KCD_HUP:
4571 idle_dialling_destroy(data->win);
4572
4573 break;
4574
4575 case KCD_0:
4576 case KCD_1:
4577 case KCD_2:
4578 case KCD_3:
4579 case KCD_4:
4580 case KCD_5:
4581 case KCD_6:
4582 case KCD_7:
4583 case KCD_8:
4584 case KCD_9:
4585 case KCD_STAR:
4586 /* SPR#1428 - SH - New Editor changes */
4587 #ifdef NEW_EDITOR
4588 ATB_edit_AsciiChar(data->editor, editControls[k->code], TRUE);
4589 win_show(data->win);
4590 #else /* NEW_EDITOR */
4591 edtChar(data->edt, editControls[k->code]);
4592 #endif /* NEW_EDITOR */
4593 break;
4594
4595 case KCD_HASH:
4596 /* SPR#1428 - SH - New Editor changes */
4597 #ifdef NEW_EDITOR
4598 ATB_edit_AsciiChar(data->editor, editControls[k->code], TRUE);
4599 win_show(data->win);
4600 #else /* NEW_EDITOR */
4601 edtChar(data->edt, editControls[k->code]);
4602 #endif /* NEW_EDITOR */
4603 memset(edt_buf_prov,'\0',sizeof(edt_buf_prov));
4604 strcpy((char*)edt_buf_prov,(char*)idle_data.edt_buf);
4605
4606 #if 0 /* FreeCalypso */
4607 //hou peng test begin
4608 if(strcmp((char*)idle_data.edt_buf, "#1#") == 0)
4609 {
4610
4611 // rfs_test_01();
4612 }
4613 if(strcmp((char*)idle_data.edt_buf, "#2#") == 0)
4614 {
4615
4616 // rfs_test_02();
4617 }
4618 if(strcmp((char*)idle_data.edt_buf, "#3#") == 0)
4619 {
4620 int i=0;
4621 wefilename = (T_AUDIO_MMS_PLAY_FROM_FFS_PARAMETER*)mfwAlloc(sizeof(T_AUDIO_MMS_PLAY_FROM_FFS_PARAMETER)*80);
4622 convert_u8_to_unicode(str1, me_uc);
4623
4624 while (me_uc[i] != '\0')
4625 {
4626 wefilename->memo_name[i] = me_uc[i];
4627 i++;
4628 }
4629 wefilename->memo_name[i] = '\0'; // add end of string
4630
4631
4632 ret=audio_mms_play_from_ffs_start(wefilename,return_path);
4633 mfwFree((U8 *)wefilename,sizeof(T_AUDIO_MMS_PLAY_FROM_FFS_PARAMETER)*80);
4634 }
4635 if(strcmp((char*)idle_data.edt_buf, "#4#") == 0)
4636 {
4637
4638 audio_mms_play_from_ffs_stop();
4639 }
4640
4641 //hou peng test end
4642 #endif
4643 if(strcmp((char*)idle_data.edt_buf, "###520#") == 0)
4644 {
4645 ShowVersion(idle_data.win);
4646 idle_dialling_destroy(data->win);
4647 finishedHere = TRUE; /*sbh*/
4648 }
4649
4650 // #ifdef TI_PS_FF_EM
4651 #if defined (TI_PS_FF_EM) || defined (MMI_EM_ENABLED)
4652
4653 //xrashmic 22 Aug, 2004 MMI-SPR-32798
4654 //Using a dialog to take the input from the user for key to be used for screen capture.
4655 else if(strcmp((char*)idle_data.edt_buf, "###1234#") == 0)
4656 {
4657 #ifndef NEPTUNE_BOARD
4658 screen_capture_dialog();
4659 idle_dialling_destroy(data->win);
4660 #endif
4661 }
4662 else
4663 { /*MC, SPR1209 check for engineering mode code*/
4664 if (strcmp((char*)idle_data.edt_buf, "*36446337464#") == 0)
4665 {
4666 TRACE_EVENT("Engineering mode string");
4667 /*create menu*/
4668 mmi_em_start_eng_mode_menus(idle_data.win);
4669 idle_dialling_destroy(data->win);
4670 finishedHere = TRUE;
4671 }
4672 #endif
4673 else
4674 {
4675 ssRes = ss_check_ss_string((UBYTE*)edt_buf_prov);
4676 switch (ssRes)
4677 {
4678 case MFW_SS_USSD:
4679 case MFW_SS_SIM_LOCK:
4680 case MFW_SS_REG_PW:
4681 case MFW_SS_CF:
4682 case MFW_SS_CB:
4683 case MFW_SS_CLIR:
4684 case MFW_SS_CLIP:
4685 case MFW_SS_COLR:
4686 case MFW_SS_COLP:
4687 case MFW_SS_WAIT:
4688 case MFW_SS_HOLD:
4689 case MFW_SS_CCBS:
4690 finishedHere = TRUE; /* Handled on # */
4691 break;
4692 case MFW_SS_SIM_REG_PW:
4693 case MFW_SS_SIM_UNBLCK_PIN:
4694 gsm_idle(0,(char *)idle_data.edt_buf);
4695 idle_dialling_destroy(data->win);
4696 finishedHere = TRUE; /* Handled on # */
4697 break;
4698 case MFW_SS_MMI:
4699 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
4700 // guarding the code with the flag
4701 #ifndef FF_MMI_ATC_MIGRATION
4702 get_imei((char*)idle_data.imei);
4703 showIMEI(idle_data.win,(char*)idle_data.imei);
4704 #endif
4705 idle_dialling_destroy(data->win);
4706 finishedHere = TRUE; /* Handled on # */
4707 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
4708 // replaced the get_imei() with the mmi_imei_retrieve() - sAT_Dn()
4709 #ifdef FF_MMI_ATC_MIGRATION
4710 mmi_imei_retrieve();
4711 #endif
4712 break;
4713 /*MC, SPR 1111 handle language reset*/
4714 case MFW_SS_LANG_RESET:
4715 /*if language has been reset*/
4716 if (resources_reset_language((char*) idle_data.edt_buf) == TRUE)
4717 {
4718 bookShowInformation(idle_data.win,TxtDone,NULL,NULL);
4719 }
4720 else /*if current language English, don't show second Line in English*/
4721 {T_DISPLAY_DATA display_info;
4722
4723 /*SPR 1619, use new info dialog configuration functions*/
4724 if (Mmi_getCurrentLanguage() == ENGLISH_LANGUAGE)
4725 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, MmiRsrcGetText(TxtUnknownCode), NULL, COLOUR_POPUP);
4726 else
4727 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, MmiRsrcGetText(TxtUnknownCode), "Code Unknown", COLOUR_POPUP);
4728 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, SIX_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
4729 /* Call Info Screen
4730 */
4731 info_dialog( idle_data.win, &display_info );
4732 }
4733 /*MC end*/
4734 idle_dialling_destroy(data->win);
4735 finishedHere = TRUE;
4736 break;
4737
4738 case MFW_SS_DIAL:
4739 case MFW_SS_DIAL_IDX:
4740 case MFW_SS_DTMF:
4741 case MFW_SS_UNKNOWN:
4742 default:
4743 /* CQ16651 - NDH - Lines Deleted, Do not delete the entered character */
4744 break;
4745 }
4746 }
4747
4748 //#ifdef TI_PS_FF_EM
4749 #if defined (TI_PS_FF_EM) || defined (MMI_EM_ENABLED)
4750 }
4751 #endif
4752 /* SH - skip out this section if we recognised SS code */
4753
4754 if (!finishedHere)
4755 {
4756 //nm 450
4757 // this functions looks for shortcut
4758 sscanf(idle_data.edt_buf, "%d", &position);
4759 current->missedCallsOffset = 0;
4760 current->index = position;
4761 current->selectedName = 0;
4762 current->KindOfSearch = SEARCH_BY_LOCATION;
4763 current->status.book = bookActiveBook(READ);
4764 bookGetCurrentStatus( &(current->status) );
4765
4766 if((idle_data.edt_buf[0]!='*')&&(bookFindName( 1, current )== MFW_PHB_OK))
4767 { memset(idle_data.edt_buf,'\0',sizeof(idle_data.edt_buf));
4768
4769 strncpy((char*)idle_data.edt_buf,(char*)current->entry[0].number,sizeof(idle_data.edt_buf)-1);
4770 /* SPR#1428 - SH - New Editor changes */
4771 #ifdef NEW_EDITOR
4772 ATB_edit_Char(data->editor, ctrlBottom, TRUE);
4773 win_show(data->win);
4774 #else /* NEW_EDITOR */
4775 edtChar(data->edt,ecBottom);
4776 #endif /* NEW_EDITOR */
4777 }
4778 }
4779 break;
4780 default:
4781 break;
4782 }
4783 FREE_MEMORY ((void *)current, sizeof (tMmiPhbData));
4784 return MFW_EVENT_CONSUMED;
4785 }
4786
4787
4788
4789 /*******************************************************************************
4790
4791 $Function: idle_dialling_kbd_long_cb
4792
4793 $Description:
4794
4795 $Returns:
4796
4797 $Arguments:
4798
4799 *******************************************************************************/
4800
4801 static int idle_dialling_kbd_long_cb (MfwEvt e, MfwKbd *k)
4802 {
4803 T_MFW_HND win = mfw_parent (mfw_header());
4804 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4805 T_idle_dialling * data = (T_idle_dialling *)win_data->user;
4806
4807 TRACE_FUNCTION ("idle_dialling_kbd_long_cb");
4808
4809 if (e & KEY_LONG)
4810 {
4811 /* SPR#1428 - SH - New Editor - Long right soft keypress clears buffer */
4812 #ifdef NEW_EDITOR
4813 if ((e & KEY_RIGHT) || (e & KEY_CLEAR))
4814 #else /* NEW_EDITOR */
4815 if (e & KEY_CLEAR)
4816 #endif /* NEW_EDITOR */
4817 {
4818 idle_dialling_destroy(data->win);
4819 return MFW_EVENT_CONSUMED;
4820 }
4821 if (e & KEY_0)
4822 {
4823 /* SPR#1428 - SH - New Editor changes */
4824 #ifdef NEW_EDITOR
4825 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */
4826 ATB_edit_AsciiChar(data->editor, '+', TRUE);
4827 win_show(data->win);
4828 #else /* NEW_EDITOR */
4829 edtChar(data->edt,ecBack);
4830 edtChar(data->edt,'+');
4831 #endif /* NEW_EDITOR */
4832
4833 return MFW_EVENT_CONSUMED;
4834 }
4835 if (e & KEY_1)
4836 {
4837 /*OMAPS00106744 Dec 08,2006 a0393213(R.Prabakar)
4838 Description : Wrong string is displayed when pressing long [1]
4839 Solution : M_callVoice() was called which checks the voice mail number stored in flash
4840 Now menu_cphs_call_mailbox_number() is called which checks cphs4.2 file if it's present else it would call M_callVoice()*/
4841 if(strcmp(idle_data.edt_buf,"1")==0)
4842 {
4843 //long press on key 1 start to dial the voicemail
4844 menu_cphs_call_mailbox_number(NULL,NULL);
4845 return MFW_EVENT_CONSUMED;
4846 }
4847 }
4848 /* MZ cq11414 support for Pause seperator for DTMF strings. */
4849 if(e & KEY_STAR)
4850 {
4851 #ifdef NEW_EDITOR
4852 ATB_edit_DeleteLeft(data->editor, FALSE);
4853
4854 //Sep 2, 2004 REF: CRR 21370 xkundadu
4855 // Changed the long press of '*' to display 'w'.
4856
4857 ATB_edit_AsciiChar(data->editor, 'w', TRUE);
4858 win_show(data->win);
4859 #else /* NEW_EDITOR */
4860 /* MZ cq11414 add Pause Character */
4861 MfwEdt *edit = ((MfwHdr*) data->edt)->data;
4862 if((edit->cp) > 0) && (edit->attr->text[edit->cp-1] == '*'))
4863 {
4864 edtChar(data->edt,ecBack);
4865 }
4866
4867 //Sep 2, 2004 REF: CRR 21370 xkundadu
4868 //Changed the long press of '*' key to display 'w'.
4869 edtChar(data->edt,'w');
4870
4871 #endif /* NEW_EDITOR */
4872 return MFW_EVENT_CONSUMED;
4873 }
4874 if (e & KEY_HASH)
4875 {
4876 /* SPR#1428 - SH - New Editor changes */
4877 #ifdef NEW_EDITOR
4878 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */
4879
4880 //Sep 2, 2004 REF: CRR 21370 xkundadu
4881 // Changed the long press of '#' key to display 'p'.
4882 ATB_edit_AsciiChar(data->editor, 'p', TRUE);
4883 win_show(data->win);
4884 #else /* NEW_EDITOR */
4885 /* MZ cq11414 add Wait Character */
4886 MfwEdt *edit = ((MfwHdr*) data->edt)->data;
4887 if((edit->cp) > 0) && (edit->attr->text[edit->cp-1] == '#'))
4888 {
4889 edtChar(data->edt,ecBack);
4890 }
4891
4892 //Sep 2, 2004 REF: CRR 21370 xkundadu
4893 // Changed the long press of '#' to display 'p'.
4894
4895 edtChar(data->edt,'p');
4896
4897 #endif /* NEW_EDITOR */
4898 return MFW_EVENT_CONSUMED;
4899 }
4900
4901 }
4902 return MFW_EVENT_CONSUMED;
4903 }
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915 /*********************************************************************
4916 **********************************************************************
4917
4918 KEYPAD LOCKED EVENT WINDOW. IMPLEMENTATION
4919
4920 *********************************************************************
4921 **********************************************************************/
4922
4923
4924 /*******************************************************************************
4925
4926 $Function: idle_key_pad_locked_create
4927
4928 $Description:
4929
4930 $Returns:
4931
4932 $Arguments:
4933
4934 *******************************************************************************/
4935
4936
4937
4938 T_MFW_HND idle_key_pad_locked_create(MfwHnd parent_window){
4939
4940 T_MFW_WIN * win;
4941 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)ALLOC_MEMORY (sizeof (T_idle_key_pad_locked));
4942
4943 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_key_pad_locked_win_cb);
4944
4945 if (data->win EQ 0)
4946 return 0;
4947
4948 /*
4949 * Create window handler
4950 */
4951 data->mmi_control.dialog = (T_DIALOG_FUNC)idle_key_pad_locked;
4952 data->mmi_control.data = data;
4953 win = ((T_MFW_HDR *)data->win)->data;
4954 win->user = (void *) data;
4955 /*
4956 * Create any other handler
4957 */
4958
4959
4960
4961 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)idle_key_pad_locked_kbd_cb);
4962 data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_key_pad_locked_kbd_long_cb);
4963 /* SPR#1428 - SH - New Editor changes */
4964 #ifdef NEW_EDITOR
4965 AUI_edit_SetAttr(&idle_data.editor_attr, WIN_DIALLING, COLOUR_EDITOR_XX, EDITOR_FONT, 0, ED_CURSOR_UNDERLINE, ATB_DCS_ASCII, (UBYTE*)idle_data.edt_buf,EDITOR_SIZE);
4966 memset (idle_data.edt_buf,'\0',EDITOR_SIZE);
4967 data->editor = ATB_edit_Create(&idle_data.editor_attr,0);
4968 ATB_edit_Init(data->editor);
4969 #else /* NEW_EDITOR */
4970 data->edt = edtCreate(data->win,&idle_data.edt_attr,0,0);
4971 #endif /* NEW_EDITOR */
4972
4973 data->win_info = 0;
4974
4975 data->menuPressed = FALSE;
4976
4977 /*
4978 * return window handle
4979 */
4980 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
4981 /* SPR#1428 - SH - New Editor changes */
4982 #ifdef NEW_EDITOR
4983 ATB_edit_Reset(data->editor);
4984 #else /* NEW_EDITOR */
4985 edtReset(data->edt);
4986 #endif /* NEW_EDITOR */
4987 showKeyPadLocked = showNothing;
4988 winShow(data->win);
4989 return data->win;
4990 }
4991
4992
4993 /*******************************************************************************
4994
4995 $Function: idle_key_pad_locked_destroy
4996
4997 $Description:
4998
4999 $Returns:
5000
5001 $Arguments:
5002
5003 *******************************************************************************/
5004
5005
5006 void idle_key_pad_locked_destroy (T_MFW_HND own_window)
5007 {
5008 T_MFW_WIN * win;
5009 T_idle_key_pad_locked * data;
5010
5011 if (own_window)
5012 {
5013 win = ((T_MFW_HDR *)own_window)->data;
5014 data = (T_idle_key_pad_locked *)win->user;
5015
5016 if (data)
5017 {
5018 /*
5019 * Exit Keyboard Handler
5020 */
5021 /*
5022 * Delete WIN Handler
5023 */
5024 win_delete (data->win);
5025 }
5026 FREE_MEMORY ((void *)data, sizeof (T_idle_key_pad_locked));
5027 idle_data.klck_win = NULL;
5028 }
5029 }
5030
5031
5032 /*******************************************************************************
5033
5034 $Function: idle_key_pad_locked
5035
5036 $Description:
5037
5038 $Returns:
5039
5040 $Arguments:
5041
5042 *******************************************************************************/
5043
5044
5045 void idle_key_pad_locked (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
5046 {
5047 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
5048 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)win_data->user;
5049 U8* key_code;
5050 // UBYTE j; // RAVI
5051 // Nov 3, 2004 REF: CRR 25887 xkundadu
5052 //Description: Unable to make an emergency call.
5053 // Added this variable to check whether the entered digit is of length 2.
5054 BOOL bTwodigitECC = FALSE;
5055
5056
5057 TRACE_FUNCTION ("idle_key_pad_locked()");
5058
5059 switch (event)
5060 {
5061 case IDLE_KEYPAD_LOCKED_UPDATE:
5062 key_code = (U8*)parameter;
5063 switch (*key_code)
5064 {
5065
5066 case KCD_RIGHT:
5067 /* API - 10/10/02 - 1162 - Call the emergency Number if this is true
5068 */
5069 if (pin_idle_emerg_call == TRUE)
5070 {
5071 /* SPR#1428 - SH - New Editor changes */
5072 #ifdef NEW_EDITOR
5073 ATB_edit_Hide(data->editor);
5074 #else /* NEW_EDITOR */
5075 edtHide(data->edt);
5076 #endif /* NEW_EDITOR */
5077 callNumber((UBYTE*)idle_data.edt_buf);
5078
5079 /* SPR#1428 - SH - New Editor changes */
5080 #ifdef NEW_EDITOR
5081 ATB_edit_Reset(data->editor);
5082 #else /* NEW_EDITOR */
5083 edtReset(data->edt);
5084 #endif /* NEW_EDITOR */
5085 memset(idle_data.edt_buf,'\0',EDITOR_SIZE); /* sbh */
5086 memset(data->TempkeyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5087 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5088 showKeyPadLocked = showNothing;
5089 pin_idle_emerg_call = FALSE;
5090 }
5091 else
5092 {
5093 data->menuPressed = TRUE;
5094 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
5095 }
5096 break;
5097 case KCD_STAR:
5098 if (data->menuPressed)
5099 {
5100 TRACE_EVENT ("dactivate the KEYpad");
5101 settingsKeyPadLockOff();
5102 data->menuPressed = FALSE;
5103 idle_key_pad_locked_destroy(win);
5104 return;
5105 }
5106 else
5107 {
5108 /* SPR#1428 - SH - New Editor changes */
5109 #ifdef NEW_EDITOR
5110 ATB_edit_Hide(data->editor);
5111 ATB_edit_Reset(data->editor);
5112 #else /* NEW_EDITOR */
5113 edtHide(data->edt);
5114 edtReset(data->edt);
5115 #endif /* NEW_EDITOR */
5116 memset(data->TempkeyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5117 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5118 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
5119 showKeyPadLocked = showNothing;
5120 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
5121 }
5122 break;
5123 // Jul 23,2004 CRR:20895 xrashmic - SASKEN
5124 // Description: The keypad should not be unlocked by SEND and *, it
5125 // should be unlocked only by Menu and *
5126 // Fix: SEND key is now handled the same way as rest of the number
5127 // keys. Keypad unlock can be done only through MENU and *.
5128 case KCD_CALL:
5129
5130 case KCD_0:
5131 case KCD_1:
5132 case KCD_2:
5133 case KCD_8:
5134 case KCD_9:
5135 /* API - 10/10/02 - 1162 - Read the Idle KeyPadLock Buffer to see if the inputed valu
5136 is that of an emergency Number
5137 */
5138 data->menuPressed = FALSE;
5139 data->TempkeyPadLockBuf[0] = editControls[*key_code];
5140
5141 strcat((char*)data->keyPadLockBuf, (char*)data->TempkeyPadLockBuf);
5142 TRACE_EVENT_P1("data->keyPadLockBuf: %s",(char*)data->keyPadLockBuf);
5143
5144 if((strlen((char*)data->keyPadLockBuf) > 1) && (strlen((char*)data->keyPadLockBuf) < 4))
5145 {
5146 TRACE_EVENT("cm_check_emergency() TRACE IDLE 1");
5147
5148 // Nov 3, 2004 REF: CRR 25887 xkundadu
5149 //Description: Unable to make an emergency call.
5150 //Fix: Changed the code to make the emergency call when the
5151 // screen is locked.
5152
5153
5154 // Check whether the buffer contains any emergency number or not.
5155 // If the number is ECC then allow the user to make emergency call.
5156
5157 if ((cm_check_emergency((UBYTE*)data->keyPadLockBuf)==TRUE) ||
5158 (( strlen((char*)data->keyPadLockBuf) == ECC_LENGTH) &&
5159 (cm_check_emergency((UBYTE*)&data->keyPadLockBuf[1])==TRUE) &&
5160 (bTwodigitECC == TRUE))) // RAVI - Changed = to == in condition.
5161 {
5162 if(bTwodigitECC == TRUE)
5163 {
5164 // If the last digits form ECC, copy the digits to editor buffer.
5165 memcpy(idle_data.edt_buf, &data->keyPadLockBuf[1], KEYPADLOCK_BUF_SIZE-1);
5166 }
5167 else
5168 {
5169 strcpy((char*)idle_data.edt_buf,(char*)data->keyPadLockBuf);
5170 }
5171 showKeyPadLocked = showSOSCallKeyPadLocked;
5172 pin_idle_emerg_call = TRUE;
5173 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5174 winUpdate((MfwWin*)mfwControl(win));
5175 }
5176 else
5177 {
5178 /* SPR#1428 - SH - New Editor changes */
5179 #ifdef NEW_EDITOR
5180 ATB_edit_Hide(data->editor);
5181 ATB_edit_Reset(data->editor);
5182 #else /* NEW_EDITOR */
5183 edtHide(data->edt);
5184 edtReset(data->edt);
5185 #endif /* NEW_EDITOR */
5186
5187 // Nov 3, 2004 REF: CRR 25887 xkundadu
5188 //Description: Unable to make an emergency call.
5189 //Fix: Changed the code to make the emergency call when the
5190 // screen is locked.
5191 if(strlen((char *)data->keyPadLockBuf) >= 3)
5192 {
5193 //If the buffer length is greater than or equal to 3 ( i.e ECC_LENGTH)
5194 // remove the first character from the buffer. This is to check
5195 // whether the remaining characters are part of ECC.
5196 memcpy(&data->keyPadLockBuf[0], &data->keyPadLockBuf[1], KEYPADLOCK_BUF_SIZE-1);
5197 }
5198 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
5199 showKeyPadLocked = showNothing;
5200 pin_idle_emerg_call = FALSE;
5201 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
5202 winUpdate((MfwWin*)mfwControl(win));
5203 }
5204 }
5205 else
5206 {
5207 /* SPR#1428 - SH - New Editor changes */
5208 #ifdef NEW_EDITOR
5209 ATB_edit_Hide(data->editor);
5210 ATB_edit_Reset(data->editor);
5211 #else /* NEW_EDITOR */
5212 edtHide(data->edt);
5213 edtReset(data->edt);
5214 #endif /* NEW_EDITOR */
5215 if(strlen((char *)data->keyPadLockBuf) >= 3)
5216 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5217 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
5218 showKeyPadLocked = showNothing;
5219 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
5220 pin_idle_emerg_call = FALSE;
5221 winUpdate((MfwWin*)mfwControl(win));
5222 }
5223
5224 break;
5225
5226 // Sep 22, 2004 REF: CRR 23871 xkundadu
5227 // Description: Screen Locking: Unlocking screen is happening by other keys
5228 // Fix: handled the other key events except '*' not to unlock the keypad.
5229
5230 case KCD_HASH:
5231 case KCD_MNUDOWN:
5232 case KCD_MNUUP:
5233 case KCD_MNULEFT:
5234 case KCD_MNURIGHT:
5235 case KCD_MNUSELECT:
5236 case KCD_LEFT:
5237 case KCD_3:
5238 case KCD_4:
5239 case KCD_5:
5240 case KCD_6:
5241 case KCD_7:
5242 case KCD_HUP:
5243 // If the user presses key, other than MENU/RSK set the
5244 // menuPressed key to FALSE. This is done to avoid the
5245 // unlocking by keys except MENU and '*'.
5246 data->menuPressed = FALSE;
5247
5248
5249 default:
5250 data->menuPressed = FALSE;
5251
5252 /* SPR#1428 - SH - New Editor changes */
5253 #ifdef NEW_EDITOR
5254 ATB_edit_Hide(data->editor);
5255 ATB_edit_Reset(data->editor);
5256 #else /* NEW_EDITOR */
5257 edtHide(data->edt);
5258 edtReset(data->edt);
5259 #endif /* NEW_EDITOR */
5260 memset(idle_data.edt_buf,'\0',EDITOR_SIZE);
5261 memset(data->TempkeyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5262 memset(data->keyPadLockBuf,'\0',KEYPADLOCK_BUF_SIZE);
5263 showKeyPadLocked = showNothing;
5264 pin_idle_emerg_call = FALSE;
5265 //winUpdate((MfwWin*)mfwControl(win));
5266 data->win_info = idle_information_start(win,2000,showPressMenuStar,(T_VOID_FUNC)idle_info_destroy_cb);
5267 break;
5268 }
5269 break;
5270
5271 case IDLE_NEW_SMS:
5272 // show the info about incoming sms on the idle screen
5273 showKeyPadLocked = showNothing;
5274
5275 /* MZ 1942 remove the additional SMS received indication screen */
5276
5277 //data->win_info = idle_information_start(win,2000,showSMSNewMessage,(T_VOID_FUNC)idle_info_destroy_cb);
5278 windowsUpdate();
5279 break;
5280
5281 case IDLE_INFO_ENDED:
5282 data->win_info = 0;
5283 win_show(win);
5284 break;
5285
5286 // Sept 15, 2005 REF: CRR 32410 x0021334
5287 // Description: The keypad unlocks even though the unlocking sequence is not executed in quick succession.
5288 // Handle IDLE_KEYPAD_UNLOCK_TIMER_EXPIRED event.
5289 case IDLE_KEYPAD_UNLOCK_TIMER_EXPIRED:
5290 data->menuPressed = FALSE;
5291 break;
5292 default:
5293 return;
5294 }
5295
5296 }
5297
5298 /*******************************************************************************
5299
5300 $Function: idle_key_pad_locked_win_cb
5301
5302 $Description:
5303
5304 $Returns:
5305
5306 $Arguments:
5307
5308 *******************************************************************************/
5309
5310
5311
5312 static int idle_key_pad_locked_win_cb(MfwEvt e, MfwWin *w)
5313 {
5314
5315 // T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)w->user; // RAVI
5316
5317 TRACE_FUNCTION ("idle_key_pad_locked_win_cb()");
5318
5319 switch (e)
5320 {
5321 case MfwWinVisible:
5322 /*NM, p022*/
5323 showKeyPadLocked();
5324 break;
5325
5326 default:
5327 return 0;
5328 }
5329
5330 return 1;
5331 }
5332
5333
5334 /*******************************************************************************
5335
5336 $Function: idle_key_pad_locked_kbd_cb
5337
5338 $Description:
5339
5340 $Returns:
5341
5342 $Arguments:
5343
5344 *******************************************************************************/
5345
5346 static int idle_key_pad_locked_kbd_cb (MfwEvt e, MfwKbd *k)
5347 {
5348
5349 T_MFW_HND win = mfw_parent (mfw_header());
5350 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5351 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)win_data->user;
5352
5353 TRACE_FUNCTION ("idle_key_pad_locked_kbd_cb()");
5354
5355 SEND_EVENT(data->win,IDLE_KEYPAD_LOCKED_UPDATE,0,&k->code);
5356 return MFW_EVENT_CONSUMED;
5357
5358 }
5359
5360
5361
5362 /*******************************************************************************
5363
5364 $Function: idle_key_pad_locked_kbd_long_cb
5365
5366 $Description:
5367
5368 $Returns:
5369
5370 $Arguments:
5371
5372 *******************************************************************************/
5373
5374
5375
5376 static int idle_key_pad_locked_kbd_long_cb (MfwEvt e, MfwKbd *k)
5377 {
5378 return MFW_EVENT_CONSUMED;
5379 }
5380
5381
5382 /*******************************************************************************
5383
5384 $Function: showSOSCallKeyPadLocked
5385
5386 $Description:
5387
5388 $Returns:
5389
5390 $Arguments:
5391
5392 *******************************************************************************/
5393
5394
5395
5396
5397 static void showSOSCallKeyPadLocked(void)
5398 {
5399 TRACE_FUNCTION("showSOSCallKeyPadLocked");
5400 /*NM p022*/
5401
5402 /*SPR#2026 - DS - Set up colour for "Emergency?" screen */
5403 resources_setColour(COLOUR_EDITOR);
5404
5405 idle_displayData(IDLE_LOCKED_ECC,TxtEmergency,NULL);
5406 softKeys_displayId(TxtNull,TxtSoftCall,0,COLOUR_EDITOR); /*SPR#2026 - DS - Changed colour from COLOUR_IDLE */
5407 }
5408
5409
5410 /*******************************************************************************
5411
5412 $Function: showNothing
5413
5414 $Description:
5415
5416 $Returns:
5417
5418 $Arguments:
5419
5420 *******************************************************************************/
5421
5422
5423
5424 static void showNothing(void)
5425 {
5426 TRACE_FUNCTION("showNothing");
5427 }
5428
5429
5430
5431 /*******************************************************************************
5432
5433 $Function: showPressMenuStar
5434
5435 $Description:
5436
5437 $Returns:
5438
5439 $Arguments:
5440
5441 *******************************************************************************/
5442
5443
5444 static void showPressMenuStar(void)
5445 {
5446 TRACE_FUNCTION("showPressMenuStar");
5447
5448 idle_displayData(IDLE_LOCKED,TxtLocked,NULL);
5449 idle_displayData(IDLE_MENU_PRESS,TxtPressMenu,NULL);
5450
5451 }
5452
5453
5454 #if(0) /* x0039928 - Lint warning removal */
5455 /*******************************************************************************
5456
5457 $Function: showSMSNewMessage
5458
5459 $Description:
5460
5461 $Returns:
5462
5463 $Arguments:
5464
5465 *******************************************************************************/
5466
5467
5468 static void showSMSNewMessage(void)
5469 {
5470 char text[20];
5471 int txtStrId;
5472 int txtNo;
5473 int xOfs; //used to offset text id when a number is to be displayed
5474
5475 TRACE_FUNCTION("showSMSNewMessage");
5476
5477 dspl_Clear(WIN_DIALLING_ORG_X,Mmi_layout_line_icons(2),mmiScrX,Mmi_layout_second_line()+YLINE*2);
5478
5479 txtStrId = smsidle_display_sms_status(&txtNo );
5480
5481 //If data has been set up, then show it
5482 if (txtStrId != TxtNull)
5483 {
5484 if (txtNo != 0)
5485 {//we have a number to display - number of new messages/missed calls
5486 sprintf((char*)text,"%d",txtNo);
5487 dspl_TextOut(4,24,0,text);//always display numbeer as ascii
5488 if (txtNo < 10)
5489 xOfs = 12;
5490 else
5491 xOfs = 18;
5492 }
5493 else
5494 xOfs = 0;
5495
5496 dspl_TextOut(4+xOfs,24,DSPL_TXTATTR_CURRENT_MODE,GET_TEXT(txtStrId));//display as chinese or ascii
5497 }
5498
5499 displaySoftKeys(TxtNull,TxtNull);
5500 }
5501 #endif
5502
5503
5504
5505 /*********************************************************************
5506 **********************************************************************
5507
5508 Information WINDOW. IMPLEMENTATION
5509
5510 *********************************************************************
5511 **********************************************************************/
5512
5513
5514
5515 /*******************************************************************************
5516
5517 $Function: idle_information_create
5518
5519 $Description:
5520
5521 $Returns:
5522
5523 $Arguments:
5524
5525 *******************************************************************************/
5526
5527
5528
5529
5530 T_MFW_HND idle_information_create(MfwHnd parent_window){
5531
5532 T_MFW_WIN * win;
5533 T_idle_information * data = (T_idle_information *)ALLOC_MEMORY (sizeof (T_idle_information));
5534
5535 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_information_win_cb);
5536 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)idle_information_kbd_cb);
5537
5538 if (data->win EQ 0)
5539 return 0;
5540
5541 /*
5542 * Create window handler
5543 */
5544 data->mmi_control.dialog = (T_DIALOG_FUNC)idle_information;
5545 data->mmi_control.data = data;
5546 win = ((T_MFW_HDR *)data->win)->data;
5547 win->user = (void *) data;
5548 data->parent_win = parent_window;
5549 /*
5550 * Create any other handler
5551 */
5552
5553
5554
5555 /*
5556 * return window handle
5557 */
5558 return data->win;
5559
5560 }
5561
5562 /*******************************************************************************
5563
5564 $Function: idle_information_destroy
5565
5566 $Description:
5567
5568 $Returns:
5569
5570 $Arguments:
5571
5572 *******************************************************************************/
5573
5574
5575 void idle_information_destroy (T_MFW_HND own_window)
5576 {
5577 T_MFW_WIN * win;
5578 T_idle_information * data;
5579
5580 if (own_window)
5581 {
5582 win = ((T_MFW_HDR *)own_window)->data;
5583 data = (T_idle_information *)win->user;
5584
5585 if (data)
5586 {
5587 /*
5588 * Exit Keyboard Handler
5589 */
5590 /*
5591 * Delete WIN Handler
5592 */
5593 win_delete (data->win);
5594
5595 /* x0039928 - Lint warning fix */
5596 SEND_EVENT(data->parent_win,IDLE_INFO_ENDED,0,0);
5597 FREE_MEMORY ((void *)data, sizeof (T_idle_information));
5598 }
5599
5600 }
5601 }
5602
5603
5604 /*******************************************************************************
5605
5606 $Function: idle_information_start
5607
5608 $Description:
5609
5610 $Returns:
5611
5612 $Arguments:
5613
5614 *******************************************************************************/
5615
5616
5617
5618 T_MFW_HND idle_information_start(MfwHnd win_parent,S32 time,void (*show)(void),T_VOID_FUNC info_cb){
5619
5620
5621
5622 T_MFW_HND win = idle_information_create(win_parent);
5623
5624
5625 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
5626 T_idle_information * data = (T_idle_information *)win_data->user;
5627
5628
5629 data->timer = timCreate(win,time,(MfwCb)idle_information_tim_cb);
5630 data->info_cb = (T_VOID_FUNC)info_cb;
5631 timStart(data->timer);
5632 showInformation = show;
5633 winShow(win);
5634 return win;
5635 }
5636
5637
5638 /*******************************************************************************
5639
5640 $Function: idle_information
5641
5642 $Description:
5643
5644 $Returns:
5645
5646 $Arguments:
5647
5648 *******************************************************************************/
5649
5650
5651
5652
5653 void idle_information (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
5654 {
5655 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI
5656 // T_idle_information * data = (T_idle_information *)win_data->user; // RAVI
5657
5658 TRACE_FUNCTION ("idle_information()");
5659
5660 switch (event)
5661 {
5662 default:
5663 return;
5664 }
5665
5666 }
5667
5668
5669 /*******************************************************************************
5670
5671 $Function: idle_information_win_cb
5672
5673 $Description:
5674
5675 $Returns:
5676
5677 $Arguments:
5678
5679 *******************************************************************************/
5680
5681
5682
5683 static int idle_information_win_cb(MfwEvt e, MfwWin *w)
5684 {
5685
5686 TRACE_FUNCTION("idle_information_win_cb");
5687
5688
5689 switch (e)
5690 {
5691 case MfwWinVisible:
5692 showInformation();
5693 break;
5694 default:
5695 return 0;
5696 }
5697
5698 return 1;
5699 }
5700
5701
5702
5703 /*******************************************************************************
5704
5705 $Function: idle_information_kbd_cb
5706
5707 $Description:
5708
5709 $Returns:
5710
5711 $Arguments:
5712
5713 *******************************************************************************/
5714
5715
5716 static int idle_information_kbd_cb(MfwEvt e, MfwKbd *k)
5717 {
5718 T_MFW_HND win = mfw_parent (mfw_header());
5719 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5720 T_idle_information * data = (T_idle_information *)win_data->user;
5721 T_MFW_HND keypad_locked_win;
5722 U8 key_code;
5723
5724
5725 keypad_locked_win = data->parent_win;
5726 key_code = k->code;
5727 TRACE_FUNCTION("idle_information_kbd_cb");
5728 idle_information_destroy(data->win);
5729 SEND_EVENT(keypad_locked_win,IDLE_KEYPAD_LOCKED_UPDATE,0,&key_code);
5730 return MFW_EVENT_CONSUMED;
5731 }
5732
5733 #if (0) /* x0039928 - Lint warning removal */
5734 /*******************************************************************************
5735
5736 $Function: idle_information_kbd_long_cb
5737
5738 $Description:
5739
5740 $Returns:
5741
5742 $Arguments:
5743
5744 *******************************************************************************/
5745
5746
5747 static int idle_information_kbd_long_cb(MfwEvt e, MfwKbd *k)
5748 {
5749 return MFW_EVENT_CONSUMED;
5750 }
5751
5752 #endif
5753
5754
5755 /*******************************************************************************
5756
5757 $Function: idle_information_tim_cb
5758
5759 $Description:
5760
5761 $Returns:
5762
5763 $Arguments:
5764
5765 *******************************************************************************/
5766
5767
5768
5769 static int idle_information_tim_cb(MfwEvt e, MfwTim *t){
5770
5771 T_MFW_HND win = mfw_parent (mfw_header());
5772 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5773 T_idle_information * data = (T_idle_information *)win_data->user;
5774
5775 TRACE_FUNCTION("idle_information_tim_cb");
5776
5777 // Nov 3, 2004 REF: CRR 25887 xkundadu
5778 //Description: Unable to make an emergency call.
5779 //Fix: Changed the code to make the emergency call when the
5780 // screen is locked.
5781 // If the "keypad locked" message is timed out, reset the key pad buffer to NULL
5782 if(data != NULL)
5783 {
5784 T_MFW_WIN * mywin_data = ((T_MFW_HDR *) data->parent_win)->data;
5785 if(mywin_data != NULL)
5786 {
5787 T_idle_key_pad_locked * mydata = (T_idle_key_pad_locked *)mywin_data->user;
5788
5789 if(mydata->keyPadLockBuf != NULL)
5790 {
5791 // Set the buffer to null once the 'key locked' message
5792 //in the idle screen is timed out.
5793 memset(mydata->keyPadLockBuf, '\0', KEYPADLOCK_BUF_SIZE);
5794 }
5795 }
5796
5797 timStop(data->timer);
5798 data->info_cb(data->parent_win,NULL,NULL);
5799
5800 // Sept 15, 2005 REF: CRR 32410 x0021334
5801 // Description: The keypad unlocks even though the unlocking sequence is not executed in quick succession.
5802 // Send event to notify that the timer has expired.
5803 SEND_EVENT(data->parent_win, IDLE_KEYPAD_UNLOCK_TIMER_EXPIRED, 0, 0);
5804 }
5805 idle_information_destroy(win);
5806 windowsUpdate(); /* p303 - sbh */
5807 return 1;
5808 }
5809
5810
5811 /*******************************************************************************
5812
5813 $Function: idle_info_destroy_cb
5814
5815 $Description:
5816
5817 $Returns:
5818
5819 $Arguments:
5820
5821 *******************************************************************************/
5822
5823
5824
5825
5826 void idle_info_destroy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason){
5827
5828 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5829 T_idle_key_pad_locked * data = (T_idle_key_pad_locked *)win_data->user;
5830
5831 data->win_info = 0;
5832
5833 }
5834 /*******************************************************************************
5835
5836 $Function: showIMEI
5837
5838 $Description:
5839
5840 $Returns:
5841
5842 $Arguments:
5843
5844 *******************************************************************************/
5845
5846
5847 void showIMEI (T_MFW_HND win, char* IMEI)
5848 {
5849 T_DISPLAY_DATA display_info;
5850
5851 /* Marcus: Issue 1603: 28/01/2003: Replaced dlg_initDisplayData_TextId with dlg_initDisplayData_TextStr */
5852 dlg_initDisplayData_TextStr( &display_info, TxtSoftOK, TxtNull, MmiRsrcGetText(TxtIMEI), IMEI, COLOUR_STATUS);
5853 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)idle_imei_info_cb, FOREVER, KEY_CLEAR| KEY_LEFT );
5854
5855 /*
5856 * Call Info Screen
5857 */
5858
5859 idle_data.info_win = info_dialog (win, &display_info);
5860
5861 }
5862
5863 /*******************************************************************************
5864
5865 $Function: idle_imei_info_cb
5866
5867 $Description:
5868
5869 $Returns:
5870
5871 $Arguments:
5872
5873 *******************************************************************************/
5874
5875
5876
5877 static int idle_imei_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason)
5878 {
5879
5880
5881 switch (reason) {
5882 case INFO_KCD_HUP:
5883 case INFO_KCD_LEFT:
5884 break;
5885 }
5886
5887 return 1;
5888 }
5889
5890 /*******************************************************************************
5891
5892 $Function: Ciphering
5893
5894 $Description: Called by mfw
5895 Now this function doesn t seperate between the GSM and GPRS status
5896
5897 $Returns:
5898
5899 $Arguments:
5900
5901 *******************************************************************************/
5902 void idle_Ciphering (UBYTE gsm_ciph, UBYTE gprs_ciph)
5903 {
5904
5905
5906 if (gsm_ciph == 0 || gprs_ciph == 0)
5907 {
5908
5909 TRACE_FUNCTION ("Ciphering: is deactivated");
5910
5911 idle_data.ciphering = SHOW_CPRS_DEACTIV;
5912 //show the DEACTIVATED ciphering indication
5913 iconsSetState(iconIdCipheringDeActiv);
5914 iconsDeleteState(iconIdCipheringActiv);
5915
5916 }
5917 else if (gsm_ciph == 1 || gprs_ciph == 1)
5918 {
5919 //show the ACTIVATED ciphering indication
5920
5921 TRACE_EVENT ("Ciphering: is activated");
5922
5923 idle_data.ciphering = SHOW_CPRS_ACITV;
5924
5925 iconsSetState(iconIdCipheringActiv);
5926 iconsDeleteState(iconIdCipheringDeActiv);
5927 }
5928 else if (gsm_ciph == 2 || gprs_ciph == 2)
5929 {
5930 //dont show ANY indication !!!
5931
5932 TRACE_EVENT ("Ciphering: is disabled");
5933
5934 idle_data.ciphering = DONT_SHOW_CPRS;
5935
5936 iconsDeleteState(iconIdCipheringActiv);
5937 iconsDeleteState(iconIdCipheringDeActiv);
5938 }
5939
5940 //update the screen
5941 windowsUpdate();
5942
5943 }
5944
5945 /*******************************************************************************
5946
5947 $Function: showVersion
5948
5949 $Description: Displays the version of software and date
5950
5951 $Returns:
5952
5953 $Arguments:
5954
5955 *******************************************************************************/
5956 T_MFW_HND ShowVersion(T_MFW_HND parent_window)
5957 {
5958 T_MFW_HND win = ShowVersion_create(parent_window);
5959 TRACE_FUNCTION("ShowVerion()");
5960 if (win NEQ NULL)
5961 {
5962 SEND_EVENT (win, SHOWVERSION_INIT, 0, 0);
5963 }
5964
5965 return win;
5966 }
5967
5968 /*******************************************************************************
5969
5970 $Function: ShowVersion_create
5971
5972 $Description: creates the window
5973
5974 $Returns:
5975
5976 $Arguments:
5977
5978 *******************************************************************************/
5979 static T_MFW_HND ShowVersion_create(MfwHnd parent_window)
5980 {
5981 tShowVerion* data = (tShowVerion*)ALLOC_MEMORY (sizeof (tShowVerion));
5982 T_MFW_WIN * win;
5983
5984 if (data EQ NULL)
5985 {
5986 return NULL;
5987 }
5988
5989 // Create window handler
5990 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, NULL);
5991 if (data->win EQ NULL)
5992 {
5993
5994 return NULL;
5995 }
5996 // connect the dialog data to the MFW-window
5997 data->mmi_control.dialog = (T_DIALOG_FUNC)ShowVersion_DialogCB;
5998 data->mmi_control.data = data;
5999 win = ((T_MFW_HDR *)data->win)->data;
6000 win->user = (void *)data;
6001 data->parent_win = parent_window;
6002
6003 return data->win;
6004 }
6005
6006
6007 /*******************************************************************************
6008
6009 $Function: showVersion_DialogCB
6010
6011 $Description: CallBack Function
6012
6013 $Returns:
6014
6015 $Arguments:
6016
6017 *******************************************************************************/
6018 static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier,
6019 void *parameter)
6020 {
6021 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
6022 tShowVerion* data = (tShowVerion*) win_data->user;
6023 #ifdef NEW_EDITOR
6024 // T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ // RAVI - Not Used.
6025 #else
6026 // T_EDITOR_DATA editor_data; // RAVI - Not Used.
6027 #endif
6028
6029 TRACE_FUNCTION("ShowVersion_DialogCB()");
6030
6031 switch( e )
6032 { //when window first created
6033 case SHOWVERSION_INIT:
6034 {
6035
6036 #if 0 /* FreeCalypso */
6037 strcat(data->buffer, "Date:");
6038 strcat(data->buffer, date);
6039 strcat(data->buffer,"\n");
6040 strcat(data->buffer, "BMI:");
6041 strcat(data->buffer, bmi);
6042 strcat(data->buffer,"\n");
6043 strcat(data->buffer,"GPRS:");
6044 strcat(data->buffer, gprs);
6045 strcat(data->buffer,"\n");
6046 strcat(data->buffer,"TI:");
6047 strcat(data->buffer, ti);
6048 #else
6049 strcat(data->buffer, firmware_version_str);
6050 #endif
6051
6052 ShowVersionSetEditor(win);//set editor with default attribute values
6053
6054 /* SPR#1428 - SH - New Editor changes */
6055 #ifdef NEW_EDITOR
6056 AUI_edit_Start(win, &data->editor_data);
6057 #else /* NEW_EDITOR */
6058 editor_start(win, &(data->editor_data)); /* start the editor */
6059 #endif /* NEW_EDITOR */
6060
6061 winShow(data->win);
6062 }
6063 break;
6064
6065 default:
6066 {
6067 TRACE_EVENT("ShowVersion_DialogCB(): Unknown Event");
6068 }
6069 break;
6070
6071 }
6072
6073 }
6074
6075 /*******************************************************************************
6076
6077 $Function: ShowVersionSetEditor
6078
6079 $Description: Set the editor up
6080
6081 $Returns:
6082
6083 $Arguments:
6084
6085 *******************************************************************************/
6086 void ShowVersionSetEditor(T_MFW_HND win)
6087 {
6088 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
6089 tShowVerion* data = (tShowVerion*) win_data->user;
6090
6091 /* SPR#1428 - SH - New Editor changes */
6092 #ifdef NEW_EDITOR
6093 AUI_edit_SetDefault(&data->editor_data);
6094 AUI_edit_SetDisplay(&data->editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT);
6095 AUI_edit_SetEvents(&data->editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)ShowVerionCB);
6096 AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)data->buffer, 35);
6097 AUI_edit_SetMode(&data->editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
6098 AUI_edit_SetTextStr(&data->editor_data, TxtNull, TxtSoftBack, TxtNull, NULL);
6099 #else /* NEW_EDITOR */
6100 editor_attr_init(&((data->editor_data).editor_attr), NULL, edtCurNone, 0, (char *)data->buffer, 35, COLOUR_EDITOR);
6101 editor_data_init(&data->editor_data, NULL, TxtSoftBack, TxtNull, 0, 1, READ_ONLY_MODE, FOREVER);
6102 data->editor_data.hide = FALSE;
6103 data->editor_data.Identifier = 0;
6104 data->editor_data.TextString = NULL;
6105 data->editor_data.destroyEditor = TRUE;
6106 data->editor_data.Callback = (T_EDIT_CB)ShowVerionCB;
6107 #endif /* NEW_EDITOR */
6108 }
6109
6110 /*******************************************************************************
6111
6112 $Function: ShowVerionCB
6113
6114 $Description: Callback
6115
6116 $Returns:
6117
6118 $Arguments:
6119
6120 *******************************************************************************/
6121 static void ShowVerionCB( T_MFW_HND win, USHORT Identifier,UBYTE reason)
6122 {
6123 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
6124 tShowVerion*data = (tShowVerion*) win_data->user;
6125
6126
6127 TRACE_FUNCTION("ShowVerionCB()");
6128
6129 switch (reason )
6130 {
6131 case INFO_KCD_LEFT:
6132 case INFO_KCD_HUP:
6133 case INFO_KCD_RIGHT:
6134
6135 default:
6136 showVersion_destroy(data->win);
6137 break;
6138 }
6139 }
6140
6141 /*******************************************************************************
6142
6143 $Function: showVersion_destroy
6144
6145 $Description: Destroys the editor
6146
6147 $Returns:
6148
6149 $Arguments:
6150
6151 *******************************************************************************/
6152 void showVersion_destroy(MfwHnd own_window)
6153 {
6154 T_MFW_WIN * win_data;
6155
6156 tShowVerion* data = NULL;
6157
6158
6159 if (own_window == NULL)
6160 {
6161 TRACE_EVENT ("Error : showVersion_destroy called with NULL Pointer");
6162 return;
6163 }
6164
6165
6166 win_data = ((T_MFW_HDR *)own_window)->data;
6167 if (win_data != NULL)
6168 data = (tShowVerion*)win_data->user;
6169
6170 if (data)
6171 {
6172 TRACE_EVENT ("calc_destroy()");
6173
6174 win_delete (data->win);
6175 // Free Memory
6176 FREE_MEMORY ((void *)data, sizeof (tShowVerion));
6177
6178 }
6179 else
6180 {
6181 TRACE_EVENT ("calc_destroy() called twice");
6182 }
6183 }
6184 //GW 28/11/02 - debug only - to allod display.c to output a trace (for timing only)
6185 void mmi_trace( char* str)
6186 {
6187 TRACE_EVENT(str);/*a0393213 warnings removal-TRACE_FUNCTION changed to TRACE_EVENT*/
6188 }
6189
6190 //xrashmic 26 Aug, 2004 MMI-SPR-23931
6191 // To display the indication of new EMS in the idle screen
6192 void addNewEMS(void)
6193 {
6194 /* x0045876, 14-Aug-2006 (WR - "currentVoiceTone" was set but never used) */
6195 #ifndef FF_MIDI_RINGER
6196 #ifndef FF_MMI_RINGTONE
6197 UBYTE currentVoiceTone;
6198 #endif
6199 #endif
6200
6201 idle_data.ems=TRUE;
6202 //Apr 05, 2005 REF: ENH 29994 xdeepadh
6203 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
6204 //Play SMS tone for EMS alert
6205 #ifdef FF_MIDI_RINGER
6206 mfw_ringer_start(AS_RINGER_MODE_SMS,false,sounds_midi_ringer_start_cb);
6207 #else
6208
6209 /* x0045876, 14-Aug-2006 (WR - "currentVoiceTone" was set but never used) */
6210 /* currentVoiceTone = getcurrentVoiceTone(); */
6211
6212 #ifdef FF_MMI_RINGTONE /* MSL SMS Tone */
6213 audio_PlaySoundID( AUDIO_BUZZER, SMSTONE_SELECT, 200, AUDIO_PLAY_ONCE );
6214 #else
6215
6216 /* x0045876, 14-Aug-2006 (WR - "currentVoiceTone" was set but never used) */
6217 currentVoiceTone = getcurrentVoiceTone();
6218 audio_PlaySoundID( AUDIO_BUZZER, currentVoiceTone, 200, AUDIO_PLAY_ONCE );
6219 #endif
6220 #endif
6221 }
6222
6223 /*******************************************************************************
6224
6225 $Function: idle_opername_timer_cb
6226
6227 $Description: Callback for timer
6228
6229 $Returns:
6230
6231 $Arguments:
6232
6233 *******************************************************************************/
6234 //x0pleela 14 Feb, 2006 ER: OMAPS00065203
6235 int idle_opername_timer_cb( MfwEvt e, MfwTim *tc )
6236 {
6237 TRACE_FUNCTION("idle_opername_timer_cb()");
6238
6239 //Display text is changed to PLMN name and refresh idle screen
6240 opername_disp_flag = PLMN;
6241 idleEvent(IdleUpdate);
6242
6243 //Stop and delete timer
6244 if( plmn_display)
6245 {
6246 timStop(plmn_display);
6247 }
6248 return MFW_EVENT_CONSUMED;
6249 }
6250
6251 //x0pleela 23 Mar, 2007 ER :OMAPS00122561
6252 #ifdef FF_PHONE_LOCK
6253 /*******************************************************************************
6254
6255 $Function: idle_autoPhoneLock_timer_cb
6256
6257 $Description: Callback for timer
6258
6259 $Returns:
6260
6261 $Arguments:
6262
6263 *******************************************************************************/
6264 int idle_autoPhoneLock_timer_cb( MfwEvt e, MfwTim *tc )
6265 {
6266 TRACE_FUNCTION("idle_autoPhoneLock_timer_cb()");
6267
6268 //Stop and delete timer
6269 if( autoPhLock_timer)
6270 {
6271 timStop(autoPhLock_timer);
6272 autoPhLock_timer_flag= FALSE;
6273 //display phone unlock screen
6274 if( !phlock_win_handle )
6275 phLock_Lock();
6276 }
6277 return MFW_EVENT_CONSUMED;
6278 }
6279 #endif /*FF_PHONE_LOCK*/
6280
6281 #ifdef NEPTUNE_BOARD
6282 #ifdef MMI_POWER_MANAGEMENT_TEST
6283
6284 /*******************************************************************************
6285
6286 $Function: powerManagementEvent
6287
6288 $Description: Callback function for powermanagement timer..
6289
6290 $Returns: Event consumed
6291
6292 $Arguments: unused
6293 *******************************************************************************/
6294 int powerManagementEvent( MfwEvt e, MfwTim *tc )
6295 {
6296 TRACE_FUNCTION("powerManagementEvent");
6297 return MFW_EVENT_CONSUMED;
6298 }
6299
6300
6301
6302 /*******************************************************************************
6303
6304 $Function: mmi_update_pm_timer_duration
6305
6306 $Description: function for updating PM timer..
6307
6308 $Returns: void
6309
6310 $Arguments: void
6311 *******************************************************************************/
6312 void mmi_update_pm_timer_duration( )
6313 {
6314 TRACE_FUNCTION("mmi_update_pm_timer_duration");
6315
6316 /* Depending on the value set in pm duration we can enable / disable the pm variable */
6317 if(FFS_flashData.pm_duration /*&& idleIsFocussed() */ )
6318 {
6319 pm_on = 1;
6320 }
6321 else
6322 {
6323 pm_on = 0;
6324 dspl_Enable(1);
6325 }
6326 }
6327
6328 /*******************************************************************************
6329
6330 $Function: mmi_pm_enable
6331
6332 $Description: function to enable/disable Power Management .
6333
6334 $Returns: void
6335
6336 $Arguments: ENABLE/DISABLE value
6337 *******************************************************************************/
6338 void mmi_pm_enable( int enable_pm)
6339 {
6340 TRACE_FUNCTION("mmi_pm_enable()");
6341
6342 if(0 == enable_pm)
6343 {
6344 SVC_SCN_EnablePM( 0, 0);
6345 pm_on = 0;
6346 dspl_Enable(1);
6347 }
6348 else
6349 {
6350 if(/*idleIsFocussed() &&*/ FFS_flashData.pm_duration)
6351 {
6352 SVC_SCN_EnablePM( 1, FFS_flashData.pm_duration);
6353 pm_on = 1;
6354
6355 /* timStart(Pm_timer); */
6356 }
6357 }
6358
6359 }
6360
6361
6362 #endif
6363 #endif