comparison src/ui/bmi/mmiMain.c @ 66:74a034762083

mmiMain.c: white space initial preen
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 23 Oct 2020 01:22:30 +0000
parents 67bfe9f274f6
children 77321341946c
comparison
equal deleted inserted replaced
65:482ce95bc49c 66:74a034762083
1 /******************************************************************************* 1 /*******************************************************************************
2 2
3 CONDAT (UK) 3 CONDAT (UK)
4 4
5 ******************************************************************************** 5 ********************************************************************************
6 6
7 This software product is the property of Condat (UK) Ltd and may not be 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. 8 disclosed to any third party without the express permission of the owner.
25 25
26 26
27 ******************************************************************************** 27 ********************************************************************************
28 28
29 $History: MmiMain.c 29 $History: MmiMain.c
30 30
31 Nov 06, 2007 ER: OMAPS00151698 x0056422 31 Nov 06, 2007 ER: OMAPS00151698 x0056422
32 Description: 32 Description:
33 Solution 1) Need to suppress key beep sound for the commands that originated from the 33 Solution 1) Need to suppress key beep sound for the commands that originated from the
34 BT headset and were simulated as key events. This is done by adding a check 34 BT headset and were simulated as key events. This is done by adding a check
35 for BMI_BT_HEADSET_COMMAND in keyAction function, and do nothing inside if 35 for BMI_BT_HEADSET_COMMAND in keyAction function, and do nothing inside if
36 it is true. 36 it is true.
37 37
38 May 24, 2007 DR: OMAPS00132483 x0pleela 38 May 24, 2007 DR: OMAPS00132483 x0pleela
39 Description: MM: While playing an AAC, unplug USB freezes the audio 39 Description: MM: While playing an AAC, unplug USB freezes the audio
40 Solution: 1) Changed the function names to get and set the status of headset, usb insertion 40 Solution: 1) Changed the function names to get and set the status of headset, usb insertion
41 and removal 41 and removal
42 2) In function globalmme(), removed the function call to get the phonelock status during 42 2) In function globalmme(), removed the function call to get the phonelock status during
43 USB plug/unplug and headset plug/unplug event and inturn using a static variable 43 USB plug/unplug and headset plug/unplug event and inturn using a static variable
44 which gives the phonelock status. Replaced the function call mfw_get_phlock_status 44 which gives the phonelock status. Replaced the function call mfw_get_phlock_status
45 with mfw_get_Phlock_status to get the phone lock status 45 with mfw_get_Phlock_status to get the phone lock status
46 46
47 Apr 03, 2007 ER: OMAPS00122561 x0pleela 47 Apr 03, 2007 ER: OMAPS00122561 x0pleela
48 Description: [ACI] Phone lock feature has to be supported by ACI 48 Description: [ACI] Phone lock feature has to be supported by ACI
49 Solution: Phone Lock ER implementation 49 Solution: Phone Lock ER implementation
50 50
51 Mar 22, 2007 DVT: OMAPS00121916 x0039928(sumanth) 51 Mar 22, 2007 DVT: OMAPS00121916 x0039928(sumanth)
52 Description: T-Flash hot swap. 52 Description: T-Flash hot swap.
53 53
54 Jan 05, 2007 OMAPS00084665 x0039928(sumanth) 54 Jan 05, 2007 OMAPS00084665 x0039928(sumanth)
55 Description: Boot time exceed UCSD estimations 55 Description: Boot time exceed UCSD estimations
56 56
57 Oct 30, 2006 ER:OMAPS00098881 x0039928(sumanth) 57 Oct 30, 2006 ER:OMAPS00098881 x0039928(sumanth)
58 Removal of power variant 58 Removal of power variant
59 59
60 Oct 30, 2006 ER:OMAPS00091029 x0039928(sumanth) 60 Oct 30, 2006 ER:OMAPS00091029 x0039928(sumanth)
61 Bootup time measurement 61 Bootup time measurement
62 62
63 Oct 05, 2006 ER: OMAPS00094496 x0061088(Prachi) 63 Oct 05, 2006 ER: OMAPS00094496 x0061088(Prachi)
64 Description:Enhance RSSI to 3 parameters: Strength, quality, min-access-level 64 Description:Enhance RSSI to 3 parameters: Strength, quality, min-access-level
65 Solution: NAPTUNE flag is removed from globalSignalUpdate(). 65 Solution: NAPTUNE flag is removed from globalSignalUpdate().
66 66
67 Sep 11, 2006 DR: OMAPS00094182 xrashmic 67 Sep 11, 2006 DR: OMAPS00094182 xrashmic
68 Description: midi and mp3 files is not being populated on accessing corresponding menu, but only during bootup 68 Description: midi and mp3 files is not being populated on accessing corresponding menu, but only during bootup
69 Solution: Populate files on accessing the "browse files" list 69 Solution: Populate files on accessing the "browse files" list
70 70
71 xashmic 9 Sep 2006, OMAPS00092732 71 xashmic 9 Sep 2006, OMAPS00092732
72 USBMS ER: Handles the connect and disconnect event. 72 USBMS ER: Handles the connect and disconnect event.
73 73
74 Aug 03, 2006 REF:OMAPS00088329 x0039928 74 Aug 03, 2006 REF:OMAPS00088329 x0039928
75 Description : TTY> When TTY is ON Headset insertion detection / profile download should not happen 75 Description : TTY> When TTY is ON Headset insertion detection / profile download should not happen
76 Solution : TTY ON condition is checked before downloading the headset profile. 76 Solution : TTY ON condition is checked before downloading the headset profile.
77 77
78 Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) 78 Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)
79 Description : CPHS Roaming indication feature implementation 79 Description : CPHS Roaming indication feature implementation
80 Solution : As part of the implementation, in this file, type of GlobalIconStatus is changed 80 Solution : As part of the implementation, in this file, type of GlobalIconStatus is changed
81 81
82 Jun 02, 2006 DRT OMAPS00079213 x0039928(sumanth) 82 Jun 02, 2006 DRT OMAPS00079213 x0039928(sumanth)
83 Description: Triton PG2.2 impacts on Locosto program 83 Description: Triton PG2.2 impacts on Locosto program
84 Solution: Software workaround is done to register headset-hook dynamically 84 Solution: Software workaround is done to register headset-hook dynamically
85 during/before call is established and unregister it after the call is ended/disconnected. 85 during/before call is established and unregister it after the call is ended/disconnected.
86 86
87 Apr 17, 2006 REF: ER OMAPS00075178 x0pleela 87 Apr 17, 2006 REF: ER OMAPS00075178 x0pleela
88 Description: When the charger connect to phone(i-sample), the charger driver works, but the MMI and App don't work 88 Description: When the charger connect to phone(i-sample), the charger driver works, but the MMI and App don't work
89 Solution: Defined new functions "charging_start_cb()": Callback after dialog "Charging" is displayed 89 Solution: Defined new functions "charging_start_cb()": Callback after dialog "Charging" is displayed
90 and "charging_start_info()" : function to display the dialog "charging" when charger is connected 90 and "charging_start_info()" : function to display the dialog "charging" when charger is connected
91 Handling battery/charger events in globalmme() 91 Handling battery/charger events in globalmme()
92 92
93 Nov 09, 2005 REF: DVT OMAPS00056873 xdeepadh 93 Nov 09, 2005 REF: DVT OMAPS00056873 xdeepadh
94 Description: Deactivating Bright Light on I-Sample 94 Description: Deactivating Bright Light on I-Sample
95 Solution: On Isample boards the backlight is set off, since the bright LEDS are very disturbing. 95 Solution: On Isample boards the backlight is set off, since the bright LEDS are very disturbing.
96 96
97 xpradipg - LOCOSTO-ENH-31895 : 23 June 2005 97 xpradipg - LOCOSTO-ENH-31895 : 23 June 2005
98 Description: Support for various audio profiles 98 Description: Support for various audio profiles
99 Solution: The support for audio device's carkit/headset/loudspeaker/handheld. 99 Solution: The support for audio device's carkit/headset/loudspeaker/handheld.
100 The audio device is enabled as per the user actions. 100 The audio device is enabled as per the user actions.
101 Jul 05, 2005 REF: SPR 31894 xdeepadh 101 Jul 05, 2005 REF: SPR 31894 xdeepadh
102 Description: Proposed chnages for Locosto-live sign off 102 Description: Proposed chnages for Locosto-live sign off
103 Solution: UICC SIM API will be used for Locosto. 103 Solution: UICC SIM API will be used for Locosto.
104 104
105 x0018858 24 Mar, 2005 MMI-FIX-11321 105 x0018858 24 Mar, 2005 MMI-FIX-11321
106 Issue Description :- If the inbox is full and a new message is receivd, no indication is received. 106 Issue Description :- If the inbox is full and a new message is receivd, no indication is received.
107 Fix: Added support for handling indication when message box is full and 107 Fix: Added support for handling indication when message box is full and
108 there is a pending message. 108 there is a pending message.
109 Apr 05, 2005 REF: ENH 29994 xdeepadh 109 Apr 05, 2005 REF: ENH 29994 xdeepadh
110 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application 110 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application
111 Solution: Generic Midi Ringer and Midi Test Application were implemented. 111 Solution: Generic Midi Ringer and Midi Test Application were implemented.
112 112
113 Jan 07, 2005 REF: CRR 26394 xkundadu 113 Jan 07, 2005 REF: CRR 26394 xkundadu
114 Issue description:Logo of the operator not displayed 114 Issue description:Logo of the operator not displayed
115 Solution: Set the network operator logo display option to enbled state. 115 Solution: Set the network operator logo display option to enbled state.
116 116
117 Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu 117 Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu
118 Issue description: Golite booting problem. 118 Issue description: Golite booting problem.
119 Solution: If the FFS is not formatted, prevent writing into the FFS. 119 Solution: If the FFS is not formatted, prevent writing into the FFS.
120 120
121 Aug 16, 2004 REF: CRR 24323 Deepa M.D 121 Aug 16, 2004 REF: CRR 24323 Deepa M.D
122 Bug:Clenup of sprintf used for tracing 122 Bug:Clenup of sprintf used for tracing
123 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX 123 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX
124 124
125 Jul 22,2004 CRR:20896 xrashmic - SASKEN 125 Jul 22,2004 CRR:20896 xrashmic - SASKEN
126 Description: The current time format is not highlighted 126 Description: The current time format is not highlighted
127 Fix: The time format is written into flash. Instead of providing the submenu 127 Fix: The time format is written into flash. Instead of providing the submenu
128 directly we call a function where we set the menu and also higlight the 128 directly we call a function where we set the menu and also higlight the
129 previously selected menu item 129 previously selected menu item
130 130
131 131
132 May 10, 2004 REF: CRR 15753 Deepa M.D 132 May 10, 2004 REF: CRR 15753 Deepa M.D
133 Menuitem provided to set the validity period to maximum. 133 Menuitem provided to set the validity period to maximum.
134 134
135 25/10/00 Original Condat(UK) BMI version. 135 25/10/00 Original Condat(UK) BMI version.
136 136
137 Dec 23, 2005 REF: SR13873 x0020906 137 Dec 23, 2005 REF: SR13873 x0020906
138 Description: To stop playing ringtone when new sms arrives - when user is in any menu screen. 138 Description: To stop playing ringtone when new sms arrives - when user is in any menu screen.
139 Fix : Fix is done in keyAction (). 139 Fix : Fix is done in keyAction ().
140 140
141 $End 141 $End
142 142
143 *******************************************************************************/ 143 *******************************************************************************/
144 144
145 #include <stdio.h> 145 #include <stdio.h>
194 /* BEGIN ADD: Neptune Alignment */ 194 /* BEGIN ADD: Neptune Alignment */
195 #ifndef NEPTUNE_BOARD 195 #ifndef NEPTUNE_BOARD
196 /* END ADD: Neptune Alignment */ 196 /* END ADD: Neptune Alignment */
197 #include "sys_types.h" 197 #include "sys_types.h"
198 /* BEGIN ADD: Neptune Alignment */ 198 /* BEGIN ADD: Neptune Alignment */
199 #else 199 #else
200 #include "bmi_integ_misc.h" 200 #include "bmi_integ_misc.h"
201 #endif 201 #endif
202 /* END ADD: Neptune Alignment */ 202 /* END ADD: Neptune Alignment */
203 #endif 203 #endif
204 204
242 //x0pleela 21 Apr, 2006 DR: OMAPS00075178 242 //x0pleela 21 Apr, 2006 DR: OMAPS00075178
243 //Removing the AUDIO_PROFILE flag as Mmicolours.h is also required for Battery/charger indication fix 243 //Removing the AUDIO_PROFILE flag as Mmicolours.h is also required for Battery/charger indication fix
244 //#ifdef FF_MMI_AUDIO_PROFILE 244 //#ifdef FF_MMI_AUDIO_PROFILE
245 #include "MmiColours.h" 245 #include "MmiColours.h"
246 //#endif 246 //#endif
247 static MfwHnd times; /* clock via software timer */ 247 static MfwHnd times; /* clock via software timer */
248 static MfwHnd times_switchoff; /* timer switch off (GB)*/ 248 static MfwHnd times_switchoff; /* timer switch off (GB)*/
249 249
250 /* GLOBAL CONTROL DATA */ 250 /* GLOBAL CONTROL DATA */
251 LngInfo mainLngInfo; /* language control block */ 251 LngInfo mainLngInfo; /* language control block */
252 MfwHnd mainMmiLng; /* global language handler */ 252 MfwHnd mainMmiLng; /* global language handler */
253 253
254 254
255 //x0pleela 11 Apr, 2006 ER: OMAPS00075178 255 //x0pleela 11 Apr, 2006 ER: OMAPS00075178
256 //Timer for battery charging animation 256 //Timer for battery charging animation
257 extern MfwHnd battery_charging_animate; 257 extern MfwHnd battery_charging_animate;
258 258
259 /* Taking idle data - RAVI - 23-12-2005 */ 259 /* Taking idle data - RAVI - 23-12-2005 */
260 #ifdef NEPTUNE_BOARD 260 #ifdef NEPTUNE_BOARD
261 extern T_idle idle_data; 261 extern T_idle idle_data;
262 #endif 262 #endif
279 static int timesEvent (MfwEvt e, MfwTim *t); 279 static int timesEvent (MfwEvt e, MfwTim *t);
280 static void showGoodBye (T_MFW_HND win); 280 static void showGoodBye (T_MFW_HND win);
281 static void goodbye_cb (void); 281 static void goodbye_cb (void);
282 282
283 283
284 static MfwHnd mme; /* our MME manager */ 284 static MfwHnd mme; /* our MME manager */
285 285
286 /* Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) 286 /* Jun 09, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)
287 Description : CPHS Roaming indication feature implementation 287 Description : CPHS Roaming indication feature implementation
288 Solution : As part of the implementation, type of GlobalIconStatus is changed from U16 to U32 as number of 288 Solution : As part of the implementation, type of GlobalIconStatus is changed from U16 to U32 as number of
289 bits in the variable is not sufficient to store details about all the icons*/ 289 bits in the variable is not sufficient to store details about all the icons*/
290 U32 GlobalIconStatus; 290 U32 GlobalIconStatus;
291 UBYTE globalMobileMode; 291 UBYTE globalMobileMode;
292 int MmiModule; 292 int MmiModule;
293 293
294 // ADDED BY RAVI - 28-11-2005 294 // ADDED BY RAVI - 28-11-2005
299 EXTERN UBYTE getCurrentRingerSettings(void); 299 EXTERN UBYTE getCurrentRingerSettings(void);
300 EXTERN UBYTE CphsPresent(void); 300 EXTERN UBYTE CphsPresent(void);
301 EXTERN void cphs_support_check(void); 301 EXTERN void cphs_support_check(void);
302 // END RAVI 302 // END RAVI
303 303
304 /* batterie and signal start */ 304 /* batterie and signal start */
305 int globalBatteryUpdate(U8 value); 305 int globalBatteryUpdate(U8 value);
306 int globalSignalUpdate(U8 value); 306 int globalSignalUpdate(U8 value);
307 307
308 // xpradipg - LOCOSTO-ENH-31895 : 23 June 2005 308 // xpradipg - LOCOSTO-ENH-31895 : 23 June 2005
309 #ifdef FF_MMI_AUDIO_PROFILE 309 #ifdef FF_MMI_AUDIO_PROFILE
310 extern void mfw_audio_device_indication(U8 notify); 310 extern void mfw_audio_device_indication(U8 notify);
311 extern void mmi_hook_handle(); 311 extern void mmi_hook_handle();
312 void mmi_device_status_info(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback); 312 void mmi_device_status_info(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback);
313 #endif 313 #endif
314 314
315 315
316 void globalFlashBattery (void); 316 void globalFlashBattery (void);
318 UBYTE globalBatteryPicNumber; 318 UBYTE globalBatteryPicNumber;
319 UBYTE globalSignalPicNumber; 319 UBYTE globalSignalPicNumber;
320 320
321 UBYTE globalBatteryMode; /* */ 321 UBYTE globalBatteryMode; /* */
322 int globalMme(MfwEvt e, void *para); 322 int globalMme(MfwEvt e, void *para);
323 /* batterie and signal end */ 323 /* batterie and signal end */
324 324
325 /*MC SPR 1725 removed current clock and date variables*/ 325 /*MC SPR 1725 removed current clock and date variables*/
326 326
327 /* x0039928 - Lint warning removal 327 /* x0039928 - Lint warning removal
328 static LONG second; */ 328 static LONG second; */
329 static U8 deregis = FALSE; /* status deregistration */ 329 static U8 deregis = FALSE; /* status deregistration */
330 330
331 // SH 6/03/02 - HUPKeyOrigin is 1 if POWER_KEY is pressed in idle screen, 0 otherwise 331 // SH 6/03/02 - HUPKeyOrigin is 1 if POWER_KEY is pressed in idle screen, 0 otherwise
332 // Means that long press of HUP key will go to idle screen, not just shut down 332 // Means that long press of HUP key will go to idle screen, not just shut down
333 UBYTE HUPKeyOrigin; 333 UBYTE HUPKeyOrigin;
334 int off_switch; /* distinguish between on- and off switching to display a goodbye message*/ 334 int off_switch; /* distinguish between on- and off switching to display a goodbye message*/
335 /* SPR877 - SH - set to TRUE if welcome animation has finished */ 335 /* SPR877 - SH - set to TRUE if welcome animation has finished */
336 extern UBYTE animation_complete; 336 extern UBYTE animation_complete;
337 337
338 T_MFW_CFLAG_STATUS DivertStatus = MFW_CFLAG_NOTSet; 338 T_MFW_CFLAG_STATUS DivertStatus = MFW_CFLAG_NOTSet;
339 #define TIME_MINUTE 60000 339 #define TIME_MINUTE 60000
340 #define TIMEDOWN 120000L /* time for powerdown 2min */ 340 #define TIMEDOWN 120000L /* time for powerdown 2min */
341 #define TIME_SWITCH_OFF 3000 /* switch off time delay */ 341 #define TIME_SWITCH_OFF 3000 /* switch off time delay */
342 //Jul 05, 2005 REF: SPR 31894 xdeepadh 342 //Jul 05, 2005 REF: SPR 31894 xdeepadh
343 //The reader_id BSP_UICC_DEFAULT_READER_ID will be 0x01. 343 //The reader_id BSP_UICC_DEFAULT_READER_ID will be 0x01.
344 #ifdef TI_PS_UICC_CHIPSET_15 344 #ifdef TI_PS_UICC_CHIPSET_15
345 #define BSP_UICC_DEFAULT_READER_ID 0x01 345 #define BSP_UICC_DEFAULT_READER_ID 0x01
346 #endif 346 #endif
347 347
348 static UBYTE buffer[100]; 348 static UBYTE buffer[100];
349 /* Amounts to: 128 (format mode) + 8 (overwrite mode) */ 349 /* Amounts to: 128 (format mode) + 8 (overwrite mode) */
350 350
351 351
352 #ifdef FF_MMI_A2DP_AVRCP 352 #ifdef FF_MMI_A2DP_AVRCP
353 extern BMI_BT_STRUCTTYPE tGlobalBmiBtStruct; 353 extern BMI_BT_STRUCTTYPE tGlobalBmiBtStruct;
354 #endif 354 #endif
355 355
356 /******************************************************************************* 356 /*******************************************************************************
357 357
358 $Function: 358 $Function:
359 359
360 $Description: general editor control 360 $Description: general editor control
361 361
362 $Returns: none. 362 $Returns: none.
363 363
364 $Arguments: 364 $Arguments:
365 365
368 /* SPR#1428 - SH - New Editor changes - this version of editControls used 368 /* SPR#1428 - SH - New Editor changes - this version of editControls used
369 * by new editor. The rest is now in AUITextEntry */ 369 * by new editor. The rest is now in AUITextEntry */
370 370
371 #ifdef NEW_EDITOR 371 #ifdef NEW_EDITOR
372 372
373 UBYTE editControls [KCD_MAX] = /* edit control keys: */ 373 UBYTE editControls [KCD_MAX] = /* edit control keys: */
374 { 374 {
375 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 375 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
376 '*', '#', ctrlNone, ctrlNone, ctrlUp, ctrlDown, ctrlLeft, ctrlRight, 376 '*', '#', ctrlNone, ctrlNone, ctrlUp, ctrlDown, ctrlLeft, ctrlRight,
377 ctrlNone, ctrlNone, ctrlEnter, ctrlNone, ctrlNone, ctrlNone, 377 ctrlNone, ctrlNone, ctrlEnter, ctrlNone, ctrlNone, ctrlNone,
378 ctrlNone, ctrlNone, ctrlEnter 378 ctrlNone, ctrlNone, ctrlEnter
379 }; 379 };
380 380
381 #else /* NEW_EDITOR */ 381 #else /* NEW_EDITOR */
382 382
383 static MfwHnd myHandle = 0; /* editors handle */ 383 static MfwHnd myHandle = 0; /* editors handle */
384 static MfwHnd editTim = 0; /* the editor timer */ 384 static MfwHnd editTim = 0; /* the editor timer */
385 static char *formatHandle; // SH - pointer to format string, so that editEventKey can see it 385 static char *formatHandle; // SH - pointer to format string, so that editEventKey can see it
386 static int *formatIndex; // SH - pointer to format index 386 static int *formatIndex; // SH - pointer to format index
387 static int *fieldIndex; // SH - pointer to field position 387 static int *fieldIndex; // SH - pointer to field position
388 static char *tmpBuf; // SH - pointer to temporary buffer for hidden alphanumeric entry 388 static char *tmpBuf; // SH - pointer to temporary buffer for hidden alphanumeric entry
389 389
390 #define KEY_PAD_MAX 5 390 #define KEY_PAD_MAX 5
391 391
392 UBYTE editControls [KCD_MAX] = /* edit control keys: */ 392 UBYTE editControls [KCD_MAX] = /* edit control keys: */
393 { 393 {
394 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 394 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
395 '*', '#', ecNone, ecNone, ecUp, ecDown, ecLeft, ecRight, 395 '*', '#', ecNone, ecNone, ecUp, ecDown, ecLeft, ecRight,
396 ecNone, ecNone, ecEnter, ecNone, ecNone, ecNone, 396 ecNone, ecNone, ecEnter, ecNone, ecNone, ecNone,
397 ecNone, ecNone, ecEnter 397 ecNone, ecNone, ecEnter
398 }; 398 };
399 399
400 static UBYTE editAlphaMode; /* alpha mode flag */ 400 static UBYTE editAlphaMode; /* alpha mode flag */
401 static UBYTE editCalcMode; /* calculator mode flag */ 401 static UBYTE editCalcMode; /* calculator mode flag */
402 static UBYTE editFormatMode; /* format mode flag */ 402 static UBYTE editFormatMode; /* format mode flag */
403 static UBYTE editHiddenMode; /* hidden alphanumeric mode */ 403 static UBYTE editHiddenMode; /* hidden alphanumeric mode */
404 static UBYTE editAlphaLevel; /* alpha level selected */ 404 static UBYTE editAlphaLevel; /* alpha level selected */
405 static UBYTE editAlphaKey; /* alpha mode current key */ 405 static UBYTE editAlphaKey; /* alpha mode current key */
406 406
407 407
408 408
409 static UBYTE editAlpha [12][KEY_PAD_MAX] = /* alpha mode characters */ 409 static UBYTE editAlpha [12][KEY_PAD_MAX] = /* alpha mode characters */
410 { 410 {
411 {'.','+','-','=','0'}, //0 key 411 {'.','+','-','=','0'}, //0 key
412 {' ','?','!','1',':'}, {'a','b','c','2',')'}, {'d','e','f','3','('}, // 1 2 3 412 {' ','?','!','1',':'}, {'a','b','c','2',')'}, {'d','e','f','3','('}, // 1 2 3
413 {'g','h','i','4','$'}, {'j','k','l','5',' '}, {'m','n','o','6',','}, // 4 5 6 413 {'g','h','i','4','$'}, {'j','k','l','5',' '}, {'m','n','o','6',','}, // 4 5 6
414 {'p','q','r','s','7'}, {'t','u','v','8',';'}, {'w','x','y','z','9'}, // 7 8 9 414 {'p','q','r','s','7'}, {'t','u','v','8',';'}, {'w','x','y','z','9'}, // 7 8 9
415 {'*','#','%','&',' '}, {' ','\'','\"','@','/'} // star and hash keys 415 {'*','#','%','&',' '}, {' ','\'','\"','@','/'} // star and hash keys
416 }; 416 };
417 417
418 static UBYTE editAlphaU [12][KEY_PAD_MAX] = /* upCase alpha mode characters*/ 418 static UBYTE editAlphaU [12][KEY_PAD_MAX] = /* upCase alpha mode characters*/
419 { 419 {
420 {'.','+','-','=','0'}, //0 key 420 {'.','+','-','=','0'}, //0 key
421 {' ','?','!','1',':'}, {'A','B','C','2',')'}, {'D','E','F','3','('}, // 1 2 3 421 {' ','?','!','1',':'}, {'A','B','C','2',')'}, {'D','E','F','3','('}, // 1 2 3
422 {'G','H','I','4','$'}, {'J','K','L','5',' '}, {'M','N','O','6',','}, // 4 5 6 422 {'G','H','I','4','$'}, {'J','K','L','5',' '}, {'M','N','O','6',','}, // 4 5 6
423 {'P','Q','R','S','7'}, {'T','U','V','8',';'}, {'W','X','Y','Z','9'}, // 7 8 9 423 {'P','Q','R','S','7'}, {'T','U','V','8',';'}, {'W','X','Y','Z','9'}, // 7 8 9
424 {'*','#','%','&',' '}, {' ','\'','\"','@','/'} // star and hash keys 424 {'*','#','%','&',' '}, {' ','\'','\"','@','/'} // star and hash keys
425 }; 425 };
426 426
427 427
428 int upCase= TRUE; 428 int upCase= TRUE;
429 429
437 extern T_call call_data; 437 extern T_call call_data;
438 #endif 438 #endif
439 439
440 #ifdef NEPTUNE_BOARD 440 #ifdef NEPTUNE_BOARD
441 #ifdef MMI_POWER_MANAGEMENT_TEST 441 #ifdef MMI_POWER_MANAGEMENT_TEST
442 #define Bool unsigned char 442 #define Bool unsigned char
443 EXTERN unsigned char Screen_Update; 443 EXTERN unsigned char Screen_Update;
444 EXTERN void SVC_SCN_EnablePM(Bool enable ); 444 EXTERN void SVC_SCN_EnablePM(Bool enable );
445 #endif 445 #endif
446 #endif 446 #endif
447 EXTERN MfwHnd timer_handle; 447 EXTERN MfwHnd timer_handle;
448 448
449 //x0pleela 19 Mar, 2007 ER: OMAPS00122561 449 //x0pleela 19 Mar, 2007 ER: OMAPS00122561
450 #ifdef FF_PHONE_LOCK 450 #ifdef FF_PHONE_LOCK
451 static int ph_lock_status; 451 static int ph_lock_status;
452 452
453 #define ResetFlag 0x00 //toset any bit to zero 453 #define ResetFlag 0x00 //toset any bit to zero
454 #define UsbMsEnum 0x01 //for USB MS enum/de-enum 454 #define UsbMsEnum 0x01 //for USB MS enum/de-enum
455 #define HeadsetReg 0x02 //For Headset Plug/Unplug 455 #define HeadsetReg 0x02 //For Headset Plug/Unplug
456 456
457 //x0pleela 29 May, 2007 DR: OMAPS00132483 457 //x0pleela 29 May, 2007 DR: OMAPS00132483
458 EXTERN int mfw_get_Phlock_status(void); 458 EXTERN int mfw_get_Phlock_status(void);
459 EXTERN void mfw_set_Phlock_status( int phlock_status); 459 EXTERN void mfw_set_Phlock_status( int phlock_status);
460 EXTERN int mfw_get_Auto_Phlock_status(void); 460 EXTERN int mfw_get_Auto_Phlock_status(void);
466 #ifdef FF_PHONE_LOCK 466 #ifdef FF_PHONE_LOCK
467 /******************************************************************************* 467 /*******************************************************************************
468 468
469 $Function: mmi_set_Headset_Reg 469 $Function: mmi_set_Headset_Reg
470 470
471 $Description: set /resets the HeadsetReg bit in ph_lock_status 471 $Description: set /resets the HeadsetReg bit in ph_lock_status
472 472
473 $Returns: none. 473 $Returns: none.
474 474
475 $Arguments: 475 $Arguments:
476 476
477 *******************************************************************************/ 477 *******************************************************************************/
478 //x0pleela 23 May, 2007 DR: OMAPS00132483 478 //x0pleela 23 May, 2007 DR: OMAPS00132483
479 GLOBAL void mmi_set_Headset_Reg( int headset_reg) 479 GLOBAL void mmi_set_Headset_Reg( int headset_reg)
480 { 480 {
481 TRACE_FUNCTION("mmi_set_Headset_Reg()"); 481 TRACE_FUNCTION("mmi_set_Headset_Reg()");
482 if( headset_reg ) 482 if( headset_reg )
483 ph_lock_status |= HeadsetReg; 483 ph_lock_status |= HeadsetReg;
484 else 484 else
485 ph_lock_status &= ResetFlag; 485 ph_lock_status &= ResetFlag;
486 return; 486 return;
487 } 487 }
488 488
489 /******************************************************************************* 489 /*******************************************************************************
490 490
491 $Function: mmi_get_Headset_Reg 491 $Function: mmi_get_Headset_Reg
492 492
493 $Description: returns the HeadsetReg status from ph_lock_status 493 $Description: returns the HeadsetReg status from ph_lock_status
494 494
495 $Returns: none. 495 $Returns: none.
496 496
497 $Arguments: 497 $Arguments:
498 498
499 *******************************************************************************/ 499 *******************************************************************************/
500 //x0pleela 23 May, 2007 DR: OMAPS00132483 500 //x0pleela 23 May, 2007 DR: OMAPS00132483
501 GLOBAL int mmi_get_Headset_Reg(void) 501 GLOBAL int mmi_get_Headset_Reg(void)
502 { 502 {
503 TRACE_FUNCTION("mmi_get_Headset_Reg()"); 503 TRACE_FUNCTION("mmi_get_Headset_Reg()");
504 if( (ph_lock_status & HeadsetReg) == HeadsetReg) 504 if( (ph_lock_status & HeadsetReg) == HeadsetReg)
505 return TRUE; 505 return TRUE;
506 else 506 else
507 return FALSE; 507 return FALSE;
508 } 508 }
509 509
510 510
511 /******************************************************************************* 511 /*******************************************************************************
512 512
513 $Function: mmi_set_usbms_enum 513 $Function: mmi_set_usbms_enum
514 514
515 $Description: set /resets the UsbMsEnum bit in ph_lock_status 515 $Description: set /resets the UsbMsEnum bit in ph_lock_status
516 516
517 $Returns: none. 517 $Returns: none.
518 518
519 $Arguments: 519 $Arguments:
520 520
521 *******************************************************************************/ 521 *******************************************************************************/
522 //x0pleela 23 May, 2007 DR: OMAPS00132483 522 //x0pleela 23 May, 2007 DR: OMAPS00132483
523 GLOBAL void mmi_set_usbms_enum( int usb_enum) 523 GLOBAL void mmi_set_usbms_enum( int usb_enum)
524 { 524 {
525 TRACE_FUNCTION("mmi_set_usbms_enum()"); 525 TRACE_FUNCTION("mmi_set_usbms_enum()");
526 if( usb_enum ) 526 if( usb_enum )
527 ph_lock_status |= UsbMsEnum; 527 ph_lock_status |= UsbMsEnum;
528 else 528 else
529 ph_lock_status &= ResetFlag; 529 ph_lock_status &= ResetFlag;
530 return; 530 return;
531 } 531 }
532 532
533 /******************************************************************************* 533 /*******************************************************************************
534 534
535 $Function: mmi_get_usbms_enum 535 $Function: mmi_get_usbms_enum
536 536
537 $Description: returns the UsbMsEnum status from ph_lock_status 537 $Description: returns the UsbMsEnum status from ph_lock_status
538 538
539 $Returns: none. 539 $Returns: none.
540 540
541 $Arguments: 541 $Arguments:
542 542
543 *******************************************************************************/ 543 *******************************************************************************/
544 //x0pleela 23 May, 2007 DR: OMAPS00132483 544 //x0pleela 23 May, 2007 DR: OMAPS00132483
545 GLOBAL int mmi_get_usbms_enum(void) 545 GLOBAL int mmi_get_usbms_enum(void)
546 { 546 {
547 TRACE_FUNCTION("mmi_get_usbms_enum()"); 547 TRACE_FUNCTION("mmi_get_usbms_enum()");
548 if(( ph_lock_status & UsbMsEnum ) == UsbMsEnum) 548 if(( ph_lock_status & UsbMsEnum ) == UsbMsEnum)
549 return TRUE; 549 return TRUE;
550 else 550 else
551 return FALSE; 551 return FALSE;
552 } 552 }
553 #endif /*FF_PHONE_LOCK*/ 553 #endif /*FF_PHONE_LOCK*/
554 554
555 /******************************************************************************* 555 /*******************************************************************************
556 556
557 $Function: mainInit 557 $Function: mainInit
558 558
559 $Description: init MMI main module 559 $Description: init MMI main module
560 560
561 $Returns: none. 561 $Returns: none.
562 562
563 $Arguments: 563 $Arguments:
564 564
565 *******************************************************************************/ 565 *******************************************************************************/
566 void mainInit (UBYTE InitCause) 566 void mainInit (UBYTE InitCause)
567 { 567 {
568 int i; 568 int i;
569 T_MFW_SMS_INFO sms_settings; 569 T_MFW_SMS_INFO sms_settings;
570 //x0018858 24 Mar, 2005 MMI-FIX-11321 570 //x0018858 24 Mar, 2005 MMI-FIX-11321
571 //added structures for storing the indication settings and CMER settings. 571 //added structures for storing the indication settings and CMER settings.
572 T_ACI_MM_CIND_VAL_TYPE cindSettings; 572 T_ACI_MM_CIND_VAL_TYPE cindSettings;
573 T_ACI_MM_CMER_VAL_TYPE cmerSettings; 573 T_ACI_MM_CMER_VAL_TYPE cmerSettings;
574 TRACE_FUNCTION("maininit"); 574 TRACE_FUNCTION("maininit");
575 575
576 mfwSetSignallingMethod(1); 576 mfwSetSignallingMethod(1);
577 winAutoFocus(TRUE); 577 winAutoFocus(TRUE);
578 mfwSetFocus(0); /* reset focus */ 578 mfwSetFocus(0); /* reset focus */
579 579
580 580
581 /*MC SPR 1111*/ 581 /*MC SPR 1111*/
582 /*MC check to see if language already selected and saved to FFS*/ 582 /*MC check to see if language already selected and saved to FFS*/
583 583
584 // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu 584 // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu
585 // Issue description: Golite booting problem. 585 // Issue description: Golite booting problem.
586 // Solution: If the FFS is not formatted, dont write into the FFS. 586 // Solution: If the FFS is not formatted, dont write into the FFS.
587 // In that case just set the langauge to English and do the mmi 587 // In that case just set the langauge to English and do the mmi
588 // layout settings. 588 // layout settings.
589 if(flash_formatted() == TRUE) 589 if(flash_formatted() == TRUE)
590 { 590 {
591 if (flash_read() >= EFFS_OK) 591 if (flash_read() >= EFFS_OK)
592 { TRACE_EVENT_P1("FFS_flashData.language: %d", FFS_flashData.language); 592 { TRACE_EVENT_P1("FFS_flashData.language: %d", FFS_flashData.language);
593 593
594 /*MC SPR 1150 if language is not 0 and not greater than the maximum language code*/ 594 /*MC SPR 1150 if language is not 0 and not greater than the maximum language code*/
595 if (FFS_flashData.language != NULL && FFS_flashData.language<= NO_OF_LANGUAGES) 595 if (FFS_flashData.language != NULL && FFS_flashData.language<= NO_OF_LANGUAGES)
596 MmiRsrcSetLang(FFS_flashData.language);/*MC, change to stored language*/ 596 MmiRsrcSetLang(FFS_flashData.language);/*MC, change to stored language*/
597 else 597 else
598 MmiRsrcSetLang(ENGLISH_LANGUAGE); 598 MmiRsrcSetLang(ENGLISH_LANGUAGE);
599 599
600 /*API - 28/07/03 - CQ10203 - If the flash value not set set to default VP_REL_24_HOURS*/ 600 /*API - 28/07/03 - CQ10203 - If the flash value not set set to default VP_REL_24_HOURS*/
601 if((FFS_flashData.vp_rel != VP_REL_1_HOUR) && 601 if((FFS_flashData.vp_rel != VP_REL_1_HOUR) &&
602 (FFS_flashData.vp_rel != VP_REL_12_HOURS) && 602 (FFS_flashData.vp_rel != VP_REL_12_HOURS) &&
603 (FFS_flashData.vp_rel != VP_REL_24_HOURS) && 603 (FFS_flashData.vp_rel != VP_REL_24_HOURS) &&
604 (FFS_flashData.vp_rel != VP_REL_1_WEEK)&& 604 (FFS_flashData.vp_rel != VP_REL_1_WEEK)&&
605 (FFS_flashData.vp_rel != VP_REL_MAXIMUM)) // May 10, 2004 REF: CRR 15753 Deepa M.D 605 (FFS_flashData.vp_rel != VP_REL_MAXIMUM)) // May 10, 2004 REF: CRR 15753 Deepa M.D
606 { 606 {
607 FFS_flashData.vp_rel = VP_REL_24_HOURS; 607 FFS_flashData.vp_rel = VP_REL_24_HOURS;
608 } 608 }
609 /*API - 28/07/03 - CQ10203 - END */ 609 /*API - 28/07/03 - CQ10203 - END */
610 610
611 /*NDH - 13/01/04 - CQ16753 - Propogate the Validity Period Settings to the ACI */ 611 /*NDH - 13/01/04 - CQ16753 - Propogate the Validity Period Settings to the ACI */
612 sms_settings.vp_rel = FFS_flashData.vp_rel; 612 sms_settings.vp_rel = FFS_flashData.vp_rel;
613 (void)sms_set_val_period(&sms_settings); 613 (void)sms_set_val_period(&sms_settings);
614 /*NDH - 13/01/04 - CQ16753 - END */ 614 /*NDH - 13/01/04 - CQ16753 - END */
615 } 615 }
616 else 616 else
617 { 617 {
618 /* GW If flash read fails set up default settings. */ 618 /* GW If flash read fails set up default settings. */
619 /* This will also save the settings to flash */ 619 /* This will also save the settings to flash */
620 memset(&FFS_flashData, 0x00, sizeof(FFS_flashData)); 620 memset(&FFS_flashData, 0x00, sizeof(FFS_flashData));
621 /*default language is english*/ 621 /*default language is english*/
622 setUserSettings2Default(); 622 setUserSettings2Default();
623 } 623 }
624 } 624 }
625 // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu 625 // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu
626 // Issue description: Golite booting problem. 626 // Issue description: Golite booting problem.
627 // Solution: If the FFS is not formatted, dont write into the FFS. 627 // Solution: If the FFS is not formatted, dont write into the FFS.
628 // In that case just set the langauge to English and mmi 628 // In that case just set the langauge to English and mmi
629 // layout settings. 629 // layout settings.
630 else 630 else
631 { 631 {
632 // Set the default language to English. 632 // Set the default language to English.
633 MmiRsrcSetLang(ENGLISH_LANGUAGE); 633 MmiRsrcSetLang(ENGLISH_LANGUAGE);
634 634
635 // Jan 07, 2005 REF: CRR 26394 xkundadu 635 // Jan 07, 2005 REF: CRR 26394 xkundadu
636 // Issue description:Logo of the operator not displayed 636 // Issue description:Logo of the operator not displayed
637 // Solution: Set the network operator logo display option to enbled state. 637 // Solution: Set the network operator logo display option to enbled state.
638 // Set other user settings also to default values. 638 // Set other user settings also to default values.
639 639
640 #ifndef MMI_LITE 640 #ifndef MMI_LITE
641 memset(&FFS_flashData, 0x00, sizeof(FFS_flashData)); 641 memset(&FFS_flashData, 0x00, sizeof(FFS_flashData));
642 setUserSettings2Default(); 642 setUserSettings2Default();
643 #endif 643 #endif
644 } 644 }
645 /*mc end*/ 645 /*mc end*/
646 HUPKeyOrigin = 0; // sbh 646 HUPKeyOrigin = 0; // sbh
647 off_switch=0; /* 0 is stands for mobile is swiched on */ 647 off_switch=0; /* 0 is stands for mobile is swiched on */
648 animation_complete = FALSE; 648 animation_complete = FALSE;
649 649
650 kbdAlways((MfwCb)keyAction); /* global keyboard access */ 650 kbdAlways((MfwCb)keyAction); /* global keyboard access */
651 kbdTime(2000,1000,400); /* long / repeat timeouts */ 651 kbdTime(2000,1000,400); /* long / repeat timeouts */
652 652
653 mainMmiLng = lngCreate(0,0,&mainLngInfo,0); /* language handler */ 653 mainMmiLng = lngCreate(0,0,&mainLngInfo,0); /* language handler */
654 654
655 // times clock event 655 // times clock event
656 656
657 /*OMAPS00098881 (removing power variant) - a0393213(Prabakar) 657 /*OMAPS00098881 (removing power variant) - a0393213(Prabakar)
658 Removed #ifndef FF_POWER_MANAGEMENT. 658 Removed #ifndef FF_POWER_MANAGEMENT.
659 Timer is created irrespective of LCD refresh state. 659 Timer is created irrespective of LCD refresh state.
660 It would be started when LCD refresh is needed else it would be stopped*/ 660 It would be started when LCD refresh is needed else it would be stopped*/
661 times = timCreate(0,TIME_MINUTE,(MfwCb)timesEvent); 661 times = timCreate(0,TIME_MINUTE,(MfwCb)timesEvent);
662 662
663 663
664 // xpradipg - LOCOSTO-ENH-31895 : 23 June 2005 664 // xpradipg - LOCOSTO-ENH-31895 : 23 June 2005
665 // additional events addes for carkit and headset 665 // additional events addes for carkit and headset
666 //xashmic 9 Sep 2006, OMAPS00092732 666 //xashmic 9 Sep 2006, OMAPS00092732
667 //Added MfwMmeUSBMS for handling USB MS events 667 //Added MfwMmeUSBMS for handling USB MS events
668 #if defined(FF_MMI_AUDIO_PROFILE) && defined( FF_MMI_USBMS) 668 #if defined(FF_MMI_AUDIO_PROFILE) && defined( FF_MMI_USBMS)
669 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState|MfwMmeHeadset|MfwMmeCarkit|MfwMmeUSBMS, (MfwCb)globalMme); 669 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState|MfwMmeHeadset|MfwMmeCarkit|MfwMmeUSBMS, (MfwCb)globalMme);
670 #else 670 #else
671 #ifdef FF_MMI_AUDIO_PROFILE 671 #ifdef FF_MMI_AUDIO_PROFILE
672 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState|MfwMmeHeadset|MfwMmeCarkit, (MfwCb)globalMme); 672 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState|MfwMmeHeadset|MfwMmeCarkit, (MfwCb)globalMme);
673 #else 673 #else
674 #ifdef FF_MMI_USBMS 674 #ifdef FF_MMI_USBMS
675 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState|MfwMmeUSBMS, (MfwCb)globalMme); 675 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState|MfwMmeUSBMS, (MfwCb)globalMme);
676 #else 676 #else
677 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState, (MfwCb)globalMme); 677 mme = mmeCreate(0, MfwMmeSignal|MfwMmeBattery|MfwMmeBaState, (MfwCb)globalMme);
678 #endif 678 #endif
679 #endif 679 #endif
680 #endif 680 #endif
681 681
682 /*Setup when we want the backlight to come on*/ 682 /*Setup when we want the backlight to come on*/
683 // Nov 09, 2005 REF: DVT OMAPS00056873 xdeepadh 683 // Nov 09, 2005 REF: DVT OMAPS00056873 xdeepadh
684 //On Isample boards the backlight is set off, since the bright LEDS are very disturbing. 684 //On Isample boards the backlight is set off, since the bright LEDS are very disturbing.
685 685
686 for (i=0;i<BL_LAST_OPTION;i++) 686 for (i=0;i<BL_LAST_OPTION;i++)
687 #if (BOARD == 71) 687 #if (BOARD == 71)
688 mme_setBacklightEvent(i,BL_NO_LIGHT); 688 mme_setBacklightEvent(i,BL_NO_LIGHT);
689 #else 689 #else
690 mme_setBacklightEvent(i,BL_MAX_LIGHT); 690 mme_setBacklightEvent(i,BL_MAX_LIGHT);
691 #endif 691 #endif
692 692
693 #if (BOARD == 71) 693 #if (BOARD == 71)
694 mme_setBacklightEvent(BL_IDLE_TIMER,BL_NO_LIGHT); 694 mme_setBacklightEvent(BL_IDLE_TIMER,BL_NO_LIGHT);
695 #else 695 #else
696 mme_setBacklightEvent(BL_IDLE_TIMER,BL_SET_IDLE); 696 mme_setBacklightEvent(BL_IDLE_TIMER,BL_SET_IDLE);
697 #endif 697 #endif
698 698
699 mme_setBacklightEvent(BL_KEY_PRESS,BL_MAX_LIGHT); 699 mme_setBacklightEvent(BL_KEY_PRESS,BL_MAX_LIGHT);
700 mme_setBacklightEvent(BL_INCOMING_CALL,BL_MAX_LIGHT); 700 mme_setBacklightEvent(BL_INCOMING_CALL,BL_MAX_LIGHT);
701 mme_setBacklightEvent(BL_EXIT,BL_NO_LIGHT); 701 mme_setBacklightEvent(BL_EXIT,BL_NO_LIGHT);
702 702
703 /*and tell the backlight that the init event has happened */ 703 /*and tell the backlight that the init event has happened */
704 mme_backlightEvent(BL_INIT); 704 mme_backlightEvent(BL_INIT);
705 705
706 //x0018858 24 Mar, 2005 MMI-FIX-11321 706 //x0018858 24 Mar, 2005 MMI-FIX-11321
707 //Added two functions to set the indication and CMER values. 707 //Added two functions to set the indication and CMER values.
708 //begin 708 //begin
709 sms_set_cind_values(&cindSettings); 709 sms_set_cind_values(&cindSettings);
710 sms_set_cmer_values(&cmerSettings); 710 sms_set_cmer_values(&cmerSettings);
711 //end. 711 //end.
712 712
713 //RM test 14-07 second = 0; 713 //RM test 14-07 second = 0;
714 /*SPR 1725, replace FFS clock data with RTC*/ 714 /*SPR 1725, replace FFS clock data with RTC*/
715 715
716 /*OMAPS00098881 (removing power variant) a0393213(R.Prabakar) 716 /*OMAPS00098881 (removing power variant) a0393213(R.Prabakar)
717 Removed #ifndef FF_POWER_MANAGEMENT flag*/ 717 Removed #ifndef FF_POWER_MANAGEMENT flag*/
718 time_date_init(); 718 time_date_init();
719 719
720 deregis = FALSE; 720 deregis = FALSE;
721 721
722 /*OMAPS00098881 (removing power variant) a0393213(R.Prabakar) 722 /*OMAPS00098881 (removing power variant) a0393213(R.Prabakar)
723 If FF_POWER_MANAGEMENT is not enabled the timer is started only when the lcd refresh is needed*/ 723 If FF_POWER_MANAGEMENT is not enabled the timer is started only when the lcd refresh is needed*/
724 #ifndef FF_POWER_MANAGEMENT 724 #ifndef FF_POWER_MANAGEMENT
725 timStart(times); /* start clock */ 725 timStart(times); /* start clock */
726 #else 726 #else
727 if(FFS_flashData.refresh==1) 727 if(FFS_flashData.refresh==1)
728 timStart(times); 728 timStart(times);
729 #endif 729 #endif
730 730
731 startExec(PhoneInit,0); /* get it rolling */ 731 startExec(PhoneInit,0); /* get it rolling */
732 732
733 } 733 }
734 734
735 /******************************************************************************* 735 /*******************************************************************************
736 736
737 $Function: mainExit 737 $Function: mainExit
738 738
739 $Description: exit MMI main module 739 $Description: exit MMI main module
740 740
741 $Returns: none. 741 $Returns: none.
742 742
743 $Arguments: 743 $Arguments:
744 744
745 *******************************************************************************/ 745 *******************************************************************************/
746 void mainExit (UBYTE InitCause) 746 void mainExit (UBYTE InitCause)
747 { 747 {
748 TRACE_FUNCTION("mainExit"); 748 TRACE_FUNCTION("mainExit");
749 749
750 startExit(); 750 startExit();
751 sim_exit(); /* finit SIM handler */ 751 sim_exit(); /* finit SIM handler */
752 lngDelete(mainMmiLng); mainMmiLng = 0; 752 lngDelete(mainMmiLng); mainMmiLng = 0;
753 timDelete(times); 753 timDelete(times);
754 sms_cb_exit ();/*MC SPR1920 clean up cell broadcast*/ 754 sms_cb_exit ();/*MC SPR1920 clean up cell broadcast*/
755 mmeDelete(mme); mme = 0; 755 mmeDelete(mme); mme = 0;
756 kbdAlways(0); 756 kbdAlways(0);
757 dspl_ClearAll(); 757 dspl_ClearAll();
758 time_date_delete();/*SPR 1725*/ 758 time_date_delete();/*SPR 1725*/
759 } 759 }
760 760
761 /******************************************************************************* 761 /*******************************************************************************
762 762
763 $Function: keyAction 763 $Function: keyAction
764 764
765 $Description: handler called on every keyboard action 765 $Description: handler called on every keyboard action
766 766
767 $Returns: 767 $Returns:
768 768
769 $Arguments: 769 $Arguments:
770 770
774 /* this function "keyAction" is called 4*times from MFW per each keypress */ 774 /* this function "keyAction" is called 4*times from MFW per each keypress */
775 /* twice for keypress and twice for keyrelease */ 775 /* twice for keypress and twice for keyrelease */
776 /* the variable "toggle" is using to avoid to play the keypadtone twice ! */ 776 /* the variable "toggle" is using to avoid to play the keypadtone twice ! */
777 static UBYTE toggle = TRUE; 777 static UBYTE toggle = TRUE;
778 778
779 /* OMAPS00151698, x0056422 */ 779 /* OMAPS00151698, x0056422 */
780 #ifdef FF_MMI_A2DP_AVRCP 780 #ifdef FF_MMI_A2DP_AVRCP
781 if(tGlobalBmiBtStruct.bConnected == BMI_BT_CONNECTED && tGlobalBmiBtStruct.tCmdSrc == BMI_BT_HEADSET_COMMAND) 781 if(tGlobalBmiBtStruct.bConnected == BMI_BT_CONNECTED && tGlobalBmiBtStruct.tCmdSrc == BMI_BT_HEADSET_COMMAND)
782 {} 782 {}
783 else 783 else
784 { 784 {
785 #endif 785 #endif
786 786
787 #ifdef NEPTUNE_BOARD /* OMAPS00033660 */ 787 #ifdef NEPTUNE_BOARD /* OMAPS00033660 */
788 static unsigned char cKeySound = 0; 788 static unsigned char cKeySound = 0;
789 #endif 789 #endif
790 790
791 /* this mask is use to filter the keyevent "e" */ 791 /* this mask is use to filter the keyevent "e" */
792 /* want to use KEY_0, KEY_1,...... KEY_HASH */ 792 /* want to use KEY_0, KEY_1,...... KEY_HASH */
793 USHORT mask = 0x0FFF; 793 USHORT mask = 0x0FFF;
794 794
795 /* Initialize - RAVI - 23-12-2005 */ 795 /* Initialize - RAVI - 23-12-2005 */
796 /*a0393213 warnings removal-variable conditionally removed*/ 796 /*a0393213 warnings removal-variable conditionally removed*/
797 #if ((!defined(FF_MIDI_RINGER)) || defined(NEPTUNE_BOARD)) 797 #if ((!defined(FF_MIDI_RINGER)) || defined(NEPTUNE_BOARD))
798 UBYTE currentRinger = 0; 798 UBYTE currentRinger = 0;
799 #endif 799 #endif
800 800
801 801
802 /* terminate the ringing in all situation (it doesnt matter where the user is */ 802 /* terminate the ringing in all situation (it doesnt matter where the user is */
803 if ( (e & KEY_HUP) && (e & KEY_MAKE) ) 803 if ( (e & KEY_HUP) && (e & KEY_MAKE) )
804 { 804 {
805 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */ 805 /* Apr 05, 2005 REF: ENH 29994 xdeepadh */
806 /* terminate the ringing */ 806 /* terminate the ringing */
807 #ifndef FF_MIDI_RINGER 807 #ifndef FF_MIDI_RINGER
808 currentRinger = getCurrentRingerSettings(); 808 currentRinger = getCurrentRingerSettings();
809 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger ); 809 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
810 #endif 810 #endif
811 811
812 } 812 }
813 813
814 /* the power-off-key ! */ 814 /* the power-off-key ! */
815 if ( (e & KEY_POWER) && (e & KEY_MAKE)) 815 if ( (e & KEY_POWER) && (e & KEY_MAKE))
816 { 816 {
817 TRACE_EVENT("KEY_POWER pressed !!!!"); 817 TRACE_EVENT("KEY_POWER pressed !!!!");
818 818
819 if (pinsIsFocussed() EQ FOCUSSED_PINS) 819 if (pinsIsFocussed() EQ FOCUSSED_PINS)
820 { 820 {
821 pin_exit(); 821 pin_exit();
822 HUPKeyOrigin=1; 822 HUPKeyOrigin=1;
823 } 823 }
824 else if (idleIsFocussed()) 824 else if (idleIsFocussed())
825 { 825 {
826 HUPKeyOrigin=1; 826 HUPKeyOrigin=1;
827 } 827 }
828 828
829 if ((HUPKeyOrigin==1) && (off_switch == 0)) 829 if ((HUPKeyOrigin==1) && (off_switch == 0))
830 { 830 {
831 /* 831 /*
832 ** Only pass through this once, off_switch must be 0 because Key_Action is called twice 832 ** Only pass through this once, off_switch must be 0 because Key_Action is called twice
833 ** for each key press. 833 ** for each key press.
834 */ 834 */
835 TRACE_EVENT("In idle window."); 835 TRACE_EVENT("In idle window.");
836 showGoodBye ( idle_get_window () ); 836 showGoodBye ( idle_get_window () );
837 times_switchoff = timCreate(0,THREE_SECS,(MfwCb)goodbye_cb); 837 times_switchoff = timCreate(0,THREE_SECS,(MfwCb)goodbye_cb);
838 timStart(times_switchoff); 838 timStart(times_switchoff);
839 off_switch++; 839 off_switch++;
840 deregis = TRUE; 840 deregis = TRUE;
841 } 841 }
842 } 842 }
843 843
844 HUPKeyOrigin = 0; 844 HUPKeyOrigin = 0;
845 845
856 satEvtDownload(SatEvtUserAction); 856 satEvtDownload(SatEvtUserAction);
857 } 857 }
858 #endif 858 #endif
859 859
860 /* Stop Playing ring tone - RAVI - 23-12-2005 */ 860 /* Stop Playing ring tone - RAVI - 23-12-2005 */
861 #ifdef NEPTUNE_BOARD 861 #ifdef NEPTUNE_BOARD
862 if(idle_data.new_sms == TRUE) 862 if(idle_data.new_sms == TRUE)
863 { 863 {
864 currentRinger = getcurrentSMSTone(); 864 currentRinger = getcurrentSMSTone();
865 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger ); 865 audio_StopSoundbyID( AUDIO_BUZZER, currentRinger );
866 866
867 /* Till this audio is stopped and next is played. */ 867 /* Till this audio is stopped and next is played. */
868 vsi_t_sleep( 0, 10 ); 868 vsi_t_sleep( 0, 10 );
869 } 869 }
870 870
871 cKeySound = 1; /* OMAPS00033660 */ 871 cKeySound = 1; /* OMAPS00033660 */
872 if( idle_data.edt_buf[0] != '\0' ) 872 if( idle_data.edt_buf[0] != '\0' )
873 { 873 {
874 if( idle_data.edt_buf[0] == '*' || idle_data.edt_buf[0] == '#' ) 874 if( idle_data.edt_buf[0] == '*' || idle_data.edt_buf[0] == '#' )
875 { 875 {
876 cKeySound = 0; 876 cKeySound = 0;
877 } 877 }
878 } 878 }
879 else 879 else
880 { 880 {
881 if ( (e & KEY_HASH) || ( e & KEY_STAR ) ) 881 if ( (e & KEY_HASH) || ( e & KEY_STAR ) )
882 { 882 {
883 cKeySound = 0; 883 cKeySound = 0;
884 } 884 }
885 } 885 }
886 886
887 if( cKeySound == 1 ) 887 if( cKeySound == 1 )
888 { 888 {
889 889
890 #endif /* OMAPS00033660 */ 890 #endif /* OMAPS00033660 */
891 /* END RAVI - 23-12-2005 */ 891 /* END RAVI - 23-12-2005 */
892 892
893 if ((FFS_flashData.settings_status & SettingsKeypadClick) && (e & KEY_MAKE)) 893 if ((FFS_flashData.settings_status & SettingsKeypadClick) && (e & KEY_MAKE))
894 { 894 {
895 TRACE_EVENT ("Keypad Click activ"); 895 TRACE_EVENT ("Keypad Click activ");
896 /* Start Playing key tones on key press - RAVI 23-12-2005 */ 896 /* Start Playing key tones on key press - RAVI 23-12-2005 */
897 #ifndef NEPTUNE_BOARD 897 #ifndef NEPTUNE_BOARD
898 audio_PlaySoundID(0, TONES_KEYBEEP, 200, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 898 audio_PlaySoundID(0, TONES_KEYBEEP, 200, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
899 #else 899 #else
900 /* RAVI - 20-1-2006 */ 900 /* RAVI - 20-1-2006 */
901 /* Silent Implementation */ 901 /* Silent Implementation */
902 /* Changed 0 to getCurrentVolumeSetting () */ 902 /* Changed 0 to getCurrentVolumeSetting () */
903 audio_PlaySoundID(0, (TONES_KEYBEEP), getCurrentVoulmeSettings(), 903 audio_PlaySoundID(0, (TONES_KEYBEEP), getCurrentVoulmeSettings(),
904 AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 904 AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
905 #endif 905 #endif
906 /* END RAVI */ 906 /* END RAVI */
907 } 907 }
908 else if ((FFS_flashData.settings_status & SettingsKeypadDTMF) && (e & KEY_MAKE)) 908 else if ((FFS_flashData.settings_status & SettingsKeypadDTMF) && (e & KEY_MAKE))
909 { 909 {
910 TRACE_EVENT ("Keypad DTMF activ"); 910 TRACE_EVENT ("Keypad DTMF activ");
911 switch (e &= mask) 911 switch (e &= mask)
912 { 912 {
913 case KEY_0: 913 case KEY_0:
914 /* RAVI - 20-1-2006 */ 914 /* RAVI - 20-1-2006 */
915 #ifdef NEPTUNE_BOARD 915 #ifdef NEPTUNE_BOARD
916 audio_PlaySoundID(0, (TONES_DTMF_0), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 916 audio_PlaySoundID(0, (TONES_DTMF_0), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
917 #else 917 #else
918 audio_PlaySoundID(0, (TONES_DTMF_0), 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 918 audio_PlaySoundID(0, (TONES_DTMF_0), 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
919 #endif 919 #endif
920 /* END RAVI */ 920 /* END RAVI */
921 break; 921 break;
922 case KEY_1: 922 case KEY_1:
923 /* RAVI - 20-1-2006 */ 923 /* RAVI - 20-1-2006 */
924 #ifdef NEPTUNE_BOARD 924 #ifdef NEPTUNE_BOARD
925 audio_PlaySoundID(0, (TONES_DTMF_1), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 925 audio_PlaySoundID(0, (TONES_DTMF_1), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
926 #else 926 #else
927 audio_PlaySoundID(0, TONES_DTMF_1, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 927 audio_PlaySoundID(0, TONES_DTMF_1, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
928 #endif 928 #endif
929 /* END RAVI */ 929 /* END RAVI */
930 break; 930 break;
931 case KEY_2: 931 case KEY_2:
932 /* RAVI - 20-1-2006 */ 932 /* RAVI - 20-1-2006 */
933 #ifdef NEPTUNE_BOARD 933 #ifdef NEPTUNE_BOARD
934 audio_PlaySoundID(0, (TONES_DTMF_2), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 934 audio_PlaySoundID(0, (TONES_DTMF_2), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
935 #else 935 #else
936 audio_PlaySoundID(0, TONES_DTMF_2, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 936 audio_PlaySoundID(0, TONES_DTMF_2, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
937 #endif 937 #endif
938 /* END RAVI */ 938 /* END RAVI */
939 break; 939 break;
940 case KEY_3: 940 case KEY_3:
941 /* RAVI - 20-1-2006 */ 941 /* RAVI - 20-1-2006 */
942 #ifdef NEPTUNE_BOARD 942 #ifdef NEPTUNE_BOARD
943 audio_PlaySoundID(0, (TONES_DTMF_3), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 943 audio_PlaySoundID(0, (TONES_DTMF_3), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
944 #else 944 #else
945 audio_PlaySoundID(0, TONES_DTMF_3, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 945 audio_PlaySoundID(0, TONES_DTMF_3, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
946 #endif 946 #endif
947 /* END RAVI */ 947 /* END RAVI */
948 break; 948 break;
949 case KEY_4: 949 case KEY_4:
950 /* RAVI - 20-1-2006 */ 950 /* RAVI - 20-1-2006 */
951 #ifdef NEPTUNE_BOARD 951 #ifdef NEPTUNE_BOARD
952 audio_PlaySoundID(0, (TONES_DTMF_4), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 952 audio_PlaySoundID(0, (TONES_DTMF_4), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
953 #else 953 #else
954 audio_PlaySoundID(0, TONES_DTMF_4, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 954 audio_PlaySoundID(0, TONES_DTMF_4, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
955 #endif 955 #endif
956 /* END RAVI */ 956 /* END RAVI */
957 break; 957 break;
958 case KEY_5: 958 case KEY_5:
959 /* RAVI - 20-1-2006 */ 959 /* RAVI - 20-1-2006 */
960 #ifdef NEPTUNE_BOARD 960 #ifdef NEPTUNE_BOARD
961 audio_PlaySoundID(0, (TONES_DTMF_5), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 961 audio_PlaySoundID(0, (TONES_DTMF_5), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
962 #else 962 #else
963 audio_PlaySoundID(0, TONES_DTMF_5, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 963 audio_PlaySoundID(0, TONES_DTMF_5, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
964 #endif 964 #endif
965 /* END RAVI */ 965 /* END RAVI */
966 break; 966 break;
967 case KEY_6: 967 case KEY_6:
968 /* RAVI - 20-1-2006 */ 968 /* RAVI - 20-1-2006 */
969 #ifdef NEPTUNE_BOARD 969 #ifdef NEPTUNE_BOARD
970 audio_PlaySoundID(0, (TONES_DTMF_6), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 970 audio_PlaySoundID(0, (TONES_DTMF_6), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
971 #else 971 #else
972 audio_PlaySoundID(0, TONES_DTMF_6, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 972 audio_PlaySoundID(0, TONES_DTMF_6, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
973 #endif 973 #endif
974 /* END RAVI */ 974 /* END RAVI */
975 break; 975 break;
976 case KEY_7: 976 case KEY_7:
977 /* RAVI - 20-1-2006 */ 977 /* RAVI - 20-1-2006 */
978 #ifdef NEPTUNE_BOARD 978 #ifdef NEPTUNE_BOARD
979 audio_PlaySoundID(0, (TONES_DTMF_7), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 979 audio_PlaySoundID(0, (TONES_DTMF_7), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
980 #else 980 #else
981 audio_PlaySoundID(0, TONES_DTMF_7, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 981 audio_PlaySoundID(0, TONES_DTMF_7, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
982 #endif 982 #endif
983 /* END RAVI */ 983 /* END RAVI */
984 break; 984 break;
985 case KEY_8: 985 case KEY_8:
986 /* RAVI - 20-1-2006 */ 986 /* RAVI - 20-1-2006 */
987 #ifdef NEPTUNE_BOARD 987 #ifdef NEPTUNE_BOARD
988 audio_PlaySoundID(0, (TONES_DTMF_8), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 988 audio_PlaySoundID(0, (TONES_DTMF_8), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
989 #else 989 #else
990 audio_PlaySoundID(0, TONES_DTMF_8, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 990 audio_PlaySoundID(0, TONES_DTMF_8, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
991 #endif 991 #endif
992 /* END RAVI */ 992 /* END RAVI */
993 break; 993 break;
994 case KEY_9: 994 case KEY_9:
995 /* RAVI - 20-1-2006 */ 995 /* RAVI - 20-1-2006 */
996 #ifdef NEPTUNE_BOARD 996 #ifdef NEPTUNE_BOARD
997 audio_PlaySoundID(0, (TONES_DTMF_9), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 997 audio_PlaySoundID(0, (TONES_DTMF_9), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
998 #else 998 #else
999 audio_PlaySoundID(0, TONES_DTMF_9, 0,AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 999 audio_PlaySoundID(0, TONES_DTMF_9, 0,AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
1000 #endif 1000 #endif
1001 /* END RAVI */ 1001 /* END RAVI */
1002 break; 1002 break;
1003 case KEY_STAR: 1003 case KEY_STAR:
1004 /* RAVI - 20-1-2006 */ 1004 /* RAVI - 20-1-2006 */
1005 #ifdef NEPTUNE_BOARD 1005 #ifdef NEPTUNE_BOARD
1006 audio_PlaySoundID(0, (TONES_DTMF_STAR), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 1006 audio_PlaySoundID(0, (TONES_DTMF_STAR), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
1007 #else 1007 #else
1008 audio_PlaySoundID(0, TONES_DTMF_STAR, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 1008 audio_PlaySoundID(0, TONES_DTMF_STAR, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
1009 #endif 1009 #endif
1010 /* END RAVI */ 1010 /* END RAVI */
1011 break; 1011 break;
1012 case KEY_HASH: 1012 case KEY_HASH:
1013 /* RAVI - 20-1-2006 */ 1013 /* RAVI - 20-1-2006 */
1014 #ifdef NEPTUNE_BOARD 1014 #ifdef NEPTUNE_BOARD
1015 audio_PlaySoundID(0, (TONES_DTMF_HASH), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 1015 audio_PlaySoundID(0, (TONES_DTMF_HASH), getCurrentVoulmeSettings(), AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
1016 #else 1016 #else
1017 audio_PlaySoundID(0, TONES_DTMF_HASH, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ 1017 audio_PlaySoundID(0, TONES_DTMF_HASH, 0, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */
1018 #endif 1018 #endif
1019 /* END RAVI */ 1019 /* END RAVI */
1020 break; 1020 break;
1021 default: 1021 default:
1022 break; 1022 break;
1023 1023
1024 } 1024 }
1025 } 1025 }
1026 1026
1027 #ifdef NEPTUNE_BOARD 1027 #ifdef NEPTUNE_BOARD
1028 } 1028 }
1029 #endif 1029 #endif
1030 1030
1031 } 1031 }
1032 1032
1033 /* OMAPS00151698, x0056422 */ 1033 /* OMAPS00151698, x0056422 */
1034 #ifdef FF_MMI_A2DP_AVRCP 1034 #ifdef FF_MMI_A2DP_AVRCP
1035 } 1035 }
1036 #endif 1036 #endif
1037 1037
1038 1038
1039 1039
1040 /* toggle the variable */ 1040 /* toggle the variable */
1041 if(toggle) 1041 if(toggle)
1054 #if(0)/* x0039928 -Lint warning removal */ 1054 #if(0)/* x0039928 -Lint warning removal */
1055 /******************************************************************************* 1055 /*******************************************************************************
1056 1056
1057 $Function: key 1057 $Function: key
1058 1058
1059 $Description: keyboard event handler 1059 $Description: keyboard event handler
1060 1060
1061 $Returns: none. 1061 $Returns: none.
1062 1062
1063 $Arguments: 1063 $Arguments:
1064 1064
1067 static int key (MfwEvt e, MfwKbd *kc) 1067 static int key (MfwEvt e, MfwKbd *kc)
1068 { 1068 {
1069 1069
1070 TRACE_FUNCTION("Initial key"); 1070 TRACE_FUNCTION("Initial key");
1071 //---------------start : Mobile On------------------- 1071 //---------------start : Mobile On-------------------
1072 TRACE_EVENT(" Mobile ON"); 1072 TRACE_EVENT(" Mobile ON");
1073 /* set the state of mobile on */ 1073 /* set the state of mobile on */
1074 globalMobileMode = (globalMobileMode | GlobalMobileOn); 1074 globalMobileMode = (globalMobileMode | GlobalMobileOn);
1075 1075
1076 1076
1077 //startExec(PhoneInit,0); /* get it rolling */ 1077 //startExec(PhoneInit,0); /* get it rolling */
1078 1078
1079 return 1; 1079 return 1;
1080 } 1080 }
1081 1081
1082 #endif 1082 #endif
1083 //Callback after dialog "Charging" is displayed 1083 //Callback after dialog "Charging" is displayed
1084 //x0pleela 14 Apr, 2006 ER: OMAPS00075178 1084 //x0pleela 14 Apr, 2006 ER: OMAPS00075178
1085 static void charging_start_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) 1085 static void charging_start_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
1086 { 1086 {
1087 TRACE_FUNCTION("charging_start_cb()"); 1087 TRACE_FUNCTION("charging_start_cb()");
1088 /* 1088 /*
1089 ** Send an Idle Update to trigger the idle screen to be updated if required, 1089 ** Send an Idle Update to trigger the idle screen to be updated if required,
1090 */ 1090 */
1091 idleEvent(IdleUpdate); 1091 idleEvent(IdleUpdate);
1092 1092
1093 return; 1093 return;
1094 } 1094 }
1095 1095
1096 //function to display the dialog "charging" when charger is connected 1096 //function to display the dialog "charging" when charger is connected
1097 //x0pleela 14 Apr, 2006 ER: OMAPS00075178 1097 //x0pleela 14 Apr, 2006 ER: OMAPS00075178
1098 static void charging_start_info(void) 1098 static void charging_start_info(void)
1099 { 1099 {
1100 T_DISPLAY_DATA display_info; 1100 T_DISPLAY_DATA display_info;
1101 1101
1102 TRACE_FUNCTION("charging_start_info()"); 1102 TRACE_FUNCTION("charging_start_info()");
1103 1103
1104 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtCharging, TxtNull, COLOUR_STATUS); 1104 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtCharging, TxtNull, COLOUR_STATUS);
1105 /*a0393213 warnings removal-callback fn typecasted*/ 1105 /*a0393213 warnings removal-callback fn typecasted*/
1106 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)charging_start_cb, TWO_SECS, KEY_CLEAR ); 1106 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)charging_start_cb, TWO_SECS, KEY_CLEAR );
1107 /* 1107 /*
1108 * Call Info Screen 1108 * Call Info Screen
1109 */ 1109 */
1110 info_dialog (idle_get_window(), &display_info); 1110 info_dialog (idle_get_window(), &display_info);
1111 1111
1112 1112
1113 return; 1113 return;
1114 } 1114 }
1115 /******************************************************************************* 1115 /*******************************************************************************
1116 1116
1117 $Function: globalMme 1117 $Function: globalMme
1118 1118
1119 $Description: MME event handler 1119 $Description: MME event handler
1120 1120
1121 $Returns: none. 1121 $Returns: none.
1122 1122
1123 $Arguments: 1123 $Arguments:
1124 1124
1125 *******************************************************************************/ 1125 *******************************************************************************/
1126 int globalMme(MfwEvt e, MfwHnd para) 1126 int globalMme(MfwEvt e, MfwHnd para)
1127 { 1127 {
1128 MfwMme* mc = (MfwMme*)para; 1128 MfwMme* mc = (MfwMme*)para;
1129 1129
1130 U8 value; 1130 U8 value;
1131 #ifdef FF_MMI_AUDIO_PROFILE 1131 #ifdef FF_MMI_AUDIO_PROFILE
1132 MfwHnd win = call_data.win_incoming; 1132 MfwHnd win = call_data.win_incoming;
1133 MfwWin * win_data ; 1133 MfwWin * win_data ;
1134 T_dialog_info * data; 1134 T_dialog_info * data;
1135 T_MFW_HND parent_win = NULL; 1135 T_MFW_HND parent_win = NULL;
1136 USHORT Identifier = 0; 1136 USHORT Identifier = 0;
1137 void (* Callback)() = NULL; 1137 void (* Callback)() = NULL;
1138 1138
1139 if( win != NULL) 1139 if( win != NULL)
1140 { 1140 {
1141 win_data = (MfwWin*)((T_MFW_HDR *)win)->data; 1141 win_data = (MfwWin*)((T_MFW_HDR *)win)->data;
1142 data = (T_dialog_info *)win_data->user; 1142 data = (T_dialog_info *)win_data->user;
1143 parent_win = data->parent_win; 1143 parent_win = data->parent_win;
1144 Identifier = data->Identifier; 1144 Identifier = data->Identifier;
1145 Callback= data->Callback; 1145 Callback= data->Callback;
1146 } 1146 }
1147 #endif 1147 #endif
1148 1148
1149 TRACE_FUNCTION("globalMme"); 1149 TRACE_FUNCTION("globalMme");
1150 1150
1151 switch(e) { 1151 switch(e) {
1152 case MfwMmeSignal : 1152 case MfwMmeSignal :
1153 TRACE_EVENT("Mme Event: Signal"); 1153 TRACE_EVENT("Mme Event: Signal");
1154 value = (U8)mc->value;//JVJE 1154 value = (U8)mc->value;//JVJE
1155 /***************************Go-lite Optimization changes Start***********************/ 1155 /***************************Go-lite Optimization changes Start***********************/
1156 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 1156 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
1157 TRACE_EVENT_P1 ("Event MfwMmeSignal %d", value); 1157 TRACE_EVENT_P1 ("Event MfwMmeSignal %d", value);
1158 /***************************Go-lite Optimization changes end***********************/ 1158 /***************************Go-lite Optimization changes end***********************/
1159 globalSignalUpdate(value); /*Update the value of the fieldstrength */ 1159 globalSignalUpdate(value); /*Update the value of the fieldstrength */
1160
1161 break; 1160 break;
1162 1161
1163 case MfwMmeBattery: 1162 case MfwMmeBattery:
1164 TRACE_EVENT("Mme Event: Battery...."); 1163 TRACE_EVENT("Mme Event: Battery....");
1165 TRACE_EVENT_P1("MfwMmeBattery:mc->value: %d", mc->value); 1164 TRACE_EVENT_P1("MfwMmeBattery:mc->value: %d", mc->value);
1166 globalBatteryUpdate(mc->value); //x0pleela 10 Apr, 2006 ER: OMAPS00075178 1165 globalBatteryUpdate(mc->value); //x0pleela 10 Apr, 2006 ER: OMAPS00075178
1167 break; 1166 break;
1168
1169 1167
1170 case MfwMmeBaState: 1168 case MfwMmeBaState:
1171 TRACE_EVENT("Mme Event: State...."); 1169 TRACE_EVENT("Mme Event: State....");
1172 1170
1173 value = (U8)mc->value; 1171 value = (U8)mc->value;
1214 break; 1212 break;
1215 default: 1213 default:
1216 break; 1214 break;
1217 } 1215 }
1218 break; 1216 break;
1219 // xpradipg - LOCOSTO-ENH-31895 : 23 June 2005 1217 // xpradipg - LOCOSTO-ENH-31895 : 23 June 2005
1220 #ifdef FF_MMI_AUDIO_PROFILE 1218 #ifdef FF_MMI_AUDIO_PROFILE
1221 //indicates the events related to the headset 1219 //indicates the events related to the headset
1222 case MfwMmeHeadset: 1220 case MfwMmeHeadset:
1223 // Aug 03, 2006 REF:OMAPS00088329 x0039928 1221 // Aug 03, 2006 REF:OMAPS00088329 x0039928
1224 #ifdef MMI_TTY_ENABLED 1222 #ifdef MMI_TTY_ENABLED
1225 1223
1226 if(FFS_flashData.ttyAlwaysOn == FALSE && call_data.tty == CALL_TTY_OFF) 1224 if(FFS_flashData.ttyAlwaysOn == FALSE && call_data.tty == CALL_TTY_OFF)
1227 1225
1228 #endif 1226 #endif
1229 { 1227 {
1230 value = (U8)mc->value; 1228 value = (U8)mc->value;
1231 switch(value) 1229 switch(value)
1232 { 1230 {
1233 case AUDIO_HEADSET_HOOK_DETECT: 1231 case AUDIO_HEADSET_HOOK_DETECT:
1234 { 1232 {
1235 TRACE_EVENT("AUDIO_HEADSET_HOOK_DETECT"); 1233 TRACE_EVENT("AUDIO_HEADSET_HOOK_DETECT");
1236 if( winIsFocussed(call_data.win_incoming)) 1234 if( winIsFocussed(call_data.win_incoming))
1237 { 1235 {
1238 dialog_info_destroy(win); 1236 dialog_info_destroy(win);
1239 if(Callback != NULL) /* x0039928 - Lint warning fix */ 1237 if(Callback != NULL) /* x0039928 - Lint warning fix */
1240 (Callback)(parent_win,Identifier, INFO_KCD_LEFT); 1238 (Callback)(parent_win,Identifier, INFO_KCD_LEFT);
1241 } 1239 }
1242 else if(call_data.win) 1240 else if(call_data.win)
1243 mmi_hook_handle(); 1241 mmi_hook_handle();
1244 } 1242 }
1245 break; 1243 break;
1246 case AUDIO_HEADSET_UNPLUGGED: 1244 case AUDIO_HEADSET_UNPLUGGED:
1247 TRACE_EVENT("AUDIO_HEADSET_UNPLUGGED"); 1245 TRACE_EVENT("AUDIO_HEADSET_UNPLUGGED");
1248 //x0pleela 20 Mar, 2007 ER: OMAPS00122561 1246 //x0pleela 20 Mar, 2007 ER: OMAPS00122561
1249 #ifdef FF_PHONE_LOCK 1247 #ifdef FF_PHONE_LOCK
1250 //Set headset connect to FALSE 1248 //Set headset connect to FALSE
1251 mmi_set_Headset_Reg(FALSE); 1249 mmi_set_Headset_Reg(FALSE);
1252 1250
1253 //x0pleela 23 May, 2007 DR: OMAPS00132483 1251 //x0pleela 23 May, 2007 DR: OMAPS00132483
1254 //get the phone lock status 1252 //get the phone lock status
1255 if( !mfw_get_Phlock_status() ) 1253 if( !mfw_get_Phlock_status() )
1256 { 1254 {
1257 #endif /*FF_PHONE_LOCK*/ 1255 #endif /*FF_PHONE_LOCK*/
1258 1256
1259 mmi_device_status_info(NULL,TxtHeadset,TxtRemoved,NULL); 1257 mmi_device_status_info(NULL,TxtHeadset,TxtRemoved,NULL);
1260 // Jun 02, 2006 DRT OMAPS00079213 x0039928(sumanth) 1258 // Jun 02, 2006 DRT OMAPS00079213 x0039928(sumanth)
1261 // Fix: Hook is unregistered when headset is plugged off. 1259 // Fix: Hook is unregistered when headset is plugged off.
1262 mfw_hook_unregister(); 1260 mfw_hook_unregister();
1263 1261
1264 //x0pleela 20 Mar, 2007 ER: OMAPS00122561 1262 //x0pleela 20 Mar, 2007 ER: OMAPS00122561
1265 #ifdef FF_PHONE_LOCK 1263 #ifdef FF_PHONE_LOCK
1266 } 1264 }
1267 #endif /*FF_PHONE_LOCK*/ 1265 #endif /*FF_PHONE_LOCK*/
1268 1266
1269 mfw_audio_device_indication(value); 1267 mfw_audio_device_indication(value);
1270 break; 1268 break;
1271 1269
1272 case AUDIO_HEADSET_PLUGGED: 1270 case AUDIO_HEADSET_PLUGGED:
1273 TRACE_EVENT("AUDIO_HEADSET_PLUGGED"); 1271 TRACE_EVENT("AUDIO_HEADSET_PLUGGED");
1274 //x0pleela 20 Mar, 2007 ER: OMAPS00122561 1272 //x0pleela 20 Mar, 2007 ER: OMAPS00122561
1275 #ifdef FF_PHONE_LOCK 1273 #ifdef FF_PHONE_LOCK
1276 //set headset connect to TRUE 1274 //set headset connect to TRUE
1277 mmi_set_Headset_Reg(TRUE); 1275 mmi_set_Headset_Reg(TRUE);
1278 1276
1279 //x0pleela 23 May, 2007 DR: OMAPS00132483 1277 //x0pleela 23 May, 2007 DR: OMAPS00132483
1280 //get the phone lock status 1278 //get the phone lock status
1281 if( !mfw_get_Phlock_status() ) 1279 if( !mfw_get_Phlock_status() )
1282 #endif /*FF_PHONE_LOCK*/ 1280 #endif /*FF_PHONE_LOCK*/
1283 1281
1284 mmi_device_status_info(NULL,TxtHeadset,TxtInserted,NULL); 1282 mmi_device_status_info(NULL,TxtHeadset,TxtInserted,NULL);
1285 1283
1286 mfw_audio_device_indication(value); 1284 mfw_audio_device_indication(value);
1287 1285
1288 //x0pleela 20 Mar, 2007 ER: OMAPS00122561 1286 //x0pleela 20 Mar, 2007 ER: OMAPS00122561
1289 #ifdef FF_PHONE_LOCK 1287 #ifdef FF_PHONE_LOCK
1290 //x0pleela 23 May, 2007 DR: OMAPS00132483 1288 //x0pleela 23 May, 2007 DR: OMAPS00132483
1291 //get the phone lock status 1289 //get the phone lock status
1292 if( !mfw_get_Phlock_status() ) 1290 if( !mfw_get_Phlock_status() )
1293 { 1291 {
1294 #endif /*FF_PHONE_LOCK*/ 1292 #endif /*FF_PHONE_LOCK*/
1295 // Jun 02, 2006 DRT OMAPS00079213 x0039928(sumanth) 1293 // Jun 02, 2006 DRT OMAPS00079213 x0039928(sumanth)
1296 // Fix: Hook is registered when headset is plugged in during call. 1294 // Fix: Hook is registered when headset is plugged in during call.
1297 if(call_data.win_calling OR call_data.win_incoming OR call_data.calls.numCalls) 1295 if(call_data.win_calling OR call_data.win_incoming OR call_data.calls.numCalls)
1298 mfw_hook_register(); 1296 mfw_hook_register();
1299 1297
1300 //x0pleela 20 Mar, 2007 ER: OMAPS00122561 1298 //x0pleela 20 Mar, 2007 ER: OMAPS00122561
1301 #ifdef FF_PHONE_LOCK 1299 #ifdef FF_PHONE_LOCK
1302 } 1300 }
1303 #endif /*FF_PHONE_LOCK*/ 1301 #endif /*FF_PHONE_LOCK*/
1304 break; 1302 break;
1305 } 1303 }
1306 } 1304 }
1307 1305
1308 break; 1306 break;
1309 //indicates the events related to the carkit 1307 //indicates the events related to the carkit
1310 case MfwMmeCarkit: 1308 case MfwMmeCarkit:
1311 value = (U8) mc->value; 1309 value = (U8) mc->value;
1312 switch(value) 1310 switch(value)
1313 { 1311 {
1314 case AUDIO_CARKIT_UNPLUGGED: 1312 case AUDIO_CARKIT_UNPLUGGED:
1315 TRACE_EVENT("AUDIO_CARKIT_UNPLUGGED"); 1313 TRACE_EVENT("AUDIO_CARKIT_UNPLUGGED");
1316 mmi_device_status_info(NULL,TxtCarkit,TxtRemoved,NULL); 1314 mmi_device_status_info(NULL,TxtCarkit,TxtRemoved,NULL);
1317 mfw_audio_device_indication(value); 1315 mfw_audio_device_indication(value);
1318 break; 1316 break;
1319 case AUDIO_CARKIT_PLUGGED: 1317 case AUDIO_CARKIT_PLUGGED:
1320 TRACE_EVENT("AUDIO_CARKIT_PLUGGED"); 1318 TRACE_EVENT("AUDIO_CARKIT_PLUGGED");
1321 mmi_device_status_info(NULL,TxtCarkit,TxtInserted,NULL); 1319 mmi_device_status_info(NULL,TxtCarkit,TxtInserted,NULL);
1322 mfw_audio_device_indication(value); 1320 mfw_audio_device_indication(value);
1323 break; 1321 break;
1324 } 1322 }
1325 break; 1323 break;
1326 #endif 1324 #endif
1327 //Handler for connect and disconnect event of the USB cable. 1325 //Handler for connect and disconnect event of the USB cable.
1328 #ifdef FF_MMI_USBMS 1326 #ifdef FF_MMI_USBMS
1329 case MfwMmeUSBMS: 1327 case MfwMmeUSBMS:
1330 { 1328 {
1331 value = (U8) mc->value; 1329 value = (U8) mc->value;
1332 switch(value) 1330 switch(value)
1333 { 1331 {
1334 case MFW_USB_CABLE_CONNECT_EVENT : 1332 case MFW_USB_CABLE_CONNECT_EVENT :
1335 //x0pleela 16 Mar, 2007 ER: OMAPS00122561 1333 //x0pleela 16 Mar, 2007 ER: OMAPS00122561
1336 #ifdef FF_PHONE_LOCK 1334 #ifdef FF_PHONE_LOCK
1337 //set usb_ms_enum to TRUE 1335 //set usb_ms_enum to TRUE
1338 mmi_set_usbms_enum( TRUE); 1336 mmi_set_usbms_enum( TRUE);
1339 //x0pleela 23 May, 2007 DR: OMAPS00132483 1337 //x0pleela 23 May, 2007 DR: OMAPS00132483
1340 //get the phone lock status 1338 //get the phone lock status
1341 if( !mfw_get_Phlock_status() ) 1339 if( !mfw_get_Phlock_status() )
1342 #endif /*FF_PHONE_LOCK*/ 1340 #endif /*FF_PHONE_LOCK*/
1343 1341
1344 mmi_usb_enumeration_options(); 1342 mmi_usb_enumeration_options();
1345 break; 1343 break;
1346 1344
1347 case MFW_USB_CABLE_DISCONNECT_EVENT : 1345 case MFW_USB_CABLE_DISCONNECT_EVENT :
1348 //x0pleela 16 Mar, 2007 ER: OMAPS00122561 1346 //x0pleela 16 Mar, 2007 ER: OMAPS00122561
1349 #ifdef FF_PHONE_LOCK 1347 #ifdef FF_PHONE_LOCK
1350 //set usb_ms_enum to FALSE 1348 //set usb_ms_enum to FALSE
1351 mmi_set_usbms_enum( FALSE ); 1349 mmi_set_usbms_enum( FALSE );
1352 //x0pleela 23 May, 2007 DR: OMAPS00132483 1350 //x0pleela 23 May, 2007 DR: OMAPS00132483
1353 //get the phone lock status 1351 //get the phone lock status
1354 if( !mfw_get_Phlock_status() ) 1352 if( !mfw_get_Phlock_status() )
1355 #endif /*FF_PHONE_LOCK*/ 1353 #endif /*FF_PHONE_LOCK*/
1356 1354
1357 mmi_usbms_mode_disconnect(); 1355 mmi_usbms_mode_disconnect();
1358 break; 1356 break;
1359 /* Mar 22, 2007 DVT: OMAPS00121916 x0039928 */ 1357 /* Mar 22, 2007 DVT: OMAPS00121916 x0039928 */
1360 #ifdef FF_MMI_FILEMANAGER 1358 #ifdef FF_MMI_FILEMANAGER
1361 case MFW_TFLASH_INSERTED_EVENT: 1359 case MFW_TFLASH_INSERTED_EVENT:
1362 mmi_device_status_info(NULL,TxtTflash,TxtInserted,NULL); 1360 mmi_device_status_info(NULL,TxtTflash,TxtInserted,NULL);
1363 break; 1361 break;
1364 case MFW_TFLASH_REMOVED_EVENT: 1362 case MFW_TFLASH_REMOVED_EVENT:
1365 mmi_device_status_info(NULL,TxtTflash,TxtRemoved,NULL); 1363 mmi_device_status_info(NULL,TxtTflash,TxtRemoved,NULL);
1366 break; 1364 break;
1367 #endif 1365 #endif
1368 } 1366 }
1369 1367
1370 } 1368 }
1371 break; 1369 break;
1372 #endif 1370 #endif
1373 1371
1374 default: 1372 default:
1375 return 1;
1376 }
1377 return 1; 1373 return 1;
1374 }
1375 return 1;
1378 } 1376 }
1379 1377
1380 #if(0) /* x0039928 - Lint warning removal */ 1378 #if(0) /* x0039928 - Lint warning removal */
1381 /******************************************************************************* 1379 /*******************************************************************************
1382 1380
1383 $Function: backlight 1381 $Function: backlight
1384 1382
1385 $Description: switch on backlight for certain time 1383 $Description: switch on backlight for certain time
1386 1384
1387 $Returns: none. 1385 $Returns: none.
1388 1386
1389 $Arguments: 1387 $Arguments:
1390 1388
1397 #endif 1395 #endif
1398 /******************************************************************************* 1396 /*******************************************************************************
1399 1397
1400 $Function: timesEvent 1398 $Function: timesEvent
1401 1399
1402 $Description: times event clock 1400 $Description: times event clock
1403 1401
1404 $Returns: none. 1402 $Returns: none.
1405 1403
1406 $Arguments: 1404 $Arguments:
1407 1405
1408 *******************************************************************************/ 1406 *******************************************************************************/
1409 static int timesEvent (MfwEvt e, MfwTim *t) 1407 static int timesEvent (MfwEvt e, MfwTim *t)
1410 { 1408 {
1411 1409
1412 //RM only for PC testing 1410 //RM only for PC testing
1413 /* x0039928 -Lint warning removal 1411 /* x0039928 -Lint warning removal
1414 second += 60; */ 1412 second += 60; */
1415 1413
1416 1414
1417 idleEvent(IdleUpdate); 1415 idleEvent(IdleUpdate);
1418 1416
1419 /*MC CONQUEST 5999->6007,21/05/02 if CPHS reading didn't work on switch-on, try again*/ 1417 /*MC CONQUEST 5999->6007,21/05/02 if CPHS reading didn't work on switch-on, try again*/
1420 if (CphsPresent() == CPHS_ERR) 1418 if (CphsPresent() == CPHS_ERR)
1421 cphs_support_check(); 1419 cphs_support_check();
1422 1420
1423 1421
1424 mme_backlightEvent(BL_IDLE_TIMER); 1422 mme_backlightEvent(BL_IDLE_TIMER);
1425 1423
1426 timStart(times); 1424 timStart(times);
1427 1425
1428 return 1; 1426 return 1;
1429 } 1427 }
1430 1428
1431 1429
1432 /******************************************************************************* 1430 /*******************************************************************************
1433 1431
1434 $Function: showCLOCK 1432 $Function: showCLOCK
1435 1433
1436 $Description: display clock 1434 $Description: display clock
1437 1435
1438 $Returns: none. 1436 $Returns: none.
1439 1437
1440 $Arguments: 1438 $Arguments:
1441 1439
1442 *******************************************************************************/ 1440 *******************************************************************************/
1443 void showCLOCK(void) 1441 void showCLOCK(void)
1444 { /*SPR 1725, use new function to get clock string*/ 1442 { /*SPR 1725, use new function to get clock string*/
1445 dspl_TextOut(30,24,0,(char *)mfw_td_get_clock_str()); 1443 dspl_TextOut(30,24,0,(char *)mfw_td_get_clock_str());
1446 } 1444 }
1447 /******************************************************************************* 1445 /*******************************************************************************
1448 1446
1449 $Function: setClockFormat 1447 $Function: setClockFormat
1450 1448
1451 $Description: used to switch between 24 hour and 12 hour display format 1449 $Description: used to switch between 24 hour and 12 hour display format
1452 1450
1453 $Returns: none. 1451 $Returns: none.
1454 1452
1455 $Arguments: format enum 1453 $Arguments: format enum
1456 1454
1462 else 1460 else
1463 FFS_flashData.time_format = MFW_TIME_FORMAT_24HOUR; 1461 FFS_flashData.time_format = MFW_TIME_FORMAT_24HOUR;
1464 // Jul 22,2004 CRR:20896 xrashmic - SASKEN 1462 // Jul 22,2004 CRR:20896 xrashmic - SASKEN
1465 // The timeformat was not being written into the flash. 1463 // The timeformat was not being written into the flash.
1466 flash_write(); 1464 flash_write();
1467 1465
1468 mfw_td_set_time_format((T_MFW_TIME_FORMAT)format); 1466 mfw_td_set_time_format((T_MFW_TIME_FORMAT)format);
1469 } 1467 }
1470 // Issue Number : MMI-SPR-12159 on 07/04/04 by Rashmi C N and Deepa M D 1468 // Issue Number : MMI-SPR-12159 on 07/04/04 by Rashmi C N and Deepa M D
1471 // change by Sasken ( Rashmi C N and Deepa M D) on April 07th 2004 1469 // change by Sasken ( Rashmi C N and Deepa M D) on April 07th 2004
1472 // Bug : The AM PM for 12 hour fomrat was not being shown 1470 // Bug : The AM PM for 12 hour fomrat was not being shown
1473 // Solution : Added the following function to get the current time format from flash 1471 // Solution : Added the following function to get the current time format from flash
1474 UBYTE getClockFormat() 1472 UBYTE getClockFormat()
1475 { 1473 {
1476 return FFS_flashData.time_format; 1474 return FFS_flashData.time_format;
1477 } 1475 }
1478 1476
1479 /*SPR 1725, removed ClockSet and DateSet functions*/ 1477 /*SPR 1725, removed ClockSet and DateSet functions*/
1480 1478
1481 /******************************************************************************* 1479 /*******************************************************************************
1482 1480
1483 $Function: showDATE 1481 $Function: showDATE
1484 1482
1485 $Description: display date 1483 $Description: display date
1486 1484
1487 $Returns: 1485 $Returns:
1488 1486
1489 $Arguments: 1487 $Arguments:
1490 1488
1498 1496
1499 /******************************************************************************* 1497 /*******************************************************************************
1500 1498
1501 $Function: displayAlignedText 1499 $Function: displayAlignedText
1502 1500
1503 $Description: Display text horizontally aligned [left|right|center] in specified row. 1501 $Description: Display text horizontally aligned [left|right|center] in specified row.
1504 1502
1505 1503
1506 $Returns: none. 1504 $Returns: none.
1507 1505
1508 $Arguments: 1506 $Arguments:
1515 1513
1516 dspl_DevCaps deviceCaps; 1514 dspl_DevCaps deviceCaps;
1517 1515
1518 dspl_GetDeviceCaps(&deviceCaps); 1516 dspl_GetDeviceCaps(&deviceCaps);
1519 1517
1520 /* SPR#1983 - SH - Shouldn't use strlen for unicode string. 1518 /* SPR#1983 - SH - Shouldn't use strlen for unicode string.
1521 * 0 means whole string will be used. */ 1519 * 0 means whole string will be used. */
1522 1520
1523 stringLength = (int)dspl_GetTextExtent(string, 0); 1521 stringLength = (int)dspl_GetTextExtent(string, 0);
1524 1522
1525 TRACE_EVENT_P2("aligned %d, extent = %d", x_alignment, stringLength); 1523 TRACE_EVENT_P2("aligned %d, extent = %d", x_alignment, stringLength);
1526 1524
1527 switch ( x_alignment ) 1525 switch ( x_alignment ) {
1528 { 1526 case LEFT:
1529 case LEFT: 1527 break;
1530 1528
1531 break; 1529 case RIGHT:
1532 1530 startXPos = (USHORT) deviceCaps.Width - stringLength /*- OneCharLen*/ ;
1533 case RIGHT: 1531 break;
1534 startXPos = (USHORT) deviceCaps.Width - stringLength /*- OneCharLen*/ ; 1532
1535 break; 1533 case CENTER:
1536 1534 startXPos = (USHORT) (deviceCaps.Width - stringLength) / 2;
1537 case CENTER: 1535 break;
1538 startXPos = (USHORT) (deviceCaps.Width - stringLength) / 2; 1536 }
1539 break; 1537
1540 1538 dspl_TextOut(startXPos, y_lineNum, attrib, (char*)string );
1541 }
1542
1543 dspl_TextOut(startXPos, y_lineNum, attrib, (char*)string );
1544 } 1539 }
1545 /******************************************************************************* 1540 /*******************************************************************************
1546 1541
1547 $Function: displayAlignedPrompt 1542 $Function: displayAlignedPrompt
1548 1543
1549 $Description: Display prompt horizontally aligned [left|right|center] in specified row. 1544 $Description: Display prompt horizontally aligned [left|right|center] in specified row.
1550 1545
1551 $Returns: 1546 $Returns:
1552 1547
1553 $Arguments: 1548 $Arguments:
1554 1549
1579 startXPos = (USHORT) (deviceCaps.Width - stringLength) / 2; 1574 startXPos = (USHORT) (deviceCaps.Width - stringLength) / 2;
1580 break; 1575 break;
1581 1576
1582 } 1577 }
1583 1578
1584 PROMPT(startXPos, y_lineNum, attrib, string_id ); 1579 PROMPT(startXPos, y_lineNum, attrib, string_id );
1585 } 1580 }
1586 /******************************************************************************* 1581 /*******************************************************************************
1587 1582
1588 $Function: mainShutdown 1583 $Function: mainShutdown
1589 1584
1590 $Description: 1585 $Description:
1591 1586
1592 $Returns: none. 1587 $Returns: none.
1593 1588
1594 $Arguments: 1589 $Arguments:
1595 1590
1596 *******************************************************************************/ 1591 *******************************************************************************/
1597 void mainShutdown(void) 1592 void mainShutdown(void)
1598 { 1593 {
1599 1594
1600 TRACE_FUNCTION("mainShutdown ()"); 1595 TRACE_FUNCTION("mainShutdown ()");
1601 1596
1602 if(deregis) 1597 if(deregis)
1603 { 1598 {
1604 //---------------start: Mobile OFF------------------- 1599 //---------------start: Mobile OFF-------------------
1605 TRACE_EVENT(" Mobile OFF"); 1600 TRACE_EVENT(" Mobile OFF");
1606 /* delete the state of mobile on */ 1601 /* delete the state of mobile on */
1607 globalMobileMode = globalMobileMode & (~GlobalMobileOn); 1602 globalMobileMode = globalMobileMode & (~GlobalMobileOn);
1608 1603
1609 deregis = FALSE; 1604 deregis = FALSE;
1610 1605
1611 mmiExit();/* RM 20-07 */ 1606 mmiExit();/* RM 20-07 */
1612 1607
1613 //Jul 05, 2005 REF: SPR 31894 xdeepadh 1608 //Jul 05, 2005 REF: SPR 31894 xdeepadh
1614 // SIM functionality has been replaced by UICC in Locosto. 1609 // SIM functionality has been replaced by UICC in Locosto.
1615 #ifdef TI_PS_UICC_CHIPSET_15 1610 #ifdef TI_PS_UICC_CHIPSET_15
1616 simdrv_poweroff(BSP_UICC_DEFAULT_READER_ID); 1611 simdrv_poweroff(BSP_UICC_DEFAULT_READER_ID);
1617 #else 1612 #else
1618 SIM_PowerOff(); 1613 SIM_PowerOff();
1619 #endif 1614 #endif
1620 #ifndef _SIMULATION_ 1615 #ifndef _SIMULATION_
1621 AI_Power(0); 1616 AI_Power(0);
1622 #endif 1617 #endif
1623 1618
1625 } 1620 }
1626 /******************************************************************************* 1621 /*******************************************************************************
1627 1622
1628 $Function: globalBatteryUpdate 1623 $Function: globalBatteryUpdate
1629 1624
1630 $Description: Update the value of the battery after the MME event 1625 $Description: Update the value of the battery after the MME event
1631 1626
1632 $Returns: 1627 $Returns:
1633 1628
1634 $Arguments: 1629 $Arguments:
1635 1630
1642 globalBatteryMode = GlobalBatteryGreater5; 1637 globalBatteryMode = GlobalBatteryGreater5;
1643 1638
1644 1639
1645 switch (value) 1640 switch (value)
1646 { 1641 {
1647 case 0: /* battery low */ 1642 case 0: /* battery low */
1648 globalBatteryPicNumber = 0; 1643 globalBatteryPicNumber = 0;
1649 globalBatteryMode = GlobalBatteryLesser5; 1644 globalBatteryMode = GlobalBatteryLesser5;
1650 1645
1651 /* is just a global status */ 1646 /* is just a global status */
1652 MmiModuleSet (ModuleBattLow); /* set the state */ 1647 MmiModuleSet (ModuleBattLow); /* set the state */
1653 break; 1648 break;
1654 1649
1655 case 1: 1650 case 1:
1656 globalBatteryPicNumber = 1; 1651 globalBatteryPicNumber = 1;
1657 break; 1652 break;
1658 1653
1659 case 2: 1654 case 2:
1660 globalBatteryPicNumber = 2; 1655 globalBatteryPicNumber = 2;
1661 break; 1656 break;
1662 1657
1663 case 3: 1658 case 3:
1664 globalBatteryPicNumber = 3; 1659 globalBatteryPicNumber = 3;
1665 break; 1660 break;
1666 1661
1667 case 4: 1662 case 4:
1668 globalBatteryPicNumber = 4; 1663 globalBatteryPicNumber = 4;
1669 break; 1664 break;
1670 1665
1671 default: 1666 default:
1672 globalBatteryPicNumber = 2; 1667 globalBatteryPicNumber = 2;
1673 break; 1668 break;
1674 } 1669 }
1675 1670
1676 idleEvent(IdleUpdate); 1671 idleEvent(IdleUpdate);
1677 1672
1678 return 0; 1673 return 0;
1692 *******************************************************************************/ 1687 *******************************************************************************/
1693 int globalSignalUpdate (U8 value) 1688 int globalSignalUpdate (U8 value)
1694 { 1689 {
1695 1690
1696 globalSignalPicNumber = value; 1691 globalSignalPicNumber = value;
1697 1692
1698 idleEvent(IdleUpdate); 1693 idleEvent(IdleUpdate);
1699 #ifdef NEPTUNE_BOARD 1694 #ifdef NEPTUNE_BOARD
1700 dspl_Enable(1); 1695 dspl_Enable(1);
1701 #endif 1696 #endif
1702 return 0; 1697 return 0;
1706 1701
1707 /******************************************************************************* 1702 /*******************************************************************************
1708 1703
1709 $Function: globalFlashBattery 1704 $Function: globalFlashBattery
1710 1705
1711 $Description: exit MMI main module 1706 $Description: exit MMI main module
1712 1707
1713 $Returns: none. 1708 $Returns: none.
1714 1709
1715 $Arguments: 1710 $Arguments:
1716 1711
1720 TRACE_EVENT(" globalFlashBattery "); 1715 TRACE_EVENT(" globalFlashBattery ");
1721 1716
1722 globalBatteryPicNumber++; 1717 globalBatteryPicNumber++;
1723 1718
1724 if(globalBatteryPicNumber > 4) 1719 if(globalBatteryPicNumber > 4)
1725 globalBatteryPicNumber = 0; 1720 globalBatteryPicNumber = 0;
1726 1721
1727 idleEvent(IdleUpdate); 1722 idleEvent(IdleUpdate);
1728 TRACE_EVENT(" start the timer for Blink "); 1723 TRACE_EVENT(" start the timer for Blink ");
1729
1730
1731 } 1724 }
1732 1725
1733 /* SPR#1428 - SH - New Editor: this is all obsolete with new editor. Equivalent 1726 /* SPR#1428 - SH - New Editor: this is all obsolete with new editor. Equivalent
1734 * functionality can be found in AUITextEntry.c */ 1727 * functionality can be found in AUITextEntry.c */
1735 1728
1736 #ifndef NEW_EDITOR 1729 #ifndef NEW_EDITOR
1737 /******************************************************************************* 1730 /*******************************************************************************
1738 1731
1739 $Function: editShowHeader 1732 $Function: editShowHeader
1740 1733
1741 $Description: displays the new character over the cursor 1734 $Description: displays the new character over the cursor
1742 1735
1743 $Returns: none. 1736 $Returns: none.
1744 1737
1745 $Arguments: 1738 $Arguments:
1746 1739
1747 *******************************************************************************/ 1740 *******************************************************************************/
1748 /*MC SPR 1242 merged in b-sample version of this function */ 1741 /*MC SPR 1242 merged in b-sample version of this function */
1749 static void editShowHeader (void) 1742 static void editShowHeader (void)
1750 { 1743 {
1751 int alphachar; 1744 int alphachar;
1752 MfwEdt *edit = ((MfwHdr *) myHandle)->data; 1745 MfwEdt *edit = ((MfwHdr *) myHandle)->data;
1753 1746
1754 TRACE_FUNCTION("editShowHeader"); 1747 TRACE_FUNCTION("editShowHeader");
1755 1748
1756 edtChar(myHandle,ecDel); 1749 edtChar(myHandle,ecDel);
1757 if (upCase) 1750 if (upCase)
1758 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; 1751 alphachar = editAlphaU[editAlphaKey][editAlphaLevel];
1759 else 1752 else
1760 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; 1753 alphachar = editAlpha[editAlphaKey][editAlphaLevel];
1761 1754
1762 if (!(editAlphaMode && editAlphaKey != KCD_MAX)) 1755 if (!(editAlphaMode && editAlphaKey != KCD_MAX))
1763 alphachar= ' '; 1756 alphachar= ' ';
1764 else if (editHiddenMode) // SH - in hidden mode... 1757 else if (editHiddenMode) // SH - in hidden mode...
1765 tmpBuf[edit->cp] = alphachar; // store character in buffer 1758 tmpBuf[edit->cp] = alphachar; // store character in buffer
1766 #ifdef NO_ASCIIZ 1759 #ifdef NO_ASCIIZ
1767 /*MC, SPR 940/2 01/08/02, don't need to check for language, tag should be enough*/ 1760 /*MC, SPR 940/2 01/08/02, don't need to check for language, tag should be enough*/
1768 if (edit->attr->text[0] == 0x80/*MC 22/07/02*/) 1761 if (edit->attr->text[0] == 0x80/*MC 22/07/02*/)
1769 alphachar = alphachar << 8; 1762 alphachar = alphachar << 8;
1770 #endif 1763 #endif
1771 {/*NM p025*/ 1764 {/*NM p025*/
1772 edit->attr->alphaMode = TRUE; 1765 edit->attr->alphaMode = TRUE;
1773 } 1766 }
1774 1767
1775 edtChar(myHandle,alphachar); 1768 edtChar(myHandle,alphachar);
1776 1769
1777 /* 1770 /*
1778 is this actually useless after insert a 1771 is this actually useless after insert a
1779 character to call "ecRight" and then "ecLeft" 1772 character to call "ecRight" and then "ecLeft"
1780 For the multitap we need only two steps: 1773 For the multitap we need only two steps:
1781 "ecDel" plus insert the character 1774 "ecDel" plus insert the character
1782 1775
1783 edtChar(myHandle,ecLeft);*/ 1776 edtChar(myHandle,ecLeft);*/
1784 1777
1785 1778
1786 {edit->attr->alphaMode = FALSE;} 1779 {edit->attr->alphaMode = FALSE;}
1787 1780
1788 /*p025 end*/ 1781 /*p025 end*/
1789 1782
1790 } 1783 }
1791 1784
1792 /******************************************************************************* 1785 /*******************************************************************************
1793 1786
1794 $Function: editEventTim 1787 $Function: editEventTim
1795 1788
1796 $Description: executes the timer event from the edit component 1789 $Description: executes the timer event from the edit component
1797 1790
1798 $Returns: none. 1791 $Returns: none.
1799 1792
1800 $Arguments: 1793 $Arguments:
1801 1794
1802 *******************************************************************************/ 1795 *******************************************************************************/
1803 /*MC SPR 1242 merged in b-sample version of this function */ 1796 /*MC SPR 1242 merged in b-sample version of this function */
1804 static int editEventTim (MfwEvt e, MfwTim *t) 1797 static int editEventTim (MfwEvt e, MfwTim *t)
1805 { 1798 {
1806 char *format = formatHandle; // SH - temporary format template 1799 char *format = formatHandle; // SH - temporary format template
1807 1800
1808 TRACE_FUNCTION("editEventTim"); 1801 TRACE_FUNCTION("editEventTim");
1809 1802
1810 if (!(editAlphaMode || editFormatMode)) 1803 if (!(editAlphaMode || editFormatMode))
1811 return 1; 1804 return 1;
1812 1805
1813 1806
1814 /*MC, SPR925 23/07/02, removed variable assignment for chinese */ 1807 /*MC, SPR925 23/07/02, removed variable assignment for chinese */
1815 1808
1816 // SH - modifications for format mode & hidden mode 1809 // SH - modifications for format mode & hidden mode
1817 if (editFormatMode) // SH - advance format pointer when 1810 if (editFormatMode) // SH - advance format pointer when
1818 { 1811 {
1819 if (editHiddenMode) 1812 if (editHiddenMode)
1820 { 1813 {
1821 editCharFindNext('*'); 1814 editCharFindNext('*');
1822 } 1815 }
1823 else 1816 else
1824 editCharFindNext(ecRight); 1817 editCharFindNext(ecRight);
1825 } 1818 }
1826 else if (editHiddenMode) 1819 else if (editHiddenMode)
1827 { 1820 {
1828 edtChar(myHandle,'*'); 1821 edtChar(myHandle,'*');
1829 } 1822 }
1830 // end of modifications 1823 // end of modifications
1831 1824
1832 else 1825 else
1833 edtChar(myHandle,ecRight); 1826 edtChar(myHandle,ecRight);
1834 1827
1835 editAlphaLevel = KEY_PAD_MAX-1; 1828 editAlphaLevel = KEY_PAD_MAX-1;
1836 editAlphaKey = KCD_MAX; 1829 editAlphaKey = KCD_MAX;
1837 1830
1838 return 1; 1831 return 1;
1839 } 1832 }
1840 1833
1841 1834
1842 /******************************************************************************* 1835 /*******************************************************************************
1843 1836
1844 $Function: editEventKey 1837 $Function: editEventKey
1845 1838
1846 $Description: executes the timer event form the edit component 1839 $Description: executes the timer event form the edit component
1847 1840
1848 $Returns: none. 1841 $Returns: none.
1849 1842
1850 $Arguments: 1843 $Arguments:
1851 1844
1852 *******************************************************************************/ 1845 *******************************************************************************/
1853 int editEventKey (MfwEvt e, MfwKbd *k) 1846 int editEventKey (MfwEvt e, MfwKbd *k)
1854 { 1847 {
1855 /*MC SPR 1242 merged in b-sample version of this function */ 1848 /*MC SPR 1242 merged in b-sample version of this function */
1856 MfwEdt *edit; 1849 MfwEdt *edit;
1857 char *tb; 1850 char *tb;
1858 UBYTE ch = '.'; 1851 UBYTE ch = '.';
1859 1852
1860 char *format = formatHandle; // SH - temporary format template 1853 char *format = formatHandle; // SH - temporary format template
1861 char formatchar; // SH - Current format character 1854 char formatchar; // SH - Current format character
1862 char alphachar; // SH - Current multi-tap character 1855 char alphachar; // SH - Current multi-tap character
1863 int safetycounter; // SH - Stops searching forever to find compatible character 1856 int safetycounter; // SH - Stops searching forever to find compatible character
1864 BOOL validCharacter; // SH - flag to indicate whether character is accepted 1857 BOOL validCharacter; // SH - flag to indicate whether character is accepted
1865 1858
1866 BOOL unicode; /* SPR957 - SH - TRUE if string is unicode */ 1859 BOOL unicode; /* SPR957 - SH - TRUE if string is unicode */
1867 1860
1868 /*NM p026*/ 1861 /*NM p026*/
1869 if (!myHandle) // If we've reached the end of the format string, don't allow input 1862 if (!myHandle) // If we've reached the end of the format string, don't allow input
1870 return 1; 1863 return 1;
1871 1864
1872 /* Over the editor handle "e" we have now the access to 1865 /* Over the editor handle "e" we have now the access to
1873 * the editor buffer "tb". We need it e.g "editCalcMode" 1866 * the editor buffer "tb". We need it e.g "editCalcMode"
1874 * to check the buffer */ 1867 * to check the buffer */
1875 1868
1876 edit = ((MfwHdr *) myHandle)->data; 1869 edit = ((MfwHdr *) myHandle)->data;
1877 tb = edit->attr->text; 1870 tb = edit->attr->text;
1878 /*p026 end*/ 1871 /*p026 end*/
1879 1872
1880 /* SPR957 - SH - TRUE if string is unicode */ 1873 /* SPR957 - SH - TRUE if string is unicode */
1881 if (tb[0]==0x80) 1874 if (tb[0]==0x80)
1882 unicode = TRUE; 1875 unicode = TRUE;
1883 else 1876 else
1884 unicode = FALSE; 1877 unicode = FALSE;
1885 1878
1886 /* SH - formatted input mode (for WAP) */ 1879 /* SH - formatted input mode (for WAP) */
1887 1880
1888 if (editFormatMode) 1881 if (editFormatMode)
1889 { 1882 {
1890 if (k->code==KCD_HUP) // Escape from edit screen 1883 if (k->code==KCD_HUP) // Escape from edit screen
1891 return 0; 1884 return 0;
1892 1885
1893 if (edit->cp >= (edit->attr->size)) // If at last character of editor, don't 1886 if (edit->cp >= (edit->attr->size)) // If at last character of editor, don't
1894 { 1887 {
1895 return 1; // print character 1888 return 1; // print character
1896 } 1889 }
1897 1890
1898 formatchar = format[*formatIndex]; 1891 formatchar = format[*formatIndex];
1899 1892
1900 if (formatchar == NULL) // If we've reached the end of the format string, don't allow input 1893 if (formatchar == NULL) // If we've reached the end of the format string, don't allow input
1901 return 1; 1894 return 1;
1902 1895
1903 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') // Delimiter for format field 1896 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') // Delimiter for format field
1904 { 1897 {
1905 (*formatIndex)++; 1898 (*formatIndex)++;
1906 *fieldIndex = 0; 1899 *fieldIndex = 0;
1907 formatchar = format[*formatIndex]; // Next character is the format for the field 1900 formatchar = format[*formatIndex]; // Next character is the format for the field
1908 } 1901 }
1909 1902
1910 /* Multi-tap input 1903 /* Multi-tap input
1911 * 1904 *
1912 * The user presses a different key, meaning the previous character must be entered */ 1905 * The user presses a different key, meaning the previous character must be entered */
1913 1906
1914 if (editAlphaKey != KCD_MAX && editAlphaKey != k->code) 1907 if (editAlphaKey != KCD_MAX && editAlphaKey != k->code)
1915 { 1908 {
1916 timStop(editTim); 1909 timStop(editTim);
1917 1910
1918 alphachar = NULL; 1911 alphachar = NULL;
1919 1912
1920 switch(formatchar) 1913 switch(formatchar)
1921 { 1914 {
1922 case 'X': // Uppercase alphabetic only 1915 case 'X': // Uppercase alphabetic only
1923 case 'A': // Uppercase alphabetic or punctuation 1916 case 'A': // Uppercase alphabetic or punctuation
1924 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; 1917 alphachar = editAlphaU[editAlphaKey][editAlphaLevel];
1925 break; 1918 break;
1926 1919
1927 case 'x': // Lowercase alphabetic only 1920 case 'x': // Lowercase alphabetic only
1928 case 'a': // Lowercase alphabetic or punctuation 1921 case 'a': // Lowercase alphabetic or punctuation
1929 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; 1922 alphachar = editAlpha[editAlphaKey][editAlphaLevel];
1930 break; 1923 break;
1931 1924
1932 case 'M': 1925 case 'M':
1933 case 'm': 1926 case 'm':
1934 if (upCase) 1927 if (upCase)
1935 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; 1928 alphachar = editAlphaU[editAlphaKey][editAlphaLevel];
1936 else 1929 else
1937 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; 1930 alphachar = editAlpha[editAlphaKey][editAlphaLevel];
1938 break; 1931 break;
1939 } 1932 }
1940 1933
1941 if (alphachar!=NULL) 1934 if (alphachar!=NULL)
1942 { 1935 {
1943 if (editHiddenMode) // SH - in hidden mode... 1936 if (editHiddenMode) // SH - in hidden mode...
1944 { 1937 {
1945 tmpBuf[edit->cp] = alphachar; // store character in buffer 1938 tmpBuf[edit->cp] = alphachar; // store character in buffer
1946 alphachar = '*'; // ...and show star 1939 alphachar = '*'; // ...and show star
1947 } 1940 }
1948 editCharFindNext(alphachar); // Add number to buffer & advance cursor 1941 editCharFindNext(alphachar); // Add number to buffer & advance cursor
1949 editAlphaLevel = KEY_PAD_MAX-1; 1942 editAlphaLevel = KEY_PAD_MAX-1;
1950 editAlphaKey = KCD_MAX; 1943 editAlphaKey = KCD_MAX;
1951 if (edit->cp >= (edit->attr->size)) // If at last character of editor, don't 1944 if (edit->cp >= (edit->attr->size)) // If at last character of editor, don't
1952 return 1; // allow another character 1945 return 1; // allow another character
1953 } 1946 }
1954 } 1947 }
1955 1948
1956 formatchar = format[*formatIndex]; 1949 formatchar = format[*formatIndex];
1957 1950
1958 if (k->code <= KCD_9) // Key pressed is 0 - 9. 1951 if (k->code <= KCD_9) // Key pressed is 0 - 9.
1959 { 1952 {
1960 1953
1961 /* Numeric */ 1954 /* Numeric */
1962 1955
1963 if (formatchar == 'N') // A numeric digit is expected 1956 if (formatchar == 'N') // A numeric digit is expected
1964 { 1957 {
1965 if (editHiddenMode) 1958 if (editHiddenMode)
1966 { 1959 {
1967 tmpBuf[edit->cp] = editControls[k->code]; 1960 tmpBuf[edit->cp] = editControls[k->code];
1968 editCharFindNext('*'); 1961 editCharFindNext('*');
1969 } 1962 }
1970 else 1963 else
1971 editCharFindNext(editControls[k->code]); // Add number to buffer & advance cursor 1964 editCharFindNext(editControls[k->code]); // Add number to buffer & advance cursor
1972 editAlphaLevel = KEY_PAD_MAX-1; // Reset multi-tap settings 1965 editAlphaLevel = KEY_PAD_MAX-1; // Reset multi-tap settings
1973 editAlphaKey = KCD_MAX; 1966 editAlphaKey = KCD_MAX;
1974 return 1; 1967 return 1;
1975 } 1968 }
1976 1969
1977 /* Multi-tap alphanumeric */ 1970 /* Multi-tap alphanumeric */
1978 1971
1979 alphachar = NULL; 1972 alphachar = NULL;
1980 1973
1981 if (!strchr("XxAaMm",formatchar)) // If not a valid format code, exit 1974 if (!strchr("XxAaMm",formatchar)) // If not a valid format code, exit
1982 return 1; 1975 return 1;
1983 1976
1984 if (strchr("Xx",formatchar) && k->code<KCD_2) // 0 and 1 keys not valid in these modes 1977 if (strchr("Xx",formatchar) && k->code<KCD_2) // 0 and 1 keys not valid in these modes
1985 return 1; 1978 return 1;
1986 1979
1987 editAlphaKey = k->code; // Store the key pressed 1980 editAlphaKey = k->code; // Store the key pressed
1988 editAlphaLevel++; // Increment through list of symbols 1981 editAlphaLevel++; // Increment through list of symbols
1989 if (editAlphaLevel > (KEY_PAD_MAX-1)) // List wraps round 1982 if (editAlphaLevel > (KEY_PAD_MAX-1)) // List wraps round
1990 editAlphaLevel = 0; 1983 editAlphaLevel = 0;
1991 1984
1992 safetycounter = 0; 1985 safetycounter = 0;
1993 while (alphachar==NULL && safetycounter<KEY_PAD_MAX) 1986 while (alphachar==NULL && safetycounter<KEY_PAD_MAX)
1994 { 1987 {
1995 validCharacter = FALSE; 1988 validCharacter = FALSE;
1996 1989
1997 switch(formatchar) 1990 switch(formatchar)
1998 { 1991 {
1999 case 'X': 1992 case 'X':
2000 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; // Uppercase... 1993 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; // Uppercase...
2001 validCharacter = (alphachar>='A' && alphachar<='Z'); // ...alphabetic only 1994 validCharacter = (alphachar>='A' && alphachar<='Z'); // ...alphabetic only
2002 break; 1995 break;
2003 1996
2004 case 'x': 1997 case 'x':
2005 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; // Lowercase 1998 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; // Lowercase
2006 validCharacter = (alphachar>='a' && alphachar<='z'); // ...alphabetic only 1999 validCharacter = (alphachar>='a' && alphachar<='z'); // ...alphabetic only
2007 break; 2000 break;
2008 2001
2009 case 'A': 2002 case 'A':
2010 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; // Uppercase... 2003 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; // Uppercase...
2011 validCharacter = (alphachar<'0' || alphachar>'9'); // ..non-numeric 2004 validCharacter = (alphachar<'0' || alphachar>'9'); // ..non-numeric
2012 break; 2005 break;
2013 2006
2014 case 'a': 2007 case 'a':
2015 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; // Lowercase... 2008 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; // Lowercase...
2016 validCharacter = (alphachar<'0' || alphachar>'9'); // ..non-numeric 2009 validCharacter = (alphachar<'0' || alphachar>'9'); // ..non-numeric
2017 break; 2010 break;
2018 2011
2019 case 'M': 2012 case 'M':
2020 case 'm': 2013 case 'm':
2021 if (upCase) // User-selected case... 2014 if (upCase) // User-selected case...
2022 alphachar = editAlphaU[editAlphaKey][editAlphaLevel]; 2015 alphachar = editAlphaU[editAlphaKey][editAlphaLevel];
2023 else 2016 else
2024 alphachar = editAlpha[editAlphaKey][editAlphaLevel]; 2017 alphachar = editAlpha[editAlphaKey][editAlphaLevel];
2025 validCharacter = TRUE; // ...any character accepted 2018 validCharacter = TRUE; // ...any character accepted
2026 break; 2019 break;
2027 } 2020 }
2028 2021
2029 if (!validCharacter) // If character isn't uppercase alphabetic, 2022 if (!validCharacter) // If character isn't uppercase alphabetic,
2030 { // find the next one that is, 2023 { // find the next one that is,
2031 alphachar = NULL; 2024 alphachar = NULL;
2032 safetycounter++; // (but don't search forever) 2025 safetycounter++; // (but don't search forever)
2033 editAlphaLevel++; 2026 editAlphaLevel++;
2034 if (editAlphaLevel > (KEY_PAD_MAX-1)) 2027 if (editAlphaLevel > (KEY_PAD_MAX-1))
2035 editAlphaLevel = 0; 2028 editAlphaLevel = 0;
2036 } 2029 }
2037 } 2030 }
2038 2031
2039 if (alphachar!=NULL) // If we've found a character, and string isn't max size 2032 if (alphachar!=NULL) // If we've found a character, and string isn't max size
2040 { 2033 {
2041 if (editHiddenMode) 2034 if (editHiddenMode)
2042 { 2035 {
2043 tmpBuf[edit->cp] = alphachar; 2036 tmpBuf[edit->cp] = alphachar;
2044 } 2037 }
2045 edtChar(myHandle,alphachar); 2038 edtChar(myHandle,alphachar);
2046 edtChar(myHandle,ecLeft); 2039 edtChar(myHandle,ecLeft);
2047 timStart(editTim); 2040 timStart(editTim);
2048 } 2041 }
2049 else 2042 else
2050 editAlphaKey = KEY_MAX; 2043 editAlphaKey = KEY_MAX;
2051 return 1; 2044 return 1;
2052 } 2045 }
2053 2046
2054 if (k->code==KCD_HASH) // Hash key 2047 if (k->code==KCD_HASH) // Hash key
2055 { 2048 {
2056 if (strchr("AaMm",formatchar)) 2049 if (strchr("AaMm",formatchar))
2057 { 2050 {
2058 if (editHiddenMode) 2051 if (editHiddenMode)
2059 { 2052 {
2060 tmpBuf[edit->cp] = ' '; 2053 tmpBuf[edit->cp] = ' ';
2061 editCharFindNext('*'); 2054 editCharFindNext('*');
2062 } 2055 }
2063 else 2056 else
2064 editCharFindNext(' '); // Prints a space in this mode 2057 editCharFindNext(' '); // Prints a space in this mode
2065 } 2058 }
2066 return 1; 2059 return 1;
2067 } 2060 }
2068 2061
2069 if (k->code==KCD_STAR) // Star key 2062 if (k->code==KCD_STAR) // Star key
2070 { 2063 {
2071 if (strchr("AaMm",formatchar)) 2064 if (strchr("AaMm",formatchar))
2072 { 2065 {
2073 if (editHiddenMode) 2066 if (editHiddenMode)
2074 { 2067 {
2075 tmpBuf[edit->cp] = '*'; 2068 tmpBuf[edit->cp] = '*';
2076 } 2069 }
2077 editCharFindNext('*'); 2070 editCharFindNext('*');
2078 } 2071 }
2079 return 1; 2072 return 1;
2080 } 2073 }
2081 2074
2082 return 1; 2075 return 1;
2083 } 2076 }
2084 2077
2085 /************************/ 2078 /************************/
2086 /* Normal multi-tap mode */ 2079 /* Normal multi-tap mode */
2087 /************************/ 2080 /************************/
2088 2081
2089 if (editAlphaMode) 2082 if (editAlphaMode)
2090 { 2083 {
2091 if (editAlphaKey != KCD_MAX && editAlphaKey != k->code) 2084 if (editAlphaKey != KCD_MAX && editAlphaKey != k->code)
2092 { 2085 {
2093 timStop(editTim); 2086 timStop(editTim);
2094 2087
2095 /*MC SPR 925, 23/07/02, removed editshowheader for chinese*/ 2088 /*MC SPR 925, 23/07/02, removed editshowheader for chinese*/
2096 edtChar(myHandle,ecRight); 2089 edtChar(myHandle,ecRight);
2097 /*MC SPR 925, 23/07/02,removed shifting of alphachar, not needed here, merged from ealier code*/ 2090 /*MC SPR 925, 23/07/02,removed shifting of alphachar, not needed here, merged from ealier code*/
2098 2091
2099 editAlphaLevel = KEY_PAD_MAX-1; 2092 editAlphaLevel = KEY_PAD_MAX-1;
2100 editAlphaKey = KCD_MAX; 2093 editAlphaKey = KCD_MAX;
2101 } 2094 }
2102 2095
2103 if (k->code <= KCD_HASH) 2096 if (k->code <= KCD_HASH)
2104 { 2097 {
2105 editAlphaLevel++; 2098 editAlphaLevel++;
2106 if (editAlphaLevel > (KEY_PAD_MAX-1)) 2099 if (editAlphaLevel > (KEY_PAD_MAX-1))
2107 editAlphaLevel = 0; 2100 editAlphaLevel = 0;
2108 if (editAlphaKey == KCD_MAX) // Inserting a new character 2101 if (editAlphaKey == KCD_MAX) // Inserting a new character
2109 { 2102 {
2110 TRACE_EVENT("Inserting character."); 2103 TRACE_EVENT("Inserting character.");
2111 /*MC, SPR 925, 23/07/02 removed insert space and ecLeft if Chinese*/ 2104 /*MC, SPR 925, 23/07/02 removed insert space and ecLeft if Chinese*/
2112 2105
2113 /* NM p01306 2106 /* NM p01306
2114 the patch p027 to reduce calling the edtChar as less as possible 2107 the patch p027 to reduce calling the edtChar as less as possible
2115 was not working for inserting characters. 2108 was not working for inserting characters.
2116 This additional change should work now: 2109 This additional change should work now:
2117 */ 2110 */
2118 if (unicode) /*SPR957 - SH - use new unicode flag */ 2111 if (unicode) /*SPR957 - SH - use new unicode flag */
2119 { 2112 {
2120 moveRightUnicode((U16 *)&edit->attr->text[edit->cp*2],1); 2113 moveRightUnicode((U16 *)&edit->attr->text[edit->cp*2],1);
2121 } 2114 }
2122 else 2115 else
2123 { 2116 {
2124 moveRight(&edit->attr->text[edit->cp],strlen(&edit->attr->text[edit->cp]),1); 2117 moveRight(&edit->attr->text[edit->cp],strlen(&edit->attr->text[edit->cp]),1);
2125 } 2118 }
2126 /* NM p01306 END */ 2119 /* NM p01306 END */
2127 } 2120 }
2128 } 2121 }
2129 editAlphaKey = k->code; 2122 editAlphaKey = k->code;
2130 editShowHeader(); 2123 editShowHeader();
2131 timStart(editTim); 2124 timStart(editTim);
2132 return 1; 2125 return 1;
2133 } 2126 }
2134 2127
2135 alphachar = NULL; 2128 alphachar = NULL;
2136 2129
2137 switch (k->code) 2130 switch (k->code)
2138 { 2131 {
2139 case KCD_HUP: 2132 case KCD_HUP:
2140 return 0; 2133 return 0;
2141 case KCD_HASH: 2134 case KCD_HASH:
2142 /* KGT: If not in an alpha mode insert blanc. 2135 /* KGT: If not in an alpha mode insert blanc.
2143 But in numeric mode insert '#'. */ 2136 But in numeric mode insert '#'. */
2144 if (editAlphaMode) 2137 if (editAlphaMode)
2145 { 2138 {
2146 alphachar = ' '; 2139 alphachar = ' ';
2147 editShowHeader(); 2140 editShowHeader();
2148 } 2141 }
2149 else 2142 else
2150 { 2143 {
2151 if (editCalcMode) 2144 if (editCalcMode)
2152 { 2145 {
2153 if(!(strchr(tb, ch ))) /* set '.' only once ! */ 2146 if(!(strchr(tb, ch ))) /* set '.' only once ! */
2154 alphachar = '.'; 2147 alphachar = '.';
2155 } 2148 }
2156 else 2149 else
2157 alphachar = '#'; 2150 alphachar = '#';
2158 } 2151 }
2159 /* end KGT */ 2152 /* end KGT */
2160 2153
2161 /* SH - hidden mode */ 2154 /* SH - hidden mode */
2162 if (editHiddenMode) 2155 if (editHiddenMode)
2163 { 2156 {
2164 tmpBuf[edit->cp] = alphachar; 2157 tmpBuf[edit->cp] = alphachar;
2165 alphachar = '*'; 2158 alphachar = '*';
2166 } 2159 }
2167 /* end of hidden mode */ 2160 /* end of hidden mode */
2168 2161
2169 /* SPR957 - In unicode mode, character is shifted to second byte */ 2162 /* SPR957 - In unicode mode, character is shifted to second byte */
2170 if (unicode) 2163 if (unicode)
2171 alphachar = alphachar << 8; 2164 alphachar = alphachar << 8;
2172 2165
2173 edtChar(myHandle,alphachar); 2166 edtChar(myHandle,alphachar);
2174 return 1; 2167 return 1;
2175 2168
2176 case KCD_STAR: 2169 case KCD_STAR:
2177 2170
2178 if (editCalcMode) 2171 if (editCalcMode)
2179 { 2172 {
2180 if(!(strchr(tb, ch ))) /* set '.' only once ! */ 2173 if(!(strchr(tb, ch ))) /* set '.' only once ! */
2181 alphachar = '.'; /* SPR957 - SH*/ 2174 alphachar = '.'; /* SPR957 - SH*/
2182 /*edtChar(myHandle,'.');*/ 2175 /*edtChar(myHandle,'.');*/
2183 } 2176 }
2184 else 2177 else
2185 { 2178 {
2186 /*if (!editAlphaMode) 2179 /*if (!editAlphaMode)
2187 edtChar(myHandle,'*'); 2180 edtChar(myHandle,'*');
2188 else */ 2181 else */
2189 if (editAlphaMode) 2182 if (editAlphaMode)
2190 { 2183 {
2191 editShowHeader(); 2184 editShowHeader();
2192 } 2185 }
2193 2186
2194 alphachar = '*'; 2187 alphachar = '*';
2195 2188
2196 /* SH - hidden mode */ 2189 /* SH - hidden mode */
2197 if (editHiddenMode) 2190 if (editHiddenMode)
2198 { 2191 {
2199 tmpBuf[edit->cp] = '*'; 2192 tmpBuf[edit->cp] = '*';
2200 } 2193 }
2201 /* end of hidden mode */ 2194 /* end of hidden mode */
2202 2195
2203 /* SPR957 - SH - In unicode mode, character is shifted to second byte */ 2196 /* SPR957 - SH - In unicode mode, character is shifted to second byte */
2204 if (unicode) 2197 if (unicode)
2205 alphachar = alphachar << 8; 2198 alphachar = alphachar << 8;
2206 edtChar(myHandle,alphachar); 2199 edtChar(myHandle,alphachar);
2207 } 2200 }
2208 return 2; // SH - 2 indicates that character WAS printed 2201 return 2; // SH - 2 indicates that character WAS printed
2209 2202
2210 case KCD_ABC: 2203 case KCD_ABC:
2211 editAlphaMode = (UBYTE) !editAlphaMode; 2204 editAlphaMode = (UBYTE) !editAlphaMode;
2212 if (editAlphaMode) 2205 if (editAlphaMode)
2213 { 2206 {
2214 editAlphaLevel = KEY_PAD_MAX-1; 2207 editAlphaLevel = KEY_PAD_MAX-1;
2215 editAlphaKey = KCD_MAX; 2208 editAlphaKey = KCD_MAX;
2216 } 2209 }
2217 editShowHeader(); 2210 editShowHeader();
2218 return 1; 2211 return 1;
2219 default: 2212 default:
2220 if (editAlphaMode){ 2213 if (editAlphaMode){
2221 timStop(editTim); 2214 timStop(editTim);
2222 edtChar(myHandle,ecRight); 2215 edtChar(myHandle,ecRight);
2223 return 1; 2216 return 1;
2224 } 2217 }
2225 break; 2218 break;
2226 } 2219 }
2227 2220
2228 /* SH - hidden mode */ 2221 /* SH - hidden mode */
2229 if (editHiddenMode) 2222 if (editHiddenMode)
2230 { 2223 {
2231 tmpBuf[edit->cp] = editControls[k->code]; 2224 tmpBuf[edit->cp] = editControls[k->code];
2232 alphachar = '*'; /* SPR957 - SH*/ 2225 alphachar = '*'; /* SPR957 - SH*/
2233 /* SPR957 - In unicode mode, character is shifted to second byte */ 2226 /* SPR957 - In unicode mode, character is shifted to second byte */
2234 if (unicode) 2227 if (unicode)
2235 alphachar = alphachar << 8; 2228 alphachar = alphachar << 8;
2236 2229
2237 edtChar(myHandle,alphachar); 2230 edtChar(myHandle,alphachar);
2238 } 2231 }
2239 /* end of hidden mode */ 2232 /* end of hidden mode */
2240 else 2233 else
2241 { /*MC SPR 964, sets alphamode to FALSE when in digits mode, so that cursor moves right*/ 2234 { /*MC SPR 964, sets alphamode to FALSE when in digits mode, so that cursor moves right*/
2242 edit->attr->alphaMode = editAlphaMode; 2235 edit->attr->alphaMode = editAlphaMode;
2243 edtChar(myHandle,editControls[k->code]); 2236 edtChar(myHandle,editControls[k->code]);
2244 } 2237 }
2245 2238
2246 return 1; 2239 return 1;
2247 } 2240 }
2248 2241
2249 2242
2250 /******************************************************************************* 2243 /*******************************************************************************
2251 2244
2252 $Function: editClear 2245 $Function: editClear
2253 2246
2254 $Description: SH - For formatted input, clears everything except fixed characters 2247 $Description: SH - For formatted input, clears everything except fixed characters
2255 2248
2256 $Returns: 2249 $Returns:
2257 2250
2258 $Arguments: 2251 $Arguments:
2259 2252
2260 *******************************************************************************/ 2253 *******************************************************************************/
2261 /*MC SPR 1242 merged in b-sample version of this function */ 2254 /*MC SPR 1242 merged in b-sample version of this function */
2262 void editClear() 2255 void editClear()
2263 { 2256 {
2264 int editIndex = 0; 2257 int editIndex = 0;
2265 MfwEdt *edit = ((MfwHdr *) myHandle)->data; 2258 MfwEdt *edit = ((MfwHdr *) myHandle)->data;
2266 char *tb = edit->attr->text; 2259 char *tb = edit->attr->text;
2267 2260
2268 *formatIndex = -1; // Find first non-fixed character, 2261 *formatIndex = -1; // Find first non-fixed character,
2269 edtChar(myHandle,ecTop); // starting from the top. 2262 edtChar(myHandle,ecTop); // starting from the top.
2270 editCharFindNext(NULL); 2263 editCharFindNext(NULL);
2271 2264
2272 while (edit->cp <strlen(tb)) 2265 while (edit->cp <strlen(tb))
2273 { 2266 {
2274 editCharFindNext(' '); // Overwrite everything with spaces 2267 editCharFindNext(' '); // Overwrite everything with spaces
2275 } 2268 }
2276 edtChar(myHandle,ecTop); 2269 edtChar(myHandle,ecTop);
2277 *formatIndex = -1; 2270 *formatIndex = -1;
2278 editCharFindNext(NULL); // Return to the first non-fixed character 2271 editCharFindNext(NULL); // Return to the first non-fixed character
2279 2272
2280 return; 2273 return;
2281 } 2274 }
2282 2275
2283 2276
2284 /******************************************************************************* 2277 /*******************************************************************************
2285 2278
2286 $Function: editCharFindNext 2279 $Function: editCharFindNext
2287 2280
2288 $Description: SH - For formatted input, adds a character to the input buffer then finds 2281 $Description: SH - For formatted input, adds a character to the input buffer then finds
2289 the next non-fixed character space for the cursor to occupy 2282 the next non-fixed character space for the cursor to occupy
2290 2283
2291 $Returns: 2284 $Returns:
2292 2285
2293 $Arguments: character - the character (or code) to print 2286 $Arguments: character - the character (or code) to print
2294 2287
2295 *******************************************************************************/ 2288 *******************************************************************************/
2296 /*MC SPR 1242 merged in b-sample version of this function */ 2289 /*MC SPR 1242 merged in b-sample version of this function */
2297 void editCharFindNext(char character) 2290 void editCharFindNext(char character)
2298 { 2291 {
2299 char *format = formatHandle; // SH - temporary format template 2292 char *format = formatHandle; // SH - temporary format template
2300 char formatchar; 2293 char formatchar;
2301 MfwEdt *edit = ((MfwHdr *) myHandle)->data; 2294 MfwEdt *edit = ((MfwHdr *) myHandle)->data;
2302 UBYTE inField = 0; // =1 if entering field, =2 if in field 2295 UBYTE inField = 0; // =1 if entering field, =2 if in field
2303 2296
2304 TRACE_EVENT("editCharFindNext"); 2297 TRACE_EVENT("editCharFindNext");
2305 2298
2306 // Check for delimited field 2299 // Check for delimited field
2307 2300
2308 if (*formatIndex>0) 2301 if (*formatIndex>0)
2309 { 2302 {
2310 formatchar = format[*formatIndex-1]; 2303 formatchar = format[*formatIndex-1];
2311 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') 2304 if ((formatchar>'0' && formatchar<='9') || formatchar=='*')
2312 inField = 2; 2305 inField = 2;
2313 } 2306 }
2314 2307
2315 formatchar = format[*formatIndex]; 2308 formatchar = format[*formatIndex];
2316 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') 2309 if ((formatchar>'0' && formatchar<='9') || formatchar=='*')
2317 inField = 1; 2310 inField = 1;
2318 2311
2319 // Check for cursor right at end of string - don't allow 2312 // Check for cursor right at end of string - don't allow
2320 2313
2321 if (character == ecRight && edit->cp >= strlen(edit->attr->text) && *formatIndex>-1 && inField==0) 2314 if (character == ecRight && edit->cp >= strlen(edit->attr->text) && *formatIndex>-1 && inField==0)
2322 { 2315 {
2323 TRACE_EVENT("End of string."); 2316 TRACE_EVENT("End of string.");
2324 return; 2317 return;
2325 } 2318 }
2326 2319
2327 if (character!=NULL) // First add the required character 2320 if (character!=NULL) // First add the required character
2328 { 2321 {
2329 edtChar(myHandle, character); // to the buffer 2322 edtChar(myHandle, character); // to the buffer
2330 } 2323 }
2331 2324
2332 // Check for start of fixed input field 2325 // Check for start of fixed input field
2333 2326
2334 if (inField==1) 2327 if (inField==1)
2335 { 2328 {
2336 TRACE_EVENT("Entering field."); 2329 TRACE_EVENT("Entering field.");
2337 (*formatIndex)++; // Get us into the field... 2330 (*formatIndex)++; // Get us into the field...
2338 *fieldIndex = 0; // ...and reset the field index 2331 *fieldIndex = 0; // ...and reset the field index
2339 formatchar = *(format+*formatIndex); 2332 formatchar = *(format+*formatIndex);
2340 if (formatchar=='M') 2333 if (formatchar=='M')
2341 upCase = TRUE; 2334 upCase = TRUE;
2342 if (formatchar=='m') 2335 if (formatchar=='m')
2343 upCase = FALSE; 2336 upCase = FALSE;
2344 inField = 2; 2337 inField = 2;
2345 } 2338 }
2346 2339
2347 // Check whether we're in a fixed input field, e.g. "4N" or "8X" 2340 // Check whether we're in a fixed input field, e.g. "4N" or "8X"
2348 2341
2349 if (inField==2) // So we don't look back beyond start of string 2342 if (inField==2) // So we don't look back beyond start of string
2350 { 2343 {
2351 TRACE_EVENT("Move on in field."); 2344 TRACE_EVENT("Move on in field.");
2352 (*fieldIndex)++; // Increment the position in the field 2345 (*fieldIndex)++; // Increment the position in the field
2353 if (*fieldIndex==(int)(formatchar-'0')) // If we've entered the number of characters specified (note- will never happen for the '*' !) 2346 if (*fieldIndex==(int)(formatchar-'0')) // If we've entered the number of characters specified (note- will never happen for the '*' !)
2354 { 2347 {
2355 TRACE_EVENT("Exiting field."); 2348 TRACE_EVENT("Exiting field.");
2356 (*formatIndex)++; // point to NULL at end of string (no more input) 2349 (*formatIndex)++; // point to NULL at end of string (no more input)
2357 } 2350 }
2358 return; 2351 return;
2359 } 2352 }
2360 2353
2361 // If not, just look at next format character as usual 2354 // If not, just look at next format character as usual
2362 2355
2363 (*formatIndex)++; // Point to next character 2356 (*formatIndex)++; // Point to next character
2364 2357
2365 while (*formatIndex<strlen(format) && *(format+*formatIndex) == '\\') // Fixed characters encountered 2358 while (*formatIndex<strlen(format) && *(format+*formatIndex) == '\\') // Fixed characters encountered
2366 { 2359 {
2367 edtChar(myHandle,ecRight); // Skip over them 2360 edtChar(myHandle,ecRight); // Skip over them
2368 (*formatIndex)+=2; 2361 (*formatIndex)+=2;
2369 } 2362 }
2370 2363
2371 if (*formatIndex>(strlen(format))) // Don't look beyond end of string 2364 if (*formatIndex>(strlen(format))) // Don't look beyond end of string
2372 *formatIndex = strlen(format); 2365 *formatIndex = strlen(format);
2373 /***************************Go-lite Optimization changes Start***********************/ 2366 /***************************Go-lite Optimization changes Start***********************/
2374 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 2367 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
2375 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex); 2368 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex);
2376 /***************************Go-lite Optimization changes end***********************/ 2369 /***************************Go-lite Optimization changes end***********************/
2377 return; 2370 return;
2378 } 2371 }
2379 2372
2380 /******************************************************************************* 2373 /*******************************************************************************
2381 2374
2382 $Function: editFindPrev 2375 $Function: editFindPrev
2383 2376
2384 $Description: SH - For formatted input, finds the previous non-fixed character and 2377 $Description: SH - For formatted input, finds the previous non-fixed character and
2385 moves the cursor there if possible 2378 moves the cursor there if possible
2386 2379
2387 $Returns: 0 if the cursor position is not changed (nowhere to go) 2380 $Returns: 0 if the cursor position is not changed (nowhere to go)
2388 1 if the previous character has been found 2381 1 if the previous character has been found
2389 2 if the cursor was over the first non-fixed character 2382 2 if the cursor was over the first non-fixed character
2390 2383
2391 $Arguments: 2384 $Arguments:
2392 2385
2393 *******************************************************************************/ 2386 *******************************************************************************/
2394 /*MC SPR 1242 merged in b-sample version of this function */ 2387 /*MC SPR 1242 merged in b-sample version of this function */
2395 int editFindPrev() 2388 int editFindPrev()
2396 { 2389 {
2397 char *format = formatHandle; // SH - temporary format template 2390 char *format = formatHandle; // SH - temporary format template
2398 int editIndex; 2391 int editIndex;
2399 char formatchar; 2392 char formatchar;
2400 MfwEdt *edit = ((MfwHdr *) myHandle)->data; 2393 MfwEdt *edit = ((MfwHdr *) myHandle)->data;
2401 2394
2402 TRACE_EVENT("editFindPrev"); 2395 TRACE_EVENT("editFindPrev");
2403 2396
2404 if (edit->cp == 0) // If cursor is at start of string, return 2 2397 if (edit->cp == 0) // If cursor is at start of string, return 2
2405 { 2398 {
2406 TRACE_EVENT("Exit - start of string found"); 2399 TRACE_EVENT("Exit - start of string found");
2407 /***************************Go-lite Optimization changes Start***********************/ 2400 /***************************Go-lite Optimization changes Start***********************/
2408 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 2401 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
2409 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex); 2402 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex);
2410 /***************************Go-lite Optimization changes end***********************/ 2403 /***************************Go-lite Optimization changes end***********************/
2411 return 2; 2404 return 2;
2412 } 2405 }
2413 // First check whether we're in a fixed input field, e.g. "4N" or "8X" 2406 // First check whether we're in a fixed input field, e.g. "4N" or "8X"
2414 2407
2415 if (*formatIndex>0) // So we don't look back beyond start of string 2408 if (*formatIndex>0) // So we don't look back beyond start of string
2416 { 2409 {
2417 formatchar = *(format+*formatIndex-1); 2410 formatchar = *(format+*formatIndex-1);
2418 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') // If it's a number between 1 and 9, or a * 2411 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') // If it's a number between 1 and 9, or a *
2419 { 2412 {
2420 TRACE_EVENT("In delimited field."); 2413 TRACE_EVENT("In delimited field.");
2421 edtChar(myHandle,ecLeft); 2414 edtChar(myHandle,ecLeft);
2422 if (edit->cp < edit->attr->size-1) // (Don't decrement if at last char in string) 2415 if (edit->cp < edit->attr->size-1) // (Don't decrement if at last char in string)
2423 (*fieldIndex)--; // Decrement the position in the field 2416 (*fieldIndex)--; // Decrement the position in the field
2424 2417
2425 if (*fieldIndex==0) // If we've reached the beginning of the field 2418 if (*fieldIndex==0) // If we've reached the beginning of the field
2426 { 2419 {
2427 TRACE_EVENT("Getting out of field."); 2420 TRACE_EVENT("Getting out of field.");
2428 (*formatIndex)--; // Get out of the field 2421 (*formatIndex)--; // Get out of the field
2429 } 2422 }
2430 2423
2431 2424
2432 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex); 2425 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex);
2433 2426
2434 if (edit->cp==(strlen(edit->attr->text)-1)) // Special case if last character - tell editor to shorten the string 2427 if (edit->cp==(strlen(edit->attr->text)-1)) // Special case if last character - tell editor to shorten the string
2435 { 2428 {
2436 TRACE_EVENT("Shorten string"); 2429 TRACE_EVENT("Shorten string");
2437 return 3; 2430 return 3;
2438 } 2431 }
2439 2432
2440 return 1; // then we're done 2433 return 1; // then we're done
2441 } 2434 }
2442 } 2435 }
2443 2436
2444 // If not (or if we've just come out of one) just look at next format character as usual 2437 // If not (or if we've just come out of one) just look at next format character as usual
2445 2438
2446 editIndex = *formatIndex-1; // Make copy of format position, starting off to left 2439 editIndex = *formatIndex-1; // Make copy of format position, starting off to left
2447 2440
2448 while (editIndex>0) 2441 while (editIndex>0)
2449 { 2442 {
2450 if (*(format+editIndex-1)=='\\') // If there's a fixed char 2443 if (*(format+editIndex-1)=='\\') // If there's a fixed char
2451 editIndex -=2; // Look back a further 2 characters 2444 editIndex -=2; // Look back a further 2 characters
2452 else // If there's a non-fixed character 2445 else // If there's a non-fixed character
2453 break; // then exit loop 2446 break; // then exit loop
2454 } 2447 }
2455 2448
2456 if (editIndex==-1) // Go back from 1st character in editor 2449 if (editIndex==-1) // Go back from 1st character in editor
2457 { 2450 {
2458 TRACE_EVENT("Exit - skipped over fixed character"); 2451 TRACE_EVENT("Exit - skipped over fixed character");
2459 /***************************Go-lite Optimization changes Start***********************/ 2452 /***************************Go-lite Optimization changes Start***********************/
2460 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 2453 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
2461 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex); 2454 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex);
2462 /***************************Go-lite Optimization changes end***********************/ 2455 /***************************Go-lite Optimization changes end***********************/
2463 return 2; 2456 return 2;
2464 } 2457 }
2465 2458
2466 formatchar = format[editIndex-1]; 2459 formatchar = format[editIndex-1];
2467 if ((formatchar>'0' && formatchar<='9') || formatchar=='*') 2460 if ((formatchar>'0' && formatchar<='9') || formatchar=='*')
2468 (*fieldIndex)--; 2461 (*fieldIndex)--;
2469 2462
2470 if (editIndex>-1) // Provided there is somewhere to go.... 2463 if (editIndex>-1) // Provided there is somewhere to go....
2471 { 2464 {
2472 while(*formatIndex>editIndex) 2465 while(*formatIndex>editIndex)
2473 { 2466 {
2474 if (edtChar(myHandle,ecLeft)==MfwResOk) // move cursor there 2467 if (edtChar(myHandle,ecLeft)==MfwResOk) // move cursor there
2475 (*formatIndex)--; 2468 (*formatIndex)--;
2476 if (format[*formatIndex]=='\\') 2469 if (format[*formatIndex]=='\\')
2477 (*formatIndex)--; 2470 (*formatIndex)--;
2478 } 2471 }
2479 TRACE_EVENT("Found new position."); 2472 TRACE_EVENT("Found new position.");
2480 /***************************Go-lite Optimization changes Start***********************/ 2473 /***************************Go-lite Optimization changes Start***********************/
2481 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 2474 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
2482 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex); 2475 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex);
2483 /***************************Go-lite Optimization changes end***********************/ 2476 /***************************Go-lite Optimization changes end***********************/
2484 return 1; // Found new position 2477 return 1; // Found new position
2485 } 2478 }
2486 TRACE_EVENT("Position unchanged."); 2479 TRACE_EVENT("Position unchanged.");
2487 /***************************Go-lite Optimization changes Start***********************/ 2480 /***************************Go-lite Optimization changes Start***********************/
2488 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 2481 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
2489 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex); 2482 TRACE_EVENT_P2("formatIndex, fieldIndex: %d, %d", *formatIndex, *fieldIndex);
2490 /***************************Go-lite Optimization changes end***********************/ 2483 /***************************Go-lite Optimization changes end***********************/
2491 return 0; // Position unchanged 2484 return 0; // Position unchanged
2492 } 2485 }
2493 2486
2494 2487
2495 /******************************************************************************* 2488 /*******************************************************************************
2496 2489
2497 $Function: editActivate 2490 $Function: editActivate
2498 2491
2499 $Description: Activates the edit component 2492 $Description: Activates the edit component
2500 2493
2501 $Returns: none. 2494 $Returns: none.
2502 2495
2503 $Arguments: 2496 $Arguments:
2504 2497
2505 *******************************************************************************/ 2498 *******************************************************************************/
2506 void editActivate (MfwHnd e, int AlphaMode) 2499 void editActivate (MfwHnd e, int AlphaMode)
2507 { 2500 {
2508 TRACE_FUNCTION("editActivate"); 2501 TRACE_FUNCTION("editActivate");
2509 2502
2510 myHandle = e; 2503 myHandle = e;
2511 /*NM p028*/ 2504 /*NM p028*/
2512 if (!editTim) 2505 if (!editTim)
2513 editTim = timCreate(0,1000,(MfwCb) editEventTim); 2506 editTim = timCreate(0,1000,(MfwCb) editEventTim);
2522 2515
2523 /******************************************************************************* 2516 /*******************************************************************************
2524 2517
2525 $Function: editHiddenActivate 2518 $Function: editHiddenActivate
2526 2519
2527 $Description: SH - Activates the edit component for hidden alphanumeric entry 2520 $Description: SH - Activates the edit component for hidden alphanumeric entry
2528 2521
2529 $Returns: none. 2522 $Returns: none.
2530 2523
2531 $Arguments: 2524 $Arguments:
2532 2525
2533 *******************************************************************************/ 2526 *******************************************************************************/
2534 void editHiddenActivate (char *buffer) 2527 void editHiddenActivate (char *buffer)
2535 { 2528 {
2536 TRACE_FUNCTION("editHiddenActivate"); 2529 TRACE_FUNCTION("editHiddenActivate");
2537 tmpBuf = buffer; 2530 tmpBuf = buffer;
2538 editHiddenMode = 1; 2531 editHiddenMode = 1;
2539 return; 2532 return;
2540 } 2533 }
2541 2534
2542 /******************************************************************************* 2535 /*******************************************************************************
2543 2536
2544 $Function: editDeactivate 2537 $Function: editDeactivate
2545 2538
2546 $Description: deactivates the edit component 2539 $Description: deactivates the edit component
2547 2540
2548 $Returns: none. 2541 $Returns: none.
2549 2542
2550 $Arguments: 2543 $Arguments:
2551 2544
2552 *******************************************************************************/ 2545 *******************************************************************************/
2553 void editDeactivate (void) 2546 void editDeactivate (void)
2554 { 2547 {
2555 //myHandle = 0; //SPR#1014 - DS - Commented out. 2548 //myHandle = 0; //SPR#1014 - DS - Commented out.
2556 2549
2557 if (editTim){ 2550 if (editTim) {
2558 timStop(editTim); 2551 timStop(editTim);
2559 timDelete(editTim); 2552 timDelete(editTim);
2560 } 2553 }
2561 editTim = 0; 2554 editTim = 0;
2562 } 2555 }
2563 /******************************************************************************* 2556 /*******************************************************************************
2564 2557
2565 $Function: activeEditor 2558 $Function: activeEditor
2566 2559
2567 $Description: deactivates the edit component 2560 $Description: deactivates the edit component
2568 2561
2569 $Returns: none. 2562 $Returns: none.
2570 2563
2571 $Arguments: 2564 $Arguments:
2572 2565
2576 return myHandle; 2569 return myHandle;
2577 } 2570 }
2578 2571
2579 /******************************************************************************* 2572 /*******************************************************************************
2580 2573
2581 $Function: setformatpointers 2574 $Function: setformatpointers
2582 2575
2583 $Description: SH - Sets static variables formatHandle and formatIndex, so thet editEventKey 2576 $Description: SH - Sets static variables formatHandle and formatIndex, so thet editEventKey
2584 can access the format string 2577 can access the format string
2585 2578
2586 $Returns: 2579 $Returns:
2587 2580
2588 $Arguments: Pointer to format string, pointer to format index 2581 $Arguments: Pointer to format string, pointer to format index
2589 2582
2590 *******************************************************************************/ 2583 *******************************************************************************/
2591 2584
2592 2585
2593 void setFormatPointers (char *format, int *index, int *index2) 2586 void setFormatPointers (char *format, int *index, int *index2)
2594 { 2587 {
2604 2597
2605 /******************************************************************************* 2598 /*******************************************************************************
2606 2599
2607 $Function: MmiModuleSet 2600 $Function: MmiModuleSet
2608 2601
2609 $Description: Set the status 2602 $Description: Set the status
2610 2603
2611 $Returns: none. 2604 $Returns: none.
2612 2605
2613 $Arguments: 2606 $Arguments:
2614 2607
2669 2662
2670 /******************************************************************************* 2663 /*******************************************************************************
2671 2664
2672 $Function: MmiModuleDel 2665 $Function: MmiModuleDel
2673 2666
2674 $Description: Delete the status 2667 $Description: Delete the status
2675 2668
2676 $Returns: none. 2669 $Returns: none.
2677 2670
2678 $Arguments: 2671 $Arguments:
2679 2672
2699 MmiModule=MmiModule & (~ModulePhon); 2692 MmiModule=MmiModule & (~ModulePhon);
2700 break; 2693 break;
2701 case ModuleSms: 2694 case ModuleSms:
2702 MmiModule=MmiModule & (~ModuleSms); 2695 MmiModule=MmiModule & (~ModuleSms);
2703 break; 2696 break;
2704 case ModuleBattLow: 2697 case ModuleBattLow:
2705 MmiModule=MmiModule & (~ModuleBattLow); 2698 MmiModule=MmiModule & (~ModuleBattLow);
2706 break; 2699 break;
2707 case ModuleSAT: 2700 case ModuleSAT:
2708 MmiModule=MmiModule & (~ModuleSAT); 2701 MmiModule=MmiModule & (~ModuleSAT);
2709 break; 2702 break;
2723 2716
2724 } 2717 }
2725 2718
2726 /******************************************************************************* 2719 /*******************************************************************************
2727 2720
2728 $Function: showGoodBye 2721 $Function: showGoodBye
2729 2722
2730 $Description: shows a goodbye Message when swiching off the mobile 2723 $Description: shows a goodbye Message when swiching off the mobile
2731 2724
2732 $Returns: none 2725 $Returns: none
2733 2726
2734 $Arguments: 2727 $Arguments:
2735 2728
2738 2731
2739 static void showGoodBye (T_MFW_HND win) 2732 static void showGoodBye (T_MFW_HND win)
2740 { 2733 {
2741 T_DISPLAY_DATA display_info; 2734 T_DISPLAY_DATA display_info;
2742 2735
2743 TRACE_FUNCTION("showGoodBye ()"); 2736 TRACE_FUNCTION("showGoodBye ()");
2744 dlg_zeroDisplayData(&display_info); 2737 dlg_zeroDisplayData(&display_info);
2745 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)goodbye_cb, FOREVER, 0 ); 2738 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)goodbye_cb, FOREVER, 0 );
2746 2739
2747 /* 2740 /*
2748 * Call Icon 2741 * Call Icon
2749 */ 2742 */
2750 2743
2753 2746
2754 } 2747 }
2755 2748
2756 /******************************************************************************* 2749 /*******************************************************************************
2757 2750
2758 $Function: goodbye_cb 2751 $Function: goodbye_cb
2759 2752
2760 $Description: 2753 $Description:
2761 2754
2762 $Returns: 2755 $Returns:
2763 2756
2767 2760
2768 2761
2769 static void goodbye_cb (void) 2762 static void goodbye_cb (void)
2770 { 2763 {
2771 TRACE_FUNCTION("goodbye_cb ()"); 2764 TRACE_FUNCTION("goodbye_cb ()");
2772 nm_deregistration(); /* start deregistration procedure */ 2765 nm_deregistration(); /* start deregistration procedure */
2773 } 2766 }
2774 2767
2775 #ifdef FF_MMI_AUDIO_PROFILE 2768 #ifdef FF_MMI_AUDIO_PROFILE
2776 void mmi_device_status_info(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback) 2769 void mmi_device_status_info(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback)
2777 { 2770 {
2778 T_DISPLAY_DATA display_info; 2771 T_DISPLAY_DATA display_info;
2779 2772
2780 TRACE_FUNCTION("mmi_device_status_info"); 2773 TRACE_FUNCTION("mmi_device_status_info");
2781 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1,str2, COLOUR_STATUS); 2774 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1,str2, COLOUR_STATUS);
2782 dlg_initDisplayData_events( &display_info, callback, THREE_SECS, KEY_LEFT | KEY_CLEAR | KEY_HUP); 2775 dlg_initDisplayData_events( &display_info, callback, THREE_SECS, KEY_LEFT | KEY_CLEAR | KEY_HUP);
2783 info_dialog(parent,&display_info); 2776 info_dialog(parent,&display_info);
2784 } 2777 }
2785 #endif 2778 #endif
2786 2779
2787 2780
2788 #if 0 /* FreeCalypso */ 2781 #if 0 /* FreeCalypso */
2789 /******************************************************************************* 2782 /*******************************************************************************
2790 2783
2791 $Function: menuBootTimeMsmt 2784 $Function: menuBootTimeMsmt
2792 2785
2793 $Description: menu handler for 'Boot Time' menu. Shows time taken for various boot events 2786 $Description: menu handler for 'Boot Time' menu. Shows time taken for various boot events
2794 2787
2795 $Returns: 2788 $Returns:
2796 2789
2797 $Arguments: 2790 $Arguments:
2798 2791
2799 *******************************************************************************/ 2792 *******************************************************************************/
2800 int menuBootTimeMsmt(MfwMnu* m, MfwMnuItem* i) 2793 int menuBootTimeMsmt(MfwMnu* m, MfwMnuItem* i)
2801 { 2794 {
2802 int boot_time[4]; 2795 int boot_time[4];
2803 T_AUI_EDITOR_DATA editor_data; 2796 T_AUI_EDITOR_DATA editor_data;
2804 T_MFW_HND win = (T_MFW_HND)bookCurrentWindow(); 2797 T_MFW_HND win = (T_MFW_HND)bookCurrentWindow();
2805 2798
2806 memset(buffer,0,sizeof(buffer)); 2799 memset(buffer,0,sizeof(buffer));
2807 get_boot_time(&boot_time); 2800 get_boot_time(&boot_time);
2808 TRACE_EVENT_P4("pre boot %d, app init %d, ti logo %d, conn log %d",boot_time[0],boot_time[1],boot_time[2],boot_time[3]); 2801 TRACE_EVENT_P4("pre boot %d, app init %d, ti logo %d, conn log %d",boot_time[0],boot_time[1],boot_time[2],boot_time[3]);
2809 sprintf((char*)buffer,"\nPre boot -%d ms \nApp init - %d ms \nModem Boot - %d ms \nNetwork sync - %d ms",boot_time[0],boot_time[1],boot_time[2],boot_time[3]); 2802 sprintf((char*)buffer,"\nPre boot -%d ms \nApp init - %d ms \nModem Boot - %d ms \nNetwork sync - %d ms",boot_time[0],boot_time[1],boot_time[2],boot_time[3]);
2810 AUI_edit_SetDefault(&editor_data); 2803 AUI_edit_SetDefault(&editor_data);
2811 AUI_edit_SetDisplay(&editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); 2804 AUI_edit_SetDisplay(&editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT);
2812 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtBootTime, NULL); 2805 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtBootTime, NULL);
2813 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, NULL); 2806 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, NULL);
2814 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, buffer, 100); 2807 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, buffer, 100);
2815 AUI_edit_SetMode(&editor_data, ED_MODE_READONLY, ED_CURSOR_NONE); 2808 AUI_edit_SetMode(&editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
2816 2809
2817 AUI_edit_Start(win, &editor_data); 2810 AUI_edit_Start(win, &editor_data);
2818 2811
2819 return 1; 2812 return 1;
2820 } 2813 }
2821 #endif 2814 #endif
2822 2815
2823 /* ****************************************************************** */ 2816 /* ****************************************************************** */
2824 #ifdef NEPTUNE_BOARD 2817 #ifdef NEPTUNE_BOARD
2834 2827
2835 #ifdef MMI_POWER_MANAGEMENT_TEST 2828 #ifdef MMI_POWER_MANAGEMENT_TEST
2836 2829
2837 /******************************************************************************* 2830 /*******************************************************************************
2838 2831
2839 $Function: mmi_PowerManagement_screen_forever 2832 $Function: mmi_PowerManagement_screen_forever
2840 2833
2841 $Description: This will be executed when closing Power Management Screen 2834 $Description: This will be executed when closing Power Management Screen
2842 2835
2843 $Returns: 2836 $Returns:
2844 $Arguments: window, Idetifier, reason 2837 $Arguments: window, Idetifier, reason
2845 2838
2846 *******************************************************************************/ 2839 *******************************************************************************/
2847 2840
2848 void mmi_PowerManagementStatus(T_MFW_HND win, USHORT identifier, SHORT reason) 2841 void mmi_PowerManagementStatus(T_MFW_HND win, USHORT identifier, SHORT reason)
2849 { 2842 {
2850 timStart( timer_handle ); 2843 timStart( timer_handle );
2853 } 2846 }
2854 2847
2855 2848
2856 /******************************************************************************* 2849 /*******************************************************************************
2857 2850
2858 $Function: mmi_PowerManagement_screen_forever 2851 $Function: mmi_PowerManagement_screen_forever
2859 2852
2860 $Description: Used to display Power Management running Screen 2853 $Description: Used to display Power Management running Screen
2861 2854
2862 $Returns: 0 - Success 2855 $Returns: 0 - Success
2863 1 - Error 2856 1 - Error
2864 2857
2865 2858
2866 $Arguments: window, textId/TestString, color 2859 $Arguments: window, textId/TestString, color
2867 2860
2868 *******************************************************************************/ 2861 *******************************************************************************/
2869 T_MFW_HND mmi_PowerManagement_screen_forever( MfwHnd win,int TextId, char* TextStr, int colour ) 2862 T_MFW_HND mmi_PowerManagement_screen_forever( MfwHnd win,int TextId, char* TextStr, int colour )
2870 { 2863 {
2871 T_DISPLAY_DATA DisplayInfo; 2864 T_DISPLAY_DATA DisplayInfo;
2872 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtCancel, TxtNull, TxtNull, colour); 2865 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtCancel, TxtNull, TxtNull, colour);
2873 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)mmi_PowerManagementStatus, FOREVER, KEY_ALL ); 2866 dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)mmi_PowerManagementStatus, FOREVER, KEY_ALL );
2874 DisplayInfo.TextString = TextStr; 2867 DisplayInfo.TextString = TextStr;
2875 return info_dialog(win, &DisplayInfo); 2868 return info_dialog(win, &DisplayInfo);
2876 } 2869 }
2877 2870
2878 /******************************************************************************* 2871 /*******************************************************************************
2879 2872
2880 $Function: mmi_PowerManagement 2873 $Function: mmi_PowerManagement
2881 2874
2882 $Description: Used to test the power Management 2875 $Description: Used to test the power Management
2883 2876
2884 $Returns: 0 - Success 2877 $Returns: 0 - Success
2885 1 - Error 2878 1 - Error
2886 2879
2887 2880
2888 $Arguments: menu, menu item 2881 $Arguments: menu, menu item
2889 2882
2890 *******************************************************************************/ 2883 *******************************************************************************/
2891 int mmi_PowerManagement(MfwMnu* m, MfwMnuItem* i) 2884 int mmi_PowerManagement(MfwMnu* m, MfwMnuItem* i)
2892 { 2885 {
2893 mmi_PowerManagement_screen_forever(0, NULL, "Power Management Running...\n", 1 ); 2886 mmi_PowerManagement_screen_forever(0, NULL, "Power Management Running...\n", 1 );
2894 timStop( timer_handle ); 2887 timStop( timer_handle );
2895 dspl_Enable(1); 2888 dspl_Enable(1);
2896 Screen_Update = 0; 2889 Screen_Update = 0;
2897 SVC_SCN_EnablePM( 1 ); 2890 SVC_SCN_EnablePM( 1 );
2898 return 0; 2891 return 0;
2899 } 2892 }
2900 2893
2901 #endif 2894 #endif
2902 2895
2903 2896
2905 2898
2906 /*OMAPS00098881(removing power variant) a0393213(prabakar) - screenUpdateOn() and screenUpdateOff() added*/ 2899 /*OMAPS00098881(removing power variant) a0393213(prabakar) - screenUpdateOn() and screenUpdateOff() added*/
2907 #ifdef FF_POWER_MANAGEMENT 2900 #ifdef FF_POWER_MANAGEMENT
2908 /******************************************************************************* 2901 /*******************************************************************************
2909 2902
2910 $Function: screenUpdateOn 2903 $Function: screenUpdateOn
2911 2904
2912 $Description: menu handler for Phone settings --> screen update --> on 2905 $Description: menu handler for Phone settings --> screen update --> on
2913 2906
2914 $Returns: 2907 $Returns:
2915 2908
2916 $Arguments: 2909 $Arguments:
2917 2910
2918 *******************************************************************************/ 2911 *******************************************************************************/
2919 int screenUpdateOn(MfwMnu* m, MfwMnuItem* i) 2912 int screenUpdateOn(MfwMnu* m, MfwMnuItem* i)
2920 { 2913 {
2921 if(FFS_flashData.refresh!=1) 2914 if(FFS_flashData.refresh!=1)
2922 { 2915 {
2923 /*Update the screen, start the timer (which is responsible for time update in idle screen) and save the status*/ 2916 /*Update the screen, start the timer (which is responsible for time update in idle screen) and save the status*/
2924 idleEvent(IdleUpdate); 2917 idleEvent(IdleUpdate);
2925 timStart(times); 2918 timStart(times);
2926 timStart(timer_handle);/*starting mfw timer also*/ 2919 timStart(timer_handle);/*starting mfw timer also*/
2927 FFS_flashData.refresh=1; 2920 FFS_flashData.refresh=1;
2928 flash_write(); 2921 flash_write();
2929 } 2922 }
2930 mmi_dialog_information_screen(0, TxtDone, NULL, NULL, 0); 2923 mmi_dialog_information_screen(0, TxtDone, NULL, NULL, 0);
2931 return MFW_EVENT_CONSUMED; 2924 return MFW_EVENT_CONSUMED;
2932 } 2925 }
2933 /******************************************************************************* 2926 /*******************************************************************************
2934 2927
2935 $Function: mmi_PowerManagement 2928 $Function: mmi_PowerManagement
2936 2929
2937 $Description: menu handler for Phone settings --> screen update --> off 2930 $Description: menu handler for Phone settings --> screen update --> off
2938 2931
2939 $Returns: 2932 $Returns:
2940 2933
2941 $Arguments: menu, menu item 2934 $Arguments: menu, menu item
2942 2935
2943 *******************************************************************************/ 2936 *******************************************************************************/
2944 int screenUpdateOff(MfwMnu* m, MfwMnuItem* i) 2937 int screenUpdateOff(MfwMnu* m, MfwMnuItem* i)
2945 { 2938 {
2946 if(FFS_flashData.refresh!=0) 2939 if(FFS_flashData.refresh!=0)
2947 { 2940 {
2948 /*Stop the timer(so no time update occurs in idle screen) and save the status in flash*/ 2941 /*Stop the timer(so no time update occurs in idle screen) and save the status in flash*/
2949 timStop(times); 2942 timStop(times);
2950 timStop(timer_handle); /*stoping mfw timer also*/ 2943 timStop(timer_handle); /*stoping mfw timer also*/
2951 FFS_flashData.refresh=0; 2944 FFS_flashData.refresh=0;
2952 flash_write(); 2945 flash_write();
2953 } 2946 }
2954 mmi_dialog_information_screen(0, TxtDone, NULL, NULL, 0); 2947 mmi_dialog_information_screen(0, TxtDone, NULL, NULL, 0);
2955 return MFW_EVENT_CONSUMED; 2948 return MFW_EVENT_CONSUMED;
2956 } 2949 }
2957 2950
2958 #endif 2951 #endif
2959 2952