• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2024 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/**
17 * @file
18 * @kit MDMKit
19 */
20
21import type systemManager from './@ohos.enterprise.systemManager';
22
23/**
24 * Class of the enterprise admin extension ability.
25 *
26 * @syscap SystemCapability.Customization.EnterpriseDeviceManager
27 * @stagemodelonly
28 * @since 12
29 */
30export default class EnterpriseAdminExtensionAbility {
31  /**
32   * Called back when an application is enabled.
33   *
34   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
35   * @stagemodelonly
36   * @since 12
37   */
38  onAdminEnabled(): void;
39
40  /**
41   * Called back when an application is disabled.
42   *
43   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
44   * @stagemodelonly
45   * @since 12
46   */
47  onAdminDisabled(): void;
48
49  /**
50   * Called back when a bundle is installed.
51   *
52   * @param { string } bundleName - bundleName indicates the name of the bundle installed.
53   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
54   * @stagemodelonly
55   * @since 12
56   */
57  onBundleAdded(bundleName: string): void;
58
59  /**
60   * Called back when a bundle is installed under an account.
61   *
62   * @param { string } bundleName - bundleName indicates the name of the bundle installed.
63   * @param { number } accountId - accountId indicates the account ID.
64   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
65   * @stagemodelonly
66   * @since 14
67   */
68  onBundleAdded(bundleName: string, accountId: number): void;
69
70  /**
71   * Called back when a bundle is uninstalled.
72   *
73   * @param { string } bundleName - bundleName indicates the name of the bundle uninstalled.
74   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
75   * @stagemodelonly
76   * @since 12
77   */
78  onBundleRemoved(bundleName: string): void;
79
80  /**
81   * Called back when a bundle is uninstalled under an account.
82   *
83   * @param { string } bundleName - bundleName indicates the name of the bundle installed.
84   * @param { number } accountId - accountId indicates the account ID.
85   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
86   * @stagemodelonly
87   * @since 14
88   */
89  onBundleRemoved(bundleName: string, accountId: number): void;
90
91  /**
92   * Called back when an app is started.
93   *
94   * @param { string } bundleName - bundleName indicates the name of the app started.
95   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
96   * @stagemodelonly
97   * @since 12
98   */
99  onAppStart(bundleName: string): void;
100
101  /**
102   * Called back when an app is stopped.
103   *
104   * @param { string } bundleName - bundleName indicates the name of the app stopped.
105   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
106   * @stagemodelonly
107   * @since 12
108   */
109  onAppStop(bundleName: string): void;
110
111  /**
112   * Called back when a system version need to update.
113   *
114   * @param { systemManager.SystemUpdateInfo } systemUpdateInfo - the information of the system version.
115   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
116   * @stagemodelonly
117   * @since 12
118   */
119  onSystemUpdate(systemUpdateInfo: systemManager.SystemUpdateInfo): void;
120
121  /**
122   * Called back when the enterprise admin extension is started.
123   *
124   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
125   * @stagemodelonly
126   * @since 12
127   */
128  onStart(): void;
129
130  /**
131   * Called when a system account is added.
132   *
133   * @param { number } accountId ID of the added account.
134   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
135   * @stagemodelonly
136   * @since 18
137   */
138  onAccountAdded(accountId: number): void;
139
140  /**
141   * Called when a system account is switched.
142   *
143   * @param { number } accountId ID of the switched account.
144   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
145   * @stagemodelonly
146   * @since 18
147   */
148  onAccountSwitched(accountId: number): void;
149
150  /**
151   * Called when a system account is removed.
152   *
153   * @param { number } accountId ID of the removed account.
154   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
155   * @stagemodelonly
156   * @since 18
157   */
158  onAccountRemoved(accountId: number): void;
159
160  /**
161   * Called back when a bundle entering kiosk mode under an account.
162   *
163   * @param { string } bundleName - bundleName indicates the name of the bundle.
164   * @param { number } accountId - accountId indicates the account ID.
165   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
166   * @stagemodelonly
167   * @since 20
168   */
169  onKioskModeEntering(bundleName: string, accountId: number): void;
170
171  /**
172   * Called back when a bundle exiting kiosk mode under an account.
173   *
174   * @param { string } bundleName - bundleName indicates the name of the bundle.
175   * @param { number } accountId - accountId indicates the account ID.
176   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
177   * @stagemodelonly
178   * @since 20
179   */
180  onKioskModeExiting(bundleName: string, accountId: number): void;
181}
182