Bug 828307 - Part 2: GPS change. r=kchen

This commit is contained in:
Edgar Chen 2013-02-25 11:59:30 +08:00
parent 0a589fb149
commit ece5ef9f84

View File

@ -449,8 +449,23 @@ GonkGPSGeolocationProvider::SetReferenceLocation()
nsCOMPtr<nsIDOMMozMobileICCInfo> iccInfo;
rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
if (iccInfo) {
iccInfo->GetMcc(&location.u.cellID.mcc);
iccInfo->GetMnc(&location.u.cellID.mnc);
nsresult result;
nsAutoString mcc, mnc;
iccInfo->GetMcc(mcc);
iccInfo->GetMnc(mnc);
location.u.cellID.mcc = mcc.ToInteger(&result, 10);
if (result != NS_OK) {
NS_WARNING("Cannot parse mcc to integer");
location.u.cellID.mcc = 0;
}
location.u.cellID.mnc = mnc.ToInteger(&result, 10);
if (result != NS_OK) {
NS_WARNING("Cannot parse mnc to integer");
location.u.cellID.mnc = 0;
}
}
nsCOMPtr<nsIDOMMozMobileConnectionInfo> voice;
rilCtx->GetVoice(getter_AddRefs(voice));