Closed Bug 938806 Opened 6 years ago Closed 6 years ago

Handle errors better in GonkFMRadio

Categories

(Core :: Hardware Abstraction Layer (HAL), defect)

All
Gonk (Firefox OS)
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: mwu, Assigned: mwu)

Details

Attachments

(1 file, 1 obsolete file)

Right now, we don't necessarily report failures while setting up the FM radio. This needs to be fixed.
Attachment #8439431 - Flags: review?(dhylands)
Comment on attachment 8439431 [details] [diff] [review]
Improve error handling in FM radio init path

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

I like it.

::: hal/gonk/GonkFMRadio.cpp
@@ +300,5 @@
>  
>    if (sMsmFMMode) {
>      sRadioFD = fd.forget();
>      sMsmFMVersion = cap.version;
>      pthread_create(&sRadioThread, nullptr, runMsmFMRadio, nullptr);

Should this code path also generate some type of notification? Right now it looks like all of the other ways of exiting this function will create a notification, except for this one.
Attachment #8439431 - Flags: review?(dhylands) → review+
runMsmFMRadio is suppose to generate its own notification. I suppose if pthread_create fails, that won't happen. I'll add a check for that too.
This also ensures pthread_create succeeds.
Attachment #8439431 - Attachment is obsolete: true
Attachment #8439549 - Flags: review?(dhylands)
Comment on attachment 8439549 [details] [diff] [review]
improve-fm-init-error-handling-v2

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

Looks good.
Attachment #8439549 - Flags: review?(dhylands) → review+
https://hg.mozilla.org/mozilla-central/rev/5bb301cd0e7c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.