Closed Bug 1053110 Opened 11 years ago Closed 11 years ago

[Telephony] Move temporary clir logic from ril_worker to telephonyService

Categories

(Firefox OS Graveyard :: RIL, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S3 (29aug)

People

(Reporter: aknow, Assigned: aknow)

References

Details

Attachments

(4 files, 5 obsolete files)

No description provided.
Attached patch Part 2: Refactoring MMI regex (obsolete) — Splinter Review
Try to make it more readable.
Attachment #8472200 - Flags: review?(htsai)
1. Move the clir logic from ril_worker to telephonyService. 2. At this time, let promise rejected when passing an mmi code to telephony.dial
Attachment #8472201 - Flags: review?(htsai)
Attached patch Part 1: Add mmi code test (obsolete) — Splinter Review
Attachment #8472202 - Flags: review?(htsai)
Comment on attachment 8472201 [details] [diff] [review] Part 3: Move clir logic to TelephonyService Got new modification. Cancel the review.
Attachment #8472201 - Flags: review?(htsai)
Comment on attachment 8472202 [details] [diff] [review] Part 1: Add mmi code test Review of attachment 8472202 [details] [diff] [review]: ----------------------------------------------------------------- This looks good though it seems not directly related to this bug.
Attachment #8472202 - Flags: review?(htsai) → review+
Attachment #8472202 - Attachment description: Part 3: Add mmi code test → Part 1: Add mmi code test
Attachment #8472200 - Attachment description: Part 1: Refactoring MMI regex → Part 2: Refactoring MMI regex
Attachment #8472201 - Attachment description: Part 2: Move clir logic to TelephonyService → Part 3: Move clir logic to TelephonyService
Attachment #8472201 - Attachment is obsolete: true
Attachment #8472200 - Flags: review?(htsai) → review+
Attachment #8474416 - Flags: review?(htsai)
Attachment #8474417 - Flags: review?(htsai)
Comment on attachment 8474416 [details] [diff] [review] Part 3: Create a helper: sendToRilWorker Review of attachment 8474416 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/telephony/gonk/TelephonyService.js @@ -331,5 @@ > > this._currentCalls[aClientId][call.callIndex] = call; > } > - > - return false; We can't remove this. The 'false' value does matter. Please see http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/RadioInterfaceLayer.js?from=RadioInterfaceLayer.js&case=true#1830
Attachment #8474416 - Flags: review?(htsai) → review-
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #8) > Comment on attachment 8474416 [details] [diff] [review] > Part 3: Create a helper: sendToRilWorker > > Review of attachment 8474416 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/telephony/gonk/TelephonyService.js > @@ -331,5 @@ > > > > this._currentCalls[aClientId][call.callIndex] = call; > > } > > - > > - return false; > > We can't remove this. The 'false' value does matter. Please see > http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ > RadioInterfaceLayer.js?from=RadioInterfaceLayer.js&case=true#1830 Returning nothing means 'undefined' and 'undefined' is treated as false.
Comment on attachment 8474416 [details] [diff] [review] Part 3: Create a helper: sendToRilWorker Review of attachment 8474416 [details] [diff] [review]: ----------------------------------------------------------------- It's okay though considering the workermessenger protocol I am still inclined to returning 'false' explicitly.
Attachment #8474416 - Flags: review- → review+
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #10) > Comment on attachment 8474416 [details] [diff] [review] > Part 3: Create a helper: sendToRilWorker > > Review of attachment 8474416 [details] [diff] [review]: > ----------------------------------------------------------------- > > It's okay though considering the workermessenger protocol I am still > inclined to returning 'false' explicitly. I have a different opinion. The purpose of the returning value is documented in workermessenger.send() but not sendWorkerMessage(). So, when writing a callback, it's really hard to understand why the function needs a return value. Also, what's the meaning of true or false? I just think that showing a "return" statement there is not so nature. It's better to hide the special ability of the "return value" and not to encourage the usage of it.
(In reply to Szu-Yu Chen [:aknow] from comment #11) > (In reply to Hsin-Yi Tsai [:hsinyi] from comment #10) > > Comment on attachment 8474416 [details] [diff] [review] > > Part 3: Create a helper: sendToRilWorker > > > > Review of attachment 8474416 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > It's okay though considering the workermessenger protocol I am still > > inclined to returning 'false' explicitly. > > I have a different opinion. > > The purpose of the returning value is documented in workermessenger.send() > but not sendWorkerMessage(). So, when writing a callback, it's really hard > to understand why the function needs a return value. You are right. I agree with you on this. :\ > Also, what's the > meaning of true or false? I just think that showing a "return" statement > there is not so nature. It's better to hide the special ability of the > "return value" and not to encourage the usage of it. The file RadioInterfaceLayer.js defines "true" and "false" clearly, but I am convinced by you that for a callback writer, there seems space to improving the design.
Comment on attachment 8474417 [details] [diff] [review] Part 4: Move clir logic to TelephonyService Review of attachment 8474417 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me! ::: dom/system/gonk/ril_worker.js @@ +2381,5 @@ > + * > + * @param number > + * Phone number to be parsed > + */ > + parseMMIFromDialNumber: function(options) { I believe it's a transient state that we will move the whole parsing work to TelephonyService.js in the bug of cleaning API backward compatibility. (Let me file a bug for tracking.) So it looks fine for now.
Attachment #8474417 - Flags: review?(htsai) → review+
Attachment #8472202 - Attachment is obsolete: true
Attachment #8475016 - Flags: review+
Attachment #8472200 - Attachment is obsolete: true
Attachment #8475017 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: