• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 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 OHOS_ABILITY_RUNTIME_INNER_MISSION_INFO_H
17 #define OHOS_ABILITY_RUNTIME_INNER_MISSION_INFO_H
18 
19 #include <string>
20 
21 #include "mission_info.h"
22 
23 namespace OHOS {
24 namespace AAFwk {
25 enum class JsonType {
26     NULLABLE,
27     BOOLEAN,
28     NUMBER,
29     OBJECT,
30     ARRAY,
31     STRING,
32 };
33 enum class StartMethod {
34     START_NORMAL,
35     START_CALL,
36 };
37 
38 /**
39  * @struct InnerMissionInfo
40  * InnerMissionInfo is used to save informations about mission information.
41  */
42 struct InnerMissionInfo {
43     bool isTemporary;
44     bool hasRecoverInfo;
45     int32_t launchMode;
46     int32_t startMethod;
47     int32_t collaboratorType = 0;
48     int32_t uid;
49     std::string bundleName;
50     std::string specifiedFlag;
51     std::string ToJsonStr() const;
52     std::string missionName;
53     std::string missionAffinity;
54     MissionInfo missionInfo;
55     bool FromJsonStr(const std::string &jsonStr);
56     void Dump(std::vector<std::string> &info) const;
57     bool CheckJsonNode(nlohmann::json &value, const std::string &node, JsonType jsonType);
58 };
59 }  // namespace AAFwk
60 }  // namespace OHOS
61 #endif  // OHOS_ABILITY_RUNTIME_INNER_MISSION_INFO_H
62