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,86 @@
'use strict';
/* exported MockCall */
function MockCall(aNumber, aState, aServiceId) {
this._eventListeners = {
'connected': [],
'disconnected': [],
'statechange': []
};
this.id = { number: aNumber };
this.serviceId = (aServiceId === undefined) ? 1 : aServiceId;
this.state = aState;
this.switchable = true; // The call can be put on hold by default
this.mergeable = true; // The call can be merged by default
this.answer = function() {
this._connect();
};
this.hangUp = function() {
this._disconnect();
};
this.hold = function() {};
this.resume = function() {};
this.mEmergencyNumbers = ['112', '911'];
this.emergency = this.mEmergencyNumbers.indexOf(aNumber) >= 0;
this.mVoicemailNumbers = ['123'];
this.voicemail = this.mVoicemailNumbers.indexOf(aNumber) >= 0;
this.addEventListener = (function(type, handler) {
if (this._eventListeners[type]) {
this._eventListeners[type].push(handler);
}
}).bind(this);
this.removeEventListener = (function(type, handler) {
if (this._eventListeners[type]) {
var idx = this._eventListeners[type].indexOf(handler);
this._eventListeners[type].splice(idx, 1);
}
}).bind(this);
this.triggerEvent = function(type) {
this._mTriggerEventListeners(type);
},
// Mocking the events
this.mChangeState = (function(state) {
this.state = state;
this._mTriggerEventListeners('statechange');
}).bind(this);
this._connect = this.mChangeState.bind(this, 'connected');
this._disconnect = (function() {
this.mChangeState('disconnected');
this._mTriggerEventListeners('disconnected');
}).bind(this);
this._hold = (function() {
this.mChangeState('held');
}).bind(this);
this._resume = (function() {
this.mChangeState('connected');
}).bind(this);
this._mTriggerEventListeners = function(type) {
if (!this._eventListeners[type]) {
return;
}
var self = this;
this._eventListeners[type].forEach(function(callback) {
if (typeof callback === 'function') {
callback({call: self});
} else if (typeof callback == 'object' &&
typeof callback.handleEvent === 'function') {
callback.handleEvent({call: self});
}
});
};
}

View file

@ -0,0 +1,44 @@
'use strict';
/* exported MockCallsHandler */
var MockCallsHandler = {
mActiveCall: null,
mActiveCallForContactImage: null,
mIsFirstCallOnCdmaNetwork: false,
get activeCall() {
return this.mActiveCall;
},
get activeCallForContactImage() {
return this.mActiveCallForContactImage;
},
isFirstCallOnCdmaNetwork: function() {
return this.mIsFirstCallOnCdmaNetwork;
},
toggleCalls: function() {},
toggleMute: function() {},
unmute: function() {},
toggleSpeaker: function() {},
switchToSpeaker: function() {},
switchToDefaultOut: function() {},
switchToReceiver: function() {},
checkCalls: function() {},
end: function() {},
answer: function() {},
updateAllPhoneNumberDisplays: function() {},
updatePlaceNewCall: function() {},
mergeCalls: function() {},
holdOrResumeSingleCall: function() {},
updateMergeAndOnHoldStatus: function() {},
updateMuteAndSpeakerStatus: function() {},
setup: function () {},
mTeardown: function() {
this.mActiveCall = null;
this.mActiveCallForContactImage = null;
this.mIsFirstCallOnCdmaNetwork = false;
}
};

View file

@ -0,0 +1,60 @@
'use strict';
/* exported MockContacts */
var MockContacts = {
// We need to test calls without contact information
// so we'll return that info depending on the
// calling number
// '111': No contacts
// '222': More than 1 contact for that number
// Any other: 1 contact
findByNumber: function findByNumber(number, callback) {
this.mCalledWith = number;
this.mPhoto = 'test';
this.mName = 'test name';
var tel = {
value: this.mCalledWith,
carrier: this.mCarrier,
type: this.mType
};
var contact = {
id: this.mId,
name: [this.mName],
tel: [tel],
photo: [this.mPhoto]
};
var contactsWithSameNumber = 0;
switch (number) {
case '111':
this.mPhoto = null;
this.mName = null;
contact = null;
tel = null;
break;
case '222':
contactsWithSameNumber = 2;
break;
default:
}
callback(contact, tel, contactsWithSameNumber);
},
findListByNumber: function cm_getContactData(number, maxitems, callback) {
callback(this.mResult);
},
getRevision: function cm_getRevision(callback) { callback(0); },
mId: 'id',
mPhoto: null,
mName: null,
mCalledWith: null,
mCarrier: 'carrier',
mType: 'type',
mResult: null,
mTearDown: function tearDown() {
this._calledWith = null;
this.mCarrier = 'carrier';
this.mType = 'type';
this.mResult = [];
}
};

View file

@ -0,0 +1,18 @@
/* exported MockFontSizeManager */
'use strict';
var MockFontSizeManager = {
/**
* Possible scenarios as declared by FontSizeManager.
*/
DIAL_PAD: 0,
SINGLE_CALL: 1,
CALL_WAITING: 2,
STATUS_BAR: 3,
SECOND_INCOMING_CALL: 4,
adaptToSpace: function() {},
ensureFixedBaseline: function() {},
resetFixedBaseline: function() {}
};

View file

@ -0,0 +1,94 @@
/* globals HandledCall, MockNavigatorMozTelephony */
/* exported telephonyAddCall, telephonyAddCdmaCall */
'use strict';
function MockHandledCall(call) {
this.call = call;
this.node = document.createElement('section'); // fake dom
}
MockHandledCall.prototype.handleEvent = function hc_handle(evt) {
};
MockHandledCall.prototype.startTimer = function hc_startTimer() {
};
MockHandledCall.prototype.updateCallNumber = function hc_updateCallNumber() {
};
MockHandledCall.prototype.replaceAdditionalContactInfo =
function hc_replaceAdditionalContactInfo(additionalContactInfo) {
};
MockHandledCall.prototype.restoreAdditionalContactInfo =
function hc_restoreAdditionalContactInfo(additionalContactInfo) {
};
MockHandledCall.prototype.formatPhoneNumber =
function hc_formatPhoneNumber(ellipsisSide, maxFontSize) {
};
MockHandledCall.prototype.renderPhoneNumber =
function hc_renderPhoneNumber(phoneNumber, ellipsisSide) {
};
MockHandledCall.prototype.replacePhoneNumber =
function hc_replacePhoneNumber(phoneNumber, ellipsisSide) {
};
MockHandledCall.prototype.restorePhoneNumber =
function hc_restorePhoneNumber() {
};
MockHandledCall.prototype.updateDirection = function hc_updateDirection() {
};
MockHandledCall.prototype.remove = function hc_remove() {
};
MockHandledCall.prototype.connected = function hc_connected() {
};
MockHandledCall.prototype.busy = function hc_busy() {
};
MockHandledCall.prototype.disconnected = function hc_disconnected() {
};
MockHandledCall.prototype.show = function hc_show() {
};
MockHandledCall.prototype.hide = function hc_hide() {
};
// Should be called in the context of a suite
function telephonyAddCall(mockCall, opt) {
MockNavigatorMozTelephony.calls.push(mockCall);
var handledCall = new MockHandledCall(mockCall);
// not already stubed
if (!('restore' in HandledCall)) {
/* jshint validthis: true */
this.sinon.stub(window, 'HandledCall');
}
HandledCall.withArgs(mockCall).returns(handledCall);
if (opt && opt.trigger) {
MockNavigatorMozTelephony.mTriggerCallsChanged();
}
return handledCall;
}
/* Should be called in the context of a suite after one call has already been
* added via telephonyAddCall(). */
function telephonyAddCdmaCall(number, opt) {
MockNavigatorMozTelephony.calls[0].secondId = { number: number };
MockNavigatorMozTelephony.calls[0].state = 'connected';
if (opt && opt.trigger) {
MockNavigatorMozTelephony.mTriggerCallsChanged();
}
}

View file

@ -0,0 +1,29 @@
'use strict';
/* exported MockKeypadManager */
var MockKeypadManager = {
_phoneNumber: '',
mOnMakeCall: null,
lastCalled: '15555555555',
init: function() {},
updatePhoneNumber: function khm_updatePhoneNumber(number) {
this._phoneNumber = number;
},
makeCall: function makeCall() {
if (this.mOnMakeCall) {
if (this._phoneNumber) {
this.lastCalled = this._phoneNumber;
}
this.mOnMakeCall(this._phoneNumber);
}
},
phoneNumber: function phoneNumber() {
return this._phoneNumber;
},
fetchLastCalled: function() {
this._phoneNumber = this.lastCalled;
},
render: function() {},
restorePhoneNumber: function() {},
restoreAdditionalContactInfo: function() {}
};

View file

@ -0,0 +1,20 @@
'use strict';
/* exported MockTelephonyHelper */
var MockTelephonyHelper = {
mInUseSim: null,
mCallPromise: null,
call: function() {
if (!this.mCallPromise) {
this.mCallPromise = new Promise(() => {});
}
return this.mCallPromise;
},
getInUseSim: function() { return this.mInUseSim; },
mTeardown: function() {
this.mInUseSim = null;
this.mCallPromise = null;
}
};

View file

@ -0,0 +1,14 @@
'use strict';
/* exported MockTelephonyMessages */
var MockTelephonyMessages = {
REGULAR_CALL: 0,
NO_NETWORK: 1,
EMERGENCY_ONLY: 2,
displayMessage: function() {},
handleDisconnect: function() {},
handleError: function() {},
notifyBusyLine: function() {}
};

View file

@ -0,0 +1,10 @@
/* exported MockTonePlayer */
'use strict';
var MockTonePlayer = {
init: function() {},
playSequence: function() {},
start: function(frequencies, shortPress) {},
stop: function() {}
};

View file

@ -0,0 +1,72 @@
'use strict';
/* exported MockUtils */
var MockUtils = {
mCalledPrettyDate: false,
mCalledSetHeaderDate: false,
mCalledGetDayDate: false,
mCalledGetPhoneNumberPrimaryInfo: false,
mCalledGetPhoneNumberAdditionalInfo: false,
prettyDate: function ut_prettyDate(time) {
this.mCalledPrettyDate = true;
},
setHeaderDate: function ut_headerDate(elem, time) {
this.mCalledSetHeaderDate = true;
elem.textContent = time;
},
getDayDate: function re_getDayDate(timestamp) {
this.mCalledGetDayDate = true;
var date = new Date(timestamp);
var startDate = new Date(date.getFullYear(),
date.getMonth(), date.getDate());
return startDate.getTime();
},
getPhoneNumberAdditionalInfo:
function getPhoneNumberAdditionalInfo(matchingTel) {
return {
id: matchingTel.type,
args: {
carrier: matchingTel.carrier
}
};
},
addEllipsis: function ut_addEllipsis() {},
getNextFontSize: function ut_getNextFontSize(view, fakeView, maxFontSize,
minFontSize, fontStep) {
return maxFontSize;
},
mTearDown: function tearDown() {
this.mCalledPrettyDate = false;
this.mCalledHeaderDate = false;
this.mCalledGetDayDate = false;
this.mCalledGetPhoneNumberPrimaryInfo = false;
this.mCalledGetPhoneNumberAdditionalInfo = false;
},
getPhoneNumberPrimaryInfo: function ut_getPhoneNumberPrimaryInfo(matchingTel,
contact) {
this.mCalledGetPhoneNumberPrimaryInfo = true;
if (contact) {
if (contact.name && String(contact.name) !== '') {
return contact.name;
} else if (contact.org && String(contact.org) !== '') {
return contact.org;
}
}
if (matchingTel) {
return matchingTel.value;
}
return null;
},
prettyDuration: function(node, duration, l10nPrefix) {},
isPhoneType: function(type) {}
};