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:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,2 @@
define([],function(){'use strict';const NETWORK_TYPE_CATEGORY={'gprs':'gsm','edge':'gsm','umts':'gsm','hsdpa':'gsm','hsupa':'gsm','hspa':'gsm','hspa+':'gsm','lte':'gsm','gsm':'gsm','is95a':'cdma','is95b':'cdma','1xrtt':'cdma','evdo0':'cdma','evdoa':'cdma','evdob':'cdma','ehrpd':'cdma'};const CALL_FORWARD_REASON={'UNCONDITIONAL':0,'MOBILE_BUSY':1,'NO_REPLY':2,'NOT_REACHABLE':3};const CALL_FORWARD_REASON_MAPPING={'unConditional':CALL_FORWARD_REASON.UNCONDITIONAL,'mobileBusy':CALL_FORWARD_REASON.MOBILE_BUSY,'noReply':CALL_FORWARD_REASON.NO_REPLY,'notReachable':CALL_FORWARD_REASON.NOT_REACHABLE};const CALL_FORWARD_ACTION={'DISABLE':0,'ENABLE':1,'QUERY_STATUS':2,'REGISTRATION':3,'ERASURE':4};const CLIR_MAPPING={'CLIR_DEFAULT':0,'CLIR_INVOCATION':1,'CLIR_SUPPRESSION':2};const CallConstant={'NETWORK_TYPE_CATEGORY':NETWORK_TYPE_CATEGORY,'CALL_FORWARD_REASON':CALL_FORWARD_REASON,'CALL_FORWARD_REASON_MAPPING':CALL_FORWARD_REASON_MAPPING,'CALL_FORWARD_ACTION':CALL_FORWARD_ACTION,'CLIR_MAPPING':CLIR_MAPPING};return CallConstant;});

View file

@ -0,0 +1,3 @@
define(['require','panels/call/call_settings_task_scheduler','modules/base/module','modules/mvvm/observable','panels/call/call_utils','panels/call/call_constant'],function(require){'use strict';var CallSettingsTaskScheduler=require('panels/call/call_settings_task_scheduler');var Module=require('modules/base/module');var Observable=require('modules/mvvm/observable');var CallUtils=require('panels/call/call_utils');var CallConstant=require('panels/call/call_constant');var mozSettings=window.navigator.mozSettings;var CallForwarding=Module.create(function CallForwarding(cardIndex){this.super(Observable).call(this);this._cardIndex=cardIndex;this._cfReasonStates=[0,0,0,0];}).extend(Observable);Observable.defineObservableProperty(CallForwarding.prototype,'state',{readonly:true,value:'normal'});Object.keys(CallConstant.CALL_FORWARD_REASON_MAPPING).forEach((cfOptionName)=>{Observable.defineObservableProperty(CallForwarding.prototype,cfOptionName+'Number',{readonly:true,value:null});Observable.defineObservableProperty(CallForwarding.prototype,cfOptionName+'Enabled',{readonly:true,value:false});});CallForwarding.prototype._getConn=function(){var conn=window.navigator.mozMobileConnections[this._cardIndex];if(!conn){this.throw('We can\'t find the conn object on card '+this._cardIndex);}else{return conn;}};CallForwarding.prototype.setCallForwardingValues=function(options){this._state='requesting';var promise=new Promise((resolve,reject)=>{var conn=this._getConn(this._cardIndex);var key=options.key;var number=options.number;var enabled=!!options.enabled;if(!key){this._state='normal';reject();}else if(this._cfReasonStates[CallConstant.CALL_FORWARD_REASON_MAPPING[key]]===enabled){this._state='normal';reject();}else{var mozMobileCFInfo={};mozMobileCFInfo.action=enabled?CallConstant.CALL_FORWARD_ACTION.REGISTRATION:CallConstant.CALL_FORWARD_ACTION.DISABLE;mozMobileCFInfo.reason=CallConstant.CALL_FORWARD_REASON_MAPPING[key];mozMobileCFInfo.serviceClass=conn.ICC_SERVICE_CLASS_VOICE;if(enabled&&!CallUtils.isPhoneNumberValid(number)){this._state='normal';reject({name:'callForwardingInvalidNumberError'});}else{mozMobileCFInfo.number=number;mozMobileCFInfo.timeSeconds=mozMobileCFInfo.reason!=CallConstant.CALL_FORWARD_REASON.NO_REPLY?0:20;CallSettingsTaskScheduler.enqueue({type:'CALL_FORWARDING',func:()=>{return conn.setCallForwardingOption(mozMobileCFInfo);}}).then(()=>{this._state='normal';resolve({key:key,action:mozMobileCFInfo.action});}).catch(()=>{this._state='normal';reject({name:'callForwardingSetError'});});}}});return promise;};CallForwarding.prototype._getOption=function(optionName){var conn=this._getConn();if(!(optionName in CallConstant.CALL_FORWARD_REASON)){this.debug('Your optionName may be wrong - ',optionName);return Promise.reject();}
return conn.getCallForwardingOption(CallConstant.CALL_FORWARD_REASON[optionName]);};CallForwarding.prototype.refresh=function(){this._state='requesting';return CallSettingsTaskScheduler.enqueue({type:'CALL_FORWARDING',func:()=>{return Promise.all([this._getOption('UNCONDITIONAL'),this._getOption('MOBILE_BUSY'),this._getOption('NO_REPLY'),this._getOption('NOT_REACHABLE')]);}}).then((results)=>{var promise=new Promise((resolve,reject)=>{var storedOptions={};var cfOptions={'unConditional':results[0],'mobileBusy':results[1],'noReply':results[2],'notReachable':results[3]};Object.keys(cfOptions).forEach(function(cfOptionName){var rules=cfOptions[cfOptionName];var rule=CallUtils.findActiveVoiceRule(rules);if(rule){this._cfReasonStates[CallConstant.CALL_FORWARD_REASON_MAPPING[cfOptionName]]=1;this['_'+cfOptionName+'Number']=rule.number;this['_'+cfOptionName+'Enabled']=true;if(cfOptionName==='unConditional'){storedOptions['ril.cf.carrier.enabled']={enabled:true,index:this._cardIndex};}}else{this._cfReasonStates[CallConstant.CALL_FORWARD_REASON_MAPPING[cfOptionName]]=0;this['_'+cfOptionName+'Number']='';this['_'+cfOptionName+'Enabled']=false;if(cfOptionName==='unConditional'){storedOptions['ril.cf.carrier.enabled']={enabled:false,index:this._cardIndex};}}},this);mozSettings.createLock().set(storedOptions).then(()=>{this._state='normal';resolve(cfOptions);},()=>{this._state='error';this.error('Something error happened when storing into settings db');reject();});});return promise;},()=>{this._state='error';this.error('Something error happened when refresh');});};CallForwarding.prototype.isUnconditionalCFOn=function(){return this._cfReasonStates[0]===1;};return CallForwarding;});

View file

@ -0,0 +1,2 @@
define(['require','modules/base/module','modules/base/task_scheduler'],function(require){'use strict';var Module=require('modules/base/module');var TaskScheduler=require('modules/base/task_scheduler');var CallSettingsTaskScheduler=Module.create(function CallSettingsTaskScheduler(){this.super(TaskScheduler).call(this);}).extend(TaskScheduler);const TASK_TYPE={GENERAL:0,CALL_FORWARDING:1,CALL_WAITING:2,CALLER_ID_PREF:3};Object.defineProperty(CallSettingsTaskScheduler,'TASK_TYPE',{enumerable:true,configurable:false,get:function(){return TASK_TYPE;}});CallSettingsTaskScheduler.prototype.enqueue=function(task){var{type,func}=task;if(!CallSettingsTaskScheduler.TASK_TYPE[type]){this.throw('You are enqueuing an unknown type - ',type,'please check again');}else{return TaskScheduler.prototype.enqueue.call(this,{type:type,func:func,cancelable:(type!=='GENERAL')});}};return CallSettingsTaskScheduler();});

View file

@ -0,0 +1,3 @@
define([],function(){'use strict';var conns=window.navigator.mozMobileConnections;var CallUtils={isPhoneNumberValid:function(number){if(number){var re=/^([\+]*[0-9])+$/;if(re.test(number)){return true;}}
return false;},findActiveVoiceRule:function(rules){rules=rules||[];return rules.find((rule)=>{return(rule.active&&(rule.serviceClass&conns[0].ICC_SERVICE_CLASS_VOICE)!==0);});}};return CallUtils;});

View file

@ -0,0 +1,11 @@
define(['require','panels/call/call_settings_task_scheduler','panels/call/call_constant','shared/settings_helper','modules/settings_panel','modules/settings_cache','modules/settings_service','dsds_settings','modules/dialog_service'],function(require){'use strict';var CallSettingsTaskScheduler=require('panels/call/call_settings_task_scheduler');var CallConstant=require('panels/call/call_constant');var SettingsHelper=require('shared/settings_helper');var SettingsPanel=require('modules/settings_panel');var SettingsCache=require('modules/settings_cache');var SettingsService=require('modules/settings_service');var DsdsSettings=require('dsds_settings');var DialogService=require('modules/dialog_service');return function ctor_call_panel(){return SettingsPanel({onInit:function(panel,options){this._cardIndex=options.cardIndex||0;this._conns=window.navigator.mozMobileConnections;this._conn=this._conns[this._cardIndex];var $=function(selector){return panel.querySelector(selector);};this._elements={panel:panel,header:$('gaia-header'),rilCallerId:$('#ril-callerId'),fdnDesc:$('#fdnSettings-desc'),alertPanel:$('.cw-alert'),alertPanelSetButton:$('.cw-alert .cw-alert-set'),alertPanelConfirmInput:$('.cw-alert .cw-alert-checkbox'),alertPanelCancelButton:$('.cw-alert .cw-alert-cancel'),alertLabel:$('#menuItem-callWaiting .cw-alert-icon'),callFdnItem:$('#menuItem-callFdn'),callFdnAnchor:$('#menuItem-callFdn a'),callWaitingItem:$('#menuItem-callWaiting'),callWaitingInput:$('#menuItem-callWaiting gaia-switch'),callForwardingItem:$('#menuItem-callForwarding'),callForwardingAnchor:$('#menuItem-callForwarding a'),callBarringItem:$('#menuItem-callBarring'),callerIdItem:$('#menuItem-callerId'),voiceMailItem:$('.menuItem-voicemail'),voiceMailDesc:$('#voiceMail-desc'),voicePrivacyItem:$('#menuItem-voicePrivacyMode'),voicePrivacyInput:$('#menuItem-voicePrivacyMode gaia-switch')};if(DsdsSettings.getNumberOfIccSlots()>1){this._elements.header.setAttribute('data-href','#call-iccs');}
this._bindPanelReadyEvent();this._bindCallForwardingMenuItemClickEvent();this._bindCallFdnMenuItemClickEvent();this._addVoiceTypeChangeListeners();this._initCallerId();this._initCallWaiting();this._initVoiceMailSettings();this._initVoicePrivacyModeChangeEvent();this._initVoicemailClickEvent();this._initCallWaitingAlertLabelClickEvent();this._initCallWaitingAlertCancelButtonClickEvent();CallSettingsTaskScheduler.observe('isLocked',(isLocked)=>{this._enableTapOn('callerIdItem',!isLocked);this._enableTapOn('callWaitingInput',!isLocked);});this._refreshCallSettingItems();},onBeforeShow:function(panel,options){if(typeof options.cardIndex!=='undefined'){this._cardIndex=options.cardIndex;this._conn=this._conns[options.cardIndex];}
this._initFDNItem();this._updateNetworkTypeLimitedItemsVisibility(this._conn.voice&&this._conn.voice.type);this._refreshCallSettingItems();},_bindPanelReadyEvent:function(){window.addEventListener('panelready',(evt)=>{switch(evt.detail.current){case'#call':if(evt.detail.previous==='#call-forwarding'||evt.detail.previous==='#call-cbSettings'){return;}
break;}});},_bindCallForwardingMenuItemClickEvent:function(){this._elements.callForwardingAnchor.onclick=()=>{SettingsService.navigate('call-forwarding',{cardIndex:this._cardIndex});};},_bindCallFdnMenuItemClickEvent:function(){this._elements.callFdnAnchor.onclick=()=>{SettingsService.navigate('call-fdnSettings',{cardIndex:this._cardIndex});};},_initCallerId:function(){this._elements.rilCallerId.onblur=()=>{var clirMode=CallConstant.CLIR_MAPPING[this._elements.rilCallerId.value];this._conn.setCallingLineIdRestriction(clirMode).then(()=>{},()=>{this._updateCallerIdPreference().then(()=>{this._updateCallerIdItemState();});});};navigator.mozSettings.addObserver('ril.clirMode',()=>{this._updateCallerIdItemState();});},_initCallWaiting:function(){this._elements.alertPanelSetButton.onclick=()=>{var checked=this._elements.alertPanelConfirmInput.checked;this._conn.setCallWaitingOption(checked).then(()=>{this._elements.alertPanel.hidden=true;this._updateCallWaitingItemState();},()=>{this._elements.alertPanel.hidden=true;this._updateCallWaitingItemState();});};this._elements.callWaitingInput.addEventListener('change',()=>{var checked=this._elements.callWaitingInput.checked;this._conn.setCallWaitingOption(checked).then(()=>{this._updateCallWaitingItemState();},()=>{this._updateCallWaitingItemState();});});},_initVoiceMailSettings:function(){SettingsCache.getSettings((results)=>{var settings=navigator.mozSettings;var voicemail=navigator.mozVoicemail;var updateVMNumber=false;var numbers=results['ril.iccInfo.mbdn']||[];[].forEach.call(this._conns,(conn,index)=>{var number=numbers[index];if(!number&&voicemail){number=voicemail.getNumber(index);if(number){updateVMNumber=true;numbers[index]=number;}}});if(updateVMNumber){settings.createLock().set({'ril.iccInfo.mbdn':numbers}).then(()=>{this._updateVoiceMailItemState();settings.addObserver('ril.iccInfo.mbdn',()=>{this._updateVoiceMailItemState();});});}else{this._updateVoiceMailItemState();settings.addObserver('ril.iccInfo.mbdn',()=>{this._updateVoiceMailItemState();});}});},_initFDNItem:function(){var iccId=navigator.mozMobileConnections[this._cardIndex].iccId;if(iccId){var icc=navigator.mozIccManager.getIccById(iccId);if(icc){icc.getServiceState('fdn').then((hasFdn)=>{this._elements.callFdnItem.hidden=!hasFdn;});}}},_initVoicemailClickEvent:function(){this._elements.voiceMailItem.onclick=()=>{DialogService.show('call-voiceMailSettings');};},_initCallWaitingAlertLabelClickEvent:function(){this._elements.alertLabel.onclick=()=>{this._elements.alertPanelConfirmInput.checked=false;this._elements.alertPanel.hidden=false;};},_initVoicePrivacyModeChangeEvent:function(){var defaultVoicePrivacySettings=[].map.call(this._conns,()=>{return false;});var voicePrivacyHelper=SettingsHelper('ril.voicePrivacy.enabled',defaultVoicePrivacySettings);this._elements.voicePrivacyInput.addEventListener('change',()=>{var checked=this._elements.voicePrivacyInput.checked;voicePrivacyHelper.get((values)=>{var originalValue=!checked;this._conn.setVoicePrivacyMode(checked).then(()=>{values[this._cardIndex]=!originalValue;voicePrivacyHelper.set(values);},()=>{this._elements.voicePrivacyInput.checked=originalValue;});});});},_initCallWaitingAlertCancelButtonClickEvent:function(){this._elements.alertPanelCancelButton.onclick=()=>{this._elements.alertPanel.hidden=true;};},_addVoiceTypeChangeListeners:function(){var voiceTypes=[].map.call(this._conns,()=>{return null;});[].forEach.call(this._conns,(conn,index)=>{voiceTypes[index]=conn.voice.type;conn.addEventListener('voicechange',()=>{var newType=conn.voice.type;if(index!==this._cardIndex||voiceTypes[index]===newType){return;}
voiceTypes[index]=newType;this._updateNetworkTypeLimitedItemsVisibility(newType);this._refreshCallSettingItems();});});},_updateNetworkTypeLimitedItemsVisibility:function(voiceType){this._elements.callForwardingItem.hidden=this._elements.callBarringItem.hidden=this._elements.callWaitingItem.hidden=this._elements.callerIdItem.hidden=(CallConstant.NETWORK_TYPE_CATEGORY[voiceType]!=='gsm');this._elements.voicePrivacyItem.hidden=(CallConstant.NETWORK_TYPE_CATEGORY[voiceType]!=='cdma');},_refreshCallSettingItems:function(){this._updateVoiceMailItemState();this._updateFdnStatus();this._updateVoicePrivacyItemState();this._updateCallerIdPreference().then(()=>{this._updateCallerIdItemState();});this._updateCallWaitingItemState();},_enableTapOn:function(elementName,enable){var element=this._elements[elementName];if(!element){return;}
if(enable){element.removeAttribute('aria-disabled');}else{element.setAttribute('aria-disabled',true);}},_updateCallerIdPreference:function(){return CallSettingsTaskScheduler.enqueue({type:'CALLER_ID_PREF',func:()=>{return this._conn.getCallingLineIdRestriction();}}).then((result)=>{var promise=new Promise((resolve)=>{var value=0;if(result){switch(result.m){case 1:case 3:case 4:switch(result.n){case 1:case 2:case 0:value=result.n;break;default:value=0;break;}
break;case 0:case 2:default:value=0;break;}
SettingsCache.getSettings((results)=>{var preferences=results['ril.clirMode']||[0,0];preferences[this._cardIndex]=value;navigator.mozSettings.createLock().set({'ril.clirMode':preferences}).then(resolve,resolve);});}});return promise;});},_updateCallerIdItemState:function(){if(this._elements.callerIdItem.hidden){return Promise.resolve();}else{var promise=new Promise((resolve)=>{SettingsCache.getSettings((results)=>{var preferences=results['ril.clirMode'];var preference=preferences&&preferences[this._cardIndex];var value;switch(preference){case 1:value='CLIR_INVOCATION';break;case 2:value='CLIR_SUPPRESSION';break;case 0:default:value='CLIR_DEFAULT';break;}
this._elements.rilCallerId.value=value;});});return promise;}},_updateCallWaitingItemState:function(){if(this._elements.callWaitingItem.hidden){return Promise.resolve();}else{return CallSettingsTaskScheduler.enqueue({type:'CALL_WAITING',func:()=>{return this._conn.getCallWaitingOption();}}).then((enabled)=>{this._elements.callWaitingInput.checked=enabled;if(enabled){this._elements.callWaitingItem.dataset.state='on';}else{this._elements.callWaitingItem.dataset.state='off';}}).catch(()=>{this._elements.callWaitingItem.dataset.state='unknown';});}},_updateVoiceMailItemState:function(){this._elements.voiceMailDesc.textContent='';SettingsCache.getSettings((results)=>{var numbers=results['ril.iccInfo.mbdn'];var number=numbers[this._cardIndex];if(number){this._elements.voiceMailDesc.removeAttribute('data-l10n-id');this._elements.voiceMailDesc.textContent=number;}else{this._elements.voiceMailDesc.setAttribute('data-l10n-id','voiceMail-number-notSet');}});},_updateVoicePrivacyItemState:function(){if(this._elements.voicePrivacyItem.hidden){return;}
this._conn.getVoicePrivacyMode().then((enabled)=>{this._elements.voicePrivacyInput.checked=enabled;},(error)=>{console.log('get voice privacy mode error');console.log(error);});},_updateFdnStatus:function(){var iccId=navigator.mozMobileConnections[this._cardIndex].iccId;if(iccId){var icc=navigator.mozIccManager.getIccById(iccId);if(icc){icc.getCardLock('fdn').then((result)=>{var enabled=result.enabled;this._elements.fdnDesc.setAttribute('data-l10n-id',enabled?'enabled':'disabled');this._elements.callForwardingItem.hidden=enabled;});}}}});};});