Closed Bug 876640 Opened 7 years ago Closed 7 years ago

Dialer Cannot do last number redial from Bluetooth when receiving BLDN command

Categories

(Firefox OS Graveyard :: Gaia::Dialer, defect, P1)

x86_64
Linux
defect

Tracking

(blocking-b2g:leo+, b2g18 verified)

VERIFIED FIXED
1.1 QE2 (6jun)
blocking-b2g leo+
Tracking Status
b2g18 --- verified

People

(Reporter: shawnjohnjr, Assigned: etienne)

Details

Attachments

(1 file, 1 obsolete file)

The error shows javascript error
05-28 18:53:57.661 E/GeckoConsole(  717): [JavaScript Error: "RecentsDBManager is not defined" {file: "app://communications.gaiamobile.org/dialer/js/dialer.js" line: 160}]
05-28 18:53:57.671 E/GeckoConsole(  717): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: '[JavaScript Error: "RecentsDBManager is not defined" {file: "app://communications.gaiamobile.org/dialer/js/dialer.js" line: 160}]' when calling method: [nsIDOMSystemMessageCallback::handleMessage]" {file: "jar:file:///system/b2g/omni.ja!/components/SystemMessageManager.js" line: 76}]
Bluetooth last number redial function fail to work now.
Severity: normal → blocker
blocking-b2g: --- → leo?
Priority: -- → P1
Target Milestone: --- → 1.1 QE2 (6jun)
Gaia version
commit a6d5dc7e091409f442ca54e147c2b912dd688ef7
Author: Julien Wajsberg <felash@gmail.com>
Date:   Thu May 23 06:01:07 2013 -0700

    Merge pull request #8757 from leob2g/Bug_853698_Device_does_not_enter_cpu_idle_state
STR:
1. Connect with Bluetooth headset
2. Use bluetooth headset and do redial via Bluetooth headset
Etienne, it looks like some major change for call log in v1-train which breaks redial function, can you help to check again?
Assignee: nobody → etienne
Setting Leo+ given this is a regression/function fail.
blocking-b2g: leo? → leo+
Attached patch Patch proposal (obsolete) — Splinter Review
My bad, should have caught this.

Shawn, is this patch working for you?
Attachment #755345 - Flags: feedback?(shuang)
Comment on attachment 755345 [details] [diff] [review]
Patch proposal

Yes. Patch is working. Thanks a lot :)
Attachment #755345 - Flags: feedback?(shuang) → feedback+
Comment on attachment 755345 [details] [diff] [review]
Patch proposal

So let's go :)
Attachment #755345 - Flags: review?(ferjmoreno)
Comment on attachment 755345 [details] [diff] [review]
Patch proposal

Review of attachment 755345 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks Shawn!

Can you send a PR to Gaia with the content of this patch, please?

::: apps/communications/dialer/js/dialer.js
@@ +147,5 @@
>    function btCommandHandler(message) {
>      var command = message['command'];
>      var partialCommand = command.substring(0, 3);
>      if (command === 'BLDN') {
> +      CallLogDBManager.getLastGroup(function(group) {

s/group/result

@@ +148,5 @@
>      var command = message['command'];
>      var partialCommand = command.substring(0, 3);
>      if (command === 'BLDN') {
> +      CallLogDBManager.getLastGroup(function(group) {
> +        if (group.number) {

.getLastGroup can return the last group object (null or not) or an error string. See http://mxr.mozilla.org/gaia/source/apps/communications/dialer/js/call_log_db.js#667

Can you add a condition like:

"if (typeof result === 'object' && result != null && result.number) {
  ...
} else {
  console.log('Could not get the last group ' + result);
}"

,please?
Attachment #755345 - Flags: review?(ferjmoreno) → review+
Attached patch Patch v2Splinter Review
The patch moved a bit so asking for r? and f? again just to make sure.

Thanks guys!
Attachment #755345 - Attachment is obsolete: true
Attachment #756690 - Flags: review?(ferjmoreno)
Attachment #756690 - Flags: feedback?(shuang)
Comment on attachment 756690 [details] [diff] [review]
Patch v2

Review of attachment 756690 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks Etienne! Looks good.
Attachment #756690 - Flags: review?(ferjmoreno) → review+
Comment on attachment 756690 [details] [diff] [review]
Patch v2

Hi Etienne,
I've tested and it works fine. Thanks for all your help.
Attachment #756690 - Flags: feedback?(shuang) → feedback+
https://github.com/mozilla-b2g/gaia/commit/0bf354d23c7d4b21225a2935ea201f1bca9fd5a7
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Uplifted 0bf354d23c7d4b21225a2935ea201f1bca9fd5a7 to:
v1-train: ea7cb7d40c66d3aa9fee6c1ba752949325d14da4
Flags: in-moztrap?
Flags: in-moztrap? → in-moztrap?(wachen)
Flags: in-moztrap?(wachen) → in-moztrap-
Flags: in-moztrap- → in-moztrap+
Executed test case https://moztrap.mozilla.org/manage/case/8457/ and verified that the bug has been fixed on: 
Device: Leo phone 
Build Identifier: 20130611074722
Update channel: leo/1.1.0/nightly
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/8d0562d20324
Gaia: 8c64e19b82d4e0490a7780232d3d6bd07d0ba9ec1370937291
Git commit info: 2013-06-11 07:54:51 
OS version: 1.1.0.0-prerelease
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.