restore.c

来自「mtk wap和mms代码。。适应mtk 25。26平台」· C语言 代码 · 共 1,549 行 · 第 1/4 页

C
1,549
字号
    data = RstGetOwnerNumStatusDefault();
    WriteValue(NVRAM_SETTING_OWNER_NO, &data, DS_BYTE, &error);
    /* CurrentDtType = 1;//default on */
    PhnsetSetShowDTStatus(1);

    /* Restore show date/time status */
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstRestorePhoneSetup(): Start restore DateTime Status. ===\n"));
    data = RstGetShowDTStatusDefault();
    WriteValue(NVRAM_SETTING_STATUS_DT_TIME, &data, DS_BYTE, &error);

    /* Restore auto update date/time status */
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstRestorePhoneSetup(): Start restore NITZ. ===\n"));
    data = RstGetNITZStatusDefault();
    WriteValue(NVRAM_SETTING_AUTOUPDATE_DT_TIME, &data, DS_BYTE, &error);

    /* Restore speed dial */
    /*
     * data = PhbRestoreSpeedDial();    
     * if(error == NVRAM_WRITE_SUCCESS)
     * return TRUE;
     * else
     * return FALSE;
     */

    /* Restore speed dial */
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstRestorePhoneSetup(): Start restore Speed dial. ===\n"));
    if (PhbRestoreSpeedDial() == MMI_FALSE)
    {
        return FALSE;
    }

    /* Restore date format  */
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstRestorePhoneSetup(): Start restore Date Format. ===\n"));
    data = RstGetDateFormatDefault();
    if (PhnsetSetDateFormat(data) != NVRAM_WRITE_SUCCESS)   /* dd-mmm-yyyy */
    {
        return FALSE;
    }

    /* Restore time format */
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstRestorePhoneSetup(): Start restore Time Format. ===\n"));
    data = RstGetTimeFormatDefault();
    if (PhnsetSetTimeFormat(data) != NVRAM_WRITE_SUCCESS)   /* 12hr format as per the error */
    {
        return FALSE;
    }

    return TRUE;

}

#ifdef __MMI_PREFER_INPUT_METHOD__


/*****************************************************************************
 * FUNCTION
 *  RstGetPreferedInputMethodDefault
 * DESCRIPTION
 *  This function is to get prefered Input Method restore default value
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U16 RstGetPreferedInputMethodDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 data16 = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* retrive preferred input method by reading default value from nvram */
    ReadValue(RESTORE_PREFER_INPUT_METHOD, &data16, DS_SHORT, &error);
    /* return the preferred input method */
    return data16;
}
#endif /* __MMI_PREFER_INPUT_METHOD__ */ 


/*****************************************************************************
 * FUNCTION
 *  RstGetSpeedDialStatusDefault
 * DESCRIPTION
 *  This function is to get speed dial status restore default value
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetSpeedDialStatusDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gSpeedDialStatus = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetSpeedDialStatusDefault() ===\n"));

    /* retrive default speed dial status from nvram */
    ReadValue(RESTORE_DEFAULT_SPEED_DIAL, &gSpeedDialStatus, DS_BYTE, &error);
    /* return the default speed dial status */
    return gSpeedDialStatus;
}


/*****************************************************************************
 * FUNCTION
 *  RstGetDateFormatDefault
 * DESCRIPTION
 *  This function is to get date format restore default
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetDateFormatDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gDateFormat = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetDateFormatDefault() ===\n"));

    /* retrive default date format from nvram */
    ReadValue(RESTORE_DEFAULT_DATE_FORMAT, &gDateFormat, DS_BYTE, &error);
    /* return the default date format */
    return gDateFormat;
}


/*****************************************************************************
 * FUNCTION
 *  RstGetTimeFormatDefault
 * DESCRIPTION
 *  This function is to get time format restore default
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetTimeFormatDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gTimeFormat = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetTimeFormatDefault() ===\n"));

    /* retrive default time format from nvram */
    ReadValue(RESTORE_DEFAULT_TIME_FORMAT, &gTimeFormat, DS_BYTE, &error);
    /* return the default time format */
    return gTimeFormat;
}


/*****************************************************************************
 * FUNCTION
 *  RstGetContrastLevelSubDefault
 * DESCRIPTION
 *  This function is to get sub lcd constract level restore default value
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetContrastLevelSubDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gContrastSubLcd = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetContrastLevelSubDefault() ===\n"));

    /* retrive the default contrast level for sub lcd from nvram */
    ReadValue(RESTORE_DEFAULT_CONTRAST_SUBLCD_LEVEL, &gContrastSubLcd, DS_BYTE, &error);
    /* return the default contrast level for sub lcd */
    return gContrastSubLcd;
}


/*****************************************************************************
 * FUNCTION
 *  RstGetContrastLevelMainDefault
 * DESCRIPTION
 *  This function is to get main lcd constract level restore default value
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetContrastLevelMainDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gContrastLcd = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetContrastLevelMainDefault() ===\n"));

    /* retrive the default contrast level for main lcd from nvram */
    ReadValue(RESTORE_DEFAULT_CONTRAST_LEVEL, &gContrastLcd, DS_BYTE, &error);
    /* return the default contrast level for main lcd */
    return gContrastLcd;
}


/*****************************************************************************
 * FUNCTION
 *  RstGetGreetingTextStatusDefault
 * DESCRIPTION
 *  This function is to get greeting text on/off status default value
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetGreetingTextStatusDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gWelcomeText = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetGreetingTextStatusDefault() ===\n"));

    /* retrive the default greeting text status from nvram */
    ReadValue(RESTORE_DEFAULT_WELCOME_TEXT, &gWelcomeText, DS_BYTE, &error);
    /* return the default greeting text status */
    return gWelcomeText;
}


/*****************************************************************************
 * FUNCTION
 *  RetGetAphorismTextStatusDefault
 * DESCRIPTION
 *  This function is to get Aphorism on/off status default value
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
#if defined(__MMI_APHORISM__)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* defined(__MMI_APHORISM__) */ 


/*****************************************************************************
 * FUNCTION
 *  RstGetOwnerNumStatusDefault
 * DESCRIPTION
 *  This function is to
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetOwnerNumStatusDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gOwnerNo = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetOwnerNumStatusDefault() ===\n"));

    /* retrive the default value for owner number status from nvram */
    ReadValue(RESTORE_DEFAULT_OWNER_NO, &gOwnerNo, DS_BYTE, &error);
    /* return the default owner numbers status */
    return gOwnerNo;
}


/*****************************************************************************
 * FUNCTION
 *  RstGetShowDTStatusDefault
 * DESCRIPTION
 *  This function is to get show date and time status default value
 *  Functionality:
 * PARAMETERS
 *  void
 *  a(?)        [IN/OUT]        
 *  b(?)        [IN]            
 * RETURNS
 *  void
 *****************************************************************************/
U8 RstGetShowDTStatusDefault(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 gStatusShowDtTime = 0;
    S16 error = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "=== RstGetShowDTStatusDefault() ===\n"));

    /* retrive default value for display date time status from nvram */
    ReadValue(RESTORE_DEFAULT_STATUS_SHOW_DT_TIME, &gStatusShowDtTime, DS_BYTE, &error);
    /* return default value for display date time status */
    return gStatusShowDtTime;
}
#endif /* __MMI_PHNSET_COMMENT__ */ 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?