W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
該模塊提供空間查詢相關(guān)的常用功能:包括對(duì)內(nèi)外卡的空間查詢,對(duì)應(yīng)用分類數(shù)據(jù)統(tǒng)計(jì)的查詢,對(duì)應(yīng)用數(shù)據(jù)的查詢等。
本模塊首批接口從API version 8開始支持。后續(xù)版本的新增接口,采用上角標(biāo)單獨(dú)標(biāo)記接口的起始版本。
getCurrentBundleStats(): Promise<BundleStats>
第三方應(yīng)用異步獲取當(dāng)前應(yīng)用存儲(chǔ)空間大?。▎挝粸锽yte),以promise方式返回。
系統(tǒng)能力:SystemCapability.FileManagement.StorageService.SpatialStatistics
返回值:
類型 | 說明 |
---|---|
Promise<Bundlestats> | 返回指定卷上的應(yīng)用存空間大?。▎挝粸锽yte) |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見文件管理錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
401 | The input parameter is invalid. |
13600001 | IPC error. |
13900032 | Unknown error. |
示例:
- let bundleStats = storageStatistics.getCurrentBundleStats();
- console.info("getCurrentBundleStats successfully:"+ JSON.stringify(bundleStats));
getCurrentBundleStats(callback: AsyncCallback<BundleStats>): void
第三方應(yīng)用異步獲取當(dāng)前應(yīng)用存儲(chǔ)空間大?。▎挝粸锽yte),以callback方式返回。
系統(tǒng)能力:SystemCapability.FileManagement.StorageService.SpatialStatistics
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
callback | AsyncCallback<BundleStats> | 是 | 獲取指定卷上的應(yīng)用存儲(chǔ)空間大小之后的回調(diào) |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見文件管理錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
401 | The input parameter is invalid. |
13600001 | IPC error. |
13900032 | Unknown error. |
示例:
- storageStatistics.getCurrentBundleStats(function(error, bundleStats){
- // do something
- console.info("getCurrentBundleStats successfully:"+ JSON.stringify(bundleStats));
- });
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: