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
|
|
@ -43,8 +43,8 @@ export function tundraCapabilities(release) {
|
|||
platform: 'tundra',
|
||||
platformName: 'Tundra',
|
||||
model: 'Google Pixel 3a',
|
||||
tundra: '0.1.0-dev',
|
||||
adapter: { version: '0.1.0-dev', device: 'sargo' },
|
||||
tundra: release.tundra,
|
||||
adapter: { version: release.adapters.sargo, device: 'sargo' },
|
||||
version: release.version,
|
||||
gaia: release.gaia,
|
||||
gecko: Services.appinfo.platformVersion,
|
||||
|
|
@ -102,6 +102,7 @@ export async function tundraRadio(operation, params = {}) {
|
|||
|
||||
let wifiScanPending = null;
|
||||
let wifiScanCache = null;
|
||||
let wifiGeneration = 0;
|
||||
const WIFI_SCAN_CACHE_MS = 5000;
|
||||
|
||||
export async function tundraWifi(params) {
|
||||
|
|
@ -110,7 +111,11 @@ export async function tundraWifi(params) {
|
|||
throw Error('WIFI_INVALID_REQUEST');
|
||||
if (params.operation !== 'scan') {
|
||||
try { return await wifiCommand(params); }
|
||||
finally { if (['connect','connectHidden','disconnect','forget','setEnabled','hotspotPower'].includes(params.operation)) wifiScanCache = null; }
|
||||
finally { if (['connect','connectHidden','disconnect','forget','setEnabled','hotspotPower'].includes(params.operation)) {
|
||||
wifiGeneration++;
|
||||
wifiScanPending = null;
|
||||
wifiScanCache = null;
|
||||
} }
|
||||
}
|
||||
// System and Settings share a broker: at most one Python scan client exists.
|
||||
if (wifiScanPending) return wifiScanPending;
|
||||
|
|
@ -118,14 +123,15 @@ export async function tundraWifi(params) {
|
|||
if (wifiScanCache.error) throw wifiScanCache.error;
|
||||
return wifiScanCache.result;
|
||||
}
|
||||
const generation = wifiGeneration;
|
||||
wifiScanPending = wifiCommand(params).then(result => {
|
||||
wifiScanCache = {result, expires:Date.now() + WIFI_SCAN_CACHE_MS};
|
||||
if (generation === wifiGeneration) wifiScanCache = {result, expires:Date.now() + WIFI_SCAN_CACHE_MS};
|
||||
return result;
|
||||
}, error => {
|
||||
// A missing interface must not turn retries into another process storm.
|
||||
wifiScanCache = {error, expires:Date.now() + WIFI_SCAN_CACHE_MS};
|
||||
if (generation === wifiGeneration) wifiScanCache = {error, expires:Date.now() + WIFI_SCAN_CACHE_MS};
|
||||
throw error;
|
||||
}).finally(() => { wifiScanPending = null; });
|
||||
}).finally(() => { if (generation === wifiGeneration) wifiScanPending = null; });
|
||||
return wifiScanPending;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue