1/* 2 * Copyright (c) 2022-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 16import { Metadata } from './Metadata'; 17import { Resource } from '../global/resource'; 18import bundleManager from './../@ohos.bundle.bundleManager'; 19 20/** 21 * Obtains configuration information about an application 22 * @typedef ApplicationInfo 23 * @syscap SystemCapability.BundleManager.BundleFramework.Core 24 * @since 9 25 */ 26export interface ApplicationInfo { 27 /** 28 * Indicates the application name, which is the same as {@code bundleName} 29 * @type {string} 30 * @syscap SystemCapability.BundleManager.BundleFramework.Core 31 * @since 9 32 */ 33 readonly name: string; 34 35 /** 36 * Description of application 37 * @type {string} 38 * @syscap SystemCapability.BundleManager.BundleFramework.Core 39 * @since 9 40 */ 41 readonly description: string; 42 43 /** 44 * Indicates the description id of the application 45 * @type {number} 46 * @syscap SystemCapability.BundleManager.BundleFramework.Core 47 * @since 9 48 */ 49 readonly descriptionId: number; 50 51 /** 52 * Indicates whether or not this application may be instantiated 53 * @type {boolean} 54 * @syscap SystemCapability.BundleManager.BundleFramework.Core 55 * @since 9 56 */ 57 readonly enabled: boolean; 58 59 /** 60 * Indicates the label of the application 61 * @type {string} 62 * @syscap SystemCapability.BundleManager.BundleFramework.Core 63 * @since 9 64 */ 65 readonly label: string; 66 67 /** 68 * Indicates the label id of the application 69 * @type {number} 70 * @syscap SystemCapability.BundleManager.BundleFramework.Core 71 * @since 9 72 */ 73 readonly labelId: number; 74 75 /** 76 * Indicates the icon of the application 77 * @type {string} 78 * @syscap SystemCapability.BundleManager.BundleFramework.Core 79 * @since 9 80 */ 81 readonly icon: string; 82 83 /** 84 * Indicates the icon id of the application 85 * @type {number} 86 * @syscap SystemCapability.BundleManager.BundleFramework.Core 87 * @since 9 88 */ 89 readonly iconId: number; 90 91 /** 92 * Process of application, if user do not set it ,the value equal bundleName 93 * @type {string} 94 * @syscap SystemCapability.BundleManager.BundleFramework.Core 95 * @since 9 96 */ 97 readonly process: string; 98 99 /** 100 * Indicates the permissions required for accessing the application. 101 * @type {Array<string>} 102 * @syscap SystemCapability.BundleManager.BundleFramework.Core 103 * @since 9 104 */ 105 readonly permissions: Array<string>; 106 107 /** 108 * Indicates the application source code path 109 * @type {string} 110 * @syscap SystemCapability.BundleManager.BundleFramework.Core 111 * @since 9 112 */ 113 readonly codePath: string; 114 115 /** 116 * Indicates the metadata of module 117 * @type {Map<string, Array<Metadata>>} 118 * @syscap SystemCapability.BundleManager.BundleFramework.Core 119 * @since 9 120 */ 121 readonly metadata: Map<string, Array<Metadata>>; 122 123 /** 124 * Indicates whether or not this application may be removable 125 * @type {boolean} 126 * @syscap SystemCapability.BundleManager.BundleFramework.Core 127 * @since 9 128 */ 129 readonly removable: boolean; 130 131 /** 132 * Indicates the access token of the application 133 * @type {number} 134 * @syscap SystemCapability.BundleManager.BundleFramework.Core 135 * @since 9 136 */ 137 readonly accessTokenId: number; 138 139 /** 140 * Indicates the uid of the application 141 * @type {number} 142 * @syscap SystemCapability.BundleManager.BundleFramework.Core 143 * @since 9 144 */ 145 readonly uid: number; 146 147 /** 148 * Indicates icon resource of the application 149 * @type {Resource} 150 * @syscap SystemCapability.BundleManager.BundleFramework.Core 151 * @since 9 152 */ 153 readonly iconResource: Resource; 154 155 /** 156 * Indicates label resource of the application 157 * @type {Resource} 158 * @syscap SystemCapability.BundleManager.BundleFramework.Core 159 * @since 9 160 */ 161 readonly labelResource: Resource; 162 163 /** 164 * Indicates description resource of the application 165 * @type {Resource} 166 * @syscap SystemCapability.BundleManager.BundleFramework.Core 167 * @since 9 168 */ 169 readonly descriptionResource: Resource; 170 171 /** 172 * Indicates the appDistributionType of the application 173 * @type {string} 174 * @syscap SystemCapability.BundleManager.BundleFramework.Core 175 * @since 9 176 */ 177 readonly appDistributionType: string; 178 179 /** 180 * Indicates the appProvisionType of the application 181 * @type {string} 182 * @syscap SystemCapability.BundleManager.BundleFramework.Core 183 * @since 9 184 */ 185 readonly appProvisionType: string; 186 187 /** 188 * Indicates whether the application is a system application 189 * @type {boolean} 190 * @syscap SystemCapability.BundleManager.BundleFramework.Core 191 * @since 9 192 */ 193 readonly systemApp: boolean; 194 195 /** 196 * Indicates the type of application is APP or atomicService. 197 * @type {bundleManager.BundleType} 198 * @syscap SystemCapability.BundleManager.BundleFramework.Core 199 * @since 9 200 */ 201 readonly bundleType: bundleManager.BundleType; 202} 203