comparison src/ui/bmi/AUIPinEditor.c @ 135:70ea7526b59e

bmi/AUI*.c: bogotab fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 Nov 2020 03:18:11 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
134:62480f597962 135:70ea7526b59e
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI (6349) 13 $Project code: BMI (6349)
14 $Module: MMI 14 $Module: MMI
15 $File: AUIPinEditor.c 15 $File: AUIPinEditor.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 22/02/01 19 $Date: 22/02/01
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: Editor for PIN entry 23 Description: Editor for PIN entry
24 24
32 32
33 xrashmic 1 Jul, 2006 OMAPS00075784 33 xrashmic 1 Jul, 2006 OMAPS00075784
34 The password mode to be turned on while entering the gsm string to 34 The password mode to be turned on while entering the gsm string to
35 unblock PUK during bootup 35 unblock PUK during bootup
36 36
37 July 09, 2005 REF : MMI - 22565 - a0876501 37 July 09, 2005 REF : MMI - 22565 - a0876501
38 Description: Proper display of IMEI with CD byte. 38 Description: Proper display of IMEI with CD byte.
39 Solution: Increased the IMEI length from 16 to 18. 39 Solution: Increased the IMEI length from 16 to 18.
40 40
41 June 16, 2005 REF: CRR 31267 x0021334 41 June 16, 2005 REF: CRR 31267 x0021334
42 Description: Handset ignore the initializtion of the PIN1/PIN2 42 Description: Handset ignore the initializtion of the PIN1/PIN2
43 Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate 43 Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate
44 message is displayed to the user. 44 message is displayed to the user.
45 45
46 May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg 46 May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
47 Description: IMEI retreival by posting a call to ACI sAT_xx API 47 Description: IMEI retreival by posting a call to ACI sAT_xx API
48 Solution: The direct call to cl_get_imeisv() is replaced with the 48 Solution: The direct call to cl_get_imeisv() is replaced with the
49 call to the mmi_imei_retrieve() which inturn calls sAT_Dn() and 49 call to the mmi_imei_retrieve() which inturn calls sAT_Dn() and
50 retrieves the IMEI info and stores it onto the global 50 retrieves the IMEI info and stores it onto the global
51 variable "imei" 51 variable "imei"
52 14/11/02 Original Condat(UK) BMI version. 52 14/11/02 Original Condat(UK) BMI version.
53 $End 53 $End
54 54
55 *******************************************************************************/ 55 *******************************************************************************/
56 56
126 #include "AUITextEntry.h" 126 #include "AUITextEntry.h"
127 127
128 #include "AUIPinEditor.h" 128 #include "AUIPinEditor.h"
129 129
130 //Nov 17, 2005 REF : OMAPS00045901 - a0876501 130 //Nov 17, 2005 REF : OMAPS00045901 - a0876501
131 #define IMEI_DISP_LEN 18 /* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */ 131 #define IMEI_DISP_LEN 18 /* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */
132 132
133 typedef struct 133 typedef struct
134 { 134 {
135 T_MMI_CONTROL mmi_control; 135 T_MMI_CONTROL mmi_control;
136 T_MFW_HND parent; // The parent window 136 T_MFW_HND parent; // The parent window
137 T_MFW_HND win; // The edit window 137 T_MFW_HND win; // The edit window
138 T_MFW_HND kbd; // The keyboard handler 138 T_MFW_HND kbd; // The keyboard handler
139 T_MFW_HND kbd_long; // The longpress keyboard handler 139 T_MFW_HND kbd_long; // The longpress keyboard handler
140 T_MFW_HND timer; // The timer for timeouts 140 T_MFW_HND timer; // The timer for timeouts
141 141
142 T_ED_DATA *editor; /* The ATB editor */ 142 T_ED_DATA *editor; /* The ATB editor */
143 T_AUI_EDITOR_DATA editor_data; /* The MMI editor data, provided by caller */ 143 T_AUI_EDITOR_DATA editor_data; /* The MMI editor data, provided by caller */
144 T_AUI_ENTRY_DATA *entry_data; /* The MMI text entry data */ 144 T_AUI_ENTRY_DATA *entry_data; /* The MMI text entry data */
145 145
146 BOOL haveTitle; /* TRUE if a title is supplied */ 146 BOOL haveTitle; /* TRUE if a title is supplied */
147 T_ATB_TEXT title; /* Title of editor */ 147 T_ATB_TEXT title; /* Title of editor */
148 148
149 BOOL hidden; 149 BOOL hidden;
150 150
151 BOOL doNextLongPress; /* Flag used to notice/not notice long keypress */ 151 BOOL doNextLongPress; /* Flag used to notice/not notice long keypress */
152 BOOL enteredMinChars; /* Set to TRUE when at least min_enter characters have been entered */ 152 BOOL enteredMinChars; /* Set to TRUE when at least min_enter characters have been entered */
153 BOOL enteredSomeChars; /* Set to TRUE if the length of the entered data is non-zero */ 153 BOOL enteredSomeChars; /* Set to TRUE if the length of the entered data is non-zero */
154 UBYTE emergency_call; /* Set to TRUE if number is an emergency call number */ 154 UBYTE emergency_call; /* Set to TRUE if number is an emergency call number */
155 UBYTE ss_string; 155 UBYTE ss_string;
156 char imei[IMEI_DISP_LEN];/* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */ 156 char imei[IMEI_DISP_LEN];/* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */
157 } 157 }
158 T_AUI_PIN_DATA; 158 T_AUI_PIN_DATA;
159 159
160 #define AUI_MAX_PIN 16 160 #define AUI_MAX_PIN 16
161 161
162 // June 16, 2005 REF: CRR 31267 x0021334 162 // June 16, 2005 REF: CRR 31267 x0021334
163 extern BOOL pin1Flag; // This flag will be needed here 163 extern BOOL pin1Flag; // This flag will be needed here
164 164
165 typedef struct 165 typedef struct
166 { 166 {
167 U8 pin_id; 167 U8 pin_id;
168 char puk_code[AUI_MAX_PIN + 1]; 168 char puk_code[AUI_MAX_PIN + 1];
169 char new_pin[AUI_MAX_PIN + 1]; 169 char new_pin[AUI_MAX_PIN + 1];
170 char cnf_pin[AUI_MAX_PIN + 1]; 170 char cnf_pin[AUI_MAX_PIN + 1];
171 } 171 }
172 T_AUI_PINS; 172 T_AUI_PINS;
173 /* LOCAL FUNCTION PROTOTYPES */ 173 /* LOCAL FUNCTION PROTOTYPES */
174 static T_MFW_HND AUI_pin_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data); 174 static T_MFW_HND AUI_pin_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data);
175 static void AUI_pin_ExecCb(T_MFW_HND win, USHORT event, SHORT value, void *parameter); 175 static void AUI_pin_ExecCb(T_MFW_HND win, USHORT event, SHORT value, void *parameter);
179 static UBYTE AUI_pin_CheckEmergency(T_AUI_PIN_DATA *data); 179 static UBYTE AUI_pin_CheckEmergency(T_AUI_PIN_DATA *data);
180 T_MFW_SS_RETURN AUI_pin_CheckSSString(T_AUI_PIN_DATA *data); 180 T_MFW_SS_RETURN AUI_pin_CheckSSString(T_AUI_PIN_DATA *data);
181 static BOOL AUI_pin_StripSSUnblock(char *cmd_string, T_AUI_PINS *pin_data); 181 static BOOL AUI_pin_StripSSUnblock(char *cmd_string, T_AUI_PINS *pin_data);
182 182
183 183
184
185
186 /******************************************************************************* 184 /*******************************************************************************
187 185
188 $Function: AUI_pin_Start 186 $Function: AUI_pin_Start
189 187
190 $Description: Start the PIN editor. 188 $Description: Start the PIN editor.
191 189
192 $Returns: None. 190 $Returns: None.
193 191
194 $Arguments: None. 192 $Arguments: None.
195 193
196 *******************************************************************************/ 194 *******************************************************************************/
197 195
198 T_MFW_HND AUI_pin_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) 196 T_MFW_HND AUI_pin_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data)
199 { 197 {
207 } 205 }
208 206
209 207
210 /******************************************************************************* 208 /*******************************************************************************
211 209
212 $Function: AUI_pin_Create 210 $Function: AUI_pin_Create
213 211
214 $Description: Create the PIN editor. 212 $Description: Create the PIN editor.
215 213
216 $Returns: Pointer to the editor's window. 214 $Returns: Pointer to the editor's window.
217 215
218 $Arguments: parent - The parent window. 216 $Arguments: parent - The parent window.
219 217
220 *******************************************************************************/ 218 *******************************************************************************/
221 219
222 static T_MFW_HND AUI_pin_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) 220 static T_MFW_HND AUI_pin_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data)
223 { 221 {
224 T_AUI_PIN_DATA *data; 222 T_AUI_PIN_DATA *data;
225 T_MFW_WIN *win_data; 223 T_MFW_WIN *win_data;
226 224
227 TRACE_FUNCTION ("AUI_pin_Create()"); 225 TRACE_FUNCTION ("AUI_pin_Create()");
228 TRACE_EVENT_P1("Memory left (start): %d", mfwCheckMemoryLeft()); 226 TRACE_EVENT_P1("Memory left (start): %d", mfwCheckMemoryLeft());
229 227
230 data = (T_AUI_PIN_DATA *)ALLOC_MEMORY(sizeof (T_AUI_PIN_DATA)); 228 data = (T_AUI_PIN_DATA *)ALLOC_MEMORY(sizeof (T_AUI_PIN_DATA));
231 TRACE_EVENT_P1("Memory left (data): %d", mfwCheckMemoryLeft()); 229 TRACE_EVENT_P1("Memory left (data): %d", mfwCheckMemoryLeft());
232 230
233 /* Create window handler */ 231 /* Create window handler */
234 232
235 data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_pin_WinCb); // Create window 233 data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_pin_WinCb); // Create window
236 TRACE_EVENT_P1("Memory left (win): %d", mfwCheckMemoryLeft()); 234 TRACE_EVENT_P1("Memory left (win): %d", mfwCheckMemoryLeft());
237 235
238 if (data->win==NULL) // Make sure window exists 236 if (data->win==NULL) // Make sure window exists
239 { 237 {
240 return NULL; 238 return NULL;
241 } 239 }
242 240
243 /* Connect the dialog data to the MFW-window */ 241 /* Connect the dialog data to the MFW-window */
244 242
245 data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_pin_ExecCb; /* Setup the destination for events */ 243 data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_pin_ExecCb; /* Setup the destination for events */
246 data->mmi_control.data = data; 244 data->mmi_control.data = data;
247 data->parent = parent; 245 data->parent = parent;
248 win_data = ((T_MFW_HDR *)data->win)->data; 246 win_data = ((T_MFW_HDR *)data->win)->data;
249 win_data->user = (void *)data; 247 win_data->user = (void *)data;
250 248
251 data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_pin_KbdCb); 249 data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_pin_KbdCb);
252 data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_pin_KbdLongCb); 250 data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_pin_KbdLongCb);
253 data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); 251 data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0);
254 TRACE_EVENT_P1("Memory left (editor): %d", mfwCheckMemoryLeft()); 252 TRACE_EVENT_P1("Memory left (editor): %d", mfwCheckMemoryLeft());
255 data->editor_data = *editor_data; 253 data->editor_data = *editor_data;
256 data->entry_data = AUI_entry_Create(data->win, data->editor, E_PIN_UPDATE); 254 data->entry_data = AUI_entry_Create(data->win, data->editor, E_PIN_UPDATE);
257 TRACE_EVENT_P1("Memory left (entry): %d", mfwCheckMemoryLeft()); 255 TRACE_EVENT_P1("Memory left (entry): %d", mfwCheckMemoryLeft());
258 SEND_EVENT(data->win, E_PIN_INIT, 0, 0); 256 SEND_EVENT(data->win, E_PIN_INIT, 0, 0);
259 257
260 /* Return window handle */ 258 /* Return window handle */
261 259
262 return data->win; 260 return data->win;
263 } 261 }
264 262
265 263
266 /******************************************************************************* 264 /*******************************************************************************
267 265
268 $Function: AUI_pin_Destroy 266 $Function: AUI_pin_Destroy
269 267
270 $Description: Destroy the PIN editor. 268 $Description: Destroy the PIN editor.
271 269
272 $Returns: None. 270 $Returns: None.
273 271
274 $Arguments: window - The editor window. 272 $Arguments: window - The editor window.
275 273
276 *******************************************************************************/ 274 *******************************************************************************/
277 275
278 void AUI_pin_Destroy(T_MFW_HND win) 276 void AUI_pin_Destroy(T_MFW_HND win)
279 { 277 {
280 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 278 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
281 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; 279 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user;
282 280
283 TRACE_FUNCTION("AUI_pin_Destroy"); 281 TRACE_FUNCTION("AUI_pin_Destroy");
284 TRACE_EVENT_P1("Memory left at start: %d", mfwCheckMemoryLeft()); 282 TRACE_EVENT_P1("Memory left at start: %d", mfwCheckMemoryLeft());
285 283
286 if (data) 284 if (data)
287 { 285 {
288 /* Free memory allocated for title */ 286 /* Free memory allocated for title */
289 287
290 if (data->haveTitle) 288 if (data->haveTitle)
291 { 289 {
292 FREE_MEMORY(data->title.data, (data->title.len+1)*ATB_string_Size(&data->title)); 290 FREE_MEMORY(data->title.data, (data->title.len+1)*ATB_string_Size(&data->title));
293 TRACE_EVENT_P1("Memory left (title dest): %d", mfwCheckMemoryLeft()); 291 TRACE_EVENT_P1("Memory left (title dest): %d", mfwCheckMemoryLeft());
294 } 292 }
295 293
296 /* Free text entry memory */ 294 /* Free text entry memory */
297 295
298 AUI_entry_Destroy(data->entry_data); 296 AUI_entry_Destroy(data->entry_data);
299 TRACE_EVENT_P1("Memory left (entry dest): %d", mfwCheckMemoryLeft()); 297 TRACE_EVENT_P1("Memory left (entry dest): %d", mfwCheckMemoryLeft());
300 /* Delete window */ 298 /* Delete window */
301 299
302 win_delete (data->win); 300 win_delete (data->win);
303 TRACE_EVENT_P1("Memory left (win dest): %d", mfwCheckMemoryLeft()); 301 TRACE_EVENT_P1("Memory left (win dest): %d", mfwCheckMemoryLeft());
304 /* Free editor memory */ 302 /* Free editor memory */
305 303
306 ATB_edit_Destroy(data->editor); 304 ATB_edit_Destroy(data->editor);
307 TRACE_EVENT_P1("Memory left (editor dest): %d", mfwCheckMemoryLeft()); 305 TRACE_EVENT_P1("Memory left (editor dest): %d", mfwCheckMemoryLeft());
308 /* Free Memory */ 306 /* Free Memory */
309 307
310 FREE_MEMORY ((void *)data, sizeof (T_AUI_PIN_DATA)); 308 FREE_MEMORY ((void *)data, sizeof (T_AUI_PIN_DATA));
311 TRACE_EVENT_P1("Memory left (data dest): %d", mfwCheckMemoryLeft()); 309 TRACE_EVENT_P1("Memory left (data dest): %d", mfwCheckMemoryLeft());
312 } 310 }
313 311
314 return; 312 return;
315 } 313 }
316 314
317 315
318 /******************************************************************************* 316 /*******************************************************************************
319 317
320 $Function: AUI_pin_ExecCb 318 $Function: AUI_pin_ExecCb
321 319
322 $Description: Dialog function for PIN editor. 320 $Description: Dialog function for PIN editor.
323 321
324 $Returns: None. 322 $Returns: None.
325 323
326 $Arguments: None. 324 $Arguments: None.
327 325
328 *******************************************************************************/ 326 *******************************************************************************/
329 327
330 static void AUI_pin_ExecCb(T_MFW_HND win, USHORT event, SHORT value, void *parameter) 328 static void AUI_pin_ExecCb(T_MFW_HND win, USHORT event, SHORT value, void *parameter)
331 { 329 {
332 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 330 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
333 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; 331 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user;
334 T_MFW_HND parent_win = data->parent; 332 T_MFW_HND parent_win = data->parent;
335 T_ATB_TEXT text={0,0,NULL}; 333 T_ATB_TEXT text={0,0,NULL};
336 /* Store these in case editor is destroyed on callback */ 334 /* Store these in case editor is destroyed on callback */
337 USHORT Identifier = data->editor_data.Identifier; 335 USHORT Identifier = data->editor_data.Identifier;
338 T_AUI_EDIT_CB Callback = data->editor_data.Callback; 336 T_AUI_EDIT_CB Callback = data->editor_data.Callback;
339 UBYTE destroyEditor = data->editor_data.destroyEditor; 337 UBYTE destroyEditor = data->editor_data.destroyEditor;
340 T_AUI_PINS *pin_unblock_data; 338 T_AUI_PINS *pin_unblock_data;
341 339
342 TRACE_FUNCTION ("AUI_pin_ExecCb()"); 340 TRACE_FUNCTION ("AUI_pin_ExecCb()");
343 341
344 switch (event) 342 switch (event)
345 { 343 {
346 /* Initialise */ 344 /* Initialise */
347 345
348 case E_PIN_INIT: 346 case E_PIN_INIT:
349 TRACE_EVENT("E_PIN_INIT"); 347 TRACE_EVENT("E_PIN_INIT");
350 ATB_edit_Init(data->editor); 348 ATB_edit_Init(data->editor);
351 349
352 data->haveTitle = FALSE; 350 data->haveTitle = FALSE;
353 351
354 /* If we require an output line, shrink editor to fit it at bottom 352 /* If we require an output line, shrink editor to fit it at bottom
355 * NB TitleString is assumed here to be a numeric string of ascii digits */ 353 * NB TitleString is assumed here to be a numeric string of ascii digits */
356 354
357 if (data->editor_data.TitleString) 355 if (data->editor_data.TitleString)
358 { 356 {
359 data->haveTitle = TRUE; 357 data->haveTitle = TRUE;
360 text.data = data->editor_data.TitleString; 358 text.data = data->editor_data.TitleString;
361 } 359 }
362 360
363 /* Set up title */ 361 /* Set up title */
364 362
365 if (data->editor_data.TitleId!=NULL) 363 if (data->editor_data.TitleId!=NULL)
366 { 364 {
367 data->haveTitle = TRUE; 365 data->haveTitle = TRUE;
368 text.data = (UBYTE *)MmiRsrcGetText(data->editor_data.TitleId); 366 text.data = (UBYTE *)MmiRsrcGetText(data->editor_data.TitleId);
369 } 367 }
370 368
371 /* If title exists, get its dcs and length */ 369 /* If title exists, get its dcs and length */
372 370
373 if (data->haveTitle) 371 if (data->haveTitle)
374 { 372 {
375 if (text.data[0]==0x80) 373 if (text.data[0]==0x80)
376 { 374 {
377 text.data += 2; /* Skip over two unicode indicator bytes */ 375 text.data += 2; /* Skip over two unicode indicator bytes */
378 text.dcs = ATB_DCS_UNICODE; 376 text.dcs = ATB_DCS_UNICODE;
379 } 377 }
380 #ifdef EASY_TEXT_ENABLED 378 #ifdef EASY_TEXT_ENABLED
381 else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) 379 else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
382 { 380 {
383 text.dcs = ATB_DCS_UNICODE; 381 text.dcs = ATB_DCS_UNICODE;
384 } 382 }
385 #endif 383 #endif
386 else 384 else
387 { 385 {
388 text.dcs = ATB_DCS_ASCII; 386 text.dcs = ATB_DCS_ASCII;
389 } 387 }
390 388
391 text.len = ATB_string_Length(&text); 389 text.len = ATB_string_Length(&text);
392 /* Allocate memory for the title and copy the text there */ 390 /* Allocate memory for the title and copy the text there */
393 data->title.data = (UBYTE *)ALLOC_MEMORY((text.len+1)*ATB_string_Size(&text)); 391 data->title.data = (UBYTE *)ALLOC_MEMORY((text.len+1)*ATB_string_Size(&text));
394 TRACE_EVENT_P1("Memory left (title): %d", mfwCheckMemoryLeft()); 392 TRACE_EVENT_P1("Memory left (title): %d", mfwCheckMemoryLeft());
395 ATB_string_Copy(&data->title, &text); 393 ATB_string_Copy(&data->title, &text);
396 } 394 }
397 395
398 /* Set flag if min_enter characters are in buffer */ 396 /* Set flag if min_enter characters are in buffer */
399 397
400 if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) 398 if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter)
401 data->enteredMinChars = TRUE; 399 data->enteredMinChars = TRUE;
402 else 400 else
403 data->enteredMinChars = FALSE; 401 data->enteredMinChars = FALSE;
404 402
405 /* Set flag if some characters are in the buffer */ 403 /* Set flag if some characters are in the buffer */
406 if (data->editor_data.editor_attr.text.len > 0 ) 404 if (data->editor_data.editor_attr.text.len > 0 )
407 data->enteredSomeChars = TRUE; 405 data->enteredSomeChars = TRUE;
408 else 406 else
409 data->enteredSomeChars = FALSE; 407 data->enteredSomeChars = FALSE;
410 408
411 /* Show the window */ 409 /* Show the window */
412 win_show(data->win); 410 win_show(data->win);
413 break; 411 break;
414 412
415 case E_PIN_UPDATE: 413 case E_PIN_UPDATE:
416 TRACE_EVENT("E_PIN_UPDATE"); 414 TRACE_EVENT("E_PIN_UPDATE");
417 win_show(data->win); 415 win_show(data->win);
418 break; 416 break;
419 417
420 case E_PIN_DEINIT: 418 case E_PIN_DEINIT:
421 TRACE_EVENT("E_PIN_DEINIT"); 419 TRACE_EVENT("E_PIN_DEINIT");
422 420
423 if (Callback) 421 if (Callback)
424 (Callback) (parent_win, Identifier, value); 422 (Callback) (parent_win, Identifier, value);
425 423
426 if (destroyEditor) 424 if (destroyEditor)
427 AUI_pin_Destroy(data->win); 425 AUI_pin_Destroy(data->win);
428 426
429 break; 427 break;
430 428
431 case E_PUK1_COMPLETE: 429 case E_PUK1_COMPLETE:
432 TRACE_EVENT("E_PIN_COMPLETE"); 430 TRACE_EVENT("E_PIN_COMPLETE");
433 431
434 pin_unblock_data = (T_AUI_PINS *)parameter; 432 pin_unblock_data = (T_AUI_PINS *)parameter;
435 433
436 sim_unblock_pin(pin_unblock_data->pin_id, 434 sim_unblock_pin(pin_unblock_data->pin_id,
437 pin_unblock_data->puk_code, 435 pin_unblock_data->puk_code,
438 pin_unblock_data->new_pin); /* unblock pin1 */ 436 pin_unblock_data->new_pin); /* unblock pin1 */
439 437
440 if (destroyEditor) 438 if (destroyEditor)
441 AUI_pin_Destroy(data->win); 439 AUI_pin_Destroy(data->win);
442 440
443 break; 441 break;
444 442
445 } 443 }
446 444
447 return; 445 return;
448 } 446 }
449 447
450 /******************************************************************************* 448 /*******************************************************************************
451 449
452 $Function: AUI_pin_WinCb 450 $Function: AUI_pin_WinCb
453 451
454 $Description: PIN editor window event handler. 452 $Description: PIN editor window event handler.
455 453
456 $Returns: None. 454 $Returns: None.
457 455
458 $Arguments: event - the event 456 $Arguments: event - the event
459 win - the editor window 457 win - the editor window
460 458
461 *******************************************************************************/ 459 *******************************************************************************/
462 460
463 static int AUI_pin_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data) 461 static int AUI_pin_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data)
464 { 462 {
465 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; 463 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user;
466 T_ED_DATA *editor = data->editor; 464 T_ED_DATA *editor = data->editor;
467 T_ATB_WIN_SIZE *win_size = &data->editor->attr->win_size; 465 T_ATB_WIN_SIZE *win_size = &data->editor->attr->win_size;
468 T_ATB_TEXT text; 466 T_ATB_TEXT text;
469 T_DS_TEXTFORMAT format; 467 T_DS_TEXTFORMAT format;
470 // USHORT titleLen; // RAVI 468 // USHORT titleLen; // RAVI
471 469
472 if (!data) 470 if (!data)
473 return MFW_EVENT_CONSUMED; 471 return MFW_EVENT_CONSUMED;
474 472
475 switch(event) 473 switch(event)
476 { 474 {
477 case E_WIN_VISIBLE: /* window is visible */ 475 case E_WIN_VISIBLE: /* window is visible */
478 if (win_data->flags & E_WIN_VISIBLE) 476 if (win_data->flags & E_WIN_VISIBLE)
479 { 477 {
480 if (editor->update==ED_UPDATE_TRIVIAL) 478 if (editor->update==ED_UPDATE_TRIVIAL)
481 { 479 {
482 TRACE_EVENT("Only updating editor."); 480 TRACE_EVENT("Only updating editor.");
483 ATB_edit_Show(data->editor); 481 ATB_edit_Show(data->editor);
484 } 482 }
485 else 483 else
486 { 484 {
487 TRACE_EVENT("Updating whole screen."); 485 TRACE_EVENT("Updating whole screen.");
488 486
489 ATB_edit_Show(data->editor); 487 ATB_edit_Show(data->editor);
490 488
491 /* Set the colour for drawing title */ 489 /* Set the colour for drawing title */
492 490
493 resources_setTitleColour(COLOUR_EDITOR); 491 resources_setTitleColour(COLOUR_EDITOR);
494 492
495 /* TITLE - only display if update type is FULL or DEFAULT*/ 493 /* TITLE - only display if update type is FULL or DEFAULT*/
496 494
497 if (editor->update!=ED_UPDATE_PARTIAL) 495 if (editor->update!=ED_UPDATE_PARTIAL)
498 { 496 {
499 dspl_Clear(0,0, SCREEN_SIZE_X-1, win_size->py-1); 497 dspl_Clear(0,0, SCREEN_SIZE_X-1, win_size->py-1);
500 498
501 if (data->haveTitle) 499 if (data->haveTitle)
502 { 500 {
503 ATB_display_SetFormatAttr(&format, 0, FALSE); 501 ATB_display_SetFormatAttr(&format, 0, FALSE);
504 502
505 /* Display "Emergency?" prompt in title if emergency call */ 503 /* Display "Emergency?" prompt in title if emergency call */
506 if (data->emergency_call) 504 if (data->emergency_call)
507 { 505 {
508 text.dcs = data->title.dcs; 506 text.dcs = data->title.dcs;
509 text.data = (UBYTE *)MmiRsrcGetText(TxtEmergency); 507 text.data = (UBYTE *)MmiRsrcGetText(TxtEmergency);
510 text.len = ATB_string_Length(&text); 508 text.len = ATB_string_Length(&text);
511 ATB_display_Text(0,0,&format, &text); 509 ATB_display_Text(0,0,&format, &text);
512 } 510 }
513 /* Otherwise, show title */ 511 /* Otherwise, show title */
514 else 512 else
515 { 513 {
516 ATB_display_Text(0,0,&format, &data->title); 514 ATB_display_Text(0,0,&format, &data->title);
517 } 515 }
518 } 516 }
519 } 517 }
520 518
521 /* Display Soft Keys */ 519 /* Display Soft Keys */
522 520
523 if (data->emergency_call) 521 if (data->emergency_call)
524 { 522 {
525 displaySoftKeys(TxtSoftCall, data->editor_data.RightSoftKey); 523 displaySoftKeys(TxtSoftCall, data->editor_data.RightSoftKey);
526 } 524 }
527 else 525 else
528 { 526 {
529 if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) 527 if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter)
530 { 528 {
531 /* entered less than the required number of chars: Alternate Softkey appears */ 529 /* entered less than the required number of chars: Alternate Softkey appears */
532 if (data->editor_data.editor_attr.text.len > 0) 530 if (data->editor_data.editor_attr.text.len > 0)
533 displaySoftKeys(data->editor_data.AltLeftSoftKey,data->editor_data.RightSoftKey); 531 displaySoftKeys(data->editor_data.AltLeftSoftKey,data->editor_data.RightSoftKey);
534 else 532 else
535 displaySoftKeys(data->editor_data.AltLeftSoftKey,TxtNull); 533 displaySoftKeys(data->editor_data.AltLeftSoftKey,TxtNull);
536 } 534 }
537 else 535 else
538 { 536 {
539 /* entered sufficient number of chars: Normal Softkey appears */ 537 /* entered sufficient number of chars: Normal Softkey appears */
540 538
541 if (data->editor_data.editor_attr.text.len > 0) 539 if (data->editor_data.editor_attr.text.len > 0)
542 displaySoftKeys(data->editor_data.LeftSoftKey,data->editor_data.RightSoftKey); 540 displaySoftKeys(data->editor_data.LeftSoftKey,data->editor_data.RightSoftKey);
543 else 541 else
544 displaySoftKeys(data->editor_data.LeftSoftKey, TxtNull); 542 displaySoftKeys(data->editor_data.LeftSoftKey, TxtNull);
545 } 543 }
546 } 544 }
547 } 545 }
548 } 546 }
549 break; 547 break;
550 } 548 }
551 549
552 data->editor->update = ED_UPDATE_DEFAULT; 550 data->editor->update = ED_UPDATE_DEFAULT;
553 551
554 /* x0045876, 14-Aug-2006 (WR - non-void function "AUI_pin_WinCb" should return a value) */ 552 /* x0045876, 14-Aug-2006 (WR - non-void function "AUI_pin_WinCb" should return a value) */
555 return MFW_EVENT_CONSUMED ; 553 return MFW_EVENT_CONSUMED ;
556 } 554 }
557 555
558 556
559 /******************************************************************************* 557 /*******************************************************************************
560 558
561 $Function: AUI_pin_KbdCb 559 $Function: AUI_pin_KbdCb
562 560
563 $Description: PIN editor keyboard event handler 561 $Description: PIN editor keyboard event handler
564 562
565 $Returns: None. 563 $Returns: None.
566 564
567 $Arguments: event - the keyboard event 565 $Arguments: event - the keyboard event
568 keyboard 566 keyboard
569 567
570 *******************************************************************************/ 568 *******************************************************************************/
571 569
572 static int AUI_pin_KbdCb(T_MFW_EVENT event, T_MFW_KBD *keyboard) 570 static int AUI_pin_KbdCb(T_MFW_EVENT event, T_MFW_KBD *keyboard)
573 { 571 {
574 T_MFW_HND win = mfw_parent (mfw_header()); 572 T_MFW_HND win = mfw_parent (mfw_header());
575 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 573 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
576 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; 574 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user;
577 // ED_RES result; // RAVI 575 // ED_RES result; // RAVI
578 UBYTE *edit_data_buf; 576 UBYTE *edit_data_buf;
579 BOOL bRetVal; 577 BOOL bRetVal;
580 T_AUI_PINS pin_unblock_data; 578 T_AUI_PINS pin_unblock_data;
581 T_DISPLAY_DATA display_info; 579 T_DISPLAY_DATA display_info;
582 580
583 TRACE_FUNCTION("AUI_pin_KbdCb()"); 581 TRACE_FUNCTION("AUI_pin_KbdCb()");
584 582
585 /* Suppress unwanted long keypresses */ 583 /* Suppress unwanted long keypresses */
586 584
587 data->doNextLongPress = TRUE; /* next Key_long event is correct */ 585 data->doNextLongPress = TRUE; /* next Key_long event is correct */
588 data->editor->update = ED_UPDATE_DEFAULT; /* Default behaviour is just to update text */ 586 data->editor->update = ED_UPDATE_DEFAULT; /* Default behaviour is just to update text */
589 587
590 switch (keyboard->code) 588 switch (keyboard->code)
591 { 589 {
592 case KCD_STAR: 590 case KCD_STAR:
593 /* Only possible when the first digit is a '*' */ 591 /* Only possible when the first digit is a '*' */
594 if ((data->editor_data.editor_attr.text.len==0) || 592 if ((data->editor_data.editor_attr.text.len==0) ||
595 (data->ss_string)) 593 (data->ss_string))
596 { 594 {
597 if (data->editor_data.editor_attr.text.len==0) 595 if (data->editor_data.editor_attr.text.len==0)
598 { 596 {
599 data->hidden = FALSE; 597 data->hidden = FALSE;
600 data->ss_string = TRUE; 598 data->ss_string = TRUE;
601 /* The string should now be visible on screen */ 599 /* The string should now be visible on screen */
602 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 600 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
603 { 601 {
604 data->hidden = TRUE; 602 data->hidden = TRUE;
605 ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN); 603 ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN);
606 } 604 }
607 } 605 }
608 606
609 AUI_entry_EventKey(data->entry_data, event, keyboard); 607 AUI_entry_EventKey(data->entry_data, event, keyboard);
610 win_show(data->win); 608 win_show(data->win);
611 } 609 }
612 //xrashmic 1 Jul, 2006 OMAPS00075784 610 //xrashmic 1 Jul, 2006 OMAPS00075784
613 //The password mode to be turned on while entering the gsm string to 611 //The password mode to be turned on while entering the gsm string to
614 //unblock PUK during bootup 612 //unblock PUK during bootup
615 if(data->editor_data.editor_attr.text.len >=4 ) 613 if(data->editor_data.editor_attr.text.len >=4 )
616 { 614 {
617 if((strncmp((char*)data->editor_data.editor_attr.text.data, "**05*", 5) == 0) || 615 if((strncmp((char*)data->editor_data.editor_attr.text.data, "**05*", 5) == 0) ||
618 (strncmp((char*)data->editor_data.editor_attr.text.data, "**052*", 6) == 0) || 616 (strncmp((char*)data->editor_data.editor_attr.text.data, "**052*", 6) == 0) ||
619 (strncmp((char*)data->editor_data.editor_attr.text.data, "**04*", 5) == 0) || 617 (strncmp((char*)data->editor_data.editor_attr.text.data, "**04*", 5) == 0) ||
620 (strncmp((char*)data->editor_data.editor_attr.text.data, "**042*", 6) == 0)) 618 (strncmp((char*)data->editor_data.editor_attr.text.data, "**042*", 6) == 0))
621 { 619 {
622 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); 620 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN);
623 } 621 }
624 } 622 }
625 break; 623 break;
626 624
627 case KCD_HASH: 625 case KCD_HASH:
628 /* Send SS string if we're entering one */ 626 /* Send SS string if we're entering one */
629 if(data->ss_string) 627 if(data->ss_string)
630 { 628 {
631 AUI_entry_EventKey(data->entry_data, event, keyboard); 629 AUI_entry_EventKey(data->entry_data, event, keyboard);
632 //xrashmic 1 Jul, 2006 OMAPS00075784 630 //xrashmic 1 Jul, 2006 OMAPS00075784
633 //The password mode to be turned on while entering the gsm string to 631 //The password mode to be turned on while entering the gsm string to
634 //unblock PUK during bootup 632 //unblock PUK during bootup
635 633
636 if(ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 634 if(ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
637 { 635 {
646 strncpy((char*)&data->editor_data.editor_attr.text.data[6], 644 strncpy((char*)&data->editor_data.editor_attr.text.data[6],
647 (char*)&data->editor->hiddenText->data[6], data->editor_data.editor_attr.text.len - 6); 645 (char*)&data->editor->hiddenText->data[6], data->editor_data.editor_attr.text.len - 6);
648 } 646 }
649 } 647 }
650 648
651 edit_data_buf = ALLOC_MEMORY(data->editor_data.editor_attr.size); 649 edit_data_buf = ALLOC_MEMORY(data->editor_data.editor_attr.size);
652 650
653 strcpy((char *)edit_data_buf, (char *)data->editor_data.editor_attr.text.data); 651 strcpy((char *)edit_data_buf, (char *)data->editor_data.editor_attr.text.data);
654 652
655 switch (AUI_pin_CheckSSString(data)) 653 switch (AUI_pin_CheckSSString(data))
656 { 654 {
657 case MFW_SS_MMI: 655 case MFW_SS_MMI:
658 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg 656 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
659 // replace the call to get_imei() with callNumber 657 // replace the call to get_imei() with callNumber
660 #ifdef FF_MMI_ATC_MIGRATION 658 #ifdef FF_MMI_ATC_MIGRATION
661 mmi_imei_retrieve(); 659 mmi_imei_retrieve();
662 #else 660 #else
663 get_imei((char*)data->imei); 661 get_imei((char*)data->imei);
664 showIMEI(win,(char*)data->imei); 662 showIMEI(win,(char*)data->imei);
665 #endif 663 #endif
666 ATB_edit_ClearAll(data->editor); 664 ATB_edit_ClearAll(data->editor);
667 665
668 /* Set back to the default */ 666 /* Set back to the default */
669 data->ss_string = FALSE; 667 data->ss_string = FALSE;
670 668
671 if (data->hidden == TRUE) 669 if (data->hidden == TRUE)
672 { 670 {
673 /* go back in the hide mode */ 671 /* go back in the hide mode */
674 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); 672 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN);
675 } 673 }
676 674
677 FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); 675 FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size);
678 win_show(data->win); 676 win_show(data->win);
679 return MFW_EVENT_CONSUMED; 677 return MFW_EVENT_CONSUMED;
680 // break; // RAVI 678 // break; // RAVI
681 679
682 case MFW_SS_SIM_UNBLCK_PIN: 680 case MFW_SS_SIM_UNBLCK_PIN:
683 bRetVal = AUI_pin_StripSSUnblock((char *)edit_data_buf, &pin_unblock_data); 681 bRetVal = AUI_pin_StripSSUnblock((char *)edit_data_buf, &pin_unblock_data);
684 682
685 FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); 683 FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size);
686 684
687 if (bRetVal == FALSE) 685 if (bRetVal == FALSE)
688 { 686 {
689 /* 687 /*
690 ** Clear the entered string, reset the editor and display a "failed" dialog 688 ** Clear the entered string, reset the editor and display a "failed" dialog
691 */ 689 */
692 ATB_edit_ClearAll(data->editor); 690 ATB_edit_ClearAll(data->editor);
693 691
694 /* Set back to the default */ 692 /* Set back to the default */
695 data->ss_string = FALSE; 693 data->ss_string = FALSE;
696 694
697 if (data->hidden == TRUE) 695 if (data->hidden == TRUE)
698 { 696 {
699 /* go back in the hide mode */ 697 /* go back in the hide mode */
700 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); 698 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN);
701 } 699 }
702 700
703 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtFailed, TxtNull, COLOUR_POPUP); 701 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtFailed, TxtNull, COLOUR_POPUP);
704 dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0); 702 dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0);
705 info_dialog(0, &display_info); 703 info_dialog(0, &display_info);
706 704
707 } 705 }
708 else 706 else
709 { 707 {
710 SEND_EVENT (win, E_PUK1_COMPLETE, INFO_KCD_LEFT, &pin_unblock_data); 708 SEND_EVENT (win, E_PUK1_COMPLETE, INFO_KCD_LEFT, &pin_unblock_data);
711 } 709 }
712 710
713 return MFW_EVENT_CONSUMED; 711 return MFW_EVENT_CONSUMED;
714 // break; // RAVI 712 // break; // RAVI
715 713
716 default: 714 default:
717 /* xreddymn OMAPS00083495 Jul-04-2006 715 /* xreddymn OMAPS00083495 Jul-04-2006
718 * Display error dialog for BPM strings that are not handled. 716 * Display error dialog for BPM strings that are not handled.
719 */ 717 */
720 ATB_edit_ClearAll(data->editor); 718 ATB_edit_ClearAll(data->editor);
721 data->ss_string = FALSE; 719 data->ss_string = FALSE;
722 if (data->hidden == TRUE) 720 if (data->hidden == TRUE)
723 { 721 {
724 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); 722 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN);
725 } 723 }
726 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtNotAllowed, TxtNull, COLOUR_POPUP); 724 dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtNotAllowed, TxtNull, COLOUR_POPUP);
727 dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0); 725 dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0);
728 info_dialog(0, &display_info); 726 info_dialog(0, &display_info);
729 FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); 727 FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size);
730 break; 728 break;
731 } 729 }
732 win_show(data->win); 730 win_show(data->win);
733 731
734 } 732 }
735 else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) 733 else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter)
736 { 734 {
737 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 735 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
738 { 736 {
739 ATB_edit_HiddenExit(data->editor); 737 ATB_edit_HiddenExit(data->editor);
740 } 738 }
741 SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL); 739 SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL);
742 } 740 }
743 741
744 break; 742 break;
745 743
746 #ifdef COLOURDISPLAY 744 #ifdef COLOURDISPLAY
747 /* Menu select has same effect as left soft key */ 745 /* Menu select has same effect as left soft key */
748 case KCD_MNUSELECT: 746 case KCD_MNUSELECT:
749 #endif /* COLOURDISPLAY */ 747 #endif /* COLOURDISPLAY */
750 748
751 case KCD_LEFT: 749 case KCD_LEFT:
752 /* Make an emergency call if an appropriate number entered */ 750 /* Make an emergency call if an appropriate number entered */
753 if ( data->emergency_call ) 751 if ( data->emergency_call )
754 { 752 {
755 /* Copy the actual typed text into the buffer */ 753 /* Copy the actual typed text into the buffer */
756 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 754 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
757 { 755 {
758 ATB_edit_HiddenExit(data->editor); 756 ATB_edit_HiddenExit(data->editor);
759 } 757 }
760 SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL); 758 SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL);
761 } 759 }
762 /* Submit PIN if sufficient characters entered */ 760 /* Submit PIN if sufficient characters entered */
763 else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) 761 else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter)
764 { 762 {
765 // June 16, 2005 REF: CRR 31267 x0021334 763 // June 16, 2005 REF: CRR 31267 x0021334
766 // If PIN1/PUK1 =0, Show info dialog that SIM is blocked 764 // If PIN1/PUK1 =0, Show info dialog that SIM is blocked
767 if (pin1Flag EQ TRUE) 765 if (pin1Flag EQ TRUE)
768 { 766 {
769 dlg_initDisplayData_TextId(&display_info, NULL, NULL, TxtSimBlocked, TxtDealer, COLOUR_STATUS); 767 dlg_initDisplayData_TextId(&display_info, NULL, NULL, TxtSimBlocked, TxtDealer, COLOUR_STATUS);
770 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT); 768 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT);
771 info_dialog (NULL, &display_info); 769 info_dialog (NULL, &display_info);
772 break; 770 break;
773 } 771 }
774 /* Left Softkey is enabled (and entered sufficient number of chars): execute it. */ 772 /* Left Softkey is enabled (and entered sufficient number of chars): execute it. */
775 /* Copy the actual typed text into the buffer */ 773 /* Copy the actual typed text into the buffer */
776 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 774 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
777 { 775 {
778 ATB_edit_HiddenExit(data->editor); 776 ATB_edit_HiddenExit(data->editor);
779 } 777 }
780 SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL); 778 SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL);
781 } 779 }
782 break; 780 break;
783 781
784 case KCD_HUP: 782 case KCD_HUP:
785 break; 783 break;
786 784
787 case KCD_CALL: 785 case KCD_CALL:
788 /* Make an emergency call if an appropriate number entered */ 786 /* Make an emergency call if an appropriate number entered */
789 if ( data->emergency_call ) 787 if ( data->emergency_call )
790 { 788 {
791 /* Copy the actual typed text into the buffer */ 789 /* Copy the actual typed text into the buffer */
792 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 790 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
793 { 791 {
794 ATB_edit_HiddenExit(data->editor); 792 ATB_edit_HiddenExit(data->editor);
795 } 793 }
796 SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL); 794 SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL);
797 } 795 }
798 break; 796 break;
799 797
800 case KCD_RIGHT: 798 case KCD_RIGHT:
801 if(data->editor_data.editor_attr.text.len!=0) 799 if(data->editor_data.editor_attr.text.len!=0)
802 { 800 {
803 //xrashmic 1 Jul, 2006 OMAPS00075784 801 //xrashmic 1 Jul, 2006 OMAPS00075784
804 //The password mode to be turned on while entering the gsm string to 802 //The password mode to be turned on while entering the gsm string to
805 //unblock PUK during bootup 803 //unblock PUK during bootup
806 if(ATB_edit_Mode(data->editor, ED_MODE_HIDDEN) && 804 if(ATB_edit_Mode(data->editor, ED_MODE_HIDDEN) &&
807 (((data->editor_data.editor_attr.text.len == 5) && 805 (((data->editor_data.editor_attr.text.len == 5) &&
808 ((strncmp((char*)data->editor_data.editor_attr.text.data, "**05*", 5) == 0) || 806 ((strncmp((char*)data->editor_data.editor_attr.text.data, "**05*", 5) == 0) ||
809 (strncmp((char*)data->editor_data.editor_attr.text.data, "**04*", 5) == 0))) || 807 (strncmp((char*)data->editor_data.editor_attr.text.data, "**04*", 5) == 0))) ||
810 ((data->editor_data.editor_attr.text.len == 6) && 808 ((data->editor_data.editor_attr.text.len == 6) &&
811 ((strncmp((char*)data->editor_data.editor_attr.text.data, "**052*", 6) == 0) || 809 ((strncmp((char*)data->editor_data.editor_attr.text.data, "**052*", 6) == 0) ||
812 (strncmp((char*)data->editor_data.editor_attr.text.data, "**042*", 6) == 0))))) 810 (strncmp((char*)data->editor_data.editor_attr.text.data, "**042*", 6) == 0)))))
813 { 811 {
814 ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN); 812 ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN);
815 } 813 }
816 814
817 ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ 815 ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */
818 816
819 /* For a SS string */ 817 /* For a SS string */
820 if ( !ATB_edit_Mode(data->editor,ED_MODE_HIDDEN) ) 818 if ( !ATB_edit_Mode(data->editor,ED_MODE_HIDDEN) )
821 { 819 {
822 if (data->editor_data.editor_attr.text.len==0 && data->ss_string) 820 if (data->editor_data.editor_attr.text.len==0 && data->ss_string)
823 { 821 {
824 data->ss_string = FALSE; 822 data->ss_string = FALSE;
825 if (data->hidden == TRUE) 823 if (data->hidden == TRUE)
826 { 824 {
827 /* The string should not be visible on screen */ 825 /* The string should not be visible on screen */
828 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); 826 ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN);
829 } 827 }
830 } 828 }
831 } 829 }
832 830
833 /* is it a emergency call number ?!*/ 831 /* is it a emergency call number ?!*/
834 AUI_pin_CheckEmergency(data); 832 AUI_pin_CheckEmergency(data);
835 win_show(data->win); 833 win_show(data->win);
836 } 834 }
837 break; 835 break;
838 836
839 case KCD_0: 837 case KCD_0:
840 case KCD_1: 838 case KCD_1:
841 case KCD_2: 839 case KCD_2:
842 case KCD_3: 840 case KCD_3:
843 case KCD_4: 841 case KCD_4:
844 case KCD_5: 842 case KCD_5:
845 case KCD_6: 843 case KCD_6:
846 case KCD_7: 844 case KCD_7:
847 case KCD_8: 845 case KCD_8:
848 case KCD_9: 846 case KCD_9:
849 /* xreddymn OMAPS00083495 Jul-04-2006 847 /* xreddymn OMAPS00083495 Jul-04-2006
850 * Limit PIN1, PIN2 entries to 8 digits. 848 * Limit PIN1, PIN2 entries to 8 digits.
851 */ 849 */
852 if(((data->editor_data.Identifier==PIN1_REQ) || 850 if(((data->editor_data.Identifier==PIN1_REQ) ||
853 (data->editor_data.Identifier==PIN2_REQ)) && 851 (data->editor_data.Identifier==PIN2_REQ)) &&
854 (data->editor_data.editor_attr.text.len>=8) && 852 (data->editor_data.editor_attr.text.len>=8) &&
855 (!data->ss_string)) 853 (!data->ss_string))
856 return MFW_EVENT_CONSUMED; 854 return MFW_EVENT_CONSUMED;
857 else 855 else
858 { 856 {
859 AUI_entry_EventKey(data->entry_data, event, keyboard); 857 AUI_entry_EventKey(data->entry_data, event, keyboard);
860 /* is it a emergency call number ?!*/ 858 /* is it a emergency call number ?!*/
861 AUI_pin_CheckEmergency(data); 859 AUI_pin_CheckEmergency(data);
862 win_show(data->win); 860 win_show(data->win);
863 } 861 }
864 break; 862 break;
865 } 863 }
866 864
867 return MFW_EVENT_CONSUMED; 865 return MFW_EVENT_CONSUMED;
868 } 866 }
869 867
870 868
871 /******************************************************************************* 869 /*******************************************************************************
872 870
873 $Function: AUI_pin_KbdLongCb 871 $Function: AUI_pin_KbdLongCb
874 872
875 $Description: PIN editor long keypress keyboard event handler 873 $Description: PIN editor long keypress keyboard event handler
876 874
877 $Returns: None. 875 $Returns: None.
878 876
879 $Arguments: event - the keyboard event 877 $Arguments: event - the keyboard event
880 keyboard 878 keyboard
881 879
882 *******************************************************************************/ 880 *******************************************************************************/
883 881
884 static int AUI_pin_KbdLongCb(T_MFW_EVENT event, T_MFW_KBD *keyboard) 882 static int AUI_pin_KbdLongCb(T_MFW_EVENT event, T_MFW_KBD *keyboard)
885 { 883 {
886 T_MFW_HND win = mfw_parent (mfw_header()); 884 T_MFW_HND win = mfw_parent (mfw_header());
887 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 885 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
888 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; 886 T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user;
889 ED_RES result; 887 ED_RES result;
890 888
891 /* Suppress unwanted long keypresses */ 889 /* Suppress unwanted long keypresses */
892 890
893 if ( data->doNextLongPress ) 891 if ( data->doNextLongPress )
894 data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ 892 data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */
895 else 893 else
896 return MFW_EVENT_CONSUMED; /* don't do current long press */ 894 return MFW_EVENT_CONSUMED; /* don't do current long press */
897 895
898 switch (keyboard->code) 896 switch (keyboard->code)
899 { 897 {
900 case KCD_RIGHT: 898 case KCD_RIGHT:
901 /* Long press of RSK deletes buffer */ 899 /* Long press of RSK deletes buffer */
902 result = ATB_edit_ClearAll(data->editor); 900 result = ATB_edit_ClearAll(data->editor);
903 901
904 /* If we've deleted on an empty buffer, exit editor */ 902 /* If we've deleted on an empty buffer, exit editor */
905 if (result==ED_DONE) 903 if (result==ED_DONE)
906 { 904 {
907 SEND_EVENT(data->win, E_PIN_DEINIT, INFO_KCD_RIGHT, 0); 905 SEND_EVENT(data->win, E_PIN_DEINIT, INFO_KCD_RIGHT, 0);
908 } 906 }
909 else 907 else
910 { 908 {
911 win_show(data->win); 909 win_show(data->win);
912 } 910 }
913 break; 911 break;
914 } 912 }
915 913
916 return MFW_EVENT_CONSUMED; 914 return MFW_EVENT_CONSUMED;
917 915
918 } 916 }
919 917
920 918
921 /******************************************************************************* 919 /*******************************************************************************
922 920
923 $Function: AUI_pin_CheckEmergency 921 $Function: AUI_pin_CheckEmergency
924 922
925 $Description: Check number to see if it's an emergency number 923 $Description: Check number to see if it's an emergency number
926 924
927 $Returns: None. 925 $Returns: None.
928 926
929 $Arguments: data - The editor data 927 $Arguments: data - The editor data
930 928
931 *******************************************************************************/ 929 *******************************************************************************/
932 930
933 static UBYTE AUI_pin_CheckEmergency(T_AUI_PIN_DATA *data) 931 static UBYTE AUI_pin_CheckEmergency(T_AUI_PIN_DATA *data)
934 { 932 {
935 UBYTE previous_emergency = data->emergency_call; 933 UBYTE previous_emergency = data->emergency_call;
936 UBYTE previous_entered = data->enteredMinChars; 934 UBYTE previous_entered = data->enteredMinChars;
937 UBYTE previous_someentered = data->enteredSomeChars; 935 UBYTE previous_someentered = data->enteredSomeChars;
938 UBYTE emergency_call; 936 UBYTE emergency_call;
939 937
940 /*SPR#2235 - DS - If the edit mode is 'hidden' then pass 938 /*SPR#2235 - DS - If the edit mode is 'hidden' then pass
941 *the 'hidden buffer' as the parameter to cm_check_emergency. 939 *the 'hidden buffer' as the parameter to cm_check_emergency.
942 *If the edit mode is not 'hidden' then pass the normal editor 940 *If the edit mode is not 'hidden' then pass the normal editor
943 *text buffer as the parameter. 941 *text buffer as the parameter.
944 */ 942 */
945 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) 943 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN))
946 emergency_call = cm_check_emergency(data->editor->hiddenText->data); 944 emergency_call = cm_check_emergency(data->editor->hiddenText->data);
947 else 945 else
948 emergency_call = cm_check_emergency(data->editor_data.editor_attr.text.data); 946 emergency_call = cm_check_emergency(data->editor_data.editor_attr.text.data);
949 947
950 if(emergency_call == TRUE) 948 if(emergency_call == TRUE)
951 { 949 {
952 TRACE_EVENT(" it is a emergency number !"); 950 TRACE_EVENT(" it is a emergency number !");
953 data->emergency_call = TRUE; 951 data->emergency_call = TRUE;
954 } 952 }
955 else 953 else
956 { 954 {
957 data->emergency_call = FALSE; 955 data->emergency_call = FALSE;
958 } 956 }
959 957
960 /* Check if we've entered min_enter characters */ 958 /* Check if we've entered min_enter characters */
961 959
962 if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) 960 if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter)
963 data->enteredMinChars = TRUE; 961 data->enteredMinChars = TRUE;
964 else 962 else
965 data->enteredMinChars = FALSE; 963 data->enteredMinChars = FALSE;
966 964
967 if (data->editor_data.editor_attr.text.len > 0) 965 if (data->editor_data.editor_attr.text.len > 0)
968 data->enteredSomeChars = TRUE; 966 data->enteredSomeChars = TRUE;
969 else 967 else
970 data->enteredSomeChars = FALSE; 968 data->enteredSomeChars = FALSE;
971 969
972 /* Check if the softkeys have changed */ 970 /* Check if the softkeys have changed */
973 971
974 if (data->emergency_call!=previous_emergency) 972 if (data->emergency_call!=previous_emergency)
975 { 973 {
976 data->editor->update = ED_UPDATE_FULL; /* Update softkeys, title and editor */ 974 data->editor->update = ED_UPDATE_FULL; /* Update softkeys, title and editor */
977 } 975 }
978 else if (data->enteredMinChars!=previous_entered || data->enteredSomeChars!=previous_someentered) 976 else if (data->enteredMinChars!=previous_entered || data->enteredSomeChars!=previous_someentered)
979 { 977 {
980 data->editor->update = ED_UPDATE_PARTIAL; /* Update softkeys and editor */ 978 data->editor->update = ED_UPDATE_PARTIAL; /* Update softkeys and editor */
981 } 979 }
982 else 980 else
983 { 981 {
984 data->editor->update = ED_UPDATE_TRIVIAL; /* Just update editor */ 982 data->editor->update = ED_UPDATE_TRIVIAL; /* Just update editor */
985 } 983 }
986 984
987 return data->emergency_call; 985 return data->emergency_call;
988 } 986 }
989 987
990 988
991 /******************************************************************************* 989 /*******************************************************************************
992 990
993 $Function: AUI_pin_CheckSSString 991 $Function: AUI_pin_CheckSSString
994 992
995 $Description: Check number to see if it's an ss string 993 $Description: Check number to see if it's an ss string
996 994
997 $Returns: None. 995 $Returns: None.
998 996
999 $Arguments: event - the keyboard event 997 $Arguments: event - the keyboard event
1000 keyboard 998 keyboard
1001 999
1002 *******************************************************************************/ 1000 *******************************************************************************/
1003 1001
1004 T_MFW_SS_RETURN AUI_pin_CheckSSString(T_AUI_PIN_DATA *data) 1002 T_MFW_SS_RETURN AUI_pin_CheckSSString(T_AUI_PIN_DATA *data)
1005 { 1003 {
1006 return ss_check_ss_string(data->editor_data.editor_attr.text.data); 1004 return ss_check_ss_string(data->editor_data.editor_attr.text.data);
1007 } 1005 }
1008 1006
1009 1007
1010 static BOOL AUI_pin_StripSSUnblock(char *cmd_string, T_AUI_PINS *pin_data) 1008 static BOOL AUI_pin_StripSSUnblock(char *cmd_string, T_AUI_PINS *pin_data)
1011 { 1009 {
1012 T_MFW_SS_RETURN retVal; 1010 T_MFW_SS_RETURN retVal;
1013 char *rest; 1011 char *rest;
1014 T_KSD_SEQPARAM ss_params; 1012 T_KSD_SEQPARAM ss_params;
1015 1013
1016 TRACE_EVENT_P2("AUI_pin_StripSSUnblock : &cmd_string = 0x%08lx, &pin_data = 0x%08lx", cmd_string, pin_data); 1014 TRACE_EVENT_P2("AUI_pin_StripSSUnblock : &cmd_string = 0x%08lx, &pin_data = 0x%08lx", cmd_string, pin_data);
1017 1015
1018 /* 1016 /*
1019 ** The incoming parameters chould not be NULL 1017 ** The incoming parameters chould not be NULL
1020 */ 1018 */
1021 if ((cmd_string == NULL) || 1019 if ((cmd_string == NULL) ||
1022 (pin_data == NULL)) 1020 (pin_data == NULL))
1023 return FALSE; 1021 return FALSE;
1024 1022
1025 retVal = ss_decode((UBYTE *)cmd_string, &rest, &ss_params); 1023 retVal = ss_decode((UBYTE *)cmd_string, &rest, &ss_params);
1026 1024
1027 if (retVal == MFW_SS_SIM_UNBLCK_PIN) 1025 if (retVal == MFW_SS_SIM_UNBLCK_PIN)
1028 { 1026 {
1029 if (ss_params.ublk.ssCd == KSD_SS_PIN1) 1027 if (ss_params.ublk.ssCd == KSD_SS_PIN1)
1030 { 1028 {
1031 pin_data->pin_id = MFW_SIM_PUK1; 1029 pin_data->pin_id = MFW_SIM_PUK1;
1032 strcpy(pin_data->puk_code, (char *)ss_params.ublk.puk); 1030 strcpy(pin_data->puk_code, (char *)ss_params.ublk.puk);
1033 strcpy(pin_data->new_pin, (char *)ss_params.ublk.pin); 1031 strcpy(pin_data->new_pin, (char *)ss_params.ublk.pin);
1034 strcpy(pin_data->cnf_pin, (char *)ss_params.ublk.pin); 1032 strcpy(pin_data->cnf_pin, (char *)ss_params.ublk.pin);
1035 1033
1036 return TRUE; 1034 return TRUE;
1037 } 1035 }
1038 else 1036 else
1039 { 1037 {
1040 TRACE_EVENT("AUI_pin_StripSSUnblock : Not unblocking PIN1"); 1038 TRACE_EVENT("AUI_pin_StripSSUnblock : Not unblocking PIN1");
1041 return FALSE; 1039 return FALSE;
1042 } 1040 }
1043 } 1041 }
1044 else 1042 else
1045 { 1043 {
1046 TRACE_EVENT_P1("AUI_pin_StripSSUnblock : ss_decode returned %d", retVal); 1044 TRACE_EVENT_P1("AUI_pin_StripSSUnblock : ss_decode returned %d", retVal);
1047 return FALSE; 1045 return FALSE;
1048 } 1046 }
1049 } 1047 }
1050