新增系统升级事件API

Signed-off-by: caiminggang <caiminggang1@huawei.com>
This commit is contained in:
caiminggang 2023-10-31 15:36:58 +08:00
parent 0a24a86d2c
commit f9a67b39fa
3 changed files with 69 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -13,6 +13,8 @@
* limitations under the License.
*/
import type systemManager from './@ohos.enterprise.systemManager';
/**
* Class of the enterprise admin extension ability.
*
@ -85,4 +87,15 @@ export default class EnterpriseAdminExtensionAbility {
* @since 10
*/
onAppStop(bundleName: string): void;
/**
* Called back when a system version need to update.
*
* @param { systemManager.SystemUpdateInfo } systemUpdateInfo - the information of the system version.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
onSystemUpdate(systemUpdateInfo: systemManager.SystemUpdateInfo): void;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -126,7 +126,16 @@ declare namespace adminManager {
* @systemapi
* @since 10
*/
MANAGED_EVENT_APP_STOP = 3
MANAGED_EVENT_APP_STOP = 3,
/**
* The event of system update.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @since 11
*/
MANAGED_EVENT_SYSTEM_UPDATE = 4,
}
/**

View File

@ -25,6 +25,50 @@ import type Want from './@ohos.app.ability.Want';
* @since 11
*/
declare namespace systemManager {
/**
* The device system update info.
*
* @typedef SystemUpdateInfo
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
export interface SystemUpdateInfo {
/**
* The name of version need to update.
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
versionName: string;
/**
* The time when the version first received.
*
* @type { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
firstReceivedTime: number;
/**
* The type of version package.
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
packageType: string;
}
/**
* Sets NTP server.
* This function can be called by a super administrator.