1、/android/packages/apps/Settings/res/xml/device_info_settings.xml在这个路径下添加自己需要的项
<!-- MainInfo -->
<Preference android:key="main_version"
style="?android:preferenceInformationStyle"
android:title="@string/main_version"
android:summary="@string/device_info_default"
/>
<!-- McuInfo -->
<Preference android:key="mcu_version"
style="?android:preferenceInformationStyle"
android:title="@string/mcu_version"
android:summary="@string/device_info_default"
/>
<!-- CanInfo -->
<Preference android:key="can_version"
style="?android:preferenceInformationStyle"
android:title="@string/can_version"
android:summary="@string/device_info_default"
/>
2、android/packages/apps/Settings/src/com/android/settings/DeviceInfoSettings.java在这个文件中
private static final String KEY_MAIN_VERSION = "main_version";
private static final String KEY_MCU_VERSION = "mcu_version";
private static final String KEY_CAN_VERSION = "can_version";
private McuManager mcuManager;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
mcuManager = (McuManager) getSystemService(Context.MCU_SERVICE);
setStringSummary(KEY_MAIN_VERSION,SystemProperties.get("ro.config.mainversion"));
setStringSummary(KEY_MCU_VERSION,mcuManager.mcuGetVersion());
setStringSummary(KEY_CAN_VERSION,"");
}
其中
ro.config.mainversion 在路径
android\device\actions\s700_cb6下的device.mk文件中
ADDITIONAL_BUILD_PROPERTIES += \ro.config.mainversion=ACCMM8708-MAN-0001-0001-0001-20180309