Fix device_info for v1/v2.
Change-Id: I77c1da11f042bf2523d5768b18c18b9a0e1e0c6e
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index ad01378..7a51c7e 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -7340,12 +7340,21 @@
band_set_info.band_fddlte = MBTK_BAND_ALL_FDDLTE_DEFAULT;
band_set_info.band_lte_ext = MBTK_BAND_ALL_EXT_LTE_DEFAULT;
} else {
- band_area = info_modem.band_area;
- band_set_info.band_gsm = info_modem.band_gsm;
- band_set_info.band_wcdma = info_modem.band_wcdma;
- band_set_info.band_tdlte = info_modem.band_tdlte;
- band_set_info.band_fddlte = info_modem.band_fddlte;
- band_set_info.band_lte_ext = info_modem.band_lte_ext;
+ if(info_modem.version == DEV_INFO_VERSION_V1) {
+ band_area = info_modem.modem.v1.band_area;
+ band_set_info.band_gsm = info_modem.modem.v1.band_gsm;
+ band_set_info.band_wcdma = info_modem.modem.v1.band_wcdma;
+ band_set_info.band_tdlte = info_modem.modem.v1.band_tdlte;
+ band_set_info.band_fddlte = info_modem.modem.v1.band_fddlte;
+ band_set_info.band_lte_ext = info_modem.modem.v1.band_lte_ext;
+ } else {
+ band_area = info_modem.modem.v2.band_area;
+ band_set_info.band_gsm = info_modem.modem.v2.band_gsm;
+ band_set_info.band_wcdma = info_modem.modem.v2.band_wcdma;
+ band_set_info.band_tdlte = info_modem.modem.v2.band_tdlte;
+ band_set_info.band_fddlte = info_modem.modem.v2.band_fddlte;
+ band_set_info.band_lte_ext = info_modem.modem.v2.band_lte_ext;
+ }
}
bool is_first = TRUE;
@@ -7392,10 +7401,15 @@
}
else
{
- reboot_reason = info_basic.reboot_flag;
- if(info_basic.reboot_flag != MBTK_REBOOT_FLAG_NORMAL)
+ reboot_reason = info_basic.version == DEV_INFO_VERSION_V1 ? info_basic.basic.v1.reboot_flag :
+ info_basic.basic.v2.reboot_flag;
+ if(reboot_reason != MBTK_REBOOT_FLAG_NORMAL)
{
- info_basic.reboot_flag = MBTK_REBOOT_FLAG_NORMAL;
+ if(info_basic.version == DEV_INFO_VERSION_V1) {
+ info_basic.basic.v1.reboot_flag = MBTK_REBOOT_FLAG_NORMAL;
+ } else {
+ info_basic.basic.v2.reboot_flag = MBTK_REBOOT_FLAG_NORMAL;
+ }
ret = mbtk_dev_info_write(MBTK_DEVICE_INFO_ITEM_BASIC, &info_basic, sizeof(mbtk_device_info_basic_t));
if(ret != 0) {
LOGE("[%s] mbtk_dev_info_write(BASIC) fail.", __func__);