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 * Ability info. 23 * 24 */ 25 public class AbilityInfo { 26 /** 27 * Indicates the name of ability. 28 */ 29 public String name = ""; 30 31 /** 32 * Indicates the description of ability. 33 */ 34 public String description = ""; 35 36 /** 37 * Indicates the description resource of ability. 38 */ 39 public String descriptionRes = ""; 40 41 /** 42 * Indicates the icon of ability. 43 */ 44 public String icon = ""; 45 46 /** 47 * Indicates the icon path of ability. 48 */ 49 public String iconPath = ""; 50 51 /** 52 * Indicates the label of ability. 53 */ 54 public String label = ""; 55 56 /** 57 * Indicates the label resource of ability. 58 */ 59 public String labelRes = ""; 60 61 /** 62 * Indicates the type of ability. 63 */ 64 public String type = ""; 65 66 /** 67 * Indicates the formEnabled of ability. 68 */ 69 public boolean formEnabled = false; 70 71 /** 72 * Indicates the formInfo of ability. 73 */ 74 public FormInfo formInfo = null; 75 76 /** 77 * Indicates the uri of ability. 78 */ 79 public String uri = ""; 80 81 /** 82 * Indicates the launchType of ability. 83 */ 84 public String launchType = ""; 85 86 /** 87 * Indicates the metaData of ability. 88 */ 89 public MetaData metaData = new MetaData(); 90 91 /** 92 * Indicates the orientation of ability. 93 */ 94 public String orientation = ""; 95 96 /** 97 * Indicates the permissions of ability. 98 */ 99 public List<String> permissions = new ArrayList<String>(); 100 101 /** 102 * Indicates the skills of ability. 103 */ 104 public List<SkillInfo> skills = new ArrayList<SkillInfo>(); 105 106 /** 107 * Indicates the backgroundModes of ability. 108 */ 109 public List<String> backgroundModes = new ArrayList<String>(); 110 111 /** 112 * Indicates the visible of ability. 113 */ 114 public boolean visible = false; 115 116 /** 117 * Indicates the grantPermission of ability. 118 */ 119 public boolean grantPermission = false; 120 121 /** 122 * Indicates the readPermission of ability. 123 */ 124 public String readPermission = ""; 125 126 /** 127 * Indicates the writePermission of ability. 128 */ 129 public String writePermission = ""; 130 131 /** 132 * Indicates the uriPermission mode of ability. 133 */ 134 public String uriPermissionMode = ""; 135 136 /** 137 * Indicates the uriPermission path of ability. 138 */ 139 public String uriPermissionPath = ""; 140 141 /** 142 * Indicates the configChanges of ability. 143 */ 144 public List<String> configChanges = new ArrayList<String>(); 145 146 /** 147 * Indicates the directLaunch of ability. 148 */ 149 public boolean directLaunch = false; 150 151 /** 152 * Indicates the mission of ability. 153 */ 154 public String mission = ""; 155 156 /** 157 * Indicates the targetAbility of ability. 158 */ 159 public String targetAbility = ""; 160 161 /** 162 * Indicates the multiUserShared of ability. 163 */ 164 public boolean multiUserShared = false; 165 166 /** 167 * Indicates the supportPipMode of ability. 168 */ 169 public boolean supportPipMode = false; 170 171 /** 172 * Indicates the forms of ability. 173 */ 174 public List<AbilityFormInfo> formInfos = new ArrayList<AbilityFormInfo>(); 175 176 /** 177 * get the customize Data value defined in this ability. 178 */ getCustomizeDataValue(String customizeDataName)179 public String getCustomizeDataValue(String customizeDataName) { 180 for (CustomizeData data : metaData.customizeDatas) { 181 if (customizeDataName.equals(data.name)) { 182 return data.value; 183 } 184 } 185 return ""; 186 } 187 }