Beispiel #1
0
static PRESULT otaupg_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	INT32 btn_state;
	UINT8 back_saved;
	
	UINT8	id = OSD_GetObjID(pObj);
	

	switch(event)
	{
	case EVN_PRE_OPEN:
        system_state = SYS_STATE_OTA_UPG;
		//p_otaosd_buff = MALLOC(OSD_VSRC_MEM_MAX_SIZE);
		epg_release();
		if(win_otaupg_set_memory() != 0)
		{
			win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_set_msg(NULL, NULL, RS_NO_ENOUGH_MEMORY);
			win_compopup_open_ext(& back_saved);
			return PROC_LEAVE;
		}
		wincom_open_subtitle((POBJECT_HEAD)&g_win_otaupg,RS_TOOLS_SW_UPGRADE_BY_OTA, 0);
		win_otaupg_get_info();
		win_otaup_set_btn_msg_display(FALSE);
		win_otaup_set_swinfo_display(FALSE);
		win_otaupg_init();

		break;
		
	case EVN_POST_OPEN:
		break;
	
	case EVN_PRE_CLOSE:
        if(ota_proc_step == OTA_STEP_BURNFLASH && ota_proc_ret != PROC_FAILURE)
        {
            ret = PROC_LOOP;
            break;
        }
        else
        {
            //btn_state = win_otaup_get_btn_state();
            if(ota_proc_ret == 0)
            {
                ota_stop_service();
				//ota_user_stop = 1;
            }
        }
  /*          
		if(btn_state == 0)
		{
			if(!ota_user_stop)
			{
				ota_stop_service();
				ota_user_stop = 1;					
			}
		}
		
		if(btn_state != 1)
			ret = PROC_LOOP;
*/
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		
		break;

	case EVN_POST_CLOSE:
		if(p_otaosd_buff != NULL)
		{
			OSD_TaskBuffer_Free(OSAL_INVALID_ID,p_otaosd_buff);
		}
		epg_init(SIE_EIT_WHOLE_TP, (UINT8*)__MM_EPG_BUFFER_START/*buffer*/, __MM_EPG_BUFFER_LEN, ap_epg_call_back);
		system_state = SYS_STATE_NORMAL;
#ifndef _BUILD_OTA_E_
		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
#endif
		break;
    case EVN_UNKNOWN_ACTION:
        ret = PROC_LOOP;
		break;
	case EVN_MSG_GOT:
		ret = win_otaupg_message_proc(param1,param2);
		break;
	}
	return ret;
}
Beispiel #2
0
INT32 ali_ipanel_enter_mw(UINT32 param1, UINT32 param2)
{
	struct osd_device *osd_dev = NULL;
	INT32 ret = SUCCESS;
	VSCR *lpVscr;
	
	if (ali_ipanel_flag_id == OSAL_INVALID_ID)
	{
		ali_ipanel_flag_id = osal_flag_create(0);
		if (ali_ipanel_flag_id == OSAL_INVALID_ID)
		{
			IPANEL_PRINTF("%s() create flag failed\n", __FUNCTION__);
			return  - 1;
		}
	}
	//close lib monitor
	dm_set_onoff(0);

	stop_tdt();

	epg_off();

       sdt_monitor_off();

	//suspend key task
	key_task_suspend();

	//suspend ota task
	ota_task_suspend();

	//close sie to stop get si section
	/*if (SUCCESS != sie_close())
	{
		IPANEL_PRINTF("%s() close sie failed\n", __FUNCTION__);
		return  - 1;
	}*/

	//close vpo
	struct vpo_device *vpo_dev = (struct vpo_device *)dev_get_by_id ( HLD_DEV_TYPE_DIS, 0 );
	vpo_win_onoff(vpo_dev, FALSE);

#if(CAS_TYPE==CAS_CDCA3||CAS_TYPE == CAS_TF||CAS_TYPE==CAS_CDCA)
	ap_osd_layer2_exit();
#endif

	//close osd
	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 0);
	if(osd_dev!=NULL)
		OSDDrv_Close((HANDLE)osd_dev);
	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 1);
	if(osd_dev!=NULL)
		OSDDrv_Close((HANDLE)osd_dev);

#ifdef USE_LIB_GE
	 struct ge_device* ge_dev= (struct ge_device*)dev_get_by_id(HLD_DEV_TYPE_GE, 0);

     app_gui_release(1);
	 ge_close(ge_dev);     
#endif
	
	//free osd vscr buf
	OSD_TaskBuffer_Free(osal_task_get_current_id(), NULL);
	lpVscr = OSD_GetTaskVscr(osal_task_get_current_id());
	lpVscr->lpbScr = NULL;

    	recreate_prog_view(VIEW_ALL|PROG_ALL_MODE, 0);
	ipanel_porting_dmx_init();
	
	//call ipanel init
	ipanel_task_init(param1, param2);

	//suspend on ali_ipanel_flag_id wait ipanel exit
	ALI_IPANEL_ENTER_MUTEX(ALI_IPANEL_FLAG_EXIT_MW);

	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 0);
	if(osd_dev!=NULL)
        ap_osd_init();

	#if 0//ndef MIS_AD
	#ifdef MULTI_CAS
	#if((CAS_TYPE==CAS_CDCA)||(CAS_TYPE==CAS_TF)||(CAS_TYPE==CAS_DVT))
	osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 1);
	if(osd_dev!=NULL)
		ap_osd_layer2_init();
	#endif
	#endif
	#endif

	return ret;
}