Bug 1016849 - Part 4: Remove isActive (provider). r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Thu, 29 May 2014 00:16:00 -0400
changeset 185481 24c221634316aedb8dbfec1c461fcb9bdfe4ecd9
parent 185480 45fbee730e464a3dbc5edab8ee918f78723cfa85
child 185482 f534cf63bf44176f113b5d627c5e1c5ae98bbf8a
push id7464
push userryanvm@gmail.com
push dateThu, 29 May 2014 12:44:24 +0000
treeherderb2g-inbound@24c221634316 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1016849
milestone32.0a1
Bug 1016849 - Part 4: Remove isActive (provider). r=hsinyi
dom/telephony/gonk/TelephonyProvider.js
--- a/dom/telephony/gonk/TelephonyProvider.js
+++ b/dom/telephony/gonk/TelephonyProvider.js
@@ -236,29 +236,26 @@ TelephonyProvider.prototype = {
       }
       return;
     }
 
     switch (aCall.state) {
       case nsITelephonyProvider.CALL_STATE_DIALING: // Fall through...
       case nsITelephonyProvider.CALL_STATE_ALERTING:
       case nsITelephonyProvider.CALL_STATE_CONNECTED:
-        aCall.isActive = true;
         this._activeCall = new SingleCall(aCall);
         this._updateCallAudioState(aCall);
         break;
 
       case nsITelephonyProvider.CALL_STATE_INCOMING:
-        aCall.isActive = false;
         this._updateCallAudioState(aCall);
         break;
 
       case nsITelephonyProvider.CALL_STATE_HELD: // Fall through...
       case nsITelephonyProvider.CALL_STATE_DISCONNECTED:
-        aCall.isActive = false;
         if (this._matchActiveSingleCall(aCall)) {
           // Previously active call is not active now.
           this._activeCall = null;
           this._updateCallAudioState(aCall);
         }
         break;
     }
   },
@@ -354,17 +351,16 @@ TelephonyProvider.prototype = {
     this._getClient(aClientId).sendWorkerMessage("enumerateCalls", null,
                                                  (function(response) {
       if (!this._currentCalls[aClientId]) {
         this._currentCalls[aClientId] = {};
       }
       for (let call of response.calls) {
         call.clientId = aClientId;
         call.state = this._convertRILCallState(call.state);
-        call.isActive = this._matchActiveSingleCall(call);
         call.isSwitchable = true;
         call.isMergeable = true;
 
         this._currentCalls[aClientId][call.callIndex] = call;
       }
 
       return false;
     }).bind(this));
@@ -399,18 +395,17 @@ TelephonyProvider.prototype = {
     for (let cid = 0; cid < this._numClients; ++cid) {
       let calls = this._currentCalls[cid];
       if (!calls) {
         continue;
       }
       for (let i = 0, indexes = Object.keys(calls); i < indexes.length; ++i) {
         let call = calls[indexes[i]];
         aListener.enumerateCallState(call.clientId, call.callIndex,
-                                     call.state, call.number,
-                                     call.isActive, call.isOutgoing,
+                                     call.state, call.number, call.isOutgoing,
                                      call.isEmergency, call.isConference,
                                      call.isSwitchable, call.isMergeable);
       }
     }
     aListener.enumerateCallStateComplete();
   },
 
   isDialing: false,
@@ -769,17 +764,16 @@ TelephonyProvider.prototype = {
     this._updateActiveCall(aCall, null);
 
     if (!aCall.failCause ||
         aCall.failCause === RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
       this._notifyAllListeners("callStateChanged", [aClientId,
                                                     aCall.callIndex,
                                                     aCall.state,
                                                     aCall.number,
-                                                    aCall.isActive,
                                                     aCall.isOutgoing,
                                                     aCall.isEmergency,
                                                     aCall.isConference,
                                                     aCall.isSwitchable,
                                                     aCall.isMergeable]);
     } else {
       this._notifyAllListeners("notifyError",
                                [aClientId, aCall.callIndex, aCall.failCause]);
@@ -823,17 +817,16 @@ TelephonyProvider.prototype = {
     aCall.clientId = aClientId;
     this._updateActiveCall(aCall, null);
 
     let call = this._currentCalls[aClientId][aCall.callIndex];
     if (call) {
       call.state = aCall.state;
       call.isConference = aCall.isConference;
       call.isEmergency = aCall.isEmergency;
-      call.isActive = aCall.isActive;
       call.isSwitchable = aCall.isSwitchable != null ?
                           aCall.isSwitchable : call.isSwitchable;
       call.isMergeable = aCall.isMergeable != null ?
                          aCall.isMergeable : call.isMergeable;
     } else {
       call = aCall;
       call.isSwitchable = aCall.isSwitchable != null ?
                           aCall.isSwitchable : true;
@@ -842,17 +835,16 @@ TelephonyProvider.prototype = {
 
       this._currentCalls[aClientId][aCall.callIndex] = call;
     }
 
     this._notifyAllListeners("callStateChanged", [aClientId,
                                                   call.callIndex,
                                                   call.state,
                                                   call.number,
-                                                  call.isActive,
                                                   call.isOutgoing,
                                                   call.isEmergency,
                                                   call.isConference,
                                                   call.isSwitchable,
                                                   call.isMergeable]);
   },
 
   notifyCdmaCallWaiting: function(aClientId, aNumber) {