Closed Bug 1159591 Opened 10 years ago Closed 10 years ago

[Telephony] Move MMI logic from ril_worker to telephonyService

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog, firefox42 fixed)

RESOLVED FIXED
FxOS-S3 (24Jul)
tracking-b2g backlog
Tracking Status
firefox42 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

Details

Attachments

(12 files, 34 obsolete files)

21.25 KB, patch
aknow
: review+
Details | Diff | Splinter Review
21.26 KB, patch
aknow
: review+
Details | Diff | Splinter Review
6.03 KB, patch
aknow
: review+
Details | Diff | Splinter Review
13.88 KB, patch
aknow
: review+
Details | Diff | Splinter Review
5.32 KB, patch
edgar
: review+
Details | Diff | Splinter Review
14.53 KB, patch
aknow
: review+
Details | Diff | Splinter Review
15.21 KB, patch
aknow
: review+
Details | Diff | Splinter Review
51.70 KB, patch
edgar
: review+
Details | Diff | Splinter Review
5.73 KB, patch
aknow
: review+
Details | Diff | Splinter Review
15.64 KB, patch
edgar
: review+
Details | Diff | Splinter Review
9.40 KB, patch
edgar
: review+
Details | Diff | Splinter Review
17.19 KB, patch
aknow
: review+
Details | Diff | Splinter Review
MMI contains many different operations, e.g. changing lock, setting call forwarding ... etc. Currently TelephonyService send a worker message, "sendMMI", to ril_worker and ril_worker will trigger corresponding RIL request. When receiving solicited response, ril_worker will also need to check if the RIL response is for "sendMMI" by checking |rilMessageType| in order to fill up correct information. This flow is a bit tricky and could be error prone. My idea is moving MMI logic to telephonyService to makes the code clearer.
Blocks: 831637
Assignee: nobody → echen
[Tracking Requested - why for this release]:
Attachment #8601254 - Attachment is obsolete: true
Attached patch Part 2: Call forwarding, v1 (obsolete) — Splinter Review
Attachment #8601994 - Attachment description: Part 1: Call forwarding, v1 → Part 2: Call forwarding, v1
Attached patch Part 3: Icc lock, v1 (obsolete) — Splinter Review
Attached patch Part 4: IMEI, v1 (obsolete) — Splinter Review
Attached patch Part 5: CLIP, v1 (obsolete) — Splinter Review
Attached patch Part 6: CLIR, v1 (obsolete) — Splinter Review
Attached patch Part 8: Call barring, v1 (obsolete) — Splinter Review
Attached patch Part 9: Call waiting, v1 (obsolete) — Splinter Review
Attached patch Part 10: USSD, v1 (obsolete) — Splinter Review
Attached patch Part 11: MMI consts, v1 (obsolete) — Splinter Review
I am working on xpcshell tests now.
Comment on attachment 8601991 [details] [diff] [review] Part 1: Add more marionette tests for MMI, v2 Review of attachment 8601991 [details] [diff] [review]: ----------------------------------------------------------------- Hi Aknow, would you mind reviewing marionette tests first? Thank you.
Attachment #8601991 - Flags: review?(szchen)
Comment on attachment 8601991 [details] [diff] [review] Part 1: Add more marionette tests for MMI, v2 Review of attachment 8601991 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Thank you. ::: dom/telephony/test/marionette/test_mmi_call_barring.js @@ +32,5 @@ > +function testCallBarring(aEnabled) { > + let promise = Promise.resolve(); > + > + for (let i = 0; i < CB_TYPES.length; i++) { > + let type = CB_TYPES[i]; you can use for .. of for (let type of CB_TYPES) @@ +41,5 @@ > + // Test getting call barring. > + .then(() => sendCbMMI("*#", type, true, > + aEnabled ? "smServiceEnabledFor": "smServiceDisabled")) > + .then(aResult => { > + if (aEnabled) { Let's check the length here. is(aResult.additionalInformation.length, MMI_SERVICE_CLASS.length); @@ +56,5 @@ > + > +function testUnsupportType() { > + let promise = Promise.resolve(); > + > + for (let i = 0; i < CB_TYPES_UNSUPPORTED.length; i++) { for .. of @@ +72,5 @@ > +function testUnsupportedOperation() { > + let promise = Promise.resolve(); > + > + let types = CB_TYPES.concat(CB_TYPES_UNSUPPORTED); > + for (let i = 0; i < types.length; i++) { for .. of @@ +73,5 @@ > + let promise = Promise.resolve(); > + > + let types = CB_TYPES.concat(CB_TYPES_UNSUPPORTED); > + for (let i = 0; i < types.length; i++) { > + for (let j = 0; j < OPERATION_UNSUPPORTED.length; j++) { for .. of @@ +91,5 @@ > + // Deactivate call barring service. > + .then(() => testCallBarring(false)) > + // Test unsupported call barring types. > + .then(() => testUnsupportType()) > + // Test unsupported operation. Some comments here are redundant. The function names clearly convey the meaning. ::: dom/telephony/test/marionette/test_mmi_call_waiting.js @@ +5,5 @@ > +MARIONETTE_HEAD_JS = "head.js"; > + > +const TEST_DATA = [ > + // [mmi, expectedError] > + // Currently emulator doesn't support REQUEST_GET_CLIR, so we expect to get a wrong comment, not CLIR @@ +8,5 @@ > + // [mmi, expectedError] > + // Currently emulator doesn't support REQUEST_GET_CLIR, so we expect to get a > + // 'RequestNotSupported' error here. > + ["*#43*10#", "RequestNotSupported"], > + // Currently emulator doesn't support REQUEST_SET_CLIR, so we expect to get a wrong comment, not CLIR @@ +21,5 @@ > +function testCallWaiting(aMmi, aExpectedError) { > + log("Test " + aMmi + " ..."); > + > + return gSendMMI(aMmi).then(aResult => { > + ok(!aResult.success, "Check success"); It's better to add a comment that explains why all the operations are failed. @@ +31,5 @@ > +// Start test > +startTest(function() { > + let promise = Promise.resolve(); > + > + for (let i = 0; i < TEST_DATA.length; i++) { for .. of ::: dom/telephony/test/marionette/test_mmi_clip.js @@ +19,5 @@ > +function testCLIP(aMmi, aExpectedError) { > + log("Test " + aMmi + " ..."); > + > + return gSendMMI(aMmi).then(aResult => { > + ok(!aResult.success, "Check success"); It's better to add a comment that explains why all the operations are failed. @@ +29,5 @@ > +// Start test > +startTest(function() { > + let promise = Promise.resolve(); > + > + for (let i = 0; i < TEST_DATA.length; i++) { for .. of ::: dom/telephony/test/marionette/test_mmi_clir.js @@ +21,5 @@ > +function testCLIR(aMmi, aExpectedError) { > + log("Test " + aMmi + " ..."); > + > + return gSendMMI(aMmi).then(aResult => { > + ok(!aResult.success, "Check success"); It's better to add a comment that explains why all the operations are failed. @@ +31,5 @@ > +// Start test > +startTest(function() { > + let promise = Promise.resolve(); > + > + for (let i = 0; i < TEST_DATA.length; i++) { for .. of
Attachment #8601991 - Flags: review?(szchen) → review+
Address review comment #16, - Use for ... of - Revise some comments Thank you, Aknow.
Attachment #8601991 - Attachment is obsolete: true
Attachment #8602626 - Flags: review+
Attached patch Part 2: Call forwarding, v2 (obsolete) — Splinter Review
Attachment #8601994 - Attachment is obsolete: true
Attached patch Part 3: Icc lock, v2 (obsolete) — Splinter Review
Attachment #8601996 - Attachment is obsolete: true
Attached patch Part 4: IMEI, v2 (obsolete) — Splinter Review
Attachment #8601999 - Attachment is obsolete: true
Attached patch Part 8: Call barring, v2 (obsolete) — Splinter Review
Attachment #8602011 - Attachment is obsolete: true
Attached patch Part 9: Call waiting, v2 (obsolete) — Splinter Review
Attachment #8602014 - Attachment is obsolete: true
Attached patch Part 10: USSD, v2 (obsolete) — Splinter Review
Attachment #8602017 - Attachment is obsolete: true
Attached patch Part 11: MMI consts, v2 (obsolete) — Splinter Review
Attachment #8602019 - Attachment is obsolete: true
Comment on attachment 8608059 [details] [diff] [review] Part 2: Call forwarding, v2 Review of attachment 8608059 [details] [diff] [review]: ----------------------------------------------------------------- Hi Aknow, I send review request for part2 first. If you are ok with the changes in part2, I will send review requset for the remaining parts then. Thank you.
Attachment #8608059 - Flags: review?(szchen)
Comment on attachment 8608059 [details] [diff] [review] Part 2: Call forwarding, v2 Review of attachment 8608059 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/telephony/gonk/TelephonyService.js @@ +931,5 @@ > + number: aMmi.sia, > + serviceClass: this._siToServiceClass(aMmi.sib), > + }; > + > + if (options.action === RIL.CALL_FORWARD_ACTION_QUERY_STATUS) { Could we redirect the request to mobileConnectionService.getCallForwarding and setCallForwarding instead of doing so by telephonyService? Although it may not reduce the code, I still prefer to have a central point for all the logic. The benefits for this case is that we don't need to have duplicate code for something like: - _rulesToCallForwardingOptions - notifyCFStateChanged Furthermore, I will expect we use the similar way for all MMI codes if we have an explicit API for them.
Attachment #8608059 - Flags: review?(szchen)
(In reply to Szu-Yu Chen [:aknow] from comment #26) > Comment on attachment 8608059 [details] [diff] [review] > Part 2: Call forwarding, v2 > > Review of attachment 8608059 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/telephony/gonk/TelephonyService.js > @@ +931,5 @@ > > + number: aMmi.sia, > > + serviceClass: this._siToServiceClass(aMmi.sib), > > + }; > > + > > + if (options.action === RIL.CALL_FORWARD_ACTION_QUERY_STATUS) { > > Could we redirect the request to mobileConnectionService.getCallForwarding > and setCallForwarding instead of doing so by telephonyService? Although it > may not reduce the code, I still prefer to have a central point for all the > logic. The benefits for this case is that we don't need to have duplicate > code for something like: > - _rulesToCallForwardingOptions > - notifyCFStateChanged > > Furthermore, I will expect we use the similar way for all MMI codes if we > have an explicit API for them. I will try using explicit API, thank you.
Attached patch Part 2: Call forwarding, v3 (obsolete) — Splinter Review
Address comment #26: - Using MobileConnectionService API instead.
Attachment #8608059 - Attachment is obsolete: true
Comment on attachment 8609304 [details] [diff] [review] Part 2: Call forwarding, v3 Review of attachment 8609304 [details] [diff] [review]: ----------------------------------------------------------------- I am still working on other parts, but I would like to have your feedback for this part first. Thank you.
Attachment #8609304 - Flags: feedback?(szchen)
Comment on attachment 8609304 [details] [diff] [review] Part 2: Call forwarding, v3 Review of attachment 8609304 [details] [diff] [review]: ----------------------------------------------------------------- Looks very good. Thank you. ::: dom/telephony/gonk/TelephonyService.js @@ +924,5 @@ > + serviceClass, { > + QueryInterface: XPCOMUtils.generateQI([Ci.nsIMobileConnectionCallback]), > + notifySuccess: function() { > + let statusMessage; > + switch (action) { How about having a mapping table from 'action' to 'statusMessage'? We could define it in ril_consts.js.
Attachment #8609304 - Flags: feedback?(szchen) → feedback+
Attachment #8609304 - Attachment is obsolete: true
Attachment #8608060 - Attachment is obsolete: true
Attached patch Part 4: IMEI, v3 (obsolete) — Splinter Review
Attachment #8608061 - Attachment is obsolete: true
Attached patch Part 6: CLIR, v2 (obsolete) — Splinter Review
Attachment #8602003 - Attachment is obsolete: true
I found some problems on using for .. of, so I change to use forEach.
Attachment #8602626 - Attachment is obsolete: true
Attachment #8610601 - Flags: review+
Attachment #8610601 - Attachment description: 8602626: Part 1: Add more marionette tests for MMI, v4, r=aknow → Part 1: Add more marionette tests for MMI, v4, r=aknow
Depends on: 1169160
Depends on: 1169225
Attached patch Part 5: CLIP, v2 (obsolete) — Splinter Review
Attachment #8602001 - Attachment is obsolete: true
Attachment #8602009 - Attachment is obsolete: true
Attached patch Part 8: Call barring, v3 (obsolete) — Splinter Review
Attachment #8608062 - Attachment is obsolete: true
Attached patch Part 9: Call waiting, v3 (obsolete) — Splinter Review
Attachment #8608063 - Attachment is obsolete: true
Attached patch Part 6: CLIR, v3 (obsolete) — Splinter Review
Attachment #8610593 - Attachment is obsolete: true
Attached patch Part 6: CLIR, v4Splinter Review
Attachment #8615932 - Attachment is obsolete: true
Attached patch Part 11: MMI consts, v3 (obsolete) — Splinter Review
Attachment #8608065 - Attachment is obsolete: true
Attached patch Part 9: Call waiting, v4 (obsolete) — Splinter Review
Attachment #8615923 - Attachment is obsolete: true
Comment on attachment 8610586 [details] [diff] [review] Part 2: Call forwarding, v4 Review of attachment 8610586 [details] [diff] [review]: ----------------------------------------------------------------- I put the MMI consts in TelephonyService, since they are only being used in TelephonyService. And in Part 11, I also move all mmi consts from ril_consts.js to here. Aknow, may I have your review? Thank you.
Attachment #8610586 - Flags: review?(szchen)
Attachment #8610587 - Flags: review?(szchen)
Comment on attachment 8610588 [details] [diff] [review] Part 4: IMEI, v3 Review of attachment 8610588 [details] [diff] [review]: ----------------------------------------------------------------- There is no explicit API for getting imei, so use `sendWorkerMessage`.
Attachment #8610588 - Flags: review?(szchen)
Attachment #8615201 - Flags: review?(szchen)
Comment on attachment 8615201 [details] [diff] [review] Part 5: CLIP, v2 Review of attachment 8615201 [details] [diff] [review]: ----------------------------------------------------------------- There is no explicit API for getting imei, so use `sendWorkerMessage`.
Attachment #8615938 - Flags: review?(szchen)
Attachment #8615202 - Flags: review?(szchen)
Attachment #8615255 - Flags: review?(szchen)
Attachment #8620785 - Flags: review?(szchen)
Comment on attachment 8608064 [details] [diff] [review] Part 10: USSD, v2 Review of attachment 8608064 [details] [diff] [review]: ----------------------------------------------------------------- There is no explicit API for ussd, so use `sendWorkerMessage`.
Attachment #8608064 - Flags: review?(szchen)
Attachment #8615939 - Flags: review?(szchen)
Attachment #8610586 - Flags: review?(szchen) → review+
Comment on attachment 8610587 [details] [diff] [review] Part 3: Icc lock, v3 Review of attachment 8610587 [details] [diff] [review]: ----------------------------------------------------------------- Edgar, Some of the tests in test_ril_worker_mmi.js are removed in your patch. Do we already have the cases that cover the same part? I can see pin and puk related test cases in telephony's marionette cases. However, I can't find anything about pin2 and puk2.
Attachment #8610587 - Flags: review?(szchen) → review-
Comment on attachment 8610588 [details] [diff] [review] Part 4: IMEI, v3 Review of attachment 8610588 [details] [diff] [review]: ----------------------------------------------------------------- r- for test cases question ::: dom/system/gonk/ril_worker.js @@ +4860,1 @@ > // So far we only send the IMEI back to chrome if it was requested via MMI. The comment doesn't really match the code. ::: dom/system/gonk/tests/test_ril_worker_mmi.js @@ +67,5 @@ > ok(context.RIL._ussdSession); > > run_next_test(); > }); > Since you remove some tests here, do we have to add the related ones in other place? ::: dom/telephony/gonk/TelephonyService.js @@ +1069,5 @@ > + * Parsed MMI structure. > + * @param aCallback > + * A nsITelephonyDialCallback object. > + */ > + _getImeiMMI: function(aClientId, aMmi, aCallback) { Imei in lower case looks weird... but I don't have a better idea now.
Attachment #8610588 - Flags: review?(szchen) → review-
Attachment #8615201 - Flags: review?(szchen) → review+
Comment on attachment 8615938 [details] [diff] [review] Part 6: CLIR, v4 Review of attachment 8615938 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/telephony/gonk/TelephonyService.js @@ +60,5 @@ > MMI_SC_TO_LOCK_TYPE[RIL.MMI_SC_PUK2] = Ci.nsIIcc.CARD_LOCK_TYPE_PUK2; > > +const MMI_PROC_TO_CLIR_ACTION = {}; > +MMI_PROC_TO_CLIR_ACTION[RIL.MMI_PROCEDURE_ACTIVATION] = Ci.nsIMobileConnection.CLIR_INVOCATION; > +MMI_PROC_TO_CLIR_ACTION[RIL.MMI_PROCEDURE_DEACTIVATION] = Ci.nsIMobileConnection.CLIR_SUPPRESSION; I am thinking that why don't we just write the object literal here. const MMI_PROC_TO_CLIR_ACTION = { RIL.MMI_PROCEDURE_ACTIVATION: Ci.nsIMobileConnection.CLIR_INVOCATION, RIL.MMI_PROCEDURE_DEACTIVATION: Ci.nsIMobileConnection.CLIR_SUPPRESSION }; How do you think? Will it be more readable? If you agree with me, we could also write other object mappings in this way.
Attachment #8615938 - Flags: review?(szchen) → review+
Attachment #8615202 - Flags: review?(szchen) → review+
Comment on attachment 8615255 [details] [diff] [review] Part 8: Call barring, v3 Review of attachment 8615255 [details] [diff] [review]: ----------------------------------------------------------------- r- for the test coverage. We will have no test cases for call barring mmi code after this patch. ::: dom/telephony/gonk/TelephonyService.js @@ +1356,5 @@ > + let services = []; > + for (let mask = 1; > + mask <= Ci.nsIMobileConnection.ICC_SERVICE_CLASS_MAX; > + mask <<= 1) { > + if ((mask & aServiceClass) !== 0) { We could remove '!== 0' and '()'
Attachment #8615255 - Flags: review?(szchen) → review-
Comment on attachment 8620785 [details] [diff] [review] Part 9: Call waiting, v4 Review of attachment 8620785 [details] [diff] [review]: ----------------------------------------------------------------- r- for the test coverage issue. Some test cases are removed and we have to add them back in somewhere to ensure the quality. ::: dom/telephony/gonk/TelephonyService.js @@ +1411,5 @@ > + _callWaitingMMI: function(aClientId, aMmi, aCallback) { > + if (!this._isRadioOn(aClientId)) { > + aCallback.notifyDialMMIError(RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE); > + return; > + } Is it the case that only IMEI mmi code doesn't require the radio? Could we move the radio check to the beginning of all mmi code so that we don't have to write it everywhere? in _dialMMI(): if (procedure !== RIL.MMI_KS_SC_IMEI && !this._isRadioOn(aClientId)) { // error } @@ +1425,5 @@ > + aCallback.notifyDialMMISuccess(RIL.MMI_SM_KS_SERVICE_DISABLED); > + return; > + } > + > + let services = []; The following part of code is duplicated in _callBarringMMI in part 8. It's better to have an utility function for that. @@ +1430,5 @@ > + for (let mask = Ci.nsIMobileConnection.ICC_SERVICE_CLASS_VOICE; > + mask <= Ci.nsIMobileConnection.ICC_SERVICE_CLASS_MAX; > + mask <<= 1) { > + if ((mask & aServiceClass) !== 0) { > + services.push(RIL.MMI_KS_SERVICE_CLASS_MAPPING[mask]); I think MMI_KS_SERVICE_CLASS_MAPPING is no longer used in ril_worker.js. If it is, we could move it to telephonyService.js
Attachment #8620785 - Flags: review?(szchen) → review-
Comment on attachment 8608064 [details] [diff] [review] Part 10: USSD, v2 Review of attachment 8608064 [details] [diff] [review]: ----------------------------------------------------------------- r- for test cases coverage and some of the logics could be moved from ril_worker to telephonyService. ::: dom/system/gonk/ril_worker.js @@ +1883,5 @@ > + /** > + * Cache the request for send out a new ussd when there is an existing > + * session. We should do cancelUSSD first. > + */ > + cachedUSSDRequest : null, I'd prefer to store cachedUSSDRequest and ussdSession in telephonyService and let ril_worker as simple as possible. Also, maybe we don't need the |cachedUSSDRequest|. We could send out the new quest in the callback of cancelUSSD. ::: dom/telephony/gonk/TelephonyService.js @@ +930,5 @@ > + aCallback.notifyDialMMIError(RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE); > + return; > + } > + > + this._sendToRilWorker(aClientId, "sendUSSD", We have sendUSSD function. How about calling it instead of directly sending the message to ril_worker.
Attachment #8608064 - Flags: review?(szchen) → review-
Comment on attachment 8615939 [details] [diff] [review] Part 11: MMI consts, v3 Review of attachment 8615939 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the huge effort for this bug.
Attachment #8615939 - Flags: review?(szchen) → review+
Attached patch Part 4: IMEI, v4 (obsolete) — Splinter Review
Address review comment 49, - Revise the comments in order to match the code.
Attachment #8610588 - Attachment is obsolete: true
Rebase only.
Attachment #8615201 - Attachment is obsolete: true
Attachment #8631999 - Flags: review+
Address review comment #51, - if (mask & aServiceClass) ...
Attachment #8615255 - Attachment is obsolete: true
Address review comment #52, - Having an utility function for service class parsing.
Attachment #8620785 - Attachment is obsolete: true
Attached patch Part 10: USSD, v3 (obsolete) — Splinter Review
Address review comment #53, - Move cachedUSSDRequest and _ussdSession from ril_worker to telephonyService.
Attachment #8608064 - Attachment is obsolete: true
Rebase only.
Attachment #8615939 - Attachment is obsolete: true
Attachment #8632056 - Flags: review+
Attachment #8631533 - Attachment is obsolete: true
Comment on attachment 8632407 [details] [diff] [review] Part 1-2: Add MMI tests for pin2, puk2 and ussd, v2 Review of attachment 8632407 [details] [diff] [review]: ----------------------------------------------------------------- Add marionette tests for pin2, puk2 and also ussd (will squash with part 1 after review+).
Attachment #8632407 - Flags: review?(szchen)
Comment on attachment 8610587 [details] [diff] [review] Part 3: Icc lock, v3 Review of attachment 8610587 [details] [diff] [review]: ----------------------------------------------------------------- (In reply to Szu-Yu Chen [:aknow] from comment #48) > Comment on attachment 8610587 [details] [diff] [review] > Part 3: Icc lock, v3 > > Review of attachment 8610587 [details] [diff] [review]: > ----------------------------------------------------------------- > > Edgar, > Some of the tests in test_ril_worker_mmi.js are removed in your patch. Do we > already have the cases that cover the same part? > I can see pin and puk related test cases in telephony's marionette cases. > However, I can't find anything about pin2 and puk2. The tests for pin2 and puk2 are in part1-2 (see comment #64).
Attachment #8610587 - Flags: review- → review?(szchen)
Comment on attachment 8631998 [details] [diff] [review] Part 4: IMEI, v4 Review of attachment 8631998 [details] [diff] [review]: ----------------------------------------------------------------- (In reply to Szu-Yu Chen [:aknow] from comment #49) > Comment on attachment 8610588 [details] [diff] [review] > Part 4: IMEI, v3 > > Review of attachment 8610588 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/system/gonk/ril_worker.js > @@ +4860,1 @@ > > // So far we only send the IMEI back to chrome if it was requested via MMI. > > The comment doesn't really match the code. Have addressed in this version. > ::: dom/system/gonk/tests/test_ril_worker_mmi.js > @@ +67,5 @@ > > Since you remove some tests here, do we have to add the related ones in > other place? There is a marionette test for getting IMSI via MMI, https://dxr.mozilla.org/mozilla-central/source/dom/telephony/test/marionette/test_mmi.js.
Attachment #8631998 - Flags: review?(szchen)
Comment on attachment 8632001 [details] [diff] [review] Part 8: Call barring, v4 Review of attachment 8632001 [details] [diff] [review]: ----------------------------------------------------------------- (In reply to Szu-Yu Chen [:aknow] from comment #51) > Comment on attachment 8615255 [details] [diff] [review] > Part 8: Call barring, v3 > > Review of attachment 8615255 [details] [diff] [review]: > ----------------------------------------------------------------- > > r- for the test coverage. We will have no test cases for call barring mmi > code after this patch. I have added a marionette test for call barring in part 1. > ::: dom/telephony/gonk/TelephonyService.js > @@ +1356,5 @@ > > + let services = []; > > + for (let mask = 1; > > + mask <= Ci.nsIMobileConnection.ICC_SERVICE_CLASS_MAX; > > + mask <<= 1) { > > + if ((mask & aServiceClass) !== 0) { > > We could remove '!== 0' and '()' Have addressed in this version.
Attachment #8632001 - Flags: review?(szchen)
Comment on attachment 8632015 [details] [diff] [review] Part 9: Call waiting, v5 Review of attachment 8632015 [details] [diff] [review]: ----------------------------------------------------------------- (In reply to Szu-Yu Chen [:aknow] from comment #52) > Comment on attachment 8620785 [details] [diff] [review] > Part 9: Call waiting, v4 > > Review of attachment 8620785 [details] [diff] [review]: > ----------------------------------------------------------------- > > r- for the test coverage issue. Some test cases are removed and we have to > add them back in somewhere to ensure the quality. I have added a marionette test for call waiting in part 1. > ::: dom/telephony/gonk/TelephonyService.js > @@ +1411,5 @@ > > + _callWaitingMMI: function(aClientId, aMmi, aCallback) { > > + if (!this._isRadioOn(aClientId)) { > > + aCallback.notifyDialMMIError(RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE); > > + return; > > + } > > Is it the case that only IMEI mmi code doesn't require the radio? > > Could we move the radio check to the beginning of all mmi code so that we > don't have to write it everywhere? Thank for the suggestion, I addressed this in part 12. > @@ +1425,5 @@ > > + aCallback.notifyDialMMISuccess(RIL.MMI_SM_KS_SERVICE_DISABLED); > > + return; > > + } > > + > > + let services = []; > > The following part of code is duplicated in _callBarringMMI in part 8. It's > better to have an utility function for that. Have addressed in this version. > @@ +1430,5 @@ > > + for (let mask = Ci.nsIMobileConnection.ICC_SERVICE_CLASS_VOICE; > > + mask <= Ci.nsIMobileConnection.ICC_SERVICE_CLASS_MAX; > > + mask <<= 1) { > > + if ((mask & aServiceClass) !== 0) { > > + services.push(RIL.MMI_KS_SERVICE_CLASS_MAPPING[mask]); > > I think MMI_KS_SERVICE_CLASS_MAPPING is no longer used in ril_worker.js. If > it is, we could move it to telephonyService.js Already handle this in part 11.
Attachment #8632015 - Flags: review?(szchen)
Comment on attachment 8632051 [details] [diff] [review] Part 10: USSD, v3 Review of attachment 8632051 [details] [diff] [review]: ----------------------------------------------------------------- (In reply to Szu-Yu Chen [:aknow] from comment #53) > Comment on attachment 8608064 [details] [diff] [review] > Part 10: USSD, v2 > > Review of attachment 8608064 [details] [diff] [review]: > ----------------------------------------------------------------- > > r- for test cases coverage and some of the logics could be moved from > ril_worker to telephonyService. The test for ussd is added in part1-2 (see comment #64). > > ::: dom/system/gonk/ril_worker.js > @@ +1883,5 @@ > > I'd prefer to store cachedUSSDRequest and ussdSession in telephonyService > and let ril_worker as simple as possible. Also, maybe we don't need the > |cachedUSSDRequest|. We could send out the new quest in the callback of > cancelUSSD. Have addressed in this version. > > ::: dom/telephony/gonk/TelephonyService.js > @@ +930,5 @@ > > + aCallback.notifyDialMMIError(RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE); > > + return; > > + } > > + > > + this._sendToRilWorker(aClientId, "sendUSSD", > > We have sendUSSD function. How about calling it instead of directly sending > the message to ril_worker. We can not reuse sendUSSD directly because the MMI operation has different callback. So I introduce new utility functions, _sendUSSDInternal and _cancelUSSDInternal, for the common code.
Attachment #8632051 - Flags: review?(szchen)
Attachment #8632068 - Flags: review?(szchen)
Comment on attachment 8632407 [details] [diff] [review] Part 1-2: Add MMI tests for pin2, puk2 and ussd, v2 Review of attachment 8632407 [details] [diff] [review]: ----------------------------------------------------------------- The style of test_mmi_unlock_puk.js and test_mmi_unlick_puk2.js are quite different. Would you like to unify them in this patch?
Attachment #8632407 - Flags: review?(szchen) → review+
Attachment #8610587 - Flags: review?(szchen) → review+
Comment on attachment 8631998 [details] [diff] [review] Part 4: IMEI, v4 Review of attachment 8631998 [details] [diff] [review]: ----------------------------------------------------------------- Please also rename the test case "test_mmi.js" to "test_mmi_imei.js" in this patch.
Attachment #8631998 - Flags: review?(szchen) → review+
(In reply to Szu-Yu Chen [:aknow] from comment #70) > Comment on attachment 8632407 [details] [diff] [review] > Part 1-2: Add MMI tests for pin2, puk2 and ussd, v2 > > Review of attachment 8632407 [details] [diff] [review]: > ----------------------------------------------------------------- > > The style of test_mmi_unlock_puk.js and test_mmi_unlick_puk2.js are quite > different. Would you like to unify them in this patch? Okay, will do that. Thank you.
(In reply to Szu-Yu Chen [:aknow] from comment #71) > Comment on attachment 8631998 [details] [diff] [review] > Part 4: IMEI, v4 > > Review of attachment 8631998 [details] [diff] [review]: > ----------------------------------------------------------------- > > Please also rename the test case "test_mmi.js" to "test_mmi_imei.js" in this > patch. Okay, will do that. Thank you.
Comment on attachment 8632001 [details] [diff] [review] Part 8: Call barring, v4 Review of attachment 8632001 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for not notice the test case in part 1. The patch looks good to me. Thank you.
Attachment #8632001 - Flags: review?(szchen) → review+
Attachment #8632015 - Flags: review?(szchen) → review+
Comment on attachment 8632051 [details] [diff] [review] Part 10: USSD, v3 Review of attachment 8632051 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +5093,3 @@ > this.sendChromeMessage({rilMessageType: "ussdreceived", > message: message, > + sessionEnded: typeCode !== "1"}); It will be better to have a comment here for the magic "1" so that we don't have to refer to spec or ril.h. ::: dom/telephony/gonk/TelephonyService.js @@ +271,5 @@ > + * to exist until: > + * a) There's a call to cancelUSSD() > + * b) Receiving a session end unsolicited event. > + */ > + _ussdSession: false, Just realized that we should make it multi-sim-compatible. I am sorry that I am not aware of this in the previous review. Maybe we should change it to an array because each client could have an ussd session.
Attachment #8632051 - Flags: review?(szchen) → review-
Attachment #8632068 - Flags: review?(szchen) → review+
(In reply to Szu-Yu Chen [:aknow] from comment #75) > Comment on attachment 8632051 [details] [diff] [review] > Part 10: USSD, v3 > > Review of attachment 8632051 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/system/gonk/ril_worker.js > @@ +5093,3 @@ > > this.sendChromeMessage({rilMessageType: "ussdreceived", > > message: message, > > + sessionEnded: typeCode !== "1"}); > > It will be better to have a comment here for the magic "1" so that we don't > have to refer to spec or ril.h. Will do. > > ::: dom/telephony/gonk/TelephonyService.js > @@ +271,5 @@ > > + * to exist until: > > + * a) There's a call to cancelUSSD() > > + * b) Receiving a session end unsolicited event. > > + */ > > + _ussdSession: false, > > Just realized that we should make it multi-sim-compatible. I am sorry that I > am not aware of this in the previous review. Maybe we should change it to an > array because each client could have an ussd session. Thanks for catching this. I didn't notice it, either. Will address it in next version.
Depends on: 1183578
1. Squash with part 1-2. 2. Address review comment #70.
Attachment #8610601 - Attachment is obsolete: true
Attachment #8632407 - Attachment is obsolete: true
Attachment #8633910 - Flags: review+
Address review comment #71.
Attachment #8631998 - Attachment is obsolete: true
Attachment #8633914 - Flags: review+
Address review comment #75.
Attachment #8632051 - Attachment is obsolete: true
Attachment #8633939 - Flags: review?(szchen)
Comment on attachment 8633939 [details] [diff] [review] Part 10: USSD, v4 Review of attachment 8633939 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Thank you.
Attachment #8633939 - Flags: review?(szchen) → review+
Blocks: 1191205
No longer blocks: 1191205
Depends on: 1191205
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: