1. 程式人生 > >[Factory mode] 怎麼配置工廠模式測試項

[Factory mode] 怎麼配置工廠模式測試項


修改alps/mediatek/custom/$proj/factory/factory.ini配置工廠模式測項

[KEYWORD]

Factory mode test

[SOLUTION]

alps/mediatek/custom/$proj/factory/factory.ini 可以定製Factory mode測試項,如:
MenuItem=M-Sensor;
MenuItem=ALS/PS;
Factory mode啟動後,會先後尋找 /sdcard/factory.ini,/etc/factory.ini檔案,所以可以複製
factory.ini檔案到SD卡,並修改其中的內容來配置測試項. 若找不到ini檔案,則使用factory.c中
的預設配置
Related code all in alps/mediatek/factory/src/factory.c:
Golbal test items array:
static item_t ftm_cust_items[ITEM_MAX_IDS]; // factory.ini settings
static item_t ftm_cust_auto_items[ITEM_MAX_IDS];// factory.ini settings
static item_t ftm_test_items[] // Default settings
static item_t ftm_auto_test_items[] // Default settings
ftm_test_items && ftm_auto_test_items controled by MACROS
(ie. FEATURE_FTM_KEYS/CUSTOM_KERNEL_ALSPS...)
In main:
read_config(/sdcard/factory.ini or /etc/factory.ini)
ftm_cust_items = Items in (factory.ini && ftm_test_items)
ftm_cust_auto_items = Items in (factory.ini && ftm_test_items && ftm_auto_test_items)