Bug 999458 - 2.c/2: 0 <= gsmLocationAreaCode <= 65535. r=echen

This commit is contained in:
Vicamo Yang 2014-05-02 00:24:12 +08:00
Родитель edd424c7b2
Коммит dac9700650
6 изменённых файлов: 13 добавлений и 20 удалений

Просмотреть файл

@ -523,10 +523,7 @@ function getEmulatorGsmLocation() {
is(aResults[1].substring(0,2), "ci", "ci output"); is(aResults[1].substring(0,2), "ci", "ci output");
let lac = parseInt(aResults[0].substring(5)); let lac = parseInt(aResults[0].substring(5));
lac = (lac < 0 ? 65535 : lac);
let cid = parseInt(aResults[1].substring(4)); let cid = parseInt(aResults[1].substring(4));
cid = (cid < 0 ? 268435455 : cid);
return { lac: lac, cid: cid }; return { lac: lac, cid: cid };
}); });
} }

Просмотреть файл

@ -8,8 +8,6 @@ function verifyDataCellLocationInfo(aLac, aCid) {
let cell = mobileConnection.data.cell; let cell = mobileConnection.data.cell;
ok(cell, "location available"); ok(cell, "location available");
// Initial LAC/CID. Android emulator initializes both value to
// 0xffff/0xffffffff.
is(cell.gsmLocationAreaCode, aLac, "data.cell.gsmLocationAreaCode"); is(cell.gsmLocationAreaCode, aLac, "data.cell.gsmLocationAreaCode");
is(cell.gsmCellId, aCid, "data.cell.gsmCellId"); is(cell.gsmCellId, aCid, "data.cell.gsmCellId");
is(cell.cdmaBaseStationId, -1, "data.cell.cdmaBaseStationId"); is(cell.cdmaBaseStationId, -1, "data.cell.cdmaBaseStationId");

Просмотреть файл

@ -13,8 +13,8 @@ const INITIAL_STATES = {
relSignalStrength: 44, relSignalStrength: 44,
cell: { cell: {
gsmLocationAreaCode: 65535, gsmLocationAreaCode: 0,
gsmCellId: 268435455, gsmCellId: 0,
cdmaBaseStationId: -1, cdmaBaseStationId: -1,
cdmaBaseStationLatitude: -2147483648, cdmaBaseStationLatitude: -2147483648,
cdmaBaseStationLongitude: -2147483648, cdmaBaseStationLongitude: -2147483648,
@ -73,8 +73,8 @@ const TEST_DATA = [{
signalStrength: -99, signalStrength: -99,
relSignalStrength: 44, relSignalStrength: 44,
cell: { cell: {
gsmLocationAreaCode: 65535, gsmLocationAreaCode: 0,
gsmCellId: 268435455 gsmCellId: 0
} }
} }
}, { }, {
@ -88,8 +88,8 @@ const TEST_DATA = [{
signalStrength: -99, signalStrength: -99,
relSignalStrength: 44, relSignalStrength: 44,
cell: { cell: {
gsmLocationAreaCode: 65535, gsmLocationAreaCode: 0,
gsmCellId: 268435455 gsmCellId: 0
} }
} }
} }

Просмотреть файл

@ -8,8 +8,6 @@ function verifyVoiceCellLocationInfo(aLac, aCid) {
let cell = mobileConnection.voice.cell; let cell = mobileConnection.voice.cell;
ok(cell, "location available"); ok(cell, "location available");
// Initial LAC/CID. Android emulator initializes both value to
// 0xffff/0xffffffff.
is(cell.gsmLocationAreaCode, aLac, "check voice.cell.gsmLocationAreaCode"); is(cell.gsmLocationAreaCode, aLac, "check voice.cell.gsmLocationAreaCode");
is(cell.gsmCellId, aCid, "check voice.cell.gsmCellId"); is(cell.gsmCellId, aCid, "check voice.cell.gsmCellId");
is(cell.cdmaBaseStationId, -1, "check voice.cell.cdmaBaseStationId"); is(cell.cdmaBaseStationId, -1, "check voice.cell.cdmaBaseStationId");

Просмотреть файл

@ -13,8 +13,8 @@ const INITIAL_STATES = {
relSignalStrength: 44, relSignalStrength: 44,
cell: { cell: {
gsmLocationAreaCode: 65535, gsmLocationAreaCode: 0,
gsmCellId: 268435455, gsmCellId: 0,
cdmaBaseStationId: -1, cdmaBaseStationId: -1,
cdmaBaseStationLatitude: -2147483648, cdmaBaseStationLatitude: -2147483648,
cdmaBaseStationLongitude: -2147483648, cdmaBaseStationLongitude: -2147483648,
@ -70,8 +70,8 @@ const TEST_DATA = [{
signalStrength: -99, signalStrength: -99,
relSignalStrength: 44, relSignalStrength: 44,
cell: { cell: {
gsmLocationAreaCode: 65535, gsmLocationAreaCode: 0,
gsmCellId: 268435455 gsmCellId: 0
} }
} }
}, { }, {
@ -85,8 +85,8 @@ const TEST_DATA = [{
signalStrength: -99, signalStrength: -99,
relSignalStrength: 44, relSignalStrength: 44,
cell: { cell: {
gsmLocationAreaCode: 65535, gsmLocationAreaCode: 0,
gsmCellId: 268435455 gsmCellId: 0
} }
} }
} }

Просмотреть файл

@ -13622,7 +13622,7 @@ ICCUtilsHelperObject.prototype = {
let iccInfo = RIL.iccInfo; let iccInfo = RIL.iccInfo;
let pnnEntry; let pnnEntry;
if (!mcc || !mnc || !lac) { if (!mcc || !mnc || lac == null || lac < 0) {
return null; return null;
} }