• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Customization Subsystem ChangeLog
2
3## cl.Customization.1 Change of the Enterprise Device Management Module Name
4
5Changed **@ohos.enterpriseDeviceManager.d.ts** to **@ohos.enterprise.adminManager.d.ts**.
6
7**Change Impact**
8
9The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version.
10
11**Key API/Component Changes**
12
13| Original API                            | New API                             |
14| ---------------------------------  | ---------------------------------- |
15| @ohos.enterpriseDeviceManager.d.ts  | @ohos.enterprise.adminManager.d.ts |
16
17**Adaptation Guide**
18
19The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem.
20
21If the original API uses **@ohos.enterpriseDeviceManager**:
22
23```js
24import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager';
25```
26
27You can modify **import** to switch to the new namespace:
28
29```js
30import enterpriseDeviceManager from '@ohos.enterprise.adminManager';
31```
32
33## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change
34
35Changed **enterpriseDeviceManager/DeviceSettingsManager.d.ts** to **ohos.enterprise.dateTimeManager.d.ts**.
36
37**Change Impact**
38
39The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version.
40
41**Key API/Component Changes**
42
43| Original API               | Original API Type            | New API             | New API Type               |
44| ---------------------------------  | --------- |  ---------------------------------- | ----- |
45| enterpriseDeviceManager/DeviceSettingsManager.d.ts | interface | @ohos.enterprise.dateTimeManager.d.ts | namespace |
46
47**Adaptation Guide**
48
49If the **setDateTime** API of **enterpriseDeviceManager/DeviceSettingsManager.d.ts** is used:
50
51```js
52import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'
53
54let wantTemp = {
55    bundleName: "bundleName",
56    abilityName: "abilityName",
57};
58enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => {
59    if (error) {
60        console.log("error code:" + error.code + " error message:" + error.message);
61        return;
62    }
63    mgr.setDateTime(wantTemp, 1526003846000, (error) => {
64        if (error) {
65            console.log("error code:" + error.code + " error message:" + error.message);
66        }
67    });
68});
69```
70
71You need to import the new namespace for adaptation:
72
73```js
74import dateTimeManager from '@ohos.enterprise.dateTimeManager'
75
76let wantTemp = {
77    bundleName: "bundleName",
78    abilityName: "abilityName",
79};
80dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => {
81    if (error) {
82        console.log("error code:" + error.code + " error message:" + error.message);
83    }
84})
85```
86
87## cl.Customization.3 System API Change
88
89Changed all enterprise device management APIs to system APIs.
90
91**Change Impact**
92
93All APIs can be called only by system applications.
94
95**Key API/Component Changes**
96
97| Module                   | Class               | Method/Attribute/Enum/Constant                                         | Change Type|
98| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
99| @ohos.enterprise.adminManager        | adminManager        | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | systemapi     |
100| @ohos.enterprise.adminManager        | adminManager        | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | systemapi     |
101| @ohos.enterprise.adminManager        | adminManager        | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | systemapi     |
102| @ohos.enterprise.adminManager        | adminManager        | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | systemapi     |
103| @ohos.enterprise.adminManager        | adminManager        | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | systemapi     |
104| @ohos.enterprise.adminManager        | adminManager        | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | systemapi     |
105| @ohos.enterprise.adminManager        | adminManager        | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | systemapi     |
106| @ohos.enterprise.adminManager        | adminManager        | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | systemapi     |
107| @ohos.enterprise.adminManager        | adminManager        | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | systemapi     |
108| @ohos.enterprise.adminManager        | adminManager        | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | systemapi     |
109| @ohos.enterprise.adminManager        | adminManager        | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | systemapi     |
110| @ohos.enterprise.adminManager        | adminManager        | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | systemapi     |
111| @ohos.enterprise.adminManager        | adminManager        | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | systemapi     |
112| @ohos.enterprise.adminManager        | adminManager        | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | systemapi     |
113| @ohos.enterprise.adminManager        | adminManager        | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | systemapi     |
114| @ohos.enterprise.adminManager        | adminManager        | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | systemapi     |
115| @ohos.enterprise.adminManager        | adminManager        | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | systemapi     |
116| @ohos.enterprise.adminManager        | adminManager        | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi     |
117| @ohos.enterprise.adminManager        | adminManager        | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi     |
118| @ohos.enterprise.adminManager        | adminManager        | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi     |
119| @ohos.enterprise.adminManager        | adminManager        | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi     |
120| @ohos.enterprise.adminManager        | adminManager        | **interface** EnterpriseInfo | systemapi     |
121| @ohos.enterprise.adminManager        | adminManager        | **enum** AdminType | systemapi     |
122| @ohos.enterprise.adminManager        | adminManager        | **enum** ManagedEvent | systemapi     |
123| @ohos.enterprise.dataTimeManager        | dateTimeManager        | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | systemapi     |
124| @ohos.enterprise.dataTimeManager        | dateTimeManager        | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | systemapi     |
125
126## cl.Customization.4 API Permission Change
127
128Added permission verification for some APIs.
129
130**Change Impact**
131
132The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs.
133
134**Key API/Component Changes**
135
136| Module                   | Class               | Method/Attribute/Enum/Constant                                         | New Permission|
137| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
138| @ohos.enterprise.adminManager        | adminManager        | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
139| @ohos.enterprise.adminManager        | adminManager        | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
140| @ohos.enterprise.adminManager        | adminManager        | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
141| @ohos.enterprise.adminManager        | adminManager        | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
142| @ohos.enterprise.adminManager        | adminManager        | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
143| @ohos.enterprise.adminManager        | adminManager        | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
144| @ohos.enterprise.adminManager        | adminManager        | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
145| @ohos.enterprise.adminManager        | adminManager        | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN     |
146| @ohos.enterprise.adminManager        | adminManager        | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | ohos.permission.SET_ENTERPRISE_INFO     |
147| @ohos.enterprise.adminManager        | adminManager        | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | ohos.permission.SET_ENTERPRISE_INFO     |
148| @ohos.enterprise.adminManager        | adminManager        | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT     |
149| @ohos.enterprise.adminManager        | adminManager        | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT     |
150| @ohos.enterprise.adminManager        | adminManager        | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT     |
151| @ohos.enterprise.adminManager        | adminManager        | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT     |
152| @ohos.enterprise.dataTimeManager        | dateTimeManager        | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SET_DATETIME     |
153| @ohos.enterprise.dataTimeManager        | dateTimeManager        | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | ohos.permission.ENTERPRISE_SET_DATETIME     |
154
155**Adaptation Guide**
156
157Apply for the corresponding permission to call these APIs properly.
158