2)The data is cached in memory for quick access.
3) There are three kind of MMI cache – 1 byte cache, 2 bytes cache, 8 bytes cache.
4) In 1/2/8 byte(s) cache, the size of every setting is 1/2/8 byte(s).
实现方法
1)在老的版本上Old registry method (10AW1032MP and before)涉及文件
▪ Define App ID – mcu\custom\common\custom_nvram_config.h
▪ Define MMI cache ENUM – mcu\custom\common\XXX_MMI\custom_mmi_default_value.h
▪ Define MMI cache default value – mcu\custom\common\XXX_MMI\common_mmi_cache_config.c
▪ Generated MMI cache table – mcu\custom\app\[BB]\nvram_mmi_cache_cust_pack.h
2)New MMI Cache Registry
Can add the item anywhere as you want. New MMI cache mechanism supports version compatible feature. It means you do not need to format the phone, when you download the new version.
When you add or modify a MMI cache item, you only need to “make resgen” and “remake mmiresource, custom and your module”.
<APP id="APP_PHONEBOOK">
<CACHEDATA
type="short"
id="NVRAM_PHB_STORAGE_LOCATION"
restore_flag="TRUE"
restore_id="@RESTORE_PHB_STORAGE_LOCATION">
<DEFAULT_VALUE>[0xFF,0xFF]</DEFAULT_VALUE>
<DESCRIPTION>Phonebook prefer storage</DESCRIPTION>
</CACHEDATA>
</APP>
说明:
<DEFAULT_VALUE> Tag
Describe the default value for every 4 bytes – [1000, 1000] = [0xE8, 0x03, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00] (double)
Discard the most left bytes if need.
– [1000] = [0xE8, 0x03] (short)
– [1000] = [0xE8] (byte)
<FIELD> Tag
▪ Parent: <CACHEDATA> , describe in detail the byte size of this MMI cache, for CAT
▪ There may be many <FIELD> tag in one cache data.
– Ex: Split the double into two fields and each size is 4.
Example 1 of <CACHEDATA>
<CACHEDATA type="byte" id="NVRAM_SETTING_DEF_ENCODING" restore_flag="TRUE">
<DEFAULT_VALUE> [0xFF] </DEFAULT_VALUE>
<DESCRIPTION> user defined encoding type </DESCRIPTION>
<FIELD>
<OPTION hint="ASCII"> [0x00]</OPTION>
<OPTION hint="ISO-8859-9"></OPTION>
<OPTION hint="Windows-1254"></OPTION>
<OPTION hint="KOI8-R"></OPTION> // Empty value, increase thevalue of last option item . So it is [0x01].
<OPTION hint="Windows-1252"></OPTION>
<OPTION hint="Big5"></OPTION>
<OPTION hint="GB2312"></OPTION>
</FIELD>
</CACHEDATA>
Example 2 of <CACHEDATA>
<CACHEDATA type="byte" id="NVRAM_MEDIA_PLAYER_SINGLE_VOLUME" restore_flag="TRUE">
<DEFAULT_VALUE> [0xFF] </DEFAULT_VALUE>
<DESCRIPTION> Byte Cache </DESCRIPTION>
<FIELD min="0" max="15"></FIELD>
</CACHEDATA>
Example 3 of <CACHEDATA>
<CACHEDATA type="short" id="NVRAM_FUNANDGAMES_SETWALLPAPER“>
<DEFAULT_VALUE> [0x01, 0x00] </DEFAULT_VALUE>
<DESCRIPTION> current wallpaper id </DESCRIPTION>
<FIELD>
<MAXIMUM> [__MMI_WALLPAPER_NUM__] </MAXIMUM>
</FIELD>
</CACHEDATA>
Output file
▪ mmi_cache_table.c-> id ENUM array, key value array, restore factory
▪ mmi_cache_table.h-> function, extern variable
▪ mmi_cache_default_value.h-> default value
▪ mmi_cache_nvram_editor.h-> for NVRAM editor(Meta)