• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 package ohos;
17 
18 import java.util.ArrayList;
19 import java.util.List;
20 
21 /**
22  * Hap info.
23  *
24  */
25 public class HapInfo {
26     /**
27      * Indicates the package of HapInfo.
28      */
29     public String packageStr = "";
30 
31     /**
32      * Indicates the name of HapInfo.
33      */
34     public String name = "";
35 
36     /**
37      * Indicates the description of HapInfo.
38      */
39     public String description = "";
40 
41     /**
42      * Indicates the supportedModes of HapInfo.
43      */
44     public List<String> supportedModes = new ArrayList<String>();
45 
46     /**
47      * Indicates the abilities of HapInfo.
48      */
49     public List<AbilityInfo> abilities = new ArrayList<AbilityInfo>();
50 
51     /**
52      * Indicates the defPermissions of HapInfo.
53      */
54     public List<DefPermission> defPermissions = new ArrayList<DefPermission>();
55 
56     /**
57      * Indicates the defPermissionsGroups of HapInfo.
58      */
59     public List<DefPermissionGroup> defPermissionsGroups = new ArrayList<DefPermissionGroup>();
60 
61     /**
62      * Indicates the distro of HapInfo.
63      */
64     public Distro distro = null;
65 
66     /**
67      * Indicates the reqCapabilities of HapInfo.
68      */
69     public List<String> reqCapabilities = new ArrayList<String>();
70 
71     /**
72      * Indicates the deviceType of HapInfo.
73      */
74     public List<String> deviceType = new ArrayList<String>();
75 
76     /**
77      * Indicates the metaData of HapInfo.
78      */
79     public MetaData metaData = new MetaData();
80 
81     /**
82      * Indicates the HapInfo is Js app.
83      */
84     public boolean isJs = false;
85 
86     /**
87      * Indicates the reqPermissions of HapInfo.
88      */
89     public List<ReqPermission> reqPermissions = new ArrayList<ReqPermission>();
90 
91     /**
92      * Indicates the commonEvents of HapInfo.
93      */
94     public List<CommonEvent> commonEvents = new ArrayList<CommonEvent>();
95 
96     /**
97      * Indicates the shortcuts of HapInfo.
98      */
99     public List<Shortcut> shortcuts = new ArrayList<Shortcut>();
100 
101     /**
102      * Indicates the DistroFilter of HapInfo
103      */
104     public DistroFilter distroFilter = new DistroFilter();
105 
106     /**
107      * Indicates the mainElement of ModuleInfo.
108      */
109     public String mainElement = "";
110 
111     /**
112      * Indicates the forms of ability.
113      */
114     public List<AbilityFormInfo> formInfos = new ArrayList<AbilityFormInfo>();
115 
116     /**
117      * get the customize Data value defined in this module.
118      */
getCustomizeDataValue(String customizeDataName)119     public String getCustomizeDataValue(String customizeDataName) {
120         for (CustomizeData data : metaData.customizeDatas) {
121             if (customizeDataName.equals(data.name)) {
122                 return data.value;
123             }
124         }
125         return "";
126     }
127 }
128