Release Preview 20 shared desktop, Android and Sargo updates
Restore Gaia settings and media workflows, extend native network adapters, and align the APK payload. Generate French/English changelogs and website entries from the simplified JSON source. Validation: shared JS and Tundra unit tests; desktop workflows and persistence; signed APK payload parity; Sargo RAM and installed startup with boot readback. Android runtime qualification is recorded separately.
This commit is contained in:
parent
be2cdce823
commit
1311bed5e9
170 changed files with 19698 additions and 2495 deletions
28
host/StorageStats.sys.mjs
Normal file
28
host/StorageStats.sys.mjs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Only byte counts for Vulpes-owned storage cross the application boundary.
|
||||
let pending, cached;
|
||||
export async function storageStats(app) {
|
||||
if(app.id!=='settings')throw Error('PERMISSION_DENIED');
|
||||
if(cached && Date.now()-cached.at<5000)return cached.value;
|
||||
if(pending)return pending;
|
||||
pending=(async()=>{
|
||||
async function bytes(path,skip='') {
|
||||
if(path===skip || !await IOUtils.exists(path))return 0;
|
||||
const file=Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);file.initWithPath(path);
|
||||
if(file.isSymlink())return 0;
|
||||
const info=await IOUtils.stat(path);
|
||||
if(info.type==='regular')return info.size;
|
||||
if(info.type!=='directory')return 0;
|
||||
let total=0;
|
||||
for(const child of await IOUtils.getChildren(path)) {
|
||||
try {total+=await bytes(child,skip);} catch(error) {if(error.name!=='NotFoundError')throw error;}
|
||||
}
|
||||
return total;
|
||||
}
|
||||
const profile=PathUtils.profileDir,media=PathUtils.join(profile,'vulpes-media');
|
||||
const file=Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);file.initWithPath(profile);
|
||||
const value={free:file.diskSpaceAvailable,apps:await bytes(profile,media),sdcard:await bytes(media),scope:'vulpes-profile'};
|
||||
cached={at:Date.now(),value};return value;
|
||||
})().finally(()=>{pending=null;});
|
||||
return pending;
|
||||
}
|
||||
Loading…
Reference in a new issue