0
点赞
收藏
分享

微信扫一扫

不插T卡无法进入camera preview

互联网码农 2023-02-08 阅读 102


由于没有预留手机空间,只有插入T卡时才可以进入camera preview,如果需要实现不插入T卡时可进行相机预览,只有当拍照时才提示插入T卡则可以参考以下修改方法: 

[SOLUTION] 

1 在函数mmi_camera_entry_app_pre_check()中删除如下代码

#if defined(__CAMERA_FEATURE_STORAGE__)

/*No phone storage*/

if (SRV_FMGR_PUBLIC_DRV == SRV_FMGR_CARD_DRV || SRV_FMGR_PUBLIC_DRV == FS_DRIVE_NOT_FOUND)

{

/* only memory card but plugout, need show popup*/

if (FS_NO_ERROR != FS_GetDevStatus(SRV_FMGR_CARD_DRV ,FS_MOUNT_STATE_ENUM))

{

MMI_CAMERA_DISPLAY_POPUP((PU8)GetString(STR_GLOBAL_INSERT_MEMORY_CARD), MMI_EVENT_FAILURE,MMI_CAMERA_POPUP_RESULT_PROCESS_DELETE_GROUP);

return MMI_FALSE;

}

}

#endif


2 在函数mmi_camera_pre_init_app()中删除如下代码: 

/* check if path is valid or not. if not will pop up a screen after the preview screen is show */ 

cur_storage = mmi_imgview_get_storage();



if (mmi_camera_check_and_restore_valid_drv())

{

/* drv is valid, create directory */

mmi_imgview_get_storage_file_path(g_camera_cntx.storage_filepath);

create_result = mmi_imgview_create_file_dir(g_camera_cntx.storage_filepath);



/* create directory failed */

if (create_result == FS_WRITE_PROTECTION)

{

g_camera_cntx.last_error = CAMERA_ERR_WRITE_PROTECT;

mmi_imgview_set_storage_not_ready();

}

else if (create_result == FS_DISK_FULL)

{

g_camera_cntx.last_error = CAMERA_ERR_CARD_DISK_FULL;

mmi_imgview_set_storage_not_ready();

}

else if (create_result == FS_ROOT_DIR_FULL)

{

g_camera_cntx.last_error = CAMERA_ERR_ROOT_DIR_FULL;

mmi_imgview_set_storage_not_ready();

}

else if (create_result == FS_INVALID_FILENAME)

{

g_camera_cntx.last_error = CAMERA_ERR_EXIST_PHOTOS_FILE;

mmi_imgview_set_storage_not_ready();

}

else if (create_result == FS_INVALID_FILENAME)

{

g_camera_cntx.last_error = CAMERA_ERR_CREATE_DIR;

mmi_imgview_set_storage_not_ready();

}

else

mmi_imgview_set_storage_ready();

}

else

{

g_camera_cntx.last_error = MDI_RES_CAMERA_ERR_NO_DISK;

mmi_imgview_set_storage_not_ready();

}

3 在函数mmi_camera_entry_app_screen_internal()中删除如下代码:

/*No phone storage*/

if (SRV_FMGR_PUBLIC_DRV == SRV_FMGR_CARD_DRV || SRV_FMGR_PUBLIC_DRV == FS_DRIVE_NOT_FOUND)

{

/* only memory card but plugout, need show popup*/

if (FS_NO_ERROR != FS_GetDevStatus(SRV_FMGR_CARD_DRV ,FS_MOUNT_STATE_ENUM))

{

MMI_CAMERA_DISPLAY_POPUP((PU8)GetString(STR_GLOBAL_INSERT_MEMORY_CARD), MMI_EVENT_FAILURE,MMI_CAMERA_POPUP_RESULT_PROCESS_DELETE_GROUP);



return;

}

}

4 在函数mmi_camera_capture_button_press()的开始添加如下代码:

#if defined(__CAMERA_FEATURE_STORAGE__)

/*No phone storage*/

if (SRV_FMGR_PUBLIC_DRV == SRV_FMGR_CARD_DRV || SRV_FMGR_PUBLIC_DRV == FS_DRIVE_NOT_FOUND)

{

/* only memory card but plugout, need show popup*/

if (FS_NO_ERROR != FS_GetDevStatus(SRV_FMGR_CARD_DRV ,FS_MOUNT_STATE_ENUM))

{

MMI_CAMERA_DISPLAY_POPUP((PU8)GetString(STR_GLOBAL_INSERT_MEMORY_CARD), MMI_EVENT_FAILURE,MMI_CAMERA_POPUP_RESULT_PROCESS_DELETE_GROUP);

return;

}

}

#endif

举报

相关推荐

0 条评论