VulpesOS/gaia/apps/ringtones/js/null_ringtone.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

79 lines
1.4 KiB
JavaScript
Executable file

/* global Promise */
/* exported NullRingtone */
'use strict';
/**
* Create a ringtone with no audio data backing it.
*/
function NullRingtone() {}
NullRingtone.prototype = {
/**
* @return {String} The localized name of the ringtone. Assumes mozL10n has
* been initialized.
*/
get name() {
return navigator.mozL10n.get(this.l10nID);
},
/**
* @return {String} The filename of the ringtone (null in this case).
*/
get filename() {
return null;
},
/**
* @return {String} The l10n ID of the ringtone.
*/
get l10nID() {
return 'ringtone-none';
},
/**
* @return {String} A unique ID for the ringtone.
*/
get id() {
return 'none:none';
},
/**
* @return {String} The type of the tone (null in this case).
*/
get type() {
return null;
},
/**
* @return {String} The URL of the ringtone (null in this case).
*/
get url() {
return null;
},
/**
* @return {Boolean} Whether this ringtone is shareable (always false).
*/
get shareable() {
return false;
},
/**
* @return {Boolean} Whether this ringtone is deletable (always false).
*/
get deletable() {
return false;
},
/**
* Gets a blob for this tone.
*
* @return {Promise} A promise returning the audio data (always null, since
* this is a null ringtone).
*/
getBlob: function() {
return new Promise(function(resolve, reject) {
resolve(null);
});
}
};