Backout 1675a6451849 (Bug 765684) due to missing r= in comments.

This commit is contained in:
Hsin-Yi Tsai 2012-06-22 10:23:55 +08:00
Родитель e1578af8d3
Коммит 5d9333f4b7
1 изменённых файлов: 15 добавлений и 22 удалений

Просмотреть файл

@ -478,33 +478,26 @@ Telephony::EnumerateCallState(PRUint32 aCallIndex, PRUint16 aCallState,
NS_IMETHODIMP
Telephony::NotifyError(PRInt32 aCallIndex,
const nsAString& aError)
const nsAString& aError)
{
nsRefPtr<TelephonyCall> callToNotify;
if (!mCalls.IsEmpty()) {
// The connection is not established yet. Get the latest call object.
if (aCallIndex == -1) {
callToNotify = mCalls[mCalls.Length() - 1];
} else {
// The connection has been established. Get the failed call.
for (PRUint32 index = 0; index < mCalls.Length(); index++) {
nsRefPtr<TelephonyCall>& call = mCalls[index];
if (call->CallIndex() == aCallIndex) {
callToNotify = call;
break;
}
}
PRInt32 index = -1;
PRInt32 length = mCalls.Length();
// The connection is not established yet, remove the latest call object
if (aCallIndex == -1) {
if (length > 0) {
index = length - 1;
}
} else {
if (aCallIndex < 0 || aCallIndex >= length) {
return NS_ERROR_INVALID_ARG;
}
index = aCallIndex;
}
if (!callToNotify) {
NS_ERROR("Don't call me with a bad call index!");
return NS_ERROR_UNEXPECTED;
if (index != -1) {
mCalls[index]->NotifyError(aError);
}
// Set the call state to 'disconnected' and remove it from the calls list.
callToNotify->NotifyError(aError);
return NS_OK;
}