⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 miscfunctions.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
 *  in this function, it will call InitAllApplications(), there are NVRAM access
 *  in this function, which will cause NVRAM & timer interlace problem.
 *  
 *  we have to stop all animation timer when we are sure poweron procdure success.
 *  we may call this function in mmi_ready_to_idle_screen_ind.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_pwron_stop_animation(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 pwron_flag;
    S16 error;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (GetExitScrnID() != SCR_OPEN_SCREEN_ID)
    {
        return;
    }

    /* stop force teminate timer */
    gui_cancel_timer(mmi_pwron_froce_terminate_display);

    /* There is a race condition.
     * There is a GUI timer expiration event in queue for still image callback.
     * It is processed after SimPasswdReqResponse is called.
     * MMI needs to avoid from continuously receiving it twice.
     */
    g_pwron_is_terminate_diplay = TRUE;

    if (g_pwron_is_image)
    {
        /* stop image playing */
        StopCategory166Animation();
    }
    else
    {
    #if defined(__MMI_VIDEO_PLAYER__)
        /* stop video playing */
        StopCategory224Video();
    #endif /* defined(__MMI_VIDEO_PLAYER__) */ 
    }

    /* write proper value to NVRAM */
    if (!g_pwron_is_successful_play)
    {
    #if defined(__MMI_POWER_ON_OFF_DISPLAY__)
        /* restore default */
        PhnsetRstPwrOnDisplayDefault();
    #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY__) */ 
    }

    pwron_flag = PWRON_DISPLAY_SUCCESS;
    WriteValue(NVRAM_POWER_ON_DISPLAY_SUCCESS, &pwron_flag, DS_SHORT, &error);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_pwron_pause_video
 * DESCRIPTION
 *  pause video, this funcion will be used by TV-Out
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#if defined(__MMI_VIDEO_PLAYER__)
void mmi_pwron_pause_video(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!g_pwron_is_image)
    {
        PauseCategory224Video();
    }
}
#endif /* defined(__MMI_VIDEO_PLAYER__) */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_pwron_resume_video
 * DESCRIPTION
 *  resume video, this funcion will be used by TV-Out
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#if defined(__MMI_VIDEO_PLAYER__)
void mmi_pwron_resume_video(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!g_pwron_is_image)
    {
        ResumeCategory224Video();
    }
}
#endif /* defined(__MMI_VIDEO_PLAYER__) */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_pwron_draw_sublcd_dummy_screen
 * DESCRIPTION
 *  dummy screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#if defined(__MMI_VIDEO_PLAYER__)
static void mmi_pwron_draw_sublcd_dummy_screen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* draw nothing, just for category224's sublcd screen have a screen to goback. */
}
#endif /* defined(__MMI_VIDEO_PLAYER__) */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_pwron_entry_animation_screen
 * DESCRIPTION
 *  start play poweron animation
 *  (1) GIF animation
 *  (2) Still image
 *  (3) Video clip
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_pwron_entry_animation_screen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 disp_id;
    PS8 filename_ptr;

    S16 error;
    U16 pwron_flag;
    U16 force_stop_time;

#if defined(__MMI_VIDEO_PLAYER__)
    SubLCDHistoryNode sub_history;
    BOOL play_audio;
#endif /* defined(__MMI_VIDEO_PLAYER__) */ 

#if defined(__MMI_POWER_ON_OFF_DISPLAY__)
    FS_HANDLE fs_handle;
#endif /* defined(__MMI_POWER_ON_OFF_DISPLAY__) */ 
    U16 res_type;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* 
     * 
     * Power On Procedure
     * 
     * Power On Display      NAND       SIM        Net Search    Idle Scr
     * #----------------------#----------#----------#-------------#-----------# 
     * (option)    (option)    (option)
     * 
     * 
     */

    /* if is entered before, means back from interrupt while playing power on display */
    if (g_pwron_is_entered)
    {
        MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_BACK2_ANIMATION));
        ClearInputEventHandler(MMI_DEVICE_ALL); /* Prevent from END key is pre-registered by call management */
        ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
        /* MT/SMS/USSD or other inetrrupt happened during poweron display, some initialzation need to be done afterward */
        PowerOnBatteryIndicationComplete();
        return;
    }
    // wangbei add start 20071010
    #ifdef __NEW_STATUS_ICONS_STYLE__
     g_is_need_draw_statusicons=FALSE;
    #endif
    // wangbei add end
    MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_START_ANIMATION));

    /* init */
    filename_ptr = NULL;
    disp_id = 0;

    g_pwron_is_entered = TRUE;
    g_pwron_is_image = TRUE;
    g_pwron_is_successful_play = FALSE;

    if (mmi_bootup_is_sim_failure_received() == MMI_TRUE)
    {
        g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_ANIMATION_SIM_FAIL;
    }
    else if (mmi_bootup_is_sim_need_security_check() == MMI_TRUE)
    {
        g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_ANIMATION_PSWD_REQ;
    }
    else
    {
        g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_ANIMATION;        /* 0x04: Power on animation */
    }

    TurnOnBacklight(0);

   /*******************************************/
    /* Valid power on display checking         */
   /*******************************************/

    /* Valid power on display restoration checking */
    ReadValue(NVRAM_POWER_ON_DISPLAY_SUCCESS, &pwron_flag, DS_SHORT, &error);

    /* 
     * 0xff is the default value, each time power on display play successfully, 
     * it will set to 0xff as well.
     */

#if defined(__MMI_POWER_ON_OFF_DISPLAY__)
    if (pwron_flag == PWRON_DISPLAY_FAILED)
    {
        /* if flag is PWRON_DISPLAY_FAILED, means something wrong happened during playing power on display */
        /* we will restore power on display to default settings */
        PhnsetRstPwrOnDisplayDefault();
    }
#endif /* defined(__MMI_POWER_ON_OFF_DISPLAY__) */ 

    /* set the flag to 0x01 , if play successfully to end, will reset back to 0xff */
    pwron_flag = PWRON_DISPLAY_PLAYING;
    WriteValue(NVRAM_POWER_ON_DISPLAY_SUCCESS, &pwron_flag, DS_SHORT, &error);

#if defined(__MMI_POWER_ON_OFF_DISPLAY__)
   /*******************************************/
    /* Get animation resource from phone setup */
   /*******************************************/
    PhnsetGetPwrOnDisp(&disp_id);

    if (disp_id == 0xff)    /* invalid format */
    {
        /* reset as default */
        PhnsetRstPwrOnDisplayDefault();

        /* this id must be a valid id */
        PhnsetGetPwrOnDisp(&disp_id);
    }
    else if (disp_id == 0x00 || /* source from file */
             disp_id == 0x01)   /* short file name */
    {
        PS8 error;

        disp_id = 0x00;

        /* filename buffer is allocated in phnset */
        filename_ptr = PhnsetGetPwrOnFileName();

        if (!mmi_fmgr_util_file_limit_check(FMGR_LIMIT_POWER_ON_OFF_DSPL, filename_ptr, &error))
        {
            /* limit check failed */
            /* reset to default */
            PhnsetRstPwrOnDisplayDefault();

            /* this id must be a valid id */
            PhnsetGetPwrOnDisp(&disp_id);
            filename_ptr = NULL;
        }
    }
    else
    {
        /* source from intenal resource */
        filename_ptr = NULL;
    }

   /*******************************************/
    /* Check if is image or video              */
   /*******************************************/
    /* get file resource type */
    if (filename_ptr != NULL)
    {
        /* source from file */
        res_type = mmi_fmgr_get_file_group(filename_ptr);

        if (res_type == FMGR_GROUP_IMAGE)
        {
            g_pwron_is_image = TRUE;
        }
    #if !defined (MMI_ON_WIN32)
        else if (res_type == FMGR_GROUP_VIDEO)
        {
            g_pwron_is_image = FALSE;
        }
    #endif /* !defined (MMI_ON_WIN32) */ 
  #ifdef __MMI_SWFLASH__
        else if (res_type == FMGR_GROUP_SWFLASH)
        {
            g_pwron_is_image = TRUE;
        }
    #endif /* __MMI_SWFLASH__ */
        else
        {
            /* unsupported file format ext */
            PhnsetRstPwrOnDisplayDefault();

            /* this id must be a valid id */
            PhnsetGetPwrOnDisp(&disp_id);
            filename_ptr = NULL;
        }

    #ifdef __DRM_SUPPORT__
        /* DRM permission check */
        if ((fs_handle = DRM_open_file((PU16) filename_ptr, FS_READ_ONLY, DRM_PERMISSION_NONE)) >= FS_NO_ERROR)
        {
            if (res_type == FMGR_GROUP_IMAGE && DRM_validate_permission(fs_handle, DRM_PERMISSION_DISPLAY))
            {
                DRM_consume_rights(fs_handle, DRM_PERMISSION_DISPLAY);
            }
        #ifdef __MMI_SWFLASH__
            else if (res_type == FMGR_GROUP_SWFLASH && DRM_validate_permission(fs_handle, DRM_PERMISSION_DISPLAY))
            {
                DRM_consume_rights(fs_handle, DRM_PERMISSION_DISPLAY);
            }
        #endif                        
            else if (res_type == FMGR_GROUP_VIDEO && DRM_validate_permission(fs_handle, DRM_PERMISSION_PLAY))
            {
                DRM_consume_rights(fs_handle, DRM_PERMISSION_PLAY);
            }
            DRM_close_file(fs_handle);
        }
    #else /* __DRM_SUPPORT__ */ 
        fs_handle = FS_Open((U16*) filename_ptr, FS_READ_ONLY);
    #endif /* __DRM_SUPPORT__ */ 

        if (fs_handle < FS_NO_ERROR)
        {
            /* open file failed */
            /* reset as default */
            PhnsetRstPwrOnDisplayDefault();

            /* this id must be a valid id */
            PhnsetGetPwrOnDisp(&disp_id);
            filename_ptr = NULL;
        }
        else
        {
            /* open file successful */
            FS_Close(fs_handle);
        }

        
    }

    /* check internal resource type */
    if (filename_ptr == NULL)
    {
        res_type = PhnsetGetDisplayType(disp_id);

        if (res_type == PHNSET_TYPE_DISP_IMAGE)
        {

⌨️ 快捷键说明

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