Quote:
Originally Posted by muziling
The code I modified, and I am not sure which number of ro.telephony.default_network is for CDMA service, which for GSM/WCDMA
Code:
#if 0
fd=open("/sys/class/htc_hw/radio", O_RDONLY);
read(fd, buffer, 32);
close(fd);//muziling
if(strncmp(buffer, "GSM",3)==0) {
phone_has = MODE_GSM;
phone_is = MODE_GSM;
LOGI("RIL_Init found GSM hardware");
} else {
phone_has = MODE_CDMA;
phone_is = MODE_CDMA;
LOGI("RIL_Init found CDMA hardware");
}
#endif
memset(buffer, 0, sizeof(buffer));
property_get("ro.telephony.default_network", buffer, "4");
if(strcmp(buffer, "4")==0) {
phone_has = MODE_CDMA;
phone_is = MODE_CDMA;
LOGI("RIL_Init found CDMA hardware");
} else {
phone_has = MODE_GSM;
phone_is = MODE_GSM;
LOGI("RIL_Init found GSM hardware");
}
|
This is a good start, but lets take this a step further. Since rhod is the only thing on nand right now we dont need to work about raph and other world phones. We can simply read the variant type and make our decisions based from that. So instead of checking if cdma/gsm, lets check the model number and assign based on that.
so here is some pseudo
if (variant = 400/500) {
phone_is = MODE_CDMA
phone_has = MODE_GSM <--- we let ril know we have gsm phone too
} else {
phone_is = MODE_GSM
phone_has = MODE_GSM
}
Either way, good work. Now to make it all automated