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.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
37
gaia/apps/operatorvariant/js/customizers/ringtone_customizer.js
Executable file
37
gaia/apps/operatorvariant/js/customizers/ringtone_customizer.js
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
/* global Customizer, Resources */
|
||||
|
||||
'use strict';
|
||||
|
||||
var RingtoneCustomizer = (function() {
|
||||
|
||||
Customizer.call(this, 'ringtone', 'json');
|
||||
this.set = function(ringtoneParams) {
|
||||
if (!this.simPresentOnFirstBoot) {
|
||||
console.log('RingtoneCustomizer. No first RUN with configured SIM.');
|
||||
return;
|
||||
}
|
||||
|
||||
var settings = navigator.mozSettings;
|
||||
if (!settings) {
|
||||
console.error('RingtoneCustomizer. Settings is not available');
|
||||
return;
|
||||
}
|
||||
|
||||
function setRingtone() {
|
||||
Resources.load(ringtoneParams.uri, 'blob', function onsuccess(blob) {
|
||||
settings.createLock().set({
|
||||
'dialer.ringtone': blob,
|
||||
'dialer.ringtone.name': ringtoneParams.name
|
||||
});
|
||||
}, function onerror(status) {
|
||||
console.error('RingtoneCustomizer.js: Error retrieving the resource.' +
|
||||
ringtoneParams.uri);
|
||||
});
|
||||
}
|
||||
|
||||
setRingtone();
|
||||
};
|
||||
});
|
||||
|
||||
var ringtoneCustomizer = new RingtoneCustomizer();
|
||||
ringtoneCustomizer.init();
|
||||
Loading…
Reference in a new issue