Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 822168 - [Bluetooth] The notification of "Bluetooth received file ready to open" is truncated. r=evelyn #7633

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 15 additions & 12 deletions apps/system/js/bluetooth_transfer.js
Expand Up @@ -349,33 +349,36 @@ var BluetoothTransfer = {
var _ = navigator.mozL10n.get;
// Remove transferring progress
this.removeProgress(transferInfo);
var fileName =
(transferInfo.fileName) ? transferInfo.fileName : _('unknown-file');
var icon = 'style/bluetooth_transfer/images/icon_bluetooth.png';
// Show banner and notification
if (transferInfo.success == true) {
// Show completed message of transferred result on the banner
this.showBanner(true);
if (transferInfo.received) {
// Received file can be opened only
// TODO: Need to modify the icon after visual provide
NotificationHelper.send(_('transferFinished-receivedCompletedTitle'),
_('transferFinished-completedBody'),
'style/bluetooth_transfer/images/icon_bluetooth.png',
NotificationHelper.send(_('transferFinished-receivedSuccessful-title'),
fileName,
icon,
this.openReceivedFile.bind(this, transferInfo));
} else {
NotificationHelper.send(_('transferFinished-sendingCompletedTitle'),
_('transferFinished-completedBody'),
'style/bluetooth_transfer/images/icon_bluetooth.png');
NotificationHelper.send(_('transferFinished-sentSuccessful-title'),
fileName,
icon);
}
} else {
// Show failed message of transferred result on the banner
this.showBanner(false);
if (transferInfo.received) {
NotificationHelper.send(_('transferFinished-sendingFailedTitle'),
_('transferFinished-failedBody'),
'style/bluetooth_transfer/images/icon_bluetooth.png');
NotificationHelper.send(_('transferFinished-receivedFailed-title'),
fileName,
icon);
} else {
NotificationHelper.send(_('transferFinished-receivedFailedTitle'),
_('transferFinished-failedBody'),
'style/bluetooth_transfer/images/icon_bluetooth.png');
NotificationHelper.send(_('transferFinished-sentFailed-title'),
fileName,
icon);
}
}
},
Expand Down
11 changes: 5 additions & 6 deletions apps/system/locales/system.en-US.properties
Expand Up @@ -212,12 +212,11 @@ continue=Continue
bluetooth-file-transfer-result=Bluetooth file transfer {{status}}.
complete=complete
failed=failed
transferFinished-sendingCompletedTitle=Bluetooth sending file complete
transferFinished-receivedCompletedTitle=Bluetooth received file ready to open
transferFinished-sendingFailedTitle=Bluetooth sending file failed
transferFinished-receivedFailedTitle=Bluetooth received a file it can not open
transferFinished-completedBody=Transfer completed
transferFinished-failedBody=Transfer failed
transferFinished-sentSuccessful-title=File sent
transferFinished-receivedSuccessful-title=File received
transferFinished-sentFailed-title=File could not be sent
transferFinished-receivedFailed-title=File could not be received
unknown-file=Unknown file
unknown-device=Unknown device
cannotOpenFile=Can not open received file
unknownMediaTypeToOpen=Can not open unknown media type:
Expand Down