restore.c
来自「mtk wap和mms代码。。适应mtk 25。26平台」· C语言 代码 · 共 1,549 行 · 第 1/4 页
C
1,549 行
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* Restore.c
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* This file is intends for restore factory default application
*
* Author:
* -------
* Robin Jian
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* $Log$
*
* Oct 12 2006 mtk00911
* [MAUI_00335233] [Java][New feature] Reset Java to factory setting
*
*
* Sep 8 2006 MTK01166
* [MAUI_00225288] Settings - Ebook storage have changed after restore Factory Settings
*
*
* Sep 4 2006 MTK01166
* [MAUI_00225288] Settings - Ebook storage have changed after restore Factory Settings
*
*
* Aug 7 2006 mtk00911
* [MAUI_00215552] [E-book] Help to patch 06.32
*
*
* May 2 2006 mtk00563
* [MAUI_00184484] [MMI] New API: ClearInputEventHandler
*
*
* Apr 11 2006 mtk00911
* [MAUI_00220710] USB-Same page, insert USB no consitent
* disable USB query when restore
*
* Apr 3 2006 mtk00911
* [MAUI_00184510] [NVRAM, NVRAM] Remove compile warnings 06.14.
*
*
* Apr 3 2006 mtk00911
* [MAUI_00220428] PowerOnDisplay_can not show video1 which is in system
*
*
* Mar 27 2006 mtk00911
* [MAUI_00182503] [MMI DispChar] DLT patch 06.13
*
*
* Mar 22 2006 mtk00911
* [MAUI_00220180] USB-Handset stop charge page after plug out USB
*
*
* Mar 16 2006 mtk00911
* [MAUI_00220057] Settings_The option sill have when press yes.
*
*
* Mar 12 2006 mtk00911
* [MAUI_00178789] [MoDIS] Remove compile option
* Remove __WIN32__
*
* Mar 9 2006 mtk00911
* [MAUI_00178162] [1]Assert Fail:0Wallpaper.c 2612-MMI
*
*
* Feb 20 2006 mtk00911
* [MAUI_00172768] [MoDIS][Item 133] Restore Factory settings -- failed
*
*
* Feb 20 2006 mtk00911
* [MAUI_00172768] [MoDIS][Item 133] Restore Factory settings -- failed
* Add MoDIS string
*
* Feb 4 2006 mtk01136
* [MAUI_00170785] MMI-There are 2 items in menu
*
*
* Jan 26 2006 mtk00911
* [MAUI_00170851] [MMI Phnset] Fix PC simulator issues.
* Fix PC simulator issues
*
* Jan 22 2006 mtk01136
* [MAUI_00169745] [MMI][Setting][new feature] Phone setup in option menu
*
*
* Jan 20 2006 mtk01136
* [MAUI_00218708] SIM lock_It can still input PW after press ok
* Disable pen event handler when clear all key handlers
*
* Dec 19 2005 mtk00911
* [MAUI_00162400] [MMI Restore] Lock Caches once the restore precedure starts.
* Lock Caches once the restore precedure starts.
*
* Dec 11 2005 mtk00911
* [MAUI_00217878] Alarm_the alarm will execute
*
*
* Oct 18 2005 mtk00911
* [MAUI_00151157] [MMI PhoneSetup] Add the DispChar saved resource id converstion.
*
*
* Oct 17 2005 mtk00911
* [MAUI_00148969] [MMI] Auto screen an image folder and generate display char. resource
*
*
* Sep 7 2005 mtk01136
* [MAUI_00216374] Sub wallpaper_set one pic to Sub wallpaper,then delete it,SubLCD display empty,can't restore default
* Sub-LCD wallpaper bad file callback
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
/*
* Copyright Notice
* ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
* Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
* (It is illegal to remove this copyright notice from this software or any
* portion of it)
*/
/**************************************************************
FILENAME : Restore.c
PURPOSE : nil
REMARKS : nil
AUTHOR : Anil Kumar Vutukuru
DATE : 11/14/2003
**************************************************************/
/*****************************************************************************
* Include
*****************************************************************************/
/* Include: MMI header file */
#define __NEWSIMULATOR
#include "MMI_features.h"
#include "stdC.h"
#include "L4Dr1.h"
#include "L4Dr.h"
#include "PixtelDataTypes.h"
#include "wgui_categories.h"
#include "CommonScreens.h"
#include "MiscFunctions.h"
#include "EventsGProt.h"
#include "CustDataRes.h"
#include "CustMenuRes.h"
#include "DebugInitDef.h"
#include "AudioInc.h"
#include "HistoryGprot.h"
#include "MainMenuDef.h"
#include "Unicodexdcl.h"
#include "ProtocolEvents.h"
#include "QueueGProt.h"
#include "Globaldefs.h"
#include "NVRAMType.h"
#include "NVRAMProt.h"
#include "NVRAMEnum.h"
#include "IdleAppDef.h"
#include "SettingProfile.h"
#include "SettingsGexdcl.h"
#include "settingGprots.h"
#include "settingprot.h"
#include "ScreenSaverDefs.h"
#include "WPSSProtos.h"
#include "ScheduledPowerOnOffGprot.h"
#include "PhonebookGprot.h"
#include "CallSetUpEnum.h"
#include "SimDetectionGexdcl.h"
#include "PhoneSetupGprots.h"
#ifdef __MOD_SMSAL__
#include "MessagesExDcl.h"
#endif
#include "SettingDefs.h"
#include "SettingsGdcl.h"
#include "wgui_categories_popup.h"
#include "wgui_categories_inputs.h"
#ifdef __MMI_TOUCH_SCREEN__
#include "Wgui_touch_screen.h"
#endif
#include "AlarmFrameWorkProt.h"
#include "NVRAMType.h"
#include "NVRAMHwMapFile.h"
#include "nvram_enums.h"
#if !defined(__MTK_TARGET__)
#include "EngineerModeDef.h"
#endif
#undef __NEWSIMULATOR
/*****************************************************************************
* External Variable
*****************************************************************************/
extern U8 CurrentDtType;
extern U8 gCallCost;
extern U8 gIsSimValid;
extern alm_queue_node_struct gAlmQueue[ALM_NUM_OF_ALAMRS];
extern alm_framework_context_struct g_alm_frm_cntx;
/*****************************************************************************
* Global Variable
*****************************************************************************/
pBOOL bStatus = FALSE;
U8 gPhonePassword[(MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH];
/*****************************************************************************
* Local Function
*****************************************************************************/
/*****************************************************************************
* External Function
*****************************************************************************/
extern pBOOL SetProfileDefault(void);
extern void EntryScrnSimBlockRsp(void);
#if !defined(MMI_ON_WIN32) && defined(__J2ME__)
extern void javaFileGenerator(kal_bool);
#endif
#ifdef __MMI_PREFER_INPUT_METHOD__
extern void SetInputMethodType(U16 inputType);
#endif
#ifdef __MMI_EBOOK_READER__
#include "EbookManager.h"
#endif /* __MMI_EBOOK_READER__ */
/*****************************************************************************
* FUNCTION
* HighlightRstScr
* DESCRIPTION
* This function is Highlight handler for "Resotre"
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void HighlightRstScr(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* Change left soft key icon and label */
ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
/* Change right soft key icon and label */
ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
/* Register function for left/right soft key */
#ifdef MMI_ON_HARDWARE_P
SetLeftSoftkeyFunction(EntryRstScr, KEY_EVENT_UP);
#else
SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
#endif
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
/* Register function for left/right arrow keys */
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
return;
}
/*****************************************************************************
* FUNCTION
* EntryRstScr
* DESCRIPTION
* This function is Entry function for "Restore"
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void EntryRstScr(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (g_pwr_context.PrevScreenIndicator == ENTER_SIM_BLOCK)
{
/* Not allow to verify phone lock if SIM card is blocked */
DisplayPopup(
(U8*) GetString(STR_SIM_BLOCK_MSG),
IMG_GLOBAL_UNFINISHED,
1,
UI_POPUP_NOTIFYDURATION_TIME,
(U8) ERROR_TONE);
return;
}
#ifdef __HALF_SECURE_RESTORE__
if (GetPhoneLock() == MMI_FALSE)
{
EntryRstConfirm();
}
else
{
EntryRstCheckPhoneLock();
}
#else /* __HALF_SECURE_RESTORE__ */ /* Check phone lock code before restore default */
EntryRstCheckPhoneLock();
#endif /* __HALF_SECURE_RESTORE__ */
}
/*****************************************************************************
* FUNCTION
* EntryRstCheckPhoneLock
* DESCRIPTION
* This function is Entry function for Restore->Enter Phone Lock Code
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void EntryRstCheckPhoneLock(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer; /* Buffer holding history data */
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "[RST Factory] EntryRstCheckPhoneLock()\n"));
/* Call Exit Handler */
EntryNewScreen(SCR_RESTORE, NULL, EntryRstScr, NULL);
/* Get current screen to gui buffer for history purposes */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?