2022-09-29 05:12:28 +00:00
|
|
|
/*
|
2023-06-17 16:34:23 +00:00
|
|
|
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
2022-09-29 05:12:28 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-07-24 14:15:08 +00:00
|
|
|
import type { AsyncCallback, Callback } from './@ohos.base';
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Provides the capability to access the data loss prevention (DLP) files.
|
|
|
|
*
|
2023-03-15 07:06:12 +00:00
|
|
|
* @namespace dlpPermission
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
|
|
|
declare namespace dlpPermission {
|
2023-06-07 11:56:32 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Enumerates the types of actions that can be performed on a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
export enum ActionFlagType {
|
2023-06-07 11:56:32 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* View a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_VIEW = 0x00000001,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Save a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_SAVE = 0x00000002,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Save a DLP file as another file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_SAVE_AS = 0x00000004,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Edit a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_EDIT = 0x00000008,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Take a screenshot of a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_SCREEN_CAPTURE = 0x00000010,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Share the screen, on which a DLP file is opened.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_SCREEN_SHARE = 0x00000020,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Record the screen, on which a DLP file is opened.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_SCREEN_RECORD = 0x00000040,
|
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Copy in the editor, on which a DLP file is opened.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_COPY = 0x00000080,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Print a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_PRINT = 0x00000100,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Export a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_EXPORT = 0x00000200,
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Change the permissions for a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ACTION_PERMISSION_CHANGE = 0x00000400
|
|
|
|
}
|
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the access permissions for a DLP file.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
export enum DLPFileAccess {
|
2023-04-03 06:29:20 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* No permission.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
NO_PERMISSION = 0,
|
2022-09-29 05:12:28 +00:00
|
|
|
|
2023-06-07 11:56:32 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Read-only.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-06-07 11:56:32 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
READ_ONLY = 1,
|
2023-06-07 11:56:32 +00:00
|
|
|
|
2022-09-29 05:12:28 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Edit.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
CONTENT_EDIT = 2,
|
2023-06-07 11:56:32 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Full control.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-06-07 11:56:32 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
FULL_CONTROL = 3
|
2023-04-03 06:29:20 +00:00
|
|
|
}
|
|
|
|
|
2023-06-07 11:56:32 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Represents the permission info of a DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
|
|
|
* @interface DLPPermissionInfo
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
export interface DLPPermissionInfo {
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Access permission for the DLP file.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { DLPFileAccess }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
dlpFileAccess: DLPFileAccess;
|
2023-06-07 11:56:32 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Actions allowed for the DLP file. The value is a combination of flags in {@link ActionFlagType}.
|
2023-06-07 11:56:32 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-06-07 11:56:32 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
flags: number;
|
2023-06-07 11:56:32 +00:00
|
|
|
}
|
|
|
|
|
2023-06-24 06:14:12 +00:00
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Represents the accessed DLP file info.
|
2023-06-24 06:14:12 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @interface AccessedDLPFileInfo
|
2023-06-24 06:14:12 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
export interface AccessedDLPFileInfo {
|
2023-06-24 06:14:12 +00:00
|
|
|
/**
|
|
|
|
* URI of the DLP file.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
uri: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Time when the DLP file was last opened.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
lastOpenTime: number;
|
2023-06-24 06:14:12 +00:00
|
|
|
}
|
|
|
|
|
2023-04-03 06:29:20 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Represents the retention sandbox info.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @interface RetentionSandboxInfo
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
export interface RetentionSandboxInfo {
|
|
|
|
/**
|
|
|
|
* Application index of the DLP sandbox.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
appIndex: number;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Bundle name of the application.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
bundleName: string;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* List of file URIs.
|
|
|
|
*
|
|
|
|
* @type { Array<string> }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
docUris: Array<string>;
|
|
|
|
}
|
2023-04-03 06:29:20 +00:00
|
|
|
|
2023-04-27 12:27:19 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Checks whether a file is a DLP file. This method uses a promise to return the result.
|
2023-04-27 12:27:19 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { number } fd - Indicates the file descriptor of the file to check.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<boolean> } Returns {@code true} if {@link fd} is a DLP file; returns {@code false} otherwise.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-04-27 12:27:19 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function isDLPFile(fd: number): Promise<boolean>;
|
2023-04-27 12:27:19 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Checks whether a file is a DLP file. This method uses an asynchronous callback to return the result.
|
2023-04-27 12:27:19 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { number } fd - Indicates the file descriptor of the file to check.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<boolean> } callback - Indicates the callback of isDLPFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-04-27 12:27:19 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function isDLPFile(fd: number, callback: AsyncCallback<boolean>): void;
|
2023-04-27 12:27:19 +00:00
|
|
|
|
2023-05-10 09:22:24 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Obtains the permission info of this DLP file. This method uses a promise to return the result.
|
2023-05-10 09:22:24 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<DLPPermissionInfo> } Returns the {@link DLPPermissionInfo}.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100006 - No permission to invoke this API, which is for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-10 09:22:24 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function getDLPPermissionInfo(): Promise<DLPPermissionInfo>;
|
2023-05-10 09:22:24 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Obtains the permission info of this DLP file. This method uses an asynchronous callback to return the result.
|
2023-05-10 09:22:24 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<DLPPermissionInfo> } callback - Indicates the callback of getDLPPermissionInfo.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100006 - No permission to invoke this API, which is for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-10 09:22:24 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function getDLPPermissionInfo(callback: AsyncCallback<DLPPermissionInfo>): void;
|
2023-05-10 09:22:24 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Obtains the original file name from a DLP file name. This method removes the DLP file name extension from the DLP file name.
|
2023-05-10 09:22:24 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { string } fileName - Indicates the DLP file name.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @returns { string } Returns the original file name obtained.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-10 09:22:24 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function getOriginalFileName(fileName: string): string;
|
2023-05-10 09:22:24 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Obtains the DLP file name extension.
|
2023-05-10 09:22:24 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @returns { string } Returns the DLP file name extension obtained.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-10 09:22:24 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function getDLPSuffix(): string;
|
2023-05-10 09:22:24 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Subscribes to the event reported when a DLP file is opened by current application.
|
2023-05-10 09:22:24 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { 'openDLPFile' } type - Indicates the type of the event to subscribe to.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { Callback<AccessedDLPFileInfo> } listener - Indicates the callback invoked when a DLP file is opened by current application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-10 09:22:24 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function on(type: 'openDLPFile', listener: Callback<AccessedDLPFileInfo>): void;
|
2023-05-10 09:22:24 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Unsubscribes from the event reported when a DLP file is opened by current application.
|
2023-05-10 09:22:24 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { 'openDLPFile' } type - Indicates the type of the event to unsubscribe from.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { Callback<AccessedDLPFileInfo> } listener - Indicates the callback invoked when a DLP file is opened by current application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function off(type: 'openDLPFile', listener?: Callback<AccessedDLPFileInfo>): void;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Checks whether current application is in the DLP sandbox. This method uses a promise to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<boolean> } Returns {@code true} if current application is in a DLP sandbox; returns {@code false} otherwise.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function isInSandbox(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Checks whether current application is in the DLP sandbox. This method uses an asynchronous callback to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<boolean> } callback - Indicates the callback of isInSandbox.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function isInSandbox(callback: AsyncCallback<boolean>): void;
|
|
|
|
|
|
|
|
/**
|
2023-06-24 06:14:12 +00:00
|
|
|
* Obtains the file types supported by DLP. This method uses a promise to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<Array<string>> } Returns the list of file types supported.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-06-24 06:14:12 +00:00
|
|
|
function getDLPSupportedFileTypes(): Promise<Array<string>>;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-24 06:14:12 +00:00
|
|
|
* Obtains the file types supported by DLP. This method uses an asynchronous callback to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<Array<string>> } callback - Indicates the callback of getDLPSupportedFileTypes.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-06-24 06:14:12 +00:00
|
|
|
function getDLPSupportedFileTypes(callback: AsyncCallback<Array<string>>): void;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Sets the retention status for the files specified by URI list. This method uses a promise to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
|
|
|
* @param { Array<string> } docUris - Indicates the URIs of the files, for which the retention status is to set.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100006 - No permission to invoke this API, which is for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function setRetentionState(docUris: Array<string>): Promise<void>;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Sets the retention status for the files specified by URI list. This method uses an asynchronous callback to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
|
|
|
* @param { Array<string> } docUris - Indicates the URIs of the files, for which the retention status is to set.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of setRetentionState.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100006 - No permission to invoke this API, which is for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function setRetentionState(docUris: Array<string>, callback: AsyncCallback<void>): void;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Cancels the retention status for the files specified by URI list. This method uses a promise to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
|
|
|
* @param { Array<string> } docUris - Indicates the list of the file URIs.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function cancelRetentionState(docUris: Array<string>): Promise<void>;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Cancels the retention status for the files specified by URI list. This method uses an asynchronous callback to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
|
|
|
* @param { Array<string> } docUris - Indicates the list of the file URIs.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of cancelRetentionState.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function cancelRetentionState(docUris: Array<string>, callback: AsyncCallback<void>): void;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains information about the retained DLP sandboxes of an application. This method uses a promise to return the result.
|
|
|
|
*
|
|
|
|
* @param { string } bundleName - Indicates the bundle name of the application.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<Array<RetentionSandboxInfo>> } Returns a list of {@link RetentionSandboxInfo}.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-10 09:22:24 +00:00
|
|
|
*/
|
|
|
|
function getRetentionSandboxList(bundleName?: string): Promise<Array<RetentionSandboxInfo>>;
|
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Obtains information about the retained DLP sandboxes of an application. This method uses an asynchronous callback to return the result.
|
|
|
|
*
|
|
|
|
* @param { string } bundleName - Indicates the bundle name of the application.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<Array<RetentionSandboxInfo>> } callback - Indicates the callback of getRetentionSandboxList.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function getRetentionSandboxList(bundleName: string, callback: AsyncCallback<Array<RetentionSandboxInfo>>): void;
|
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Obtains information about the retained DLP sandboxes of an application. This method uses an asynchronous callback to return the result.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<Array<RetentionSandboxInfo>> } callback - Indicates the callback of getRetentionSandboxList.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function getRetentionSandboxList(callback: AsyncCallback<Array<RetentionSandboxInfo>>): void;
|
|
|
|
|
2023-05-22 08:21:03 +00:00
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Obtains the DLP file access records. This method uses a promise to return the result.
|
2023-05-22 08:21:03 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<Array<AccessedDLPFileInfo>> } Returns a list of {@link AccessedDLPFileInfo}.
|
2023-05-22 08:21:03 +00:00
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-05-22 08:21:03 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-22 08:21:03 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function getDLPFileAccessRecords(): Promise<Array<AccessedDLPFileInfo>>;
|
2023-05-22 08:21:03 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Obtains the DLP file access records. This method uses an asynchronous callback to return the result.
|
2023-05-22 08:21:03 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<Array<AccessedDLPFileInfo>> } callback - Indicates the callback of getDLPFileAccessRecords.
|
2023-05-22 08:21:03 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100007 - No permission to invoke this API, which is not for DLP sandbox application.
|
2023-05-22 08:21:03 +00:00
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @since 10
|
2023-05-22 08:21:03 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function getDLPFileAccessRecords(callback: AsyncCallback<Array<AccessedDLPFileInfo>>): void;
|
2023-05-22 08:21:03 +00:00
|
|
|
|
2023-04-03 06:29:20 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Enumerates the gathering policy types for DLP files.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
export enum GatheringPolicyType {
|
|
|
|
/**
|
|
|
|
* Gathering, which allows multiple DLP files to be opened in a sandbox.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
GATHERING = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Non-gathering, which allows only one DLP file to be opened in a sandbox.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
NON_GATHERING = 2
|
|
|
|
}
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Obtains the DLP sandbox gathering policy. This method uses a promise to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<GatheringPolicyType> } Returns the {@link GatheringPolicyType}.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function getDLPGatheringPolicy(): Promise<GatheringPolicyType>;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Obtains the DLP sandbox gathering policy. This method uses an asynchronous callback to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<GatheringPolicyType> } callback - Indicates the callback of getDLPGatheringPolicy.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function getDLPGatheringPolicy(callback: AsyncCallback<GatheringPolicyType>): void;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Represents the installed DLP sandbox application info.
|
|
|
|
*
|
|
|
|
* @interface DLPSandboxInfo
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
export interface DLPSandboxInfo {
|
|
|
|
/**
|
|
|
|
* Index of the installed DLP sandbox application.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
appIndex: number;
|
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Token ID of the installed DLP sandbox application.
|
2023-06-17 16:34:23 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
tokenID: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Installs a DLP sandbox application. This method uses a promise to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } bundleName - Indicates the bundle name of the application.
|
|
|
|
* @param { DLPFileAccess } access - Indicates the access permission for the DLP file.
|
|
|
|
* @param { number } userId - Indicates the user ID.
|
|
|
|
* @param { string } uri - Indicates the URI of the file.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<DLPSandboxInfo> } Returns the {@link DLPSandboxInfo}.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function installDLPSandbox(
|
|
|
|
bundleName: string,
|
|
|
|
access: DLPFileAccess,
|
|
|
|
userId: number,
|
|
|
|
uri: string
|
2023-06-24 06:14:12 +00:00
|
|
|
): Promise<DLPSandboxInfo>;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Installs a DLP sandbox application. This method uses an asynchronous callback to return the result.
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
|
|
|
* @param { string } bundleName - Indicates the bundle name of the application.
|
|
|
|
* @param { DLPFileAccess } access - Indicates the access permission for the DLP file.
|
|
|
|
* @param { number } userId - Indicates the user ID.
|
|
|
|
* @param { string } uri - Indicates the URI of the file.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<DLPSandboxInfo> } callback - Indicates the callback of installDLPSandbox.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function installDLPSandbox(
|
2023-04-03 06:29:20 +00:00
|
|
|
bundleName: string,
|
2023-06-17 16:34:23 +00:00
|
|
|
access: DLPFileAccess,
|
2023-04-03 06:29:20 +00:00
|
|
|
userId: number,
|
2023-05-10 09:22:24 +00:00
|
|
|
uri: string,
|
2023-06-24 06:14:12 +00:00
|
|
|
callback: AsyncCallback<DLPSandboxInfo>
|
2023-04-03 06:29:20 +00:00
|
|
|
): void;
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Uninstalls a DLP sandbox application. This method uses a promise to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } bundleName - Indicates the bundle name of the application.
|
|
|
|
* @param { number } userId - Indicates the user ID.
|
|
|
|
* @param { number } appIndex - Indicates the index of DLP sandbox.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function uninstallDLPSandbox(bundleName: string, userId: number, appIndex: number): Promise<void>;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Uninstalls a DLP sandbox application. This method uses an asynchronous callback to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } bundleName - Indicates the bundle name of the application.
|
|
|
|
* @param { number } userId - Indicates the user ID.
|
|
|
|
* @param { number } appIndex - Indicates the index of DLP sandbox.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of uninstallDLPSandbox.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function uninstallDLPSandbox(
|
2023-04-03 06:29:20 +00:00
|
|
|
bundleName: string,
|
|
|
|
userId: number,
|
|
|
|
appIndex: number,
|
|
|
|
callback: AsyncCallback<void>
|
|
|
|
): void;
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Represents the DLP sandbox state.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @interface DLPSandboxState
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
export interface DLPSandboxState {
|
|
|
|
/**
|
|
|
|
* Bundle name of the application.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
bundleName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Application index of the DLP sandbox.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
appIndex: number;
|
|
|
|
}
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Subscribes to the event reported when a DLP sandbox application is uninstalled.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { 'uninstallDLPSandbox' } type - Indicates the type of event to subscribe to.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { Callback<DLPSandboxState> } listener - Indicates the callback for the DLP sandbox application uninstall event.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function on(type: 'uninstallDLPSandbox', listener: Callback<DLPSandboxState>): void;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Unsubscribes from the event reported when a DLP sandbox application is uninstalled.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { 'uninstallDLPSandbox' } type - Indicates the type of event to unsubscribe from.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { Callback<DLPSandboxState> } listener - Indicates the callback for the DLP sandbox application uninstall event.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function off(type: 'uninstallDLPSandbox', listener?: Callback<DLPSandboxState>): void;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Enumerates the account types for a DLP file.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
|
|
|
export enum AccountType {
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Cloud account.
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-04-03 06:29:20 +00:00
|
|
|
CLOUD_ACCOUNT = 1,
|
2023-03-15 07:06:12 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Domain account.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-04-03 06:29:20 +00:00
|
|
|
DOMAIN_ACCOUNT = 2,
|
|
|
|
}
|
2023-03-15 07:06:12 +00:00
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Represents the authorized user information.
|
|
|
|
*
|
|
|
|
* @interface AuthUser
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-04-03 06:29:20 +00:00
|
|
|
export interface AuthUser {
|
2023-03-15 07:06:12 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Authorized account of the DLP file.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-04-03 06:29:20 +00:00
|
|
|
authAccount: string;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Type of the authorized account.
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { AccountType }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
authAccountType: AccountType;
|
2023-03-15 07:06:12 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Authorized permission for the DLP file.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { DLPFileAccess }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
dlpFileAccess: DLPFileAccess;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Authorization expiration time of the DLP file.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
permExpiryTime: number;
|
2023-04-03 06:29:20 +00:00
|
|
|
}
|
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Represents the DLP file property.
|
|
|
|
*
|
|
|
|
* @interface DLPProperty
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
export interface DLPProperty {
|
2023-04-03 06:29:20 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Owner account of the DLP file.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
|
|
|
ownerAccount: string;
|
|
|
|
|
2023-06-08 08:55:45 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Owner account ID of the DLP file.
|
2023-06-08 08:55:45 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-06-08 08:55:45 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
ownerAccountID: string;
|
2023-06-08 08:55:45 +00:00
|
|
|
|
2023-04-03 06:29:20 +00:00
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Type of the owner account of the DLP file.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @type { AccountType }
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
ownerAccountType: AccountType;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Authorized users of the DLP file.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @type { Array<AuthUser>? }
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
authUserList?: Array<AuthUser>;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Contact account of the DLP file.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-07-24 14:15:08 +00:00
|
|
|
* @type { string }
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
contactAccount: string;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Whether the DLP file can be accessed offline.
|
|
|
|
* If the DLP file supports offline access, the credential server needs to be connected to the network only when the DLP file is opened for the first time.
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
|
|
|
offlineAccess: boolean;
|
2023-06-07 11:56:32 +00:00
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Everyone access list for the DLP file.
|
|
|
|
*
|
|
|
|
* @type { Array<DLPFileAccess> }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
everyoneAccessList?: Array<DLPFileAccess>;
|
2023-04-03 06:29:20 +00:00
|
|
|
}
|
|
|
|
|
2023-06-17 16:34:23 +00:00
|
|
|
/**
|
|
|
|
* Defines the DLP file object.
|
|
|
|
*
|
|
|
|
* @interface DLPFile
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
export interface DLPFile {
|
2023-04-03 06:29:20 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* DLP file property.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
2023-06-17 16:34:23 +00:00
|
|
|
* @type { DLPProperty }
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
dlpProperty: DLPProperty;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Adds a link file for the DLP file. This method uses a promise to return the result.
|
|
|
|
* The link file is implemented through the Filesystem in Userspace (FUSE).
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } linkFileName - Indicates the name of link file to add.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
addDLPLinkFile(linkFileName: string): Promise<void>;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Adds a link file for the DLP file. This method uses an asynchronous callback to return the result.
|
|
|
|
* The link file is implemented through the FUSE.
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
2023-03-15 07:06:12 +00:00
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } linkFileName - Indicates the name of link file to add.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of addDLPLinkFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2022-09-29 05:12:28 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
addDLPLinkFile(linkFileName: string, callback: AsyncCallback<void>): void;
|
2023-03-15 07:06:12 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Stops the FUSE link between the DLP file and a link file. This method uses a promise to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
2022-09-29 05:12:28 +00:00
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
stopFuseLink(): Promise<void>;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Stops the FUSE link between the DLP file and a link file. This method uses an asynchronous callback to return the result.
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
2023-03-15 07:06:12 +00:00
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of stopFuseLink.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2022-09-29 05:12:28 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
stopFuseLink(callback: AsyncCallback<void>): void;
|
2023-06-17 16:34:23 +00:00
|
|
|
|
2023-03-15 07:06:12 +00:00
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Resumes the FUSE link between the DLP file and a link file. This method uses a promise to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
2022-09-29 05:12:28 +00:00
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
resumeFuseLink(): Promise<void>;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Resumes the FUSE link between the DLP file and a link file. This method uses an asynchronous callback to return the result.
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of resumeFuseLink.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
resumeFuseLink(callback: AsyncCallback<void>): void;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Replaces the link file of the DLP file. This method uses a promise to return the result.
|
2022-09-29 05:12:28 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } linkFileName - Indicates the name of link file.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2022-09-29 05:12:28 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
replaceDLPLinkFile(linkFileName: string): Promise<void>;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Replaces the link file of the DLP file. This method uses an asynchronous callback to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } linkFileName - Indicates the name of link file.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of replaceDLPLinkFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
replaceDLPLinkFile(linkFileName: string, callback: AsyncCallback<void>): void;
|
|
|
|
|
2022-09-29 05:12:28 +00:00
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Deletes a link file of the DLP file. This method uses a promise to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } linkFileName - Indicates the name of link file to delete.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
deleteDLPLinkFile(linkFileName: string): Promise<void>;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Deletes a link file of the DLP file. This method uses an asynchronous callback to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { string } linkFileName - Indicates the name of link file to delete.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of deleteDLPLinkFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
deleteDLPLinkFile(linkFileName: string, callback: AsyncCallback<void>): void;
|
2022-09-29 05:12:28 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Recovers the file in plaintext from the DLP file. This method uses a promise to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { number } plaintextFd - Indicates the file descriptor of the file in plaintext.
|
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100002 - Credential task error.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100003 - Credential task time out.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100004 - Credential service error.
|
|
|
|
* @throws { BusinessError } 19100005 - Remote credential server error.
|
|
|
|
* @throws { BusinessError } 19100008 - Not DLP file.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100010 - DLP file is read-only.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
recoverDLPFile(plaintextFd: number): Promise<void>;
|
2023-03-15 07:06:12 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Recovers the file in plaintext from the DLP file. This method uses an asynchronous callback to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { number } plaintextFd - Indicates the file descriptor of the file in plaintext.
|
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of recoverDLPFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100002 - Credential task error.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100003 - Credential task time out.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100004 - Credential service error.
|
|
|
|
* @throws { BusinessError } 19100005 - Remote credential server error.
|
|
|
|
* @throws { BusinessError } 19100008 - Not DLP file.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100010 - DLP file is read-only.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
recoverDLPFile(plaintextFd: number, callback: AsyncCallback<void>): void;
|
2023-03-15 07:06:12 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Closes the DLP file when the object is no longer used. This method uses a promise to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
closeDLPFile(): Promise<void>;
|
2023-03-15 07:06:12 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Closes the DLP file when the object is no longer used. This method uses an asynchronous callback to return the result.
|
2023-03-15 07:06:12 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - Indicates the callback of closeDLPFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-03-15 07:06:12 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-03-15 07:06:12 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
closeDLPFile(callback: AsyncCallback<void>): void;
|
2023-04-03 06:29:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Generates a DLP file. This method uses a promise to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { number } plaintextFd - Indicates the file descriptor of the file in plaintext.
|
|
|
|
* @param { number } ciphertextFd - Indicates the file descriptor of the DLP file.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @param { DLPProperty } property - Indicates the property of the DLP file.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @returns { Promise<DLPFile> } Returns the {@link DLPFile}.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100002 - Credential task error.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100003 - Credential task time out.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100004 - Credential service error.
|
|
|
|
* @throws { BusinessError } 19100005 - Remote credential server error.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function generateDLPFile(plaintextFd: number, ciphertextFd: number, property: DLPProperty): Promise<DLPFile>;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-17 16:34:23 +00:00
|
|
|
* Generates a DLP file. This method uses an asynchronous callback to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { number } plaintextFd - Indicates the file descriptor of the file in plaintext.
|
|
|
|
* @param { number } ciphertextFd - Indicates the file descriptor of the DLP file.
|
|
|
|
* @param { DLPProperty } property - Indicates the property of the DLP file.
|
|
|
|
* @param { AsyncCallback<DLPFile> } callback - Indicates the callback of generateDLPFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100002 - Credential task error.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100003 - Credential task time out.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100004 - Credential service error.
|
|
|
|
* @throws { BusinessError } 19100005 - Remote credential server error.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-06-17 16:34:23 +00:00
|
|
|
function generateDLPFile(
|
2023-07-24 14:15:08 +00:00
|
|
|
plaintextFd: number,
|
|
|
|
ciphertextFd: number,
|
2023-06-17 16:34:23 +00:00
|
|
|
property: DLPProperty,
|
|
|
|
callback: AsyncCallback<DLPFile>
|
2023-04-03 06:29:20 +00:00
|
|
|
): void;
|
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Opens a DLP file. This method uses a promise to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { number } ciphertextFd - Indicates the file descriptor of the DLP file to open.
|
|
|
|
* @returns { Promise<DLPFile> } Returns the {@link DLPFile}.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100002 - Credential task error.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100003 - Credential task time out.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100004 - Credential service error.
|
|
|
|
* @throws { BusinessError } 19100005 - Remote credential server error.
|
|
|
|
* @throws { BusinessError } 19100008 - Not DLP file.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
2023-09-18 10:35:49 +00:00
|
|
|
* @throws { BusinessError } 19100015 - System need to be upgraded.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function openDLPFile(ciphertextFd: number): Promise<DLPFile>;
|
2023-04-03 06:29:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-24 14:15:08 +00:00
|
|
|
* Opens a DLP file. This method uses an asynchronous callback to return the result.
|
2023-04-03 06:29:20 +00:00
|
|
|
*
|
|
|
|
* @permission ohos.permission.ACCESS_DLP_FILE
|
2023-07-24 14:15:08 +00:00
|
|
|
* @param { number } ciphertextFd - Indicates the file descriptor of the DLP file to open.
|
|
|
|
* @param { AsyncCallback<DLPFile> } callback - Indicates the callback of openDLPFile.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
|
|
|
* @throws { BusinessError } 202 - Non-system applications use system APIs.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error.
|
|
|
|
* @throws { BusinessError } 19100001 - Invalid parameter value.
|
|
|
|
* @throws { BusinessError } 19100002 - Credential task error.
|
2023-07-24 14:15:08 +00:00
|
|
|
* @throws { BusinessError } 19100003 - Credential task time out.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @throws { BusinessError } 19100004 - Credential service error.
|
|
|
|
* @throws { BusinessError } 19100005 - Remote credential server error.
|
|
|
|
* @throws { BusinessError } 19100008 - Not DLP file.
|
|
|
|
* @throws { BusinessError } 19100009 - Failed to operate the DLP file.
|
|
|
|
* @throws { BusinessError } 19100011 - System service exception.
|
2023-09-18 10:35:49 +00:00
|
|
|
* @throws { BusinessError } 19100015 - System need to be upgraded.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @syscap SystemCapability.Security.DataLossPrevention
|
2023-04-03 06:29:20 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2023-06-17 16:34:23 +00:00
|
|
|
* @since 10
|
2023-04-03 06:29:20 +00:00
|
|
|
*/
|
2023-07-24 14:15:08 +00:00
|
|
|
function openDLPFile(ciphertextFd: number, callback: AsyncCallback<DLPFile>): void;
|
2022-09-29 05:12:28 +00:00
|
|
|
}
|
|
|
|
export default dlpPermission;
|