Merge m-c to inbound.

This commit is contained in:
Ryan VanderMeulen 2013-05-09 13:21:14 -04:00
commit cb01ebf601
12 changed files with 124 additions and 66 deletions

View File

@ -137,8 +137,8 @@ pref(webgl.force-layers-readback,true) random-if(B2G) == webgl-color-test.html?r
# Check alpha behavior: # Check alpha behavior:
fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0&nogl wrapper.html?colors.png fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0&nogl wrapper.html?colors.png
fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0 wrapper.html?colors.png fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0 wrapper.html?colors.png
fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0&nogl wrapper.html?black.png fails-if(B2G) == webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0&nogl wrapper.html?black.png
fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0 wrapper.html?black.png fails-if(B2G) == webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0 wrapper.html?black.png
fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&nogl wrapper.html?colors.png fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&nogl wrapper.html?colors.png
fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0 wrapper.html?colors.png fuzzy-if(B2G,256,83) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0 wrapper.html?colors.png

View File

@ -243,7 +243,7 @@ nsScreen::GetLockOrientationPermission() const
nsCOMPtr<nsIDOMDocument> domDoc; nsCOMPtr<nsIDOMDocument> domDoc;
owner->GetDocument(getter_AddRefs(domDoc)); owner->GetDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc); nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
if (!doc) { if (!doc || doc->Hidden()) {
return LOCK_DENIED; return LOCK_DENIED;
} }

View File

@ -50,9 +50,15 @@ namespace {
StaticAutoPtr<BluetoothHfpManager> gBluetoothHfpManager; StaticAutoPtr<BluetoothHfpManager> gBluetoothHfpManager;
StaticRefPtr<BluetoothHfpManagerObserver> sHfpObserver; StaticRefPtr<BluetoothHfpManagerObserver> sHfpObserver;
bool gInShutdown = false; bool gInShutdown = false;
static const char kHfpCrlf[] = "\xd\xa";
// Sending ringtone related
static bool sStopSendingRingFlag = true; static bool sStopSendingRingFlag = true;
static int sRingInterval = 3000; //unit: ms static int sRingInterval = 3000; //unit: ms
static const char kHfpCrlf[] = "\xd\xa";
// Wait for 2 seconds for Dialer processing event 'BLDN'. '2' seconds is a
// magic number. The mechanism should be revised once we can get call history.
static int sWaitingForProcessingBLDNInterval = 2000; //unit: ms
} // anonymous namespace } // anonymous namespace
/* CallState for sCINDItems[CINDType::CALL].value /* CallState for sCINDItems[CINDType::CALL].value
@ -263,6 +269,20 @@ BluetoothHfpManagerObserver::Observe(nsISupports* aSubject,
NS_IMPL_ISUPPORTS1(BluetoothHfpManagerObserver, nsIObserver) NS_IMPL_ISUPPORTS1(BluetoothHfpManagerObserver, nsIObserver)
class BluetoothHfpManager::RespondToBLDNTask : public Task
{
private:
void Run() MOZ_OVERRIDE
{
MOZ_ASSERT(gBluetoothHfpManager);
if (!gBluetoothHfpManager->mBLDNProcessed) {
gBluetoothHfpManager->mBLDNProcessed = true;
gBluetoothHfpManager->SendLine("ERROR");
}
}
};
class BluetoothHfpManager::SendRingIndicatorTask : public Task class BluetoothHfpManager::SendRingIndicatorTask : public Task
{ {
public: public:
@ -384,6 +404,7 @@ BluetoothHfpManager::Reset()
mCMEE = false; mCMEE = false;
mCMER = false; mCMER = false;
mReceiveVgsFlag = false; mReceiveVgsFlag = false;
mBLDNProcessed = true;
ResetCallArray(); ResetCallArray();
} }
@ -846,16 +867,25 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket,
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService(); nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
data.AppendInt(newVgs); data.AppendInt(newVgs);
os->NotifyObservers(nullptr, "bluetooth-volume-change", data.get()); os->NotifyObservers(nullptr, "bluetooth-volume-change", data.get());
} else if (msg.Find("AT+BLDN") != -1) { } else if ((msg.Find("AT+BLDN") != -1) || (msg.Find("ATD>") != -1)) {
// Dialer app of FFOS v1 does not have plan to support Memory Dailing.
// However, in order to pass Bluetooth HFP certification, we have to
// make a call when we receive AT command 'ATD>n'. The solution here
// is firing a 'BLDN' event to Dialer to do 'Last Number Redial'.
mBLDNProcessed = false;
NotifyDialer(NS_LITERAL_STRING("BLDN")); NotifyDialer(NS_LITERAL_STRING("BLDN"));
MessageLoop::current()->
PostDelayedTask(FROM_HERE, new RespondToBLDNTask(),
sWaitingForProcessingBLDNInterval);
// Don't send response 'OK' here because we'll respond later in either
// RespondToBLDNTask or HandleCallStateChanged()
return;
} else if (msg.Find("ATA") != -1) { } else if (msg.Find("ATA") != -1) {
NotifyDialer(NS_LITERAL_STRING("ATA")); NotifyDialer(NS_LITERAL_STRING("ATA"));
} else if (msg.Find("AT+CHUP") != -1) { } else if (msg.Find("AT+CHUP") != -1) {
NotifyDialer(NS_LITERAL_STRING("CHUP")); NotifyDialer(NS_LITERAL_STRING("CHUP"));
} else if (msg.Find("ATD>") != -1) {
// Currently, we don't support memory dialing in Dialer app
SendLine("ERROR");
return;
} else if (msg.Find("AT+CLCC") != -1) { } else if (msg.Find("AT+CLCC") != -1) {
SendCommand("+CLCC: "); SendCommand("+CLCC: ");
} else if (msg.Find("ATD") != -1) { } else if (msg.Find("ATD") != -1) {
@ -1250,6 +1280,11 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
} }
break; break;
case nsITelephonyProvider::CALL_STATE_DIALING: case nsITelephonyProvider::CALL_STATE_DIALING:
if (!mBLDNProcessed) {
SendLine("OK");
mBLDNProcessed = true;
}
mCurrentCallArray[aCallIndex].mDirection = false; mCurrentCallArray[aCallIndex].mDirection = false;
UpdateCIND(CINDType::CALLSETUP, CallSetupState::OUTGOING, aSend); UpdateCIND(CINDType::CALLSETUP, CallSetupState::OUTGOING, aSend);

View File

@ -79,9 +79,11 @@ public:
private: private:
class GetVolumeTask; class GetVolumeTask;
class RespondToBLDNTask;
class SendRingIndicatorTask; class SendRingIndicatorTask;
friend class GetVolumeTask; friend class GetVolumeTask;
friend class RespondToBLDNTask;
friend class SendRingIndicatorTask; friend class SendRingIndicatorTask;
friend class BluetoothHfpManagerObserver; friend class BluetoothHfpManagerObserver;
@ -113,6 +115,7 @@ private:
bool mFirstCKPD; bool mFirstCKPD;
int mNetworkSelectionMode; int mNetworkSelectionMode;
bool mReceiveVgsFlag; bool mReceiveVgsFlag;
bool mBLDNProcessed;
nsString mDevicePath; nsString mDevicePath;
nsString mMsisdn; nsString mMsisdn;
nsString mOperatorName; nsString mOperatorName;

View File

@ -29,7 +29,8 @@ class CameraPreviewMediaStream : public MediaStream {
public: public:
CameraPreviewMediaStream(DOMMediaStream* aWrapper) : CameraPreviewMediaStream(DOMMediaStream* aWrapper) :
MediaStream(aWrapper), MediaStream(aWrapper),
mMutex("mozilla::camera::CameraPreviewMediaStream") mMutex("mozilla::camera::CameraPreviewMediaStream"),
mFrameCallback(nullptr)
{ {
mIsConsumed = false; mIsConsumed = false;
} }

View File

@ -995,9 +995,7 @@ MmsService.prototype = {
* merged with the extra retrieval confirmation. * merged with the extra retrieval confirmation.
*/ */
mergeRetrievalConfirmation: function mergeRetrievalConfirmation(intermediate, savable) { mergeRetrievalConfirmation: function mergeRetrievalConfirmation(intermediate, savable) {
if (intermediate.headers["Date"]) { savable.timestamp = Date.now();
savable.timestamp = Date.parse(intermediate.headers["Date"]);
}
if (intermediate.headers.from) { if (intermediate.headers.from) {
savable.sender = intermediate.headers.from.address; savable.sender = intermediate.headers.from.address;
} else { } else {
@ -1432,8 +1430,9 @@ MmsService.prototype = {
}); });
}, },
retrieve: function retrieve(id, aRequest) { retrieve: function retrieve(aMessageId, aRequest) {
gMobileMessageDatabaseService.getMessageRecordById(id, if (DEBUG) debug("Retrieving message with ID " + aMessageId);
gMobileMessageDatabaseService.getMessageRecordById(aMessageId,
(function notifyResult(aRv, aMessageRecord) { (function notifyResult(aRv, aMessageRecord) {
if (Ci.nsIMobileMessageCallback.SUCCESS_NO_ERROR != aRv) { if (Ci.nsIMobileMessageCallback.SUCCESS_NO_ERROR != aRv) {
if (DEBUG) debug("Function getMessageRecordById() return error."); if (DEBUG) debug("Function getMessageRecordById() return error.");
@ -1441,27 +1440,33 @@ MmsService.prototype = {
return; return;
} }
if ("mms" != aMessageRecord.type) { if ("mms" != aMessageRecord.type) {
if (DEBUG) debug("Type of message record is not mms"); if (DEBUG) debug("Type of message record is not 'mms'.");
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR); aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return; return;
} }
if (!aMessageRecord.headers || if (!aMessageRecord.headers) {
!aMessageRecord.headers["x-mms-content-location"]) { if (DEBUG) debug("Must need the MMS' headers to proceed the retrieve.");
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return;
}
if (!aMessageRecord.headers["x-mms-content-location"]) {
if (DEBUG) debug("Can't find mms content url in database."); if (DEBUG) debug("Can't find mms content url in database.");
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR); aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
return; return;
} }
// Cite 6.2 "Multimedia Message Notification" in OMA-TS-MMS_ENC-V1_3-20110913-A: // Cite 6.2 "Multimedia Message Notification" in OMA-TS-MMS_ENC-V1_3-20110913-A:
// The field has only one format, relative. The recipient client calculates this // The field has only one format, relative. The recipient client calculates
// length of time relative to the time it receives the notification. // this length of time relative to the time it receives the notification.
let expiriedDate = aMessageRecord.timestamp + if (aMessageRecord.headers["x-mms-expiry"] != undefined) {
let expiryDate = aMessageRecord.timestamp +
aMessageRecord.headers["x-mms-expiry"] * 1000; aMessageRecord.headers["x-mms-expiry"] * 1000;
if (expiriedDate < Date.now()) { if (expiryDate < Date.now()) {
if (DEBUG) debug("The message to be retrieved is expired.");
aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.NOT_FOUND_ERROR); aRequest.notifyGetMessageFailed(Ci.nsIMobileMessageCallback.NOT_FOUND_ERROR);
if (DEBUG) debug("This notification indication is expired.");
return; return;
} }
}
let url = aMessageRecord.headers["x-mms-content-location"].uri; let url = aMessageRecord.headers["x-mms-content-location"].uri;
// For X-Mms-Report-Allowed // For X-Mms-Report-Allowed

View File

@ -13,7 +13,7 @@ dictionary MmsAttachment
nsIDOMBlob content; nsIDOMBlob content;
}; };
[scriptable, builtinclass, uuid(e916d5c8-dbf4-4fdc-a463-793b67491863)] [scriptable, builtinclass, uuid(2e5e1c16-b7af-11e2-af04-8f4b1610a600)]
interface nsIDOMMozMmsMessage : nsISupports interface nsIDOMMozMmsMessage : nsISupports
{ {
/** /**
@ -39,7 +39,7 @@ interface nsIDOMMozMmsMessage : nsISupports
readonly attribute jsval receivers; // DOMString[] readonly attribute jsval receivers; // DOMString[]
[implicit_jscontext] [implicit_jscontext]
readonly attribute jsval timestamp; // Date readonly attribute jsval timestamp; // Date object
readonly attribute boolean read; readonly attribute boolean read;
readonly attribute DOMString subject; readonly attribute DOMString subject;
@ -49,6 +49,7 @@ interface nsIDOMMozMmsMessage : nsISupports
readonly attribute jsval attachments; // MmsAttachment[] readonly attribute jsval attachments; // MmsAttachment[]
[implicit_jscontext] [implicit_jscontext]
readonly attribute jsval expiryDate; // Expiry date of manually readonly attribute jsval expiryDate; // Date object
// downloading multimedia message. // Expiry date for an MMS to be
// manually downloaded.
}; };

View File

@ -89,6 +89,39 @@ MmsMessage::MmsMessage(const mobilemessage::MmsMessageData& aData)
} }
} }
/**
* A helper function to convert the JS value to an integer value for time.
*
* @params aCx
* The JS context.
* @params aTime
* Can be an object or a number.
* @params aReturn
* The integer value to return.
* @return NS_OK if the convertion succeeds.
*/
static nsresult
convertTimeToInt(JSContext* aCx, const JS::Value& aTime, uint64_t& aReturn)
{
if (aTime.isObject()) {
JSObject* timestampObj = &aTime.toObject();
if (!JS_ObjectIsDate(aCx, timestampObj)) {
return NS_ERROR_INVALID_ARG;
}
aReturn = js_DateGetMsecSinceEpoch(timestampObj);
} else {
if (!aTime.isNumber()) {
return NS_ERROR_INVALID_ARG;
}
double number = aTime.toNumber();
if (static_cast<uint64_t>(number) != number) {
return NS_ERROR_INVALID_ARG;
}
aReturn = static_cast<uint64_t>(number);
}
return NS_OK;
}
/* static */ nsresult /* static */ nsresult
MmsMessage::Create(int32_t aId, MmsMessage::Create(int32_t aId,
const uint64_t aThreadId, const uint64_t aThreadId,
@ -188,22 +221,8 @@ MmsMessage::Create(int32_t aId,
// Set |timestamp|. // Set |timestamp|.
uint64_t timestamp; uint64_t timestamp;
if (aTimestamp.isObject()) { nsresult rv = convertTimeToInt(aCx, aTimestamp, timestamp);
JSObject* timestampObj = &aTimestamp.toObject(); NS_ENSURE_SUCCESS(rv, rv);
if (!JS_ObjectIsDate(aCx, timestampObj)) {
return NS_ERROR_INVALID_ARG;
}
timestamp = js_DateGetMsecSinceEpoch(timestampObj);
} else {
if (!aTimestamp.isNumber()) {
return NS_ERROR_INVALID_ARG;
}
double number = aTimestamp.toNumber();
if (static_cast<uint64_t>(number) != number) {
return NS_ERROR_INVALID_ARG;
}
timestamp = static_cast<uint64_t>(number);
}
// Set |attachments|. // Set |attachments|.
if (!aAttachments.isObject()) { if (!aAttachments.isObject()) {
@ -224,7 +243,7 @@ MmsMessage::Create(int32_t aId,
} }
MmsAttachment attachment; MmsAttachment attachment;
nsresult rv = attachment.Init(aCx, &attachmentJsVal); rv = attachment.Init(aCx, &attachmentJsVal);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
attachments.AppendElement(attachment); attachments.AppendElement(attachment);
@ -232,22 +251,8 @@ MmsMessage::Create(int32_t aId,
// Set |expiryDate|. // Set |expiryDate|.
uint64_t expiryDate; uint64_t expiryDate;
if (aExpiryDate.isObject()) { rv = convertTimeToInt(aCx, aExpiryDate, expiryDate);
JSObject* expiryDateObj = &aExpiryDate.toObject(); NS_ENSURE_SUCCESS(rv, rv);
if (!JS_ObjectIsDate(aCx, expiryDateObj)) {
return NS_ERROR_INVALID_ARG;
}
expiryDate = js_DateGetMsecSinceEpoch(expiryDateObj);
} else {
if (!aExpiryDate.isNumber()) {
return NS_ERROR_INVALID_ARG;
}
double number = aExpiryDate.toNumber();
if (static_cast<uint64_t>(number) != number) {
return NS_ERROR_INVALID_ARG;
}
expiryDate = static_cast<uint64_t>(number);
}
nsCOMPtr<nsIDOMMozMmsMessage> message = new MmsMessage(aId, nsCOMPtr<nsIDOMMozMmsMessage> message = new MmsMessage(aId,
aThreadId, aThreadId,

View File

@ -717,7 +717,10 @@ MobileMessageDatabaseService.prototype = {
}); });
} }
} }
let expiryDate = aMessageRecord.timestamp + headers["x-mms-expiry"] * 1000; let expiryDate = 0;
if (headers["x-mms-expiry"] != undefined) {
expiryDate = aMessageRecord.timestamp + headers["x-mms-expiry"] * 1000;
}
return gMobileMessageService.createMmsMessage(aMessageRecord.id, return gMobileMessageService.createMmsMessage(aMessageRecord.id,
aMessageRecord.threadId, aMessageRecord.threadId,
aMessageRecord.delivery, aMessageRecord.delivery,

View File

@ -1327,6 +1327,9 @@ RILContentHelper.prototype = {
if (this.voicemailStatus.messageCount != message.msgCount) { if (this.voicemailStatus.messageCount != message.msgCount) {
changed = true; changed = true;
this.voicemailStatus.messageCount = message.msgCount; this.voicemailStatus.messageCount = message.msgCount;
} else if (message.msgCount == -1) {
// For MWI using DCS the message count is not available
changed = true;
} }
if (this.voicemailStatus.returnNumber != message.returnNumber) { if (this.voicemailStatus.returnNumber != message.returnNumber) {

View File

@ -580,7 +580,9 @@ public:
return gl::RGBAExternalLayerProgramType; return gl::RGBAExternalLayerProgramType;
} }
MOZ_ASSERT(mTextureTarget == LOCAL_GL_TEXTURE_2D); MOZ_ASSERT(mTextureTarget == LOCAL_GL_TEXTURE_2D);
return GetProgramTypeForTexture(this); return mFormat == gfx::FORMAT_B8G8R8A8 || mFormat == gfx::FORMAT_B8G8R8X8
? gl::BGRALayerProgramType
: gl::RGBALayerProgramType;
} }
GLenum GetWrapMode() const MOZ_OVERRIDE GLenum GetWrapMode() const MOZ_OVERRIDE

View File

@ -1,7 +1,7 @@
# BMP 1BPP tests # BMP 1BPP tests
# Images of various sizes # Images of various sizes
== bmp-size-1x1-1bpp.bmp bmp-size-1x1-1bpp.png fails-if(B2G) == bmp-size-1x1-1bpp.bmp bmp-size-1x1-1bpp.png
== bmp-size-2x2-1bpp.bmp bmp-size-2x2-1bpp.png == bmp-size-2x2-1bpp.bmp bmp-size-2x2-1bpp.png
== bmp-size-3x3-1bpp.bmp bmp-size-3x3-1bpp.png == bmp-size-3x3-1bpp.bmp bmp-size-3x3-1bpp.png
== bmp-size-4x4-1bpp.bmp bmp-size-4x4-1bpp.png == bmp-size-4x4-1bpp.bmp bmp-size-4x4-1bpp.png