From f8805326702f3c92c5662f5c5b942cce98e2cf12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E6=8C=AF=E6=9D=B0?= Date: Fri, 4 Jul 2025 18:08:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD=E6=81=A2=E5=A4=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81getCompatibilityInfo=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吕振杰 --- ...os.application.BackupExtensionAbility.d.ts | 26 +++++++++++ api/@ohos.file.backup.d.ts | 45 +++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/api/@ohos.application.BackupExtensionAbility.d.ts b/api/@ohos.application.BackupExtensionAbility.d.ts index a03b309519..147010c2a5 100644 --- a/api/@ohos.application.BackupExtensionAbility.d.ts +++ b/api/@ohos.application.BackupExtensionAbility.d.ts @@ -168,6 +168,32 @@ declare class BackupExtensionAbility { * @since 20 */ onRelease(scenario: number): Promise; + + /** + * Callback to be called when getting application backup compatibilityInfo. + * Developer could override this method to provide the backup compatibilityInfo. + * + * @param { string } extInfo Information about the capabilities of the peer. + * @returns { Promise } Return backup compatibilityInfo, support promise. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @StageModelOnly + * @since 20 + */ + getBackupCompatibilityInfo(extInfo: string) : Promise; + + /** + * Callback to be called when getting application restore compatibilityInfo. + * Developer could override this method to provide the restore compatibilityInfo. + * + * @param { string } extInfo Information about the capabilities of the peer. + * @returns { Promise } Return restore compatibilityInfo, support promise. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @StageModelOnly + * @since 20 + */ + getRestoreCompatibilityInfo(extInfo: string) : Promise; } export default BackupExtensionAbility; diff --git a/api/@ohos.file.backup.d.ts b/api/@ohos.file.backup.d.ts index 723db6e50a..4310765c87 100644 --- a/api/@ohos.file.backup.d.ts +++ b/api/@ohos.file.backup.d.ts @@ -677,6 +677,21 @@ declare namespace backup { * @since 20 */ cleanBundleTempDir(bundleName: string): Promise; + + /** + * Provides an interface for the tool to get compatibility info. + * @permission ohos.permission.BACKUP + * @param { string } bundleName - Set the bundleName of the application that need to get compatibilityInfo. + * @param { string } extInfo - Indicates the extension information of application. + * @returns { Promise } Return compatibility info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, + * application which is not a system application uses system API. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 20 + */ + getCompatibilityInfo(bundleName: string, extInfo: string): Promise; } /** @@ -901,6 +916,21 @@ declare namespace backup { * @since 20 */ cleanBundleTempDir(bundleName: string): Promise; + + /** + * Provides an interface for the tool to get compatibility info. + * @permission ohos.permission.BACKUP + * @param { string } bundleName - Set the bundleName of the application that need to get compatibilityInfo. + * @param { string } extInfo - Indicates the extension information of application. + * @returns { Promise } Return compatibility info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, + * application which is not a system application uses system API. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 20 + */ + getCompatibilityInfo(bundleName: string, extInfo: string): Promise; } /** @@ -1059,6 +1089,21 @@ declare namespace backup { * @since 20 */ cleanBundleTempDir(bundleName: string): Promise; + + /** + * Provides an interface for the tool to get compatibility info. + * @permission ohos.permission.BACKUP + * @param { string } bundleName - Set the bundleName of the application that need to get compatibilityInfo. + * @param { string } extInfo - Indicates the extension information of application. + * @returns { Promise } Return compatibility info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, + * application which is not a system application uses system API. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 20 + */ + getCompatibilityInfo(bundleName: string, extInfo: string): Promise; } } export default backup; -- Gitee