Bug 1155072 - Part 1: Deprecate nsITelephonyListener.conferenceCallStateChanged (Telephony). r=btseng

This commit is contained in:
Ben Hsu 2015-10-12 01:47:00 +02:00
parent 141b6799dc
commit cd4cd3c6b8
10 changed files with 24 additions and 84 deletions

View File

@ -344,7 +344,7 @@ Telephony::HandleCallInfo(nsITelephonyCallInfo* aInfo)
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
}
}
// Update an existing call
call->UpdateEmergency(isEmergency);
@ -723,6 +723,7 @@ Telephony::WindowAudioCaptureChanged()
NS_IMETHODIMP
Telephony::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllInfo)
{
// Update call state
nsresult rv;
for (uint32_t i = 0; i < aLength; ++i) {
rv = HandleCallInfo(aAllInfo[i]);
@ -731,6 +732,9 @@ Telephony::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllInfo)
}
}
// Update conference state
mGroup->ChangeState();
rv = HandleAudioAgentState();
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -744,17 +748,6 @@ Telephony::EnumerateCallState(nsITelephonyCallInfo* aInfo)
return HandleCallInfo(aInfo);
}
NS_IMETHODIMP
Telephony::ConferenceCallStateChanged(uint16_t aCallState)
{
// The current design of Telephony Stack gaurantees that the calls within a
// call group are updated before this method being called, so we can let a
// call update its state by its own, and we can discard |aCallState| here.
// Anyway, this method is going to be deprecated in Bug 1155072.
mGroup->ChangeState();
return NS_OK;
}
NS_IMETHODIMP
Telephony::EnumerateCallStateComplete()
{

View File

@ -369,7 +369,6 @@ function TelephonyService() {
this._isDialing = false;
this._cachedDialRequest = null;
this._currentCalls = {};
this._currentConferenceState = nsITelephonyService.CALL_STATE_UNKNOWN;
this._audioStates = [];
this._ussdSessions = [];
@ -2040,7 +2039,6 @@ TelephonyService.prototype = {
calls.push(call);
}
this._handleCallStateChanged(aClientId, calls);
this._handleConferenceCallStateChanged(nsITelephonyService.CALL_STATE_CONNECTED);
aCallback.notifySuccess();
});
@ -2084,7 +2082,6 @@ TelephonyService.prototype = {
parentCall.isSwitchable = true;
parentCall.isMergeable = true;
this._handleCallStateChanged(aClientId, [childCall, parentCall]);
this._handleConferenceCallStateChanged(nsITelephonyService.CALL_STATE_UNKNOWN);
},
// See 3gpp2, S.R0006-522-A v1.0. Table 4, XID 6S.
@ -2128,11 +2125,24 @@ TelephonyService.prototype = {
return;
}
let foreground = this._currentConferenceState == nsITelephonyService.CALL_STATE_CONNECTED;
this._sendToRilWorker(aClientId,
foreground ? "hangUpForeground" : "hangUpBackground",
null,
this._defaultCallbackHandler.bind(this, aCallback));
// Find a conference call, and send the corresponding request to RIL worker.
for (let index in this._currentCalls[aClientId]) {
let call = this._currentCalls[aClientId][index];
if (!call.isConference) {
continue;
}
let command = call.state === nsITelephonyService.CALL_STATE_CONNECTED ?
"hangUpForeground" : "hangUpBackground";
this._sendToRilWorker(aClientId, command, null,
this._defaultCallbackHandler.bind(this, aCallback));
return;
}
// There is no conference call.
if (DEBUG) debug("hangUpConference: " +
"No conference call in modem[" + aClientId + "].");
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
},
_switchConference: function(aClientId, aCallback) {
@ -2354,12 +2364,6 @@ TelephonyService.prototype = {
this._handleCallStateChanged(aClientId, [...changedCalls]);
// Should handle conferenceCallStateChange after callStateChanged and
// callDisconnected.
if (newConferenceState != this._currentConferenceState) {
this._handleConferenceCallStateChanged(newConferenceState);
}
this._updateAudioState(aClientId);
// Handle cached dial request.
@ -2439,12 +2443,6 @@ TelephonyService.prototype = {
[aClientId, callIndex, notification]);
},
_handleConferenceCallStateChanged: function(aState) {
if (DEBUG) debug("handleConferenceCallStateChanged: " + aState);
this._currentConferenceState = aState;
this._notifyAllListeners("conferenceCallStateChanged", [aState]);
},
notifyUssdReceived: function(aClientId, aMessage, aSessionEnded) {
if (DEBUG) {
debug("notifyUssdReceived for " + aClientId + ": " +

View File

@ -97,7 +97,6 @@ this.TelephonyUtils = {
resolve();
}
},
conferenceCallStateChanged: function() {},
supplementaryServiceNotification: function() {},
notifyError: function() {},
notifyCdmaCallWaiting: function() {},

View File

@ -129,8 +129,6 @@ child:
NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
NotifyConferenceCallStateChanged(uint16_t aCallState);
NotifyConferenceError(nsString aName, nsString aMessage);
NotifySupplementaryService(uint32_t aClientId, int32_t aCallIndex,

View File

@ -80,15 +80,6 @@ TelephonyChild::RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
return true;
}
bool
TelephonyChild::RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState)
{
MOZ_ASSERT(mService);
mService->ConferenceCallStateChanged(aCallState);
return true;
}
bool
TelephonyChild::RecvNotifyConferenceError(const nsString& aName,
const nsString& aMessage)

View File

@ -41,9 +41,6 @@ protected:
RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
const IPCCdmaWaitingCallData& aData) override;
virtual bool
RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) override;
virtual bool
RecvNotifyConferenceError(const nsString& aName,
const nsString& aMessage) override;

View File

@ -376,15 +376,6 @@ TelephonyIPCService::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** a
return NS_OK;
}
NS_IMETHODIMP
TelephonyIPCService::ConferenceCallStateChanged(uint16_t aCallState)
{
for (uint32_t i = 0; i < mListeners.Length(); i++) {
mListeners[i]->ConferenceCallStateChanged(aCallState);
}
return NS_OK;
}
NS_IMETHODIMP
TelephonyIPCService::EnumerateCallStateComplete()
{

View File

@ -286,15 +286,6 @@ TelephonyParent::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllI
return SendNotifyCallStateChanged(allInfo) ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TelephonyParent::ConferenceCallStateChanged(uint16_t aCallState)
{
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
return SendNotifyConferenceCallStateChanged(aCallState) ? NS_OK
: NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TelephonyParent::EnumerateCallStateComplete()
{
@ -381,12 +372,6 @@ TelephonyRequestParent::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo*
MOZ_CRASH("Not a TelephonyParent!");
}
NS_IMETHODIMP
TelephonyRequestParent::ConferenceCallStateChanged(uint16_t aCallState)
{
MOZ_CRASH("Not a TelephonyParent!");
}
NS_IMETHODIMP
TelephonyRequestParent::EnumerateCallStateComplete()
{

View File

@ -7,7 +7,7 @@
interface nsIMobileCallForwardingOptions;
interface nsITelephonyCallInfo;
[scriptable, uuid(80faf34e-286b-4487-bd55-135bd92668b9)]
[scriptable, uuid(baa9f5f3-5cab-40e0-81e9-ae0abd917907)]
interface nsITelephonyListener : nsISupports
{
/**
@ -29,17 +29,6 @@ interface nsITelephonyListener : nsISupports
void callStateChanged(in unsigned long length,
[array, size_is(length)] in nsITelephonyCallInfo allInfo);
/**
* Called when participants of a conference call have been updated, and the
* conference call state changes.
*
* @param callState
* Possible values are: nsITelephonyService::CALL_STATE_UNKNOWN,
* nsITelephonyService::CALL_STATE_HELD,
* nsITelephonyService::CALL_STATE_CONNECTED.
*/
void conferenceCallStateChanged(in unsigned short callState);
/**
* Notify when RIL receives supplementary service notification.
*

View File

@ -45,7 +45,6 @@ function waitForStateChanged(aPredicate) {
}
},
conferenceCallStateChanged: function() {},
supplementaryServiceNotification: function() {},
notifyError: function() {},
notifyCdmaCallWaiting: function() {},