Bug 1191237 - Part 1: Enhance |TelephonyService.js|. r=aknow
authorBen Hsu <driftersprt@gmail.com>
Thu, 06 Aug 2015 10:20:00 +0200
changeset 288429 9ba92e1ffa2d21377c984922cf6d5e855ab788bd
parent 288428 38184025d155d3f3c1d807cdd3aa7c680150de29
child 288430 8fdce5ed302ae77e6a6c0b1bf3c190018e27aef7
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaknow
bugs1191237
milestone42.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 1191237 - Part 1: Enhance |TelephonyService.js|. r=aknow
dom/telephony/gonk/TelephonyService.js
--- a/dom/telephony/gonk/TelephonyService.js
+++ b/dom/telephony/gonk/TelephonyService.js
@@ -2357,16 +2357,20 @@ TelephonyService.prototype = {
   },
 
   /**
    * Handle call state changes.
    */
   _handleCallStateChanged: function(aClientId, aCalls) {
     if (DEBUG) debug("handleCallStateChanged: " + JSON.stringify(aCalls));
 
+    if (aCalls.length === 0) {
+      return;
+    }
+
     if (aCalls.some(call => call.state == nsITelephonyService.CALL_STATE_DIALING)) {
       gTelephonyMessenger.notifyNewCall();
     }
 
     let allInfo = aCalls.map(call => new TelephonyCallInfo(call));
     this._notifyAllListeners("callStateChanged", [allInfo.length, allInfo]);
   },