MTK platform learning-Analysis of the FileManager Module

Source: Internet
Author: User
Tags file info

FileManager module Analysis

1. External Interface

1. Functions of the interface functions used by other modules
Mmi_fmgr_init initialize file manager context
Mmi_fmgr_select_path_and_entry entry point to file manager for other applications
Mmi_fmgr_reset_app_select reset selection from other application
GetFileSystemErrorString convert file system return error code to error messgae pop up

2. Analyze mmi_fmgr_select_path_and_entry, mmi_fmgr_reset_app_selec
Function prototype: void mmi_fmgr_select_path_and_entry (U8 app_id, U8 sel_type, U32 filter, PS8 start_path, PsFuncPtr callback );
(1) mainly analyze the callback function
A. excute mmi_fmgr_select_path_and_entry (......)
Start_path
---> Callback (.....)
---> Callback internal check: N
Start_path = NULL? ---> The selection is completed
|
| Y
The selection is aborted
B. Influence of FMGR_SELECT_REPEAT on callback function and
You can use fmgr_select_repeat to select files/folders multiple times.
A. Each select
Select target
Start_path
---> Callback (......)
---> Callback Internal Check n
Start_path = NULL? ---> User abort (the selection is aborted)
|
| Y
Reach application's condition? ---> Application abort (the selection is aborted)
|
|
The selection is completed
B. Two types of abort
User ABORT:
Will cause a callback with null parameter and file manager will automatically reset;
Application abort:
Needs to call the mmi_fmgr_reset_app_select () to terminate the process
(2) FMGR_SELECT_BROWSE Parameter
Drive option
Folder option
File option

3. Utility Functions
BOOL mmi_fmgr_get_default_folder_path (S8 * folder, S8 * path, 2010length );
Void mmi_fmgr_remove_last_dir (S8 * path );
S8 * mmi_fmgr_extract_file_name (S8 * path );
S8 * mmi_fmgr_extract_ext_file_name (S8 * path );
Void mmi_fmgr_hide_ext_name (S8 * path );
Mmi_fmgr_check_file_present


Ii. Cache

1. First Time Enter a Floder
A. General Process
First time enter a floder
--> Call fmgr_kenmel: init the cache
--> Load file frome FS until the cache is filled
--> Whether or not the sort option is available, file manager obtains the file list.
B. About sort API
When the number of files in a directory item exceeds 255, file manager can't use sort API to get file list from file system
But linear find first/find next instead.
C. filter

2. Request for File Info
A. Function: fmgr_kernel_get_file_info
B. call fmgr_kernel_get_file_info with a index
--> Get A structe of Data filled with useful File Information
--> This funciton will use the passed in index to see y
If the desired file info is already in chached or not ---> from Cache
|
| N
|
Reload cache and return file info

3. Image Cache
A. Preview image Cache of the File Manger Module
B. General Process
Draw Thumb Image
Y
--> Is in cache? -----> Draw it from cache
|
| N
|
Decord image -----> decord done -----> cache the image -----> draw it from Cache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.