Bug 1147842 - Fix defect of setting call started time. r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Sun, 29 Mar 2015 21:54:57 +0800
changeset 266706 17b24c5f7773f6c05e33250bb130f8d01c88c846
parent 266705 4ed5777cdfe760feb0b7fba75bba70f0fefbf182
child 266710 9c786bf6a7ff4b00d84bd5a1c2218a30ba976c2d
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1147842
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1147842 - Fix defect of setting call started time. r=hsinyi
dom/telephony/gonk/TelephonyService.js
--- a/dom/telephony/gonk/TelephonyService.js
+++ b/dom/telephony/gonk/TelephonyService.js
@@ -997,35 +997,35 @@ TelephonyService.prototype = {
    *
    * @return Boolean to indicate whether the data is changed.
    */
   _updateCallFromRil: function(aCall, aRilCall) {
     aRilCall.state = this._convertRILCallState(aRilCall.state);
     aRilCall.number = this._formatInternationalNumber(aRilCall.number,
                                                       aRilCall.toa);
 
-    if (!aCall.started &&
-        aCall.state == nsITelephonyService.CALL_STATE_CONNECTED) {
-      aCall.started = new Date().getTime();
-    }
-
     let change = false;
     const key = ["state", "number", "numberPresentation", "name",
                  "namePresentation"];
 
     for (let k of key) {
       if (aCall[k] != aRilCall[k]) {
         aCall[k] = aRilCall[k];
         change = true;
       }
     }
 
     aCall.isOutgoing = !aRilCall.isMT;
     aCall.isEmergency = gDialNumberUtils.isEmergency(aCall.number);
 
+    if (!aCall.started &&
+        aCall.state == nsITelephonyService.CALL_STATE_CONNECTED) {
+      aCall.started = new Date().getTime();
+    }
+
     return change;
   },
 
   /**
    * Identify the conference group.
    * Return the conference state and a array of calls in group.
    *
    * TODO: handle multi-sim case.