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