Merge birch to m-c.

This commit is contained in:
Ryan VanderMeulen 2013-05-08 09:59:16 -04:00
commit 00ff98a916
4 changed files with 33 additions and 17 deletions

View File

@ -1351,9 +1351,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
break;
default:
NS_WARNING("Not handling state changed");
sCINDItems[CINDType::CALL].value = CallState::NO_CALL;
sCINDItems[CINDType::CALLSETUP].value = CallSetupState::NO_CALLSETUP;
sCINDItems[CINDType::CALLHELD].value = CallHeldState::NO_CALLHELD;
break;
}
}

View File

@ -1077,7 +1077,8 @@ MmsService.prototype = {
},
/**
* A helper function to broadcast the mms sent system message and notify observers.
* A helper function to broadcast system message and notify observers that
* an MMS is sent.
*
* @params aDomMessage
* The nsIDOMMozMmsMessage object.
@ -1091,7 +1092,8 @@ MmsService.prototype = {
},
/**
* A helper function to broadcast the mms received system message and notify observers.
* A helper function to broadcast system message and notify observers that
* an MMS is received.
*
* @params aDomMessage
* The nsIDOMMozMmsMessage object.
@ -1100,7 +1102,7 @@ MmsService.prototype = {
// Broadcasting a 'sms-received' system message to open apps.
this.broadcastMmsSystemMessage("sms-received", aDomMessage);
// Notifying observers an MMS message is comming.
// Notifying observers an MMS message is received.
Services.obs.notifyObservers(aDomMessage, kSmsReceivedObserverTopic, null);
},
@ -1142,6 +1144,12 @@ MmsService.prototype = {
gMobileMessageDatabaseService.saveReceivedMessage(savableMessage,
(function (rv, domMessage) {
let success = Components.isSuccessCode(rv);
// Cite 6.2.1 "Transaction Flow" in OMA-TS-MMS_ENC-V1_3-20110913-A:
// The M-NotifyResp.ind response PDU SHALL provide a message retrieval
// status code. The status retrieved SHALL be used only if the MMS
// Client has successfully retrieved the MM prior to sending the
// NotifyResp.ind response PDU.
let transaction =
new NotifyResponseTransaction(transactionId,
success ? MMS.MMS_PDU_STATUS_RETRIEVED
@ -1219,7 +1227,10 @@ MmsService.prototype = {
// For RETRIEVAL_MODE_AUTOMATIC or RETRIEVAL_MODE_AUTOMATIC_HOME but not
// roaming, proceed to retrieve MMS.
this.retrieveMessage(url, this.retrieveMessageCallback.bind(this, wish, savableMessage));
this.retrieveMessage(url,
this.retrieveMessageCallback.bind(this,
wish,
savableMessage));
},
/**
@ -1389,7 +1400,11 @@ MmsService.prototype = {
if (DEBUG) debug("Send MMS successful. aParams.receivers = " +
JSON.stringify(aParams.receivers));
self.broadcastSentMessageEvent(domMessage);
// Notifying observers the MMS message is sent.
self.broadcastSentMessageEvent(aDomMessage);
// Return the request after sending the MMS message successfully.
aRequest.notifyMessageSent(aDomMessage);
});
};
@ -1490,9 +1505,18 @@ MmsService.prototype = {
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return;
}
// Notifying observers a new MMS message is retrieved.
aRequest.notifyMessageGot(domMessage);
this.broadcastReceivedMessageEvent(domMessage);
// Return the request after retrieving the MMS message successfully.
aRequest.notifyMessageGot(domMessage);
// Cite 6.3.1 "Transaction Flow" in OMA-TS-MMS_ENC-V1_3-20110913-A:
// If an acknowledgement is requested, the MMS Client SHALL respond
// with an M-Acknowledge.ind PDU to the MMS Proxy-Relay that supports
// the specific MMS Client. The M-Acknowledge.ind PDU confirms
// successful message retrieval to the MMS Proxy Relay.
let transaction = new AcknowledgeTransaction(transactionId, reportAllowed);
transaction.run();
}).bind(this));

View File

@ -199,8 +199,7 @@ public:
};
AudioManager::AudioManager() : mPhoneState(PHONE_STATE_CURRENT),
mObserver(new HeadphoneSwitchObserver()),
mFMChannelIsMuted(0)
mObserver(new HeadphoneSwitchObserver())
{
RegisterSwitchObserver(SWITCH_HEADPHONES, mObserver);
@ -423,12 +422,8 @@ AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
status_t status =
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex);
// sync the fm stream volume with music volume, except set fm volume by audioChannelServices
if (aStream == AUDIO_STREAM_FM && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
mFMChannelIsMuted = aIndex == 0;
}
// sync fm volume with music stream type
if (aStream == AUDIO_STREAM_MUSIC && IsDeviceOn(AUDIO_DEVICE_OUT_FM) && !mFMChannelIsMuted) {
if (aStream == AUDIO_STREAM_MUSIC && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_FM), aIndex);
}

View File

@ -55,7 +55,6 @@ protected:
private:
nsAutoPtr<mozilla::hal::SwitchObserver> mObserver;
nsCOMPtr<AudioChannelAgent> mPhoneAudioAgent;
bool mFMChannelIsMuted;
};
} /* namespace gonk */