Bug 864695 - [Dialer] Numbers starting with 5 retrive wrong phone number suggestions. r=reuben.bmo, r=bent

This commit is contained in:
Gregor Wagner 2013-04-30 15:14:09 -04:00
parent acfc9a35b1
commit 2364dfa204
2 changed files with 7 additions and 19 deletions

View File

@ -498,22 +498,14 @@ ContactDB.prototype = {
}
// containsSearch holds incremental search values for:
// normalized number, national format, international format
// normalized number and national format
for (let i = 0; i < normalized.length; i++) {
containsSearch[normalized.substring(i, normalized.length)] = 1;
}
if (parsedNumber) {
if (parsedNumber.nationalFormat) {
let number = PhoneNumberUtils.normalize(parsedNumber.nationalFormat);
for (let i = 0; i < number.length; i++) {
containsSearch[number.substring(i, number.length)] = 1;
}
}
if (parsedNumber.internationalFormat) {
let number = PhoneNumberUtils.normalize(parsedNumber.internationalFormat);
for (let i = 0; i < number.length; i++) {
containsSearch[number.substring(i, number.length)] = 1;
}
if (parsedNumber && parsedNumber.nationalFormat) {
let number = PhoneNumberUtils.normalize(parsedNumber.nationalFormat);
for (let i = 0; i < number.length; i++) {
containsSearch[number.substring(i, number.length)] = 1;
}
}
}

View File

@ -122,9 +122,7 @@ var steps = [
filterValue: number1.international};
req = mozContacts.find(options);
req.onsuccess = function () {
ok(req.result.length == 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ok(findResult1.id == sample_id1, "Same ID");
ok(req.result.length == 0, "Found exactly 0 contacts.");
next();
};
req.onerror = onFailure;
@ -220,9 +218,7 @@ var steps = [
filterValue: number2.international};
req = mozContacts.find(options);
req.onsuccess = function () {
ok(req.result.length == 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ok(findResult1.id == sample_id1, "Same ID");
ok(req.result.length == 0, "Found exactly 1 contact.");
next();
};
req.onerror = onFailure;