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

📄 idleapp.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
    {mmi_vobj_is_pending_object, mmi_vobj_entry_recv_object}, /* unread vObjects */
#endif 
#if defined(__MMI_IRDA_SUPPORT__)
    {mmi_irda_get_recv_files_cnt, mmi_irda_entry_idle_notify_scr}, /* files from IrDA */
#endif 
#if (defined(__MMI_DOWNLOADABLE_THEMES_SUPPORT__) && defined(__MMI_IRDA_SUPPORT__))
    {mmi_irda_is_any_theme_file_rcv, mmi_irda_theme_show_idle_notify_scr}, /* downloadable theme from IrDA */
#endif 
#if defined(__MMI_NITZ__)
    {mmi_idle_pending_nitz_check, EntryNitzScreen}, /* NITZ */
#endif 
    {mmi_msg_need_new_cb_ind, mmi_msg_entry_new_cb_ind}, /* new CB message */
#if defined(OBIGO_SUPPORT) && defined(WAP_SUPPORT)
    {mmi_idle_widget_check_and_display_new_msg, NULL}, /* new message from widget */
#endif 
#if defined(__MMI_PHB_CALLERGROUP_IN_SIM__)
    {mmi_phb_init_check_sim_change, NULL}, /* associate caller group in SIM card entry */
#endif 
#if defined(__MMI_VRSD_DIAL__)
    {mmi_vrsddial_check_sim_change, NULL}, /* VRSD dial */
#endif 
#if defined(__MMI_OPP_SUPPORT__)
    {mmi_opp_get_recv_files_cnt, mmi_opp_entry_idle_notify_scr}, /* files from Bluetooth */
#endif
#if defined(__MMI_DOWNLOAD_AGENT__)
    {mmi_da_launch_ring_buffer_check, mmi_da_entry_new_push_ind}, /* download agent */
#endif 
#if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
    {mmi_jmms_need_mms_ind, mmi_jmms_entry_new_mms_ind}, /* new mms message */
#endif 
#if !defined (__MMI_UNIFIED_MESSAGE__) && defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
    {mmi_brw_new_push_msg_ind, mmi_brw_entry_new_push_msg_ind},  /* new wap push message */
#endif 
#if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))
    {mmi_prov_check_and_install_new_settings, mmi_prov_show_install_settings_dialog},
#endif 
#ifdef __SYNCML_SUPPORT__
    {mmi_syncml_is_sync_alarm_expired, mmi_syncml_sync_alarm_hdlr}, /* sync */
#endif
#ifdef __MMI_USER_CTRL_PLMN_SUPPORT__
    {mmi_netset_unknown_operator_check, mmi_netset_unknown_operator_query}, /* user control plmn */
#endif
#if defined(__FOTA_ENABLE__)
    {mmi_dm_fwu_check_download_finish, mmi_dm_fwu_entry_download_finish_ind}, /* firmware upgrade finished */
#endif

    {NULL, NULL}                                            /* dummy one, please add callbacks before this entity */
};

extern S8 *idle_screen_wallpaper_name;

// zrx add begin 20070529
#ifdef __CAIVS_SUPPORT__
extern BOOL  symbol_caivs;  // zrx add 20070529
#endif
// zrx add end


/*****************************************************************************
* Local Function 
*****************************************************************************/
static U16 idleLRStringtID = 0; /* for __MANUAL_MODE_NW_SEL__ */


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_exe_callback
 * DESCRIPTION
 *  Execute callbacks before entry idle screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static pBOOL mmi_idle_exe_callback(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 i;
    pBOOL rtn = MMI_FALSE;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    for (i = 0; mmi_idle_callbacks[i].idle_callback_chk_f != NULL; i++)
    {
        if ((*mmi_idle_callbacks[i].idle_callback_chk_f) ())
        {
            rtn = MMI_TRUE;
            if (mmi_idle_callbacks[i].idle_callback_exe_f != NULL)
            {
                (*mmi_idle_callbacks[i].idle_callback_exe_f) ();
            }
            break;
        }
    }

    g_keylock_context.IsOnKeyLockCallbackScreen = (rtn == MMI_TRUE) ? 1 : 0;
    return rtn;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_missed_call_check
 * DESCRIPTION
 *  Wrapper for idle screen callback
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static U8 mmi_idle_missed_call_check(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (GetMissedCallFlag() && CHISTGetMissedCallCountBeforeView())
    {
        return MMI_TRUE;
    }
    else
    {
        return MMI_FALSE;
    }
}

#ifdef __MMI_NITZ__
/*****************************************************************************
 * FUNCTION
 *  mmi_idle_pending_nitz_check
 * DESCRIPTION
 *  Wrapper for idle screen callback
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static U8 mmi_idle_pending_nitz_check(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return (U8) g_nitz_cntx.IsNITZPending;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_update_opname_from_nitz
 * DESCRIPTION
 *  Update NITZ network name if a new message is received
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_idle_update_opname_from_nitz(void)
{
    if (mmi_idle_is_on_idle_screen())
    {
        EntryIdleScreen(); /* IdleRefreshServiceIndicationArea(); */
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_update_nitz_content
 * DESCRIPTION
 *  Update NITZ network name from NVRAM
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_idle_update_nitz_content(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 max_display_length = MAX_LENGTH_DISPLAY_NAME;
    U8 mcc_tmp_unicode[4 * ENCODING_LENGTH];
    U8 tmp_plmn[MAX_PLMN_LEN_MMI + 1];
    U8 tmp_display_name[MAX_LENGTH_DISPLAY_NAME * ENCODING_LENGTH];

    U8 iCnt = 0;
    S32 StringWidth, StringHeight;
    stFontAttribute prev_f;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    memset(tmp_plmn, 0 , MAX_PLMN_LEN_MMI + 1);
    memset(tmp_display_name, 0, MAX_LENGTH_DISPLAY_NAME);

    mmi_nitz_get_nitz_nw_name(tmp_plmn, tmp_display_name, (U8) MAX_LENGTH_DISPLAY_NAME - 1, &g_nitz_display.country_init);

    if (strlen((S8*)tmp_plmn) != 0 && strlen((S8*)tmp_display_name) != 0)
    {
    	strcpy((S8*)g_nitz_display.plmn, (S8*)tmp_plmn);
        if (g_nitz_display.country_init)
        {
            max_display_length -= 4;    /* 1 space char and 3 mcc digits */
        }
        
        if (pfnUnicodeStrlen((S8*) tmp_display_name) >= max_display_length)
        {
            pfnUnicodeStrncpy((S8*) g_nitz_display.display_name, (S8*) tmp_display_name, max_display_length);
        }
        else
        {
            pfnUnicodeStrcpy((S8*) g_nitz_display.display_name, (S8*) tmp_display_name);
        }

        /* add check if the NITZ display name exceeds the LCD width */
        memcpy(&prev_f, UI_font, sizeof(stFontAttribute));
        UI_set_font(&UI_DEFAULT_FONT);
        for (iCnt = (U8) pfnUnicodeStrlen((PS8) g_nitz_display.display_name); iCnt > 0; iCnt--)
        {
            Get_StringWidthHeight((U8*) g_nitz_display.display_name, &StringWidth, &StringHeight);
            if ((StringWidth + 1) >= MAIN_LCD_device_width - (ICON_WIDTH << 1))
            {
                g_nitz_display.display_name[iCnt * ENCODING_LENGTH] = 0x0;
                g_nitz_display.display_name[iCnt * ENCODING_LENGTH + 1] = 0x0;
            }
            else
            {
                break;
            }
        }
        UI_set_font(&prev_f);

        if (g_nitz_display.country_init)
        {
            AnsiiNToUnicodeString((S8*) mcc_tmp_unicode, (S8*) g_nitz_display.plmn, 3);
            pfnUnicodeStrcat((S8*) g_nitz_display.display_name, " ");
            pfnUnicodeStrcat((S8*) g_nitz_display.display_name, (S8*) mcc_tmp_unicode);
        }

        g_nitz_display.opname_from_nitz = 1;
    }
    else
    {
        g_nitz_display.opname_from_nitz = 0;
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_check_nitz_display_validation
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
pBOOL mmi_idle_check_nitz_display_validation(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (memcmp(g_nitz_display.plmn, gPLMN, MAX_PLMN_LEN_MMI) != 0)
    {
        g_nitz_display.opname_from_nitz = 0;
        return MMI_FALSE;
    }
    else
    {
        return MMI_TRUE;
    }
}

#endif /* __MMI_NITZ__ */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_widget_check_and_display_new_msg
 * DESCRIPTION
 *  Wrapper for idle screen callback
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#if defined(OBIGO_SUPPORT) && defined(WAP_SUPPORT)
static U8 mmi_idle_widget_check_and_display_new_msg(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_keylock_context.gKeyPadLockFlag)
    {
        if (widget_MMI_check_and_display_new_msg_when_keypad_lock
            (g_keylock_context.KeyLockLSKStringID, g_keylock_context.KeyLockLSKIconID,
             g_keylock_context.KeyLockRSKStringID, g_keylock_context.KeyLockRSKIconID))
        {
            return MMI_TRUE;
        }
    }
    else
    {
        if (widget_MMI_check_and_display_new_msg())
        {
            return MMI_TRUE;
        }
    }
    return MMI_FALSE;
}
#endif /* defined(OBIGO_SUPPORT) && defined(WAP_SUPPORT) && !defined (__UNIFIED_MSG_SUPPORT__) */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_pen_block
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#ifdef __MMI_TOUCH_SCREEN__
void mmi_idle_pen_block(void)
{
#ifndef __MMI_GPIO_DISABLE_SLEEP_MODE__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    extern BOOL gIsInSleepMode;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (gIsInSleepMode != 1)
#endif /* __MMI_GPIO_DISABLE_SLEEP_MODE__ */ 
        mmi_pen_block();
}
#endif /* __MMI_TOUCH_SCREEN__ */

/*****************************************************************************
 * FUNCTION
 *  mmi_idle_set_keypad_lock_string
 * DESCRIPTION
 *  This function is used to set keypad lock RSK string
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_idle_set_keypad_lock_string(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    g_keylock_context.KeyLockRSKStringID = 0;
    g_keylock_context.KeyLockRSKIconID = 0;
    g_keylock_context.KeyLockLSKStringID = 0;
    g_keylock_context.KeyLockLSKIconID = 0;

    if (g_idle_context.IsOnIdleScreen == 1 || g_idle_context.IsOnSimErrorScreen == 1)
    {
    #ifdef __MMI_TOUCH_SCREEN__
        ChangeStatusIconImage(STATUS_ICON_KEYPAD_LOCK, IMG_SI_KEYPAD_LOCK);
    #else 
        ShowStatusIcon(STATUS_ICON_KEYPAD_LOCK);
    #endif 

    #ifdef __MMI_KEYPAD_LOCK_PATTERN_1__
    #ifdef __MMI_TOUCH_SCREEN__
        g_keylock_context.KeyLockRSKStringID = SCREEN_LOCKED_TEXT;
    #else 
        g_keylock_context.KeyLockRSKStringID = KEYPAD_LOCKED_RSK_TEXT;
    #endif 
    #endif /* __MMI_KEYPAD_LOCK_PATTERN_1__ */ 

    #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
    #ifdef __MMI_TOUCH_SCREEN__
        g_keylock_context.KeyLockLSKStringID = SCREEN_LOCKED_TEXT;
    #else 
        g_keylock_context.KeyLockLSKStringID = KEYPAD_LOCKED_RSK_TEXT;
    #endif 
    #endif /* __MMI_KEYPAD_LOCK_PATTERN_2__ */ 
    }
    else
    {
        /* If active screen is not idle, pen is not blocked */
        /* Set RSK/LSK string to "unlock" because it is allowed to click the touch screen to unlock */
    #ifdef __MMI_KEYPAD_LOCK_PATTERN_1__
        g_keylock_context.KeyLockRSKStringID = KEYPAD_LOCKED_RSK_TEXT;
    #endif 
    #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
        g_keylock_context.KeyLockLSKStringID = KEYPAD_LOCKED_RSK_TEXT;
    #endif 
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_dummy_key_handler
 * DESCRIPTION
 *  This function is a dummy handler for idle screen keys
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static FuncPtr dummyKeyHandler[MAX_KEYS];
extern FuncPtr currKeyFuncPtrs[MAX_KEYS][MAX_KEY_TYPE];

static void mmi_idle_dummy_key_handler(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 ScreenSaverStatus, ScreenSaverWait;
    U16 keyCode, keyType;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PhnsetGetScrSvrSetings(&ScreenSaverStatus, &ScreenSaverWait);

    GetkeyInfo(&keyCode, &keyType);

    if (g_idle_context.IsOnIdleScreen)
    {
        /* postpone the screensaver after press keys */
        if (dummyKeyHandler[keyCode] != NULL && !g_keylock_context.gKeyPadLockFlag)
        {
            (*dummyKeyHandler[keyCode]) ();
        }

        if (keyCode == KEY_ENTER && dummyKeyHandler[keyCode] == NULL && currKeyFuncPtrs[keyCode][KEY_LONG_PRESS] == NULL
            && !g_keylock_context.gKeyPadLockFlag)
        {
            (*dummyKeyHandler[KEY_LSK]) (); /* special case for KEY ENTER with null handler */
            ClearKeyHandler(KEY_ENTER, KEY_EVENT_DOWN);
        }
    }

    if (g_idle_context.IsOnIdleScreen)
    {
        StopTimer(SCREENSAVER_TIMER);
        StartTimer(SCREENSAVER_TIMER, ScreenSaverWait * 1000, EntryIdleSetScreenSaver);
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_idle_date_time_reminder
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_idle_date_time_reminder(void)
{
#if defined(__MMI_DATE_TIME_SETTING_REMINDER__)
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    static BOOL datejust_reminder_shown = MMI_FALSE;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef MMI_ON_HARDWARE_P

⌨️ 快捷键说明

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