Closed Bug 908084 Opened 12 years ago Closed 12 years ago

[B2G][Helix][Gaia][ouyangming] There is the wrong alert after open the file which is transfered by the bluetooth

Categories

(Firefox OS Graveyard :: Gaia::Bluetooth, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 908124

People

(Reporter: lecky.wanglei, Unassigned)

Details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; aff-kingsoft-ciba; .NET4.0C; .NET4.0E) Steps to reproduce: 1. Prepare two phones(Phone A and Phone B), open the bluetooth on both two phones and paired with each other. 2. Use the Phone A to get a picture by camera APP, and then send this picture to phone B by bluetooth. 3. When phone B received the picture, click the receive message to open the picture. 4. After opening the picture, press the home button. Actual results: 1. There is the wrong alert dialog on the screen. The title is "Can not open the received file", the content is "Can not open the unknown media type: /sdcard/downloads/bluetooth/XXXX.jpg". (XXXX.jpg is the name of the picture). Expected results: 1. It is not show this alert dialog, because the file can be opened.
I trace the code, maybe the problem is related to the following codes in bluetooth_transfer.js: getreq.onsuccess = function() { var file = getreq.result; // When we got the file by storage type of "sdcard" // use the file.type to replace the empty fileType which is given by API var fileName = file.name; var extension = fileName.split('.').pop(); var originalType = file.type || contentType; var mappedType = (MimeMapper.isSupportedType(originalType)) ? originalType : MimeMapper.guessTypeFromExtension(extension); var a = new MozActivity({ name: 'open', data: { type: mappedType, blob: file, // XXX: https://bugzilla.mozilla.org/show_bug.cgi?id=812098 // Pass the file name for Music APP since it can not open blob filename: file.name } }); a.onerror = function(e) { var msg = 'open activity error:' + a.error.name; self.debug(msg); // Cannot identify MIMETYPE // So, show cannot open file dialog with unknow media type UtilityTray.hide(); self.showUnknownMediaPrompt(fileName); }; a.onsuccess = function(e) { var msg = 'open activity onsuccess'; self.debug(msg); }; }; After opening the file, it is always call the function a.onerror to show the error prompt.
Severity: normal → critical
Priority: -- → P1
blocking-b2g: --- → hd?
Hi lecky, This is a dup of bug 908124, but still thank you for reporting this and even debugging. Besides, please remember to put the build version on the bug so developers can save some time. Thanks.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Clearing flag as dupe fixed this.
blocking-b2g: hd? → ---
You need to log in before you can comment on or make changes to this bug.