Release Vulpes OS Preview 26 with Gecko 161.0 and Tundra 0.2.0
This commit is contained in:
parent
3a1fba4efe
commit
e241a42d2f
1 changed files with 1305 additions and 331 deletions
|
|
@ -54,6 +54,30 @@
|
|||
});
|
||||
}
|
||||
if (app === 'system') {
|
||||
if (window.VulpesPlatform === 'tundra' && window.VulpesNativeTelephony &&
|
||||
!window.VulpesNativeRadioStatus && !navigator.mozMobileConnections) {
|
||||
let revision = 0;
|
||||
const refreshCarrier = async () => {
|
||||
const element = document.getElementById('lockscreen-conn-states');
|
||||
const current = ++revision;
|
||||
if (!element) return;
|
||||
const key = 'ril.radio.disabled';
|
||||
const request = navigator.mozSettings.createLock().get(key);
|
||||
request.onsuccess = async () => {
|
||||
if (current !== revision) return;
|
||||
const line = document.createElement('span');
|
||||
if (request.result[key]) navigator.mozL10n.setAttributes(line, 'airplaneMode');
|
||||
else line.textContent = await VulpesCompat.call('platform.carrierName', {}).catch(() => '');
|
||||
if (current !== revision || !element.isConnected) return;
|
||||
element.replaceChildren(line);
|
||||
element.hidden = !request.result[key] && !line.textContent;
|
||||
};
|
||||
};
|
||||
navigator.mozSettings.addObserver('ril.radio.disabled', refreshCarrier);
|
||||
addEventListener('lockscreen-appopened', refreshCarrier);
|
||||
addEventListener('screenchange', event => { if (event.detail.screenEnabled) refreshCarrier(); });
|
||||
navigator.mozL10n.ready(refreshCarrier);
|
||||
}
|
||||
// Android reserves the edge swipe for its own shade. A tap on Gaia's
|
||||
// status bar provides access without competing with that system gesture.
|
||||
if (window.VulpesPlatform === 'android') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue