• 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
16import { AbilityInfo } from './abilityInfo';
17import { ApplicationInfo } from './applicationInfo';
18import { HapModuleInfo } from './hapModuleInfo';
19
20/**
21 * @name The scene which is used
22 * @since 7
23 * @syscap SystemCapability.BundleManager.BundleFramework
24 * @deprecated since 9
25 * @useinstead ohos.bundle.bundleManager.UsedScene
26 *
27 */
28export interface UsedScene {
29  /**
30    * @default Indicates the abilities that need the permission
31    * @since 7
32    * @syscap SystemCapability.BundleManager.BundleFramework
33    */
34  abilities: Array<string>;
35
36  /**
37    * @default Indicates the time when the permission is used
38    * @since 7
39    * @syscap SystemCapability.BundleManager.BundleFramework
40    */
41  when: string;
42}
43
44/**
45 * @name Indicates the required permissions details defined in file config.json
46 * @since 7
47 * @syscap SystemCapability.BundleManager.BundleFramework
48 * @deprecated since 9
49 * @useinstead ohos.bundle.bundleManager.ReqPermissionDetail
50 */
51export interface ReqPermissionDetail {
52  /**
53    * @default Indicates the name of this required permissions
54    * @since 7
55    * @syscap SystemCapability.BundleManager.BundleFramework
56    */
57  name: string;
58
59  /**
60    * @default Indicates the reason of this required permissions
61    * @since 7
62    * @syscap SystemCapability.BundleManager.BundleFramework
63    */
64  reason: string;
65
66  /**
67    * @default Indicates the used scene of this required permissions
68    * @since 7
69    * @syscap SystemCapability.BundleManager.BundleFramework
70    */
71  usedScene: UsedScene;
72}
73
74/**
75 * @name Obtains configuration information about a bundle
76 * @since 7
77 * @syscap SystemCapability.BundleManager.BundleFramework
78 * @deprecated since 9
79 * @useinstead ohos.bundle.bundleManager.BundleInfo
80 */
81export interface BundleInfo {
82  /**
83    * @default Indicates the name of this bundle
84    * @since 7
85    * @syscap SystemCapability.BundleManager.BundleFramework
86    */
87  readonly name: string;
88
89  /**
90    * @default Indicates the name of this original bundle
91    * @since 7
92    * @syscap SystemCapability.BundleManager.BundleFramework
93    */
94  readonly type: string;
95
96  /**
97    * @default Indicates the ID of the application to which this bundle belongs
98    * The application ID uniquely identifies an application. It is determined by the bundle name and signature
99    * @since 7
100    * @syscap SystemCapability.BundleManager.BundleFramework
101    */
102  readonly appId: string;
103
104  /**
105    * @default Indicates the UID of the application to which this bundle belongs
106    * The UID uniquely identifies an application. It is determined by the process and user IDs of the application
107    * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled
108    * @since 7
109    * @syscap SystemCapability.BundleManager.BundleFramework
110    */
111  readonly uid: number;
112
113  /**
114    * @default Indicates the hap install time
115    * @since 7
116    * @syscap SystemCapability.BundleManager.BundleFramework
117    */
118  readonly installTime: number;
119
120  /**
121    * @default Indicates the hap update time
122    * @since 7
123    * @syscap SystemCapability.BundleManager.BundleFramework
124    */
125  readonly updateTime: number;
126
127  /**
128    * @default Obtains configuration information about an application
129    * @since 7
130    * @syscap SystemCapability.BundleManager.BundleFramework
131    */
132  readonly appInfo: ApplicationInfo;
133
134  /**
135    * @default Obtains configuration information about an ability
136    * @since 7
137    * @syscap SystemCapability.BundleManager.BundleFramework
138    */
139  readonly abilityInfos: Array<AbilityInfo>;
140
141  /**
142    * @default Indicates the required permissions name defined in file config.json
143    * @since 7
144    * @syscap SystemCapability.BundleManager.BundleFramework
145    */
146  readonly reqPermissions: Array<string>;
147
148  /**
149    * @default Indicates the required permissions details defined in file config.json
150    * @since 7
151    * @syscap SystemCapability.BundleManager.BundleFramework
152    */
153  readonly reqPermissionDetails: Array<ReqPermissionDetail>;
154
155  /**
156    * @default Describes the bundle vendor
157    * @since 7
158    * @syscap SystemCapability.BundleManager.BundleFramework
159    */
160  readonly vendor: string;
161
162  /**
163    * @default Indicates the version number of the bundle
164    * @since 7
165    * @syscap SystemCapability.BundleManager.BundleFramework
166    */
167  readonly versionCode: number;
168
169  /**
170    * @default Indicates the text description of the bundle version
171    * @since 7
172    * @syscap SystemCapability.BundleManager.BundleFramework
173    */
174  readonly versionName: string;
175
176  /**
177    * @default Indicates the compatible version number of the bundle
178    * @since 7
179    * @syscap SystemCapability.BundleManager.BundleFramework
180    */
181  readonly compatibleVersion: number;
182
183  /**
184    * @default Indicates the target version number of the bundle
185    * @since 7
186    * @syscap SystemCapability.BundleManager.BundleFramework
187    */
188  readonly targetVersion: number;
189
190  /**
191    * @default Indicates is compress native libs
192    * @since 7
193    * @syscap SystemCapability.BundleManager.BundleFramework
194    */
195  readonly isCompressNativeLibs: boolean;
196
197  /**
198    * @default Obtains configuration information about a module
199    * @since 7
200    * @syscap SystemCapability.BundleManager.BundleFramework
201    */
202  readonly hapModuleInfos: Array<HapModuleInfo>;
203
204  /**
205    * @default Indicates entry module name
206    * @since 7
207    * @syscap SystemCapability.BundleManager.BundleFramework
208    */
209  readonly entryModuleName: string;
210
211  /**
212    * @default Indicates the cpuAbi information of this bundle.
213    * @since 7
214    * @syscap SystemCapability.BundleManager.BundleFramework
215    */
216  readonly cpuAbi: string;
217
218  /**
219    * @default Indicates is silent installation
220    * @since 7
221    * @syscap SystemCapability.BundleManager.BundleFramework
222    */
223  readonly isSilentInstallation: string;
224
225  /**
226    * @default Indicates the earliest historical version compatible with the bundle
227    * @since 7
228    * @syscap SystemCapability.BundleManager.BundleFramework
229    */
230  readonly minCompatibleVersionCode: number;
231
232  /**
233    * @default Indicates whether free installation of the entry is supported
234    * @since 7
235    * @syscap SystemCapability.BundleManager.BundleFramework
236    */
237  readonly entryInstallationFree: boolean;
238
239  /**
240    * @default Indicates the grant status of required permissions
241    * @since 8
242    * @syscap SystemCapability.BundleManager.BundleFramework
243    */
244  readonly reqPermissionStates: Array<number>;
245}
246