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; break;
default: default:
NS_WARNING("Not handling state changed"); NS_WARNING("Not handling state changed");
sCINDItems[CINDType::CALL].value = CallState::NO_CALL; break;
sCINDItems[CINDType::CALLSETUP].value = CallSetupState::NO_CALLSETUP;
sCINDItems[CINDType::CALLHELD].value = CallHeldState::NO_CALLHELD;
} }
} }

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 * @params aDomMessage
* The nsIDOMMozMmsMessage object. * 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 * @params aDomMessage
* The nsIDOMMozMmsMessage object. * The nsIDOMMozMmsMessage object.
@ -1100,7 +1102,7 @@ MmsService.prototype = {
// Broadcasting a 'sms-received' system message to open apps. // Broadcasting a 'sms-received' system message to open apps.
this.broadcastMmsSystemMessage("sms-received", aDomMessage); 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); Services.obs.notifyObservers(aDomMessage, kSmsReceivedObserverTopic, null);
}, },
@ -1142,6 +1144,12 @@ MmsService.prototype = {
gMobileMessageDatabaseService.saveReceivedMessage(savableMessage, gMobileMessageDatabaseService.saveReceivedMessage(savableMessage,
(function (rv, domMessage) { (function (rv, domMessage) {
let success = Components.isSuccessCode(rv); 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 = let transaction =
new NotifyResponseTransaction(transactionId, new NotifyResponseTransaction(transactionId,
success ? MMS.MMS_PDU_STATUS_RETRIEVED success ? MMS.MMS_PDU_STATUS_RETRIEVED
@ -1219,7 +1227,10 @@ MmsService.prototype = {
// For RETRIEVAL_MODE_AUTOMATIC or RETRIEVAL_MODE_AUTOMATIC_HOME but not // For RETRIEVAL_MODE_AUTOMATIC or RETRIEVAL_MODE_AUTOMATIC_HOME but not
// roaming, proceed to retrieve MMS. // 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 = " + if (DEBUG) debug("Send MMS successful. aParams.receivers = " +
JSON.stringify(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); aRequest.notifyMessageSent(aDomMessage);
}); });
}; };
@ -1490,9 +1505,18 @@ MmsService.prototype = {
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR); aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return; return;
} }
// Notifying observers a new MMS message is retrieved. // Notifying observers a new MMS message is retrieved.
aRequest.notifyMessageGot(domMessage);
this.broadcastReceivedMessageEvent(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); let transaction = new AcknowledgeTransaction(transactionId, reportAllowed);
transaction.run(); transaction.run();
}).bind(this)); }).bind(this));

View File

@ -199,8 +199,7 @@ public:
}; };
AudioManager::AudioManager() : mPhoneState(PHONE_STATE_CURRENT), AudioManager::AudioManager() : mPhoneState(PHONE_STATE_CURRENT),
mObserver(new HeadphoneSwitchObserver()), mObserver(new HeadphoneSwitchObserver())
mFMChannelIsMuted(0)
{ {
RegisterSwitchObserver(SWITCH_HEADPHONES, mObserver); RegisterSwitchObserver(SWITCH_HEADPHONES, mObserver);
@ -423,12 +422,8 @@ AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
status_t status = status_t status =
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex); 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 // 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); AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_FM), aIndex);
} }

View File

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