Bug 830164 - Part 4: Update GPS. r=dougt

This commit is contained in:
Yoshi Huang 2013-01-10 14:57:49 +01:00
parent ccdb765e1e
commit db6d7bb3c1

View File

@ -408,21 +408,23 @@ GonkGPSGeolocationProvider::RequestSetID(uint32_t flags)
mRIL->GetRilContext(getter_AddRefs(rilCtx)); mRIL->GetRilContext(getter_AddRefs(rilCtx));
if (rilCtx) { if (rilCtx) {
nsCOMPtr<nsIICCRecords> icc; nsAutoString id;
rilCtx->GetIcc(getter_AddRefs(icc)); if (flags & AGPS_RIL_REQUEST_SETID_IMSI) {
if (icc) { type = AGPS_SETID_TYPE_IMSI;
nsAutoString id; rilCtx->GetImsi(id);
if (flags & AGPS_RIL_REQUEST_SETID_IMSI) {
type = AGPS_SETID_TYPE_IMSI;
icc->GetImsi(id);
}
if (flags & AGPS_RIL_REQUEST_SETID_MSISDN) {
type = AGPS_SETID_TYPE_MSISDN;
icc->GetMsisdn(id);
}
NS_ConvertUTF16toUTF8 idBytes(id);
mAGpsRilInterface->set_set_id(type, idBytes.get());
} }
if (flags & AGPS_RIL_REQUEST_SETID_MSISDN) {
nsCOMPtr<nsIDOMMozMobileICCInfo> iccInfo;
rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
if (iccInfo) {
type = AGPS_SETID_TYPE_MSISDN;
iccInfo->GetMsisdn(id);
}
}
NS_ConvertUTF16toUTF8 idBytes(id);
mAGpsRilInterface->set_set_id(type, idBytes.get());
} }
} }
@ -444,11 +446,11 @@ GonkGPSGeolocationProvider::SetReferenceLocation()
location.type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID; location.type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
if (rilCtx) { if (rilCtx) {
nsCOMPtr<nsIICCRecords> icc; nsCOMPtr<nsIDOMMozMobileICCInfo> iccInfo;
rilCtx->GetIcc(getter_AddRefs(icc)); rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
if (icc) { if (iccInfo) {
icc->GetMcc(&location.u.cellID.mcc); iccInfo->GetMcc(&location.u.cellID.mcc);
icc->GetMnc(&location.u.cellID.mnc); iccInfo->GetMnc(&location.u.cellID.mnc);
} }
nsCOMPtr<nsIDOMMozMobileConnectionInfo> voice; nsCOMPtr<nsIDOMMozMobileConnectionInfo> voice;
rilCtx->GetVoice(getter_AddRefs(voice)); rilCtx->GetVoice(getter_AddRefs(voice));