Bug 963813 - Make sure no another outgoing call when there's already one. r=aknow, a=1.3+
authorHsin-Yi Tsai <htsai@mozilla.com>
Wed, 29 Jan 2014 14:27:22 +0800
changeset 175144 ab540076cb46d29e733b3056cf2ab6a7efcc521d
parent 175143 f98bf9a4df97ddc24d3be275d569692ae0092b04
child 175145 662ce8f620a9ff50da6c2ecf656f9d87b940c9ac
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaknow, 1
bugs963813
milestone28.0a2
Bug 963813 - Make sure no another outgoing call when there's already one. r=aknow, a=1.3+
dom/telephony/Telephony.cpp
dom/telephony/TelephonyCall.cpp
dom/telephony/TelephonyCall.h
--- a/dom/telephony/Telephony.cpp
+++ b/dom/telephony/Telephony.cpp
@@ -216,18 +216,17 @@ Telephony::ProvidedOrDefaultServiceId(co
   }
 }
 
 bool
 Telephony::HasDialingCall()
 {
   for (uint32_t i = 0; i < mCalls.Length(); i++) {
     const nsRefPtr<TelephonyCall>& call = mCalls[i];
-    if (call->IsOutgoing() &&
-        call->CallState() > nsITelephonyProvider::CALL_STATE_UNKNOWN &&
+    if (call->CallState() > nsITelephonyProvider::CALL_STATE_UNKNOWN &&
         call->CallState() < nsITelephonyProvider::CALL_STATE_CONNECTED) {
       return true;
     }
   }
 
   return false;
 }
 
--- a/dom/telephony/TelephonyCall.cpp
+++ b/dom/telephony/TelephonyCall.cpp
@@ -42,18 +42,17 @@ TelephonyCall::Create(Telephony* aTeleph
   call->ChangeStateInternal(aCallState, false);
 
   return call.forget();
 }
 
 TelephonyCall::TelephonyCall()
   : mCallIndex(kOutgoingPlaceholderCallIndex),
     mCallState(nsITelephonyProvider::CALL_STATE_UNKNOWN),
-    mLive(false),
-    mOutgoing(false)
+    mLive(false)
 {
   SetIsDOMBinding();
 }
 
 TelephonyCall::~TelephonyCall()
 {
 }
 
@@ -102,20 +101,16 @@ TelephonyCall::ChangeStateInternal(uint1
       break;
     default:
       NS_NOTREACHED("Unknown state!");
   }
 
   mState = stateString;
   mCallState = aCallState;
 
-  if (aCallState == nsITelephonyProvider::CALL_STATE_DIALING) {
-    mOutgoing = true;
-  }
-
   if (aCallState == nsITelephonyProvider::CALL_STATE_DISCONNECTED) {
     NS_ASSERTION(mLive, "Should be live!");
     if (mGroup) {
       mGroup->RemoveCall(this);
     } else {
       mTelephony->RemoveCall(this);
     }
     mLive = false;
--- a/dom/telephony/TelephonyCall.h
+++ b/dom/telephony/TelephonyCall.h
@@ -26,17 +26,16 @@ class TelephonyCall MOZ_FINAL : public n
   nsString mSecondNumber;
   nsString mState;
   bool mEmergency;
   nsRefPtr<DOMError> mError;
 
   uint32_t mCallIndex;
   uint16_t mCallState;
   bool mLive;
-  bool mOutgoing;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCall,
                                            nsDOMEventTargetHelper)
 
   friend class Telephony;
@@ -152,22 +151,16 @@ public:
   }
 
   void
   UpdateSecondNumber(const nsAString& aNumber)
   {
     mSecondNumber = aNumber;
   }
 
-  bool
-  IsOutgoing() const
-  {
-    return mOutgoing;
-  }
-
   void
   NotifyError(const nsAString& aError);
 
   void
   ChangeGroup(TelephonyCallGroup* aGroup);
 
 private:
   TelephonyCall();