openharmony 鸿蒙 changelogs-enterprise_device_management

2023-02-03 浏览 (572)

Customization Subsystem ChangeLog

Compared with OpenHarmony 3.2.8.1, OpenHarmony 3.2.8.3 has the following API changes in the customization subsystem:

cl.Customization.1 Change of the Enterprise Device Management Module Name

Beginning from OpenHarmony 3.2.8.3, @ohos.enterpriseDeviceManager.d.ts is changed to @ohos.enterprise.adminManager.d.ts. You need to adapt your applications according to the following information.

Change Impacts

The 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.

Key API/Component Changes

Original APINew API
@ohos.enterpriseDeviceManager.d.ts@ohos.enterprise.adminManager.d.ts

Adaptation Guide

The original APIs are only migrated to the new namespace. Therefore, you can modify import to solve the adaptation problem.

If the original API uses @ohos.enterpriseDeviceManager:

import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager';

You can directly modify import to switch to the new namespace:

import enterpriseDeviceManager from '@ohos.enterprise.adminManager';

cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change

Beginning from OpenHarmony 3.2.8.3, enterpriseDeviceManager/DeviceSettingsManager.d.ts is changed to ohos.enterprise.dateTimeManager.d.ts.

Change Impacts

The 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.

Key API/Component Changes

Original APIOriginal API TypeNew APINew API Type
enterpriseDeviceManager/DeviceSettingsManager.d.tsinterface@ohos.enterprise.dateTimeManager.d.tsnamespace

Adaptation Guide

If the setDateTime API of enterpriseDeviceManager/DeviceSettingsManager.d.ts is used:

import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'

let wantTemp = {
    bundleName: "bundleName",
    abilityName: "abilityName",
};
enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => {
    if (error) {
        console.log("error code:" + error.code + " error message:" + error.message);
        return;
    }
    mgr.setDateTime(wantTemp, 1526003846000, (error) => {
        if (error) {
            console.log("error code:" + error.code + " error message:" + error.message);
        }
    });
});

You need to import the new namespace for adaptation:

import dateTimeManager from '@ohos.enterprise.dateTimeManager'

let wantTemp = {
    bundleName: "bundleName",
    abilityName: "abilityName",
};
dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => {
    if (error) {
        console.log("error code:" + error.code + " error message:" + error.message);
    }
})

cl.Customization.3 System API Change

Beginning from OpenHarmony 3.2.8.3, all enterprise device management APIs are changed to system APIs.

Change Impacts

All APIs can be called only by system applications.

Key API/Component Changes

ModuleClassMethod/Attribute/Enumeration/ConstantChange Type
@ohos.enterprise.adminManageradminManagerfunction enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<void>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction disableAdmin(admin: Want, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction disableAdmin(admin: Want, userId: number, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction disableAdmin(admin: Want, userId?: number): Promise<void>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction disableSuperAdmin(bundleName: String, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction disableSuperAdmin(bundleName: String): Promise<void>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction isAdminEnabled(admin: Want, callback: AsyncCallback<boolean>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<boolean>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction isAdminEnabled(admin: Want, userId?: number): Promise<boolean>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction getEnterpriseInfo(admin: Want, callback: AsyncCallback<EnterpriseInfo>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction getEnterpriseInfo(admin: Want): Promise<EnterpriseInfo>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<void>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction isSuperAdmin(bundleName: String, callback: AsyncCallback<boolean>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction isSuperAdmin(bundleName: String): Promise<boolean>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction subscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction subscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>): Promise<void>;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction unsubscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.adminManageradminManagerfunction unsubscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>): Promise<void>;Changed to a system API
@ohos.enterprise.adminManageradminManagerinterface EnterpriseInfoChanged to a system API
@ohos.enterprise.adminManageradminManagerenum AdminTypeChanged to a system API
@ohos.enterprise.adminManageradminManagerenum ManagedEventChanged to a system API
@ohos.enterprise.dataTimeManagerdateTimeManagerfunction setDateTime(admin: Want, time: number, callback: AsyncCallback<void>): void;Changed to a system API
@ohos.enterprise.dataTimeManagerdateTimeManagerfunction setDateTime(admin: Want, time: number): Promise<void>;Changed to a system API

cl.Customization.4 API Permission Change

Beginning from OpenHarmony 3.2.8.3, permission verification is required for some APIs.

Change Impacts

The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs.

Key API/Component Changes

ModuleClassMethod/Attribute/Enumeration/ConstantNew Permission
@ohos.enterprise.adminManageradminManagerfunction enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<void>): void;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<void>): void;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<void>;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction disableAdmin(admin: Want, callback: AsyncCallback<void>): void;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction disableAdmin(admin: Want, userId: number, callback: AsyncCallback<void>): void;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction disableAdmin(admin: Want, userId?: number): Promise<void>;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction disableSuperAdmin(bundleName: String, callback: AsyncCallback<void>): void;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction disableSuperAdmin(bundleName: String): Promise<void>;ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
@ohos.enterprise.adminManageradminManagerfunction setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<void>): void;ohos.permission.SET_ENTERPRISE_INFO
@ohos.enterprise.adminManageradminManagerfunction setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<void>;ohos.permission.SET_ENTERPRISE_INFO
@ohos.enterprise.adminManageradminManagerfunction subscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>, callback: AsyncCallback<void>): void;ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
@ohos.enterprise.adminManageradminManagerfunction subscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>): Promise<void>;ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
@ohos.enterprise.adminManageradminManagerfunction unsubscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>, callback: AsyncCallback<void>): void;ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
@ohos.enterprise.adminManageradminManagerfunction unsubscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>): Promise<void>;ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT
@ohos.enterprise.dataTimeManagerdateTimeManagerfunction setDateTime(admin: Want, time: number, callback: AsyncCallback<void>): void;ohos.permission.ENTERPRISE_SET_DATETIME
@ohos.enterprise.dataTimeManagerdateTimeManagerfunction setDateTime(admin: Want, time: number): Promise<void>;ohos.permission.ENTERPRISE_SET_DATETIME

Adaptation Guide

Apply for the corresponding permission to call these APIs properly.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Distributed Scheduler Subsystem ChangeLog

harmony 鸿蒙Wi-Fi Subsystem ChangeLog

harmony 鸿蒙Ability Subsystem ChangeLog

harmony 鸿蒙Account Subsystem ChangeLog

harmony 鸿蒙Location Subsystem ChangeLog

harmony 鸿蒙Multimedia Subsystem ChangeLog

harmony 鸿蒙Common Event and Notification Subsystem ChangeLog

harmony 鸿蒙User IAM Subsystem ChangeLog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/fa8b7a92a25b418e905f6557358e1f24