1 /*
2  * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef INTERFACES_INNER_API_DLP_FILE_KITS_H
17 #define INTERFACES_INNER_API_DLP_FILE_KITS_H
18 #include <cstdint>
19 #include <string>
20 #include "dlp_file_manager.h"
21 #include "want.h"
22 #include "ability_info.h"
23 
24 namespace OHOS {
25 namespace Security {
26 namespace DlpPermission {
27 static const std::string TAG_ACTION_VIEW = "ohos.want.action.viewData";
28 static const std::string TAG_ACTION_EDIT = "ohos.want.action.editData";
29 
30 static const std::string TAG_KEY_FD = "keyFd";
31 static const std::string TAG_KEY_FD_TYPE = "type";
32 static const std::string TAG_KEY_FD_VALUE = "value";
33 static const std::string VALUE_KEY_FD_TYPE = "FD";
34 static const int INVALID_FD = -1;
35 
36 static const std::string TAG_FILE_NAME = "fileName";
37 static const std::string TAG_FILE_NAME_VALUE = "name";
38 static const std::string DLP_FILE_SUFFIX = ".dlp";
39 static const std::string DEFAULT_STRING = "";
40 
41 class DlpFileKits {
42 public:
43     static bool GetSandboxFlag(AAFwk::Want &want);
44     static bool IsDlpFile(int32_t dlpFd);
45     static void ConvertAbilityInfoWithSupportDlp(const AAFwk::Want& want,
46         std::vector<AppExecFwk::AbilityInfo> &abilityInfos);
47 };
48 }  // namespace DlpPermission
49 }  // namespace Security
50 }  // namespace OHOS
51 #endif /*  INTERFACES_INNER_API_DLP_FILE_KITS_H */
52