From cb581615127d5e6f959033a5e65c60d5cfe704fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Wed, 18 Jan 2023 09:32:25 +0000 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.backgroundTaskManager.d.ts | 98 ++++++++---- ...esourceschedule.backgroundTaskManager.d.ts | 139 +++++++++++++----- api/@ohos.resourceschedule.workScheduler.d.ts | 103 +++++++++---- 3 files changed, 245 insertions(+), 95 deletions(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index f707324f0e..130b3d6b25 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -20,8 +20,11 @@ import Context from './application/BaseContext'; /** * Manages background tasks. * - * @since 7 + * @namespace backgroundTaskManager * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @since 7 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager */ @@ -30,8 +33,8 @@ declare namespace backgroundTaskManager { * The info of delay suspend. * * @name DelaySuspendInfo - * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 7 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo */ @@ -49,9 +52,9 @@ declare namespace backgroundTaskManager { /** * Cancels delayed transition to the suspended state. * - * @since 7 + * @param { number } requestId - Indicates the identifier of the delay request. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @param requestId Indicates the identifier of the delay request. + * @since 7 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay */ @@ -60,24 +63,35 @@ declare namespace backgroundTaskManager { /** * Obtains the remaining time before an application enters the suspended state. * - * @since 7 + * @param { number } requestId - Indicates the identifier of the delay request. + * @param { AsyncCallback } callback - The callback of the remaining delay time. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @param requestId Indicates the identifier of the delay request. - * @returns The remaining delay time + * @since 7 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; + + /** + * Obtains the remaining time before an application enters the suspended state. + * + * @param { number } requestId - Indicates the identifier of the delay request. + * @returns { Promise } The remaining delay time + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime + */ function getRemainingDelayTime(requestId: number): Promise; /** * Requests delayed transition to the suspended state. * - * @since 7 + * @param { string } reason - Indicates the reason for delayed transition to the suspended state. + * @param { Callback } callback - The callback delay time expired. + * @returns { DelaySuspendInfo } Info of delay request * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @param reason Indicates the reason for delayed transition to the suspended state. - * @param callback The callback delay time expired. - * @returns Info of delay request + * @since 7 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay */ @@ -87,35 +101,63 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request start running in background. * system will publish a notification related to the this service. * - * @since 8 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @permission ohos.permission.KEEP_BACKGROUND_RUNNING - * @param context app running context. - * @param bgMode Indicates which background mode to request. - * @param wantAgent Indicates which ability to start when user click the notification bar. + * @param { Context } context - App running context. + * @param { BackgroundMode } bgMode - Indicates which background mode to request. + * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @param { AsyncCallback } callback - The callback of the function. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; + + /** + * Service ability uses this method to request start running in background. + * system will publish a notification related to the this service. + * + * @permission ohos.permission.KEEP_BACKGROUND_RUNNING + * @param { Context } context - App running context. + * @param { BackgroundMode } bgMode - Indicates which background mode to request. + * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @returns { Promise } The promise returned by the function. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning + */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; /** * Service ability uses this method to request stop running in background. * - * @since 8 + * @param { Context } context - App running context. + * @param { AsyncCallback } callback - The callback of the function. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @param context app running context. + * @since 8 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; + + /** + * Service ability uses this method to request stop running in background. + * + * @param { Context } context - App running context. + * @returns { Promise } The promise returned by the function. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning + */ function stopBackgroundRunning(context: Context): Promise; /** * Supported background mode. * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.BackgroundMode */ @@ -123,66 +165,66 @@ declare namespace backgroundTaskManager { /** * data transfer mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ DATA_TRANSFER = 1, /** * audio playback mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ AUDIO_PLAYBACK = 2, /** * audio recording mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ AUDIO_RECORDING = 3, /** * location mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ LOCATION = 4, /** * bluetooth interaction mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ BLUETOOTH_INTERACTION = 5, /** * multi-device connection mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ MULTI_DEVICE_CONNECTION = 6, /** * wifi interaction mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. + * @since 8 */ WIFI_INTERACTION = 7, /** * Voice over Internet Phone mode * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. + * @since 8 */ VOIP = 8, @@ -190,8 +232,8 @@ declare namespace backgroundTaskManager { * background continuous calculate mode, for example 3D render. * only supported in particular device * - * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 8 */ TASK_KEEPING = 9, } diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 9b82d9d302..f9a0cdace5 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -20,16 +20,19 @@ import Context from './application/BaseContext'; /** * Manages background tasks. * - * @since 9 + * @namespace backgroundTaskManager * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @since 9 */ declare namespace backgroundTaskManager { /** * The info of delay suspend. * * @name DelaySuspendInfo - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 9 */ interface DelaySuspendInfo { /** @@ -45,9 +48,7 @@ declare namespace backgroundTaskManager { /** * Cancels delayed transition to the suspended state. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @param requestId Indicates the identifier of the delay request. + * @param { number } requestId - The identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. @@ -55,15 +56,16 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 9900001 - Caller information verification failed. * @throws { BusinessError } 9900002 - Background task verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 9 */ function cancelSuspendDelay(requestId: number): void; /** * Obtains the remaining time before an application enters the suspended state. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @param requestId Indicates the identifier of the delay request. + * @param { number } requestId - The identifier of the delay request. + * @param { AsyncCallback } callback - The callback of the remaining delay time. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. @@ -71,18 +73,34 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 9900001 - Caller information verification failed. * @throws { BusinessError } 9900002 - Background task verification failed. - * @returns The remaining delay time + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 9 */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; - function getRemainingDelayTime(requestId: number): Promise; /** - * Requests delayed transition to the suspended state. + * Obtains the remaining time before an application enters the suspended state. * * @since 9 + * @param { number } requestId - The identifier of the delay request. + * @returns { Promise } The promise returns the remaining delay time. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9900001 - Caller information verification failed. + * @throws { BusinessError } 9900002 - Background task verification failed. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @param reason Indicates the reason for delayed transition to the suspended state. - * @param callback The callback delay time expired. + */ + function getRemainingDelayTime(requestId: number): Promise; + + /** + * Requests delayed transition to the suspended state. + * + * @param { string } reason - Indicates the reason for delayed transition to the suspended state. + * @param { Callback } callback - The callback delay time expired. + * @returns { DelaySuspendInfo } Info of delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. @@ -90,7 +108,8 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 9900001 - Caller information verification failed. * @throws { BusinessError } 9900002 - Background task verification failed. - * @returns Info of delay request + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @since 9 */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; @@ -98,12 +117,11 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request start running in background. * system will publish a notification related to the this service. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @permission ohos.permission.KEEP_BACKGROUND_RUNNING - * @param context app running context. - * @param bgMode Indicates which background mode to request. - * @param wantAgent Indicates which ability to start when user click the notification bar. + * @param { Context } context - App running context. + * @param { BackgroundMode } bgMode - Indicates which background mode to request. + * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @param { AsyncCallback } callback - The callback of the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -113,16 +131,39 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800005 - Background task verification failed. * @throws { BusinessError } 9800006 - Notification verification failed. * @throws { BusinessError } 9800007 - Task storage failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; + + /** + * Service ability uses this method to request start running in background. + * system will publish a notification related to the this service. + * + * @permission ohos.permission.KEEP_BACKGROUND_RUNNING + * @param { Context } context - App running context. + * @param { BackgroundMode } bgMode - Indicates which background mode to request. + * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9800005 - Background task verification failed. + * @throws { BusinessError } 9800006 - Notification verification failed. + * @throws { BusinessError } 9800007 - Task storage failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 + */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; /** * Service ability uses this method to request stop running in background. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @param context app running context. + * @param { Context } context - App running context. + * @param { AsyncCallback } callback - The callback of the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -132,15 +173,33 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800005 - Background task verification failed. * @throws { BusinessError } 9800006 - Notification verification failed. * @throws { BusinessError } 9800007 - Task storage failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; + + /** + * Service ability uses this method to request stop running in background. + * + * @param { Context } context - App running context. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9800005 - Background task verification failed. + * @throws { BusinessError } 9800006 - Notification verification failed. + * @throws { BusinessError } 9800007 - Task storage failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 + */ function stopBackgroundRunning(context: Context): Promise; /** * Apply or unapply efficiency resources. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -148,16 +207,15 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800003 - Inner transact failed. * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 18700001 - Caller information verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @since 9 */ function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; /** * Reset all efficiency resources apply. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply - * @systemapi Hide this for inner system use. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -165,79 +223,82 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800003 - Inner transact failed. * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 18700001 - Caller information verification failed. + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @systemapi Hide this for inner system use. + * @since 9 */ function resetAllEfficiencyResources(): void; /** * Supported background mode. * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ export enum BackgroundMode { /** * data transfer mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ DATA_TRANSFER = 1, /** * audio playback mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ AUDIO_PLAYBACK = 2, /** * audio recording mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ AUDIO_RECORDING = 3, /** * location mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ LOCATION = 4, /** * bluetooth interaction mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ BLUETOOTH_INTERACTION = 5, /** * multi-device connection mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ MULTI_DEVICE_CONNECTION = 6, /** * wifi interaction mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. + * @since 9 */ WIFI_INTERACTION = 7, /** * Voice over Internet Phone mode * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. + * @since 9 */ VOIP = 8, @@ -245,8 +306,8 @@ declare namespace backgroundTaskManager { * background continuous calculate mode, for example 3D render. * only supported in particular device * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @since 9 */ TASK_KEEPING = 9, } @@ -254,9 +315,9 @@ declare namespace backgroundTaskManager { /** * The type of resource. * - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @since 9 */ export enum ResourceType { /** @@ -299,9 +360,9 @@ declare namespace backgroundTaskManager { * The request of efficiency resources. * * @name EfficiencyResourcesRequest - * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @since 9 */ export interface EfficiencyResourcesRequest { /** diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index 1cb2eabc86..b867fc7507 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -18,18 +18,19 @@ import {AsyncCallback} from './basic'; /** * Work scheduler interface. * - * @since 9 + * @namespace workScheduler * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ declare namespace workScheduler { /** * The info of work. * * @name WorkInfo - * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ export interface WorkInfo { /** @@ -102,104 +103,150 @@ declare namespace workScheduler { * Add a work to the queue. A work can be executed only when it meets the preset triggering condition * and complies with the rules of work scheduler manager. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. + * @param { WorkInfo } work - The info of work. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. * @throws { BusinessError } 9700004 - Check workInfo failed. * @throws { BusinessError } 9700005 - StartWork failed. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @since 9 */ function startWork(work: WorkInfo): void; /** * Stop a work. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - * @param needCancel True if need to be canceled after being stopped, otherwise false. + * @param { WorkInfo } work - The info of work. + * @param { boolean } needCancel - True if need to be canceled after being stopped, otherwise false. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. * @throws { BusinessError } 9700004 - Check workInfo failed. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @since 9 */ function stopWork(work: WorkInfo, needCancel?: boolean): void; /** * Obtains the work info of the wordId. * - * @since 9 + * @param { number } workId - The id of work. + * @param { AsyncCallback } callback - The callback of the function. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @param workId The id of work. + * @since 9 + */ + function getWorkStatus(workId: number, callback: AsyncCallback): void; + + /** + * Obtains the work info of the wordId. + * + * @param { number } workId - The id of work. + * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. * @throws { BusinessError } 9700004 - Check workInfo failed. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @since 9 */ - function getWorkStatus(workId: number, callback: AsyncCallback): void; function getWorkStatus(workId: number): Promise; /** * Get all works of the calling application. * - * @since 9 + * @param { AsyncCallback } callback - The callback of the function. + * @returns { Array } the work info list. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 + */ + function obtainAllWorks(callback: AsyncCallback): Array; + + /** + * Get all works of the calling application. + * + * @returns { Promise> } The work info list. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. - * @returns the work info list. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @since 9 */ - function obtainAllWorks(callback: AsyncCallback): Array; function obtainAllWorks(): Promise>; /** * Stop all and clear all works of the calling application. * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. * @throws { BusinessError } 9700004 - Check workInfo failed. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @since 9 */ function stopAndClearWorks(): void; /** * Check whether last work running is timeout. The interface is for repeating work. * - * @since 9 + * @param { number } workId - The id of work. + * @param { AsyncCallback } callback - The callback of the function. + * @returns { boolean } true if last work running is timeout, otherwise false. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @param workId The id of work. + * @since 9 + */ + function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; + + /** + * Check whether last work running is timeout. The interface is for repeating work. + * + * @param { number } workId - The id of work. + * @returns { Promise } True if last work running is timeout, otherwise false. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. * @throws { BusinessError } 9700004 - Check workInfo failed. - * @returns true if last work running is timeout, otherwise false. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @since 9 */ - function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; function isLastWorkTimeOut(workId: number): Promise; /** * Describes network type. * * @name NetworkType - * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ export enum NetworkType { /** @@ -232,9 +279,9 @@ declare namespace workScheduler { * Describes charging type. * * @name ChargingType - * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ export enum ChargingType { /** @@ -259,9 +306,9 @@ declare namespace workScheduler { * Describes the battery status. * * @name BatteryStatus - * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ export enum BatteryStatus { /** @@ -282,9 +329,9 @@ declare namespace workScheduler { * Describes the storage request. * * @name StorageRequest - * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ export enum StorageRequest { /** -- Gitee From 9cdf7cbd5d679a462913bead5907ad6bcca8db23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Wed, 18 Jan 2023 09:44:17 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...esourceschedule.backgroundTaskManager.d.ts | 4 + ...ohos.resourceschedule.usageStatistics.d.ts | 624 ++++++++++++++---- 2 files changed, 486 insertions(+), 142 deletions(-) diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index f9a0cdace5..07ae23175f 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -123,6 +123,7 @@ declare namespace backgroundTaskManager { * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. * @param { AsyncCallback } callback - The callback of the function. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. @@ -146,6 +147,7 @@ declare namespace backgroundTaskManager { * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. @@ -201,6 +203,7 @@ declare namespace backgroundTaskManager { * Apply or unapply efficiency resources. * * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. @@ -217,6 +220,7 @@ declare namespace backgroundTaskManager { * Reset all efficiency resources apply. * * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. * @throws { BusinessError } 9800002 - Parcel operation failed. diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 0916267edf..f3599b1704 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -24,14 +24,18 @@ import { AsyncCallback , Callback} from './basic'; * The system stores the query result in a {@link BundleStatsInfo} instance and * then returns it to you. * + * @namespace usageStatistics + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @since 9 */ declare namespace usageStatistics { /** - * @since 9 + * @interface BundleStatsInfo * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @since 9 */ interface BundleStatsInfo { /** @@ -79,9 +83,10 @@ declare namespace usageStatistics { } /** - * @since 9 + * @interface HapFormInfo * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @since 9 */ interface HapFormInfo { /** @@ -107,9 +112,10 @@ declare namespace usageStatistics { } /** - * @since 9 + * @interface HapModuleInfo * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @since 9 */ interface HapModuleInfo { /** @@ -167,9 +173,10 @@ declare namespace usageStatistics { } /** - * @since 9 + * @interface DeviceEventStats * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @since 9 */ interface DeviceEventStats { /** @@ -189,8 +196,9 @@ declare namespace usageStatistics { } /** - * @since 9 + * @interface BundleEvents * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 9 */ interface BundleEvents { /** @@ -219,9 +227,10 @@ declare namespace usageStatistics { eventId?: number; } /** - * @since 9 + * @interface AppGroupCallbackInfo * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. + * @since 9 */ interface AppGroupCallbackInfo { /* @@ -248,78 +257,145 @@ declare namespace usageStatistics { /** * Checks whether the application with a specified bundle name is in the idle state. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @param bundleName Indicates the bundle name of the application to query. + * + * @param { string } bundleName - Indicates the bundle name of the application to query. + * @param { AsyncCallback } callback - the callback of isIdleState, + * boolean value is true mean the application is idle in a particular period; false mean otherwise. + * The time range of the particular period is defined by the system, which may be hours or days. * @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @returns Returns {@code true} if the application is idle in a particular period; - * returns {@code false} otherwise. The time range of the particular period is defined by the system, - * which may be hours or days. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 9 */ function isIdleState(bundleName: string, callback: AsyncCallback): void; + + /** + * Checks whether the application with a specified bundle name is in the idle state. + * + * @param { string } bundleName - Indicates the bundle name of the application to query. + * @returns { Promise } the promise returned by queryAppGroup, + * boolean value is true mean the application is idle in a particular period; false mean otherwise. + * The time range of the particular period is defined by the system, which may be hours or days. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 9 + */ function isIdleState(bundleName: string): Promise; /** * Queries the app group of the calling application. - * *

The priority defined in a priority group restricts the resource usage of an application, * for example, restricting the running of background tasks.

* - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @param { AsyncCallback } callback - the callback of queryAppGroup. + * Returns the app group of the calling application. * @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000004 - IPC failed. * @throws { BusinessError } 10000005 - Application is not installed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10100002 - Get Application group info failed. - * @returns Returns the app group of the calling application. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10100002 - Failed to get the application group information. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 9 */ function queryAppGroup(callback: AsyncCallback): void; - function queryAppGroup(): Promise; /** - * Queries the usage priority group of the calling application. - * + * Queries the app group of the calling application. *

The priority defined in a priority group restricts the resource usage of an application, * for example, restricting the running of background tasks.

* - * @since 9 + * @returns { Promise } the promise returned by queryAppGroup. + * Returns the app group of the calling application. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10100002 - Failed to get the application group information. * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 9 + */ + function queryAppGroup(): Promise; + + /** + * Queries the usage priority group by bundleName. + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param bundleName, name of the application. + * @param { string } bundleName - name of the application. + * @param { AsyncCallback } callback - the callback of queryAppGroup, + * the usage priority group of the calling application. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000004 - IPC failed. * @throws { BusinessError } 10000005 - Application is not installed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10100002 - Get Application group info failed. - * @returns Returns the usage priority group of the calling application. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10100002 - Failed to get the application group information. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + * @since 9 */ function queryAppGroup(bundleName : string, callback: AsyncCallback): void; + + /** + * Queries the usage priority group by bundleName. + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { string } bundleName - name of the application. + * @returns { Promise } the promise returned by queryAppGroup, + * the usage priority group of the calling application. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10100002 - Failed to get the application group information. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryAppGroup(bundleName : string): Promise; /** - * @since 9 + * @interface BundleStatsMap * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @since 9 */ interface BundleStatsMap { [key: string]: BundleStatsInfo; @@ -327,35 +403,60 @@ declare namespace usageStatistics { /** * Queries usage information about each bundle within a specified period. - * *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

* - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. + * @param {number} begin - Indicates the start time of the query period, in milliseconds. + * @param {number} end - Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback } callback - the callback of queryBundleStatsInfos, + * the {@link BundleStatsMap} objects containing the usage information about each bundle. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the {@link BundleStatsMap} objects containing the usage information about each bundle. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void; - function queryBundleStatsInfos(begin: number, end: number): Promise; /** - * Declares interval type. + * Queries usage information about each bundle within a specified period. + *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

* + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param {number} begin - Indicates the start time of the query period, in milliseconds. + * @param {number} end - Indicates the end time of the query period, in milliseconds. + * @returns { Promise } the promise returned by queryBundleStatsInfos, + * the {@link BundleStatsMap} objects containing the usage information about each bundle. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. * @since 9 + */ + function queryBundleStatsInfos(begin: number, end: number): Promise; + + /** + * Declares interval type. + * @enum {number} * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @since 9 */ export enum IntervalType { /** @@ -386,123 +487,244 @@ declare namespace usageStatistics { /** * Queries usage information about each bundle within a specified period at a specified interval. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param byInterval Indicates the interval at which the usage statistics are queried. + * @param { IntervalType } byInterval - Indicates the interval at which the usage statistics are queried. * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback - the callback of queryBundleStatsInfoByInterval, + * the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; + + /** + * Queries usage information about each bundle within a specified period at a specified interval. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { IntervalType } byInterval - Indicates the interval at which the usage statistics are queried. + * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } the promise returned by queryBundleStatsInfoByInterval, + * the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; /** * Queries state data of all bundles within a specified period identified by the start and end time. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback - the promise returned by queryBundleEvents, + * the list of {@link BundleEvents} objects containing the state data of all bundles. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the list of {@link BundleEvents} objects containing the state data of all bundles. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; + + /** + * Queries state data of all bundles within a specified period identified by the start and end time. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } the promise returned by queryBundleEvents, + * the list of {@link BundleEvents} objects containing the state data of all bundles. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryBundleEvents(begin: number, end: number): Promise>; /** * Queries state data of the current bundle within a specified period. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. + * + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback - the callback of queryCurrentBundleEvents, + * the {@link BundleEvents} object Array containing the state data of the current bundle. * @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the {@link BundleEvents} object Array containing the state data of the current bundle. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 9 */ function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; - function queryCurrentBundleEvents(begin: number, end: number): Promise>; /** - * Queries recently module usage records. - * - * @since 9 + * Queries state data of the current bundle within a specified period. + * + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } the promise returned by queryCurrentBundleEvents, + * the {@link BundleEvents} object Array containing the state data of the current bundle. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 9 + */ + function queryCurrentBundleEvents(begin: number, end: number): Promise>; + + /** + * Queries recently module usage records with maxNum. + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. + * @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000. + * @param { AsyncCallback> } callback - the callback of queryModuleUsageRecords, + * the {@link HapModuleInfo} object Array containing the usage data of the modules. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void; + + /** + * Queries recently module usage records with maxNum. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000. + * @returns { Promise> } the promise returned by queryModuleUsageRecords, + * the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryModuleUsageRecords(maxNum: number): Promise>; /** * Queries recently module usage records. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. + * @param { AsyncCallback> } callback - the callback of queryModuleUsageRecords, + * the {@link HapModuleInfo} object Array containing the usage data of the modules. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryModuleUsageRecords(callback: AsyncCallback>): void; + + /** + * Queries recently module usage records. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @returns { Promise> } the promise returned by queryModuleUsageRecords, + * the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryModuleUsageRecords(): Promise>; - /** + /** * Declares group type. - * - * @since 9 + * @enum {number} * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. + * @since 9 */ export enum GroupType { /** @@ -537,111 +759,229 @@ declare namespace usageStatistics { } /** - * Set app group by bundleName and number. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * Set app group by bundleName. + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param bundleName, name of the application. - * @param newGroup, the group of the application whose name is bundleName. + * @param { string } bundleName - name of the application. + * @param { GroupType } newGroup - the group of the application whose name is bundleName. + * @param { AsyncCallback } callback - the callback of setAppGroup. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10100001 - Application group operation repeated. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10100001 - Repeated operation on the application group. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + * @since 9 */ function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; - function setAppGroup(bundleName: string, newGroup: GroupType): Promise; /** - * Register callback to service. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * Set app group by bundleName. + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { string } bundleName - name of the application. + * @param { GroupType } newGroup - the group of the application whose name is bundleName. + * @returns { Promise } the promise returned by setAppGroup. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10100001 - Repeated operation on the application group. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. - * @param Callback, callback when application group change,return the AppGroupCallbackInfo. + * @since 9 + */ + function setAppGroup(bundleName: string, newGroup: GroupType): Promise; + + /** + * Register appGroup change callback to service. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { Callback } groupCallback - + * callback when AppGroupCallbackInfo when the group of app changed. + * @param { AsyncCallback } callback - the callback of registerAppGroupCallBack. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10100001 - Application group operation repeated. - * @returns Returns AppGroupCallbackInfo when the group of bundle changed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10100001 - Repeated operation on the application group. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + * @since 9 */ function registerAppGroupCallBack(groupCallback: Callback, callback: AsyncCallback): void; - function registerAppGroupCallBack(groupCallback: Callback): Promise; /** - * Unregister callback from service. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * Register appGroup change callback to service. + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { Callback } groupCallback - + * callback when AppGroupCallbackInfo when the group of app changed. + * @returns { Promise } the promise returned by registerAppGroupCallBack. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10100001 - Repeated operation on the application group. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. + * @since 9 + */ + function registerAppGroupCallBack(groupCallback: Callback): Promise; + + /** + * Unregister appGroup change callback from service. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { AsyncCallback } callback - the callback of unregisterAppGroupCallBack. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10100001 - Application group operation repeated. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10100001 - Repeated operation on the application group. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + * @since 9 */ function unregisterAppGroupCallBack(callback: AsyncCallback): void; + + /** + * Unregister appGroup change callback from service. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @returns { Promise } the promise returned by unregisterAppGroupCallBack. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10100001 - Repeated operation on the application group. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + * @since 9 + */ function unregisterAppGroupCallBack(): Promise; /** * Queries device event states data within a specified period identified by the start and end time. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback - the callback of queryDeviceEventStats, + * the {@link DeviceEventStats} object Array containing the event states data. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the {@link DeviceEventStats} object Array containing the event states data. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void; + + /** + * Queries device event states data within a specified period identified by the start and end time. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } the promise returned by queryDeviceEventStats, + * the {@link DeviceEventStats} object Array containing the event states data. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryDeviceEventStats(begin: number, end: number): Promise>; /** * Queries app notification number within a specified period identified by the start and end time. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback - the callback of queryNotificationEventStats, + * the {@link DeviceEventStats} object Array containing the event states data. * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 10000001 - Memory operation failed. * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @returns Returns the {@link NotificationEventStats} object Array containing the event states data. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 */ function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; + + /** + * Queries app notification number within a specified period identified by the start and end time. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin - Indicates the start time of the query period, in milliseconds. + * @param { number } end - Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } the promise returned by queryNotificationEventStats, + * the {@link DeviceEventStats} object Array containing the event states data. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC failed. + * @throws { BusinessError } 10000006 - Failed to get the application information. + * @throws { BusinessError } 10000007 - Failed to get the system time. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 9 + */ function queryNotificationEventStats(begin: number, end: number): Promise>; } -- Gitee From ee7dc70acf020e64cee2d7b1648b770911c6ed8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Wed, 18 Jan 2023 09:57:42 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.backgroundTaskManager.d.ts | 2 -- api/@ohos.resourceschedule.backgroundTaskManager.d.ts | 2 -- api/@ohos.resourceschedule.usageStatistics.d.ts | 1 - 3 files changed, 5 deletions(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index 130b3d6b25..9cc197c885 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -22,8 +22,6 @@ import Context from './application/BaseContext'; * * @namespace backgroundTaskManager * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @since 7 * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 07ae23175f..b5970ad468 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -22,8 +22,6 @@ import Context from './application/BaseContext'; * * @namespace backgroundTaskManager * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @since 9 */ declare namespace backgroundTaskManager { diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index f3599b1704..1f76db6218 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -26,7 +26,6 @@ import { AsyncCallback , Callback} from './basic'; * * @namespace usageStatistics * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @since 9 */ declare namespace usageStatistics { -- Gitee From 92a8427b83d742d11b4d97dca250da6f8e646fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Thu, 19 Jan 2023 02:39:34 +0000 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.backgroundTaskManager.d.ts | 4 ++-- api/@ohos.resourceschedule.backgroundTaskManager.d.ts | 10 ++++++---- api/@ohos.resourceschedule.usageStatistics.d.ts | 11 +++++++++-- api/@ohos.resourceschedule.workScheduler.d.ts | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index 9cc197c885..5a220c950a 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -102,7 +102,7 @@ declare namespace backgroundTaskManager { * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. * @param { BackgroundMode } bgMode - Indicates which background mode to request. - * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar. * @param { AsyncCallback } callback - The callback of the function. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 @@ -118,7 +118,7 @@ declare namespace backgroundTaskManager { * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. * @param { BackgroundMode } bgMode - Indicates which background mode to request. - * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar. * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index b5970ad468..e6605afbae 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -28,7 +28,7 @@ declare namespace backgroundTaskManager { /** * The info of delay suspend. * - * @name DelaySuspendInfo + * @interface DelaySuspendInfo * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 9 */ @@ -118,7 +118,7 @@ declare namespace backgroundTaskManager { * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. * @param { BackgroundMode } bgMode - Indicates which background mode to request. - * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar. * @param { AsyncCallback } callback - The callback of the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not System App. @@ -142,7 +142,7 @@ declare namespace backgroundTaskManager { * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. * @param { BackgroundMode } bgMode - Indicates which background mode to request. - * @param {WantAgent} wantAgent - Indicates which ability to start when user click the notification bar. + * @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not System App. @@ -234,6 +234,7 @@ declare namespace backgroundTaskManager { /** * Supported background mode. * + * @enum { number } * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 9 */ @@ -317,6 +318,7 @@ declare namespace backgroundTaskManager { /** * The type of resource. * + * @enum { number } * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @since 9 @@ -361,7 +363,7 @@ declare namespace backgroundTaskManager { /** * The request of efficiency resources. * - * @name EfficiencyResourcesRequest + * @interface EfficiencyResourcesRequest * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @since 9 diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 1f76db6218..a8f7a7782b 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -26,6 +26,7 @@ import { AsyncCallback , Callback} from './basic'; * * @namespace usageStatistics * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @since 9 */ declare namespace usageStatistics { @@ -257,6 +258,7 @@ declare namespace usageStatistics { /** * Checks whether the application with a specified bundle name is in the idle state. * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { string } bundleName - Indicates the bundle name of the application to query. * @param { AsyncCallback } callback - the callback of isIdleState, * boolean value is true mean the application is idle in a particular period; false mean otherwise. @@ -270,6 +272,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC failed. * @throws { BusinessError } 10000006 - Failed to get the application information. * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. * @since 9 */ function isIdleState(bundleName: string, callback: AsyncCallback): void; @@ -277,6 +280,7 @@ declare namespace usageStatistics { /** * Checks whether the application with a specified bundle name is in the idle state. * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { string } bundleName - Indicates the bundle name of the application to query. * @returns { Promise } the promise returned by queryAppGroup, * boolean value is true mean the application is idle in a particular period; false mean otherwise. @@ -290,6 +294,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC failed. * @throws { BusinessError } 10000006 - Failed to get the application information. * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. * @since 9 */ function isIdleState(bundleName: string): Promise; @@ -452,7 +457,8 @@ declare namespace usageStatistics { /** * Declares interval type. - * @enum {number} + * + * @enum { number } * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @since 9 @@ -720,7 +726,8 @@ declare namespace usageStatistics { /** * Declares group type. - * @enum {number} + * + * @enum { number } * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. * @since 9 diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index b867fc7507..553bb981db 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -27,7 +27,7 @@ declare namespace workScheduler { /** * The info of work. * - * @name WorkInfo + * @interface WorkInfo * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @since 9 -- Gitee From 2b0b55a9746c2fa96695987b051d376c97323f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Thu, 19 Jan 2023 02:52:30 +0000 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.backgroundTaskManager.d.ts | 96 ++++++++-------------------- 1 file changed, 28 insertions(+), 68 deletions(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index 5a220c950a..f707324f0e 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -20,9 +20,8 @@ import Context from './application/BaseContext'; /** * Manages background tasks. * - * @namespace backgroundTaskManager - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager */ @@ -31,8 +30,8 @@ declare namespace backgroundTaskManager { * The info of delay suspend. * * @name DelaySuspendInfo - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo */ @@ -50,9 +49,9 @@ declare namespace backgroundTaskManager { /** * Cancels delayed transition to the suspended state. * - * @param { number } requestId - Indicates the identifier of the delay request. - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @param requestId Indicates the identifier of the delay request. * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay */ @@ -61,35 +60,24 @@ declare namespace backgroundTaskManager { /** * Obtains the remaining time before an application enters the suspended state. * - * @param { number } requestId - Indicates the identifier of the delay request. - * @param { AsyncCallback } callback - The callback of the remaining delay time. - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 7 - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime - */ - function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; - - /** - * Obtains the remaining time before an application enters the suspended state. - * - * @param { number } requestId - Indicates the identifier of the delay request. - * @returns { Promise } The remaining delay time * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask - * @since 7 + * @param requestId Indicates the identifier of the delay request. + * @returns The remaining delay time * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime */ + function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; function getRemainingDelayTime(requestId: number): Promise; /** * Requests delayed transition to the suspended state. * - * @param { string } reason - Indicates the reason for delayed transition to the suspended state. - * @param { Callback } callback - The callback delay time expired. - * @returns { DelaySuspendInfo } Info of delay request - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @param reason Indicates the reason for delayed transition to the suspended state. + * @param callback The callback delay time expired. + * @returns Info of delay request * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay */ @@ -99,63 +87,35 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request start running in background. * system will publish a notification related to the this service. * - * @permission ohos.permission.KEEP_BACKGROUND_RUNNING - * @param { Context } context - App running context. - * @param { BackgroundMode } bgMode - Indicates which background mode to request. - * @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar. - * @param { AsyncCallback } callback - The callback of the function. - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning - */ - function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; - - /** - * Service ability uses this method to request start running in background. - * system will publish a notification related to the this service. - * - * @permission ohos.permission.KEEP_BACKGROUND_RUNNING - * @param { Context } context - App running context. - * @param { BackgroundMode } bgMode - Indicates which background mode to request. - * @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar. - * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @since 8 + * @permission ohos.permission.KEEP_BACKGROUND_RUNNING + * @param context app running context. + * @param bgMode Indicates which background mode to request. + * @param wantAgent Indicates which ability to start when user click the notification bar. * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning */ + function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; /** * Service ability uses this method to request stop running in background. * - * @param { Context } context - App running context. - * @param { AsyncCallback } callback - The callback of the function. - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning - */ - function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; - - /** - * Service ability uses this method to request stop running in background. - * - * @param { Context } context - App running context. - * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @since 8 + * @param context app running context. * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning */ + function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; /** * Supported background mode. * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.BackgroundMode */ @@ -163,66 +123,66 @@ declare namespace backgroundTaskManager { /** * data transfer mode * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ DATA_TRANSFER = 1, /** * audio playback mode * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ AUDIO_PLAYBACK = 2, /** * audio recording mode * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ AUDIO_RECORDING = 3, /** * location mode * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ LOCATION = 4, /** * bluetooth interaction mode * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ BLUETOOTH_INTERACTION = 5, /** * multi-device connection mode * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ MULTI_DEVICE_CONNECTION = 6, /** * wifi interaction mode * + * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. - * @since 8 */ WIFI_INTERACTION = 7, /** * Voice over Internet Phone mode * + * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. - * @since 8 */ VOIP = 8, @@ -230,8 +190,8 @@ declare namespace backgroundTaskManager { * background continuous calculate mode, for example 3D render. * only supported in particular device * - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ TASK_KEEPING = 9, } -- Gitee From 6ca6d78708885bdf4abd06a3b8838c8a44d23f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Sat, 28 Jan 2023 07:07:48 +0000 Subject: [PATCH 6/8] add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.resourceschedule.usageStatistics.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index a8f7a7782b..dc51e030f5 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -26,7 +26,6 @@ import { AsyncCallback , Callback} from './basic'; * * @namespace usageStatistics * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @since 9 */ declare namespace usageStatistics { -- Gitee From 16a913f9e3c8c05c757dfa2dc0f371086a03c418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 30 Jan 2023 06:19:35 +0000 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.WorkSchedulerExtensionAbility.d.ts | 4 +- ...esourceschedule.backgroundTaskManager.d.ts | 5 +- ...ohos.resourceschedule.usageStatistics.d.ts | 99 +++++++++---------- api/@ohos.resourceschedule.workScheduler.d.ts | 3 +- 4 files changed, 54 insertions(+), 57 deletions(-) diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts index e84ee214c2..56367d6ca1 100644 --- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -29,7 +29,7 @@ export default class WorkSchedulerExtensionAbility { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @param work The info of work. + * @param {workScheduler.WorkInfo} work - The info of work. */ onWorkStart(work: workScheduler.WorkInfo): void; @@ -39,7 +39,7 @@ export default class WorkSchedulerExtensionAbility { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @param work The info of work. + * @param {workScheduler.WorkInfo} work - The info of work. */ onWorkStop(work: workScheduler.WorkInfo): void; } \ No newline at end of file diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index e6605afbae..8b96fafbd2 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -21,7 +21,6 @@ import Context from './application/BaseContext'; * Manages background tasks. * * @namespace backgroundTaskManager - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @since 9 */ declare namespace backgroundTaskManager { @@ -113,7 +112,7 @@ declare namespace backgroundTaskManager { /** * Service ability uses this method to request start running in background. - * system will publish a notification related to the this service. + *

System will publish a notification related to the this service.

* * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. @@ -137,7 +136,7 @@ declare namespace backgroundTaskManager { /** * Service ability uses this method to request start running in background. - * system will publish a notification related to the this service. + *

System will publish a notification related to the this service.

* * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param { Context } context - App running context. diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index dc51e030f5..287a03398c 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -25,7 +25,6 @@ import { AsyncCallback , Callback} from './basic'; * then returns it to you. * * @namespace usageStatistics - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @since 9 */ declare namespace usageStatistics { @@ -259,9 +258,9 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { string } bundleName - Indicates the bundle name of the application to query. - * @param { AsyncCallback } callback - the callback of isIdleState, - * boolean value is true mean the application is idle in a particular period; false mean otherwise. - * The time range of the particular period is defined by the system, which may be hours or days. + * @param { AsyncCallback } callback - the callback of isIdleState. + *

boolean value is true mean the application is idle in a particular period; false mean otherwise. + * The time range of the particular period is defined by the system, which may be hours or days.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. @@ -281,9 +280,9 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { string } bundleName - Indicates the bundle name of the application to query. - * @returns { Promise } the promise returned by queryAppGroup, - * boolean value is true mean the application is idle in a particular period; false mean otherwise. - * The time range of the particular period is defined by the system, which may be hours or days. + * @returns { Promise } the promise returned by queryAppGroup. + *

boolean value is true mean the application is idle in a particular period; false mean otherwise. + * The time range of the particular period is defined by the system, which may be hours or days.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. @@ -304,7 +303,7 @@ declare namespace usageStatistics { * for example, restricting the running of background tasks.

* * @param { AsyncCallback } callback - the callback of queryAppGroup. - * Returns the app group of the calling application. + *

Returns the app group of the calling application.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. @@ -326,7 +325,7 @@ declare namespace usageStatistics { * for example, restricting the running of background tasks.

* * @returns { Promise } the promise returned by queryAppGroup. - * Returns the app group of the calling application. + *

Returns the app group of the calling application.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. @@ -349,8 +348,8 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { string } bundleName - name of the application. - * @param { AsyncCallback } callback - the callback of queryAppGroup, - * the usage priority group of the calling application. + * @param { AsyncCallback } callback - the callback of queryAppGroup. + *

the usage priority group of the calling application.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -375,8 +374,8 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { string } bundleName - name of the application. - * @returns { Promise } the promise returned by queryAppGroup, - * the usage priority group of the calling application. + * @returns { Promise } the promise returned by queryAppGroup. + *

the usage priority group of the calling application.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -412,7 +411,7 @@ declare namespace usageStatistics { * @param {number} begin - Indicates the start time of the query period, in milliseconds. * @param {number} end - Indicates the end time of the query period, in milliseconds. * @param { AsyncCallback } callback - the callback of queryBundleStatsInfos, - * the {@link BundleStatsMap} objects containing the usage information about each bundle. + *

the {@link BundleStatsMap} objects containing the usage information about each bundle.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -436,8 +435,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param {number} begin - Indicates the start time of the query period, in milliseconds. * @param {number} end - Indicates the end time of the query period, in milliseconds. - * @returns { Promise } the promise returned by queryBundleStatsInfos, - * the {@link BundleStatsMap} objects containing the usage information about each bundle. + * @returns { Promise } the promise returned by queryBundleStatsInfos. + *

the {@link BundleStatsMap} objects containing the usage information about each bundle.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -494,12 +493,12 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { IntervalType } byInterval - Indicates the interval at which the usage statistics are queried. - * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, - * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + *

The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.

* @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @param { AsyncCallback> } callback - the callback of queryBundleStatsInfoByInterval, - * the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. + * @param { AsyncCallback> } callback - the callback of queryBundleStatsInfoByInterval. + *

the list of {@link BundleStatsInfo} objects containing the usage information about each bundle.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -521,12 +520,12 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { IntervalType } byInterval - Indicates the interval at which the usage statistics are queried. - * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, - * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + *

The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.

* @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @returns { Promise> } the promise returned by queryBundleStatsInfoByInterval, - * the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. + * @returns { Promise> } the promise returned by queryBundleStatsInfoByInterval. + *

the list of {@link BundleStatsInfo} objects containing the usage information about each bundle.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -549,8 +548,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @param { AsyncCallback> } callback - the promise returned by queryBundleEvents, - * the list of {@link BundleEvents} objects containing the state data of all bundles. + * @param { AsyncCallback> } callback - the promise returned by queryBundleEvents. + *

the list of {@link BundleEvents} objects containing the state data of all bundles.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -573,8 +572,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @returns { Promise> } the promise returned by queryBundleEvents, - * the list of {@link BundleEvents} objects containing the state data of all bundles. + * @returns { Promise> } the promise returned by queryBundleEvents. + *

the list of {@link BundleEvents} objects containing the state data of all bundles.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -596,8 +595,8 @@ declare namespace usageStatistics { * * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @param { AsyncCallback> } callback - the callback of queryCurrentBundleEvents, - * the {@link BundleEvents} object Array containing the state data of the current bundle. + * @param { AsyncCallback> } callback - the callback of queryCurrentBundleEvents. + *

the {@link BundleEvents} object Array containing the state data of the current bundle.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. @@ -617,8 +616,8 @@ declare namespace usageStatistics { * * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @returns { Promise> } the promise returned by queryCurrentBundleEvents, - * the {@link BundleEvents} object Array containing the state data of the current bundle. + * @returns { Promise> } the promise returned by queryCurrentBundleEvents. + *

the {@link BundleEvents} object Array containing the state data of the current bundle.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 401 - Permission denied. * @throws { BusinessError } 801 - Capability not supported. @@ -638,8 +637,8 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000. - * @param { AsyncCallback> } callback - the callback of queryModuleUsageRecords, - * the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @param { AsyncCallback> } callback - the callback of queryModuleUsageRecords. + *

the {@link HapModuleInfo} object Array containing the usage data of the modules.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -661,8 +660,8 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000. - * @returns { Promise> } the promise returned by queryModuleUsageRecords, - * the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @returns { Promise> } the promise returned by queryModuleUsageRecords. + *

the {@link HapModuleInfo} object Array containing the usage data of the modules.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -683,8 +682,8 @@ declare namespace usageStatistics { * Queries recently module usage records. * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @param { AsyncCallback> } callback - the callback of queryModuleUsageRecords, - * the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @param { AsyncCallback> } callback - the callback of queryModuleUsageRecords. + *

the {@link HapModuleInfo} object Array containing the usage data of the modules.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -705,8 +704,8 @@ declare namespace usageStatistics { * Queries recently module usage records. * * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @returns { Promise> } the promise returned by queryModuleUsageRecords, - * the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @returns { Promise> } the promise returned by queryModuleUsageRecords. + *

the {@link HapModuleInfo} object Array containing the usage data of the modules.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -814,7 +813,7 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { Callback } groupCallback - - * callback when AppGroupCallbackInfo when the group of app changed. + *

callback when AppGroupCallbackInfo when the group of app changed.

* @param { AsyncCallback } callback - the callback of registerAppGroupCallBack. * @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. @@ -836,7 +835,7 @@ declare namespace usageStatistics { * * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { Callback } groupCallback - - * callback when AppGroupCallbackInfo when the group of app changed. + *

callback when AppGroupCallbackInfo when the group of app changed.

* @returns { Promise } the promise returned by registerAppGroupCallBack. * @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. @@ -899,8 +898,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @param { AsyncCallback> } callback - the callback of queryDeviceEventStats, - * the {@link DeviceEventStats} object Array containing the event states data. + * @param { AsyncCallback> } callback - the callback of queryDeviceEventStats. + *

the {@link DeviceEventStats} object Array containing the event states data.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -923,8 +922,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @returns { Promise> } the promise returned by queryDeviceEventStats, - * the {@link DeviceEventStats} object Array containing the event states data. + * @returns { Promise> } the promise returned by queryDeviceEventStats. + *

the {@link DeviceEventStats} object Array containing the event states data.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -947,8 +946,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @param { AsyncCallback> } callback - the callback of queryNotificationEventStats, - * the {@link DeviceEventStats} object Array containing the event states data. + * @param { AsyncCallback> } callback - the callback of queryNotificationEventStats. + *

the {@link DeviceEventStats} object Array containing the event states data.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. @@ -971,8 +970,8 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @param { number } begin - Indicates the start time of the query period, in milliseconds. * @param { number } end - Indicates the end time of the query period, in milliseconds. - * @returns { Promise> } the promise returned by queryNotificationEventStats, - * the {@link DeviceEventStats} object Array containing the event states data. + * @returns { Promise> } the promise returned by queryNotificationEventStats. + *

the {@link DeviceEventStats} object Array containing the event states data.

* @throws { BusinessError } 201 - Parameter error. * @throws { BusinessError } 202 - Not System App. * @throws { BusinessError } 401 - Permission denied. diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index 553bb981db..0eaac10ffe 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -19,7 +19,6 @@ import {AsyncCallback} from './basic'; * Work scheduler interface. * * @namespace workScheduler - * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @since 9 */ @@ -101,7 +100,7 @@ declare namespace workScheduler { /** * Add a work to the queue. A work can be executed only when it meets the preset triggering condition - * and complies with the rules of work scheduler manager. + *

and complies with the rules of work scheduler manager.

* * @param { WorkInfo } work - The info of work. * @throws { BusinessError } 401 - Parameter error. -- Gitee From ccd09046aa5c6d45a14810a2914b3bf4a176f505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 30 Jan 2023 06:34:29 +0000 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.WorkSchedulerExtensionAbility.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts index 56367d6ca1..de49d5822b 100644 --- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -18,28 +18,28 @@ import workScheduler from "./@ohos.resourceschedule.workScheduler"; /** * Class of the work scheduler extension ability. * - * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @since 9 */ export default class WorkSchedulerExtensionAbility { /** * Called back when a work is started. * - * @since 9 + * @param {workScheduler.WorkInfo} work - The info of work. * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @param {workScheduler.WorkInfo} work - The info of work. + * @since 9 */ onWorkStart(work: workScheduler.WorkInfo): void; /** * Called back when a work is stopped. * - * @since 9 + * @param {workScheduler.WorkInfo} work - The info of work. * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @param {workScheduler.WorkInfo} work - The info of work. + * @since 9 */ onWorkStop(work: workScheduler.WorkInfo): void; } \ No newline at end of file -- Gitee