;
/**
* 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.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Parcel operation failed.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* 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.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
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 } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Parcel operation failed.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* 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 } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise;
/**
* UIAbility uses this method to request start running in background.
* System will publish a notification related to the UIAbility.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { Context } context - App running context.
* @param { string[] } bgModes - Indicates which background mode to request.
* @param { WantAgent } wantAgent - Indicates which ability to start when user click the notification bar.
* @returns { Promise } The The continuous task notification.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
function startBackgroundRunning(context: Context, bgModes: string[], wantAgent: WantAgent): Promise;
/**
* UIAbility uses this method to update background mode.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { Context } context - App running context.
* @param { string[] } bgModes - Indicates which background mode to request.
* @returns { Promise } The continuous task notification.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
function updateBackgroundRunning(context: Context, bgModes: string[]): 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.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Parcel operation failed.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* 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.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Parcel operation failed.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
/**
* 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.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 19
*/
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. Possible causes: 1. Mandatory parameters are left unspecified.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Parcel operation failed.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* 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. Possible causes: 1. Mandatory parameters are left unspecified.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Parcel operation failed.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
/**
* 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 } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @throws { BusinessError } 9800006 - Notification verification failed for a continuous task.
* @throws { BusinessError } 9800007 - Continuous task storage failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 19
*/
function stopBackgroundRunning(context: Context): Promise;
/**
* Obtains all the continuous tasks before an application enters the suspended state,
* including continuous tasks in suspended state.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { Context } context - App running context.
* @returns { Promise } The promise returns the continuous task info.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
function getAllContinuousTasks(context: Context): Promise;
/**
* Obtains all the continuous tasks before an application enters the suspended state.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { Context } context - App running context.
* @param { boolean } includeSuspended - Return the suspended continuous tasks.
* @returns { Promise } The promise returns the continuous task info.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
function getAllContinuousTasks(context: Context, includeSuspended: boolean): Promise;
/**
* Apply or unapply efficiency resources.
*
* @param { EfficiencyResourcesRequest } request - The request of apply or unapply efficiency resources.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
*
2. Incorrect parameters types; 3. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 18700001 - Caller information verification failed for an energy resource request.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;
/**
* Reset all efficiency resources apply.
*
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Parameter verification failed.
* @throws { BusinessError } 9800001 - Memory operation failed.
* @throws { BusinessError } 9800002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 9800003 - Internal transaction failed.
* @throws { BusinessError } 9800004 - System service operation failed.
* @throws { BusinessError } 18700001 - Caller information verification failed for an energy resource request.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
function resetAllEfficiencyResources(): void;
/**
* Obtains all the efficiency resources of current application.
*
* @returns { Promise } The promise returns the efficiency resources info.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 18700001 - Caller information verification failed for an energy resource request.
* @throws { BusinessError } 18700002 - Failed to write data into parcel. Possible reasons: 1. Invalid parameters;
*
2. Failed to apply for memory.
* @throws { BusinessError } 18700004 - System service operation failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi
* @since 20
*/
function getAllEfficiencyResources(): Promise;
/**
* Register continuous task cancel callback.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { 'continuousTaskCancel' } type - The type of continuous task cancel.
* @param { Callback } callback - the callback of continuous task cancel.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Callback parameter error;
*
2. Register a exist callback type; 3. Parameter verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
function on(type: 'continuousTaskCancel', callback: Callback): void;
/**
* Unregister continuous task cancel callback.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { 'continuousTaskCancel' } type - The type of continuous task cancel.
* @param { Callback } callback - the callback of continuous task cancel.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Callback parameter error;
*
2. Unregister type has not register; 3. Parameter verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
function off(type: 'continuousTaskCancel', callback?: Callback): void;
/**
* Register continuous task suspend callback.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { 'continuousTaskSuspend' } type - The type of continuous task suspend.
* @param { Callback } callback - the callback of continuous task suspend.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
function on(type: 'continuousTaskSuspend', callback: Callback): void;
/**
* Unregister continuous task suspend callback.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { 'continuousTaskSuspend' } type - The type of continuous task suspend.
* @param { Callback } [callback] - the callback of continuous task suspend.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
function off(type: 'continuousTaskSuspend', callback?: Callback): void;
/**
* Register continuous task active callback.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { 'continuousTaskActive' } type - The type of continuous task active.
* @param { Callback } callback - the callback of continuous task active.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
function on(type: 'continuousTaskActive', callback: Callback): void;
/**
* Unregister continuous task suspend callback.
*
* @permission ohos.permission.KEEP_BACKGROUND_RUNNING
* @param { 'continuousTaskActive' } type - The type of continuous task active.
* @param { Callback } [callback] - the callback of continuous task active.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 9800005 - Continuous task verification failed.
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
function off(type: 'continuousTaskActive', callback?: Callback): void;
/**
* Supported background mode.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* Supported background mode.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
export enum BackgroundMode {
/**
* data transfer mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
DATA_TRANSFER = 1,
/**
* audio playback mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* audio playback mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
AUDIO_PLAYBACK = 2,
/**
* audio recording mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
AUDIO_RECORDING = 3,
/**
* location mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
LOCATION = 4,
/**
* bluetooth interaction mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
BLUETOOTH_INTERACTION = 5,
/**
* multi-device connection mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
/**
* multi-device connection mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @atomicservice
* @since 12
*/
MULTI_DEVICE_CONNECTION = 6,
/**
* wifi interaction mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @systemapi Hide this for inner system use.
* @since 9
*/
WIFI_INTERACTION = 7,
/**
* Voice over Internet Phone mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 13
*/
VOIP = 8,
/**
* background continuous calculate mode, for example 3D render.
* only supported in particular device
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 9
*/
TASK_KEEPING = 9,
}
/**
* The type of resource.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
export enum ResourceType {
/**
* The cpu resource for not being suspended.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
CPU = 1,
/**
* The resource for not being proxyed common_event.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
COMMON_EVENT = 1 << 1,
/**
* The resource for not being proxyed timer.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
TIMER = 1 << 2,
/**
* The resource for not being proxyed workscheduler.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
WORK_SCHEDULER = 1 << 3,
/**
* The resource for not being proxyed bluetooth.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
BLUETOOTH = 1 << 4,
/**
* The resource for not being proxyed gps.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
GPS = 1 << 5,
/**
* The resource for not being proxyed audio.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
AUDIO = 1 << 6,
/**
* The resource for not being proxyed running lock.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 10
*/
RUNNING_LOCK = 1 << 7,
/**
* The resource for not being proxyed sensor.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 10
*/
SENSOR = 1 << 8
}
/**
* The request of efficiency resources.
*
* @interface EfficiencyResourcesRequest
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
export interface EfficiencyResourcesRequest {
/**
* The set of resource types that app wants to apply.
*
* @type { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
resourceTypes: number;
/**
* True if the app begin to use, else false.
*
* @type { boolean }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
isApply: boolean;
/**
* The duration that the resource can be used most.
*
* @type { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
timeOut: number;
/**
* True if the apply action is persist, else false. Default value is false.
*
* @type { ?boolean }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
isPersist?: boolean;
/**
* True if apply action is for process, false is for package. Default value is false.
*
* @type { ?boolean }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
isProcess?: boolean;
/**
* The apply reason.
*
* @type { string }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply
* @systemapi Hide this for inner system use.
* @since 9
*/
reason: string;
}
/**
* The type of continuous task cancel reason.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
export enum ContinuousTaskCancelReason {
/**
* User cancel.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
USER_CANCEL = 1,
/**
* System cancel.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL = 2,
/**
* User remove notification.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
USER_CANCEL_REMOVE_NOTIFICATION = 3,
/**
* Low network speed when request data transfer mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_DATA_TRANSFER_LOW_SPEED = 4,
/**
* Not use avsession when request audio playback mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_AUDIO_PLAYBACK_NOT_USE_AVSESSION = 5,
/**
* Audio is not running when request audio playback mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_AUDIO_PLAYBACK_NOT_RUNNING = 6,
/**
* Audio is not running when request audio recording mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_AUDIO_RECORDING_NOT_RUNNING = 7,
/**
* Not use location when request location mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_NOT_USE_LOCATION = 8,
/**
* Not use bluetooth when request bluetooth interaction mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_NOT_USE_BLUETOOTH = 9,
/**
* Not use multi device when request multi-device connection mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_NOT_USE_MULTI_DEVICE = 10,
/**
* Use some mode illegally.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 15
*/
SYSTEM_CANCEL_USE_ILLEGALLY = 11,
}
/**
* Supported background submode.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 16
*/
export enum BackgroundSubMode {
/**
* bluetooth car key mode
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 16
*/
CAR_KEY = 1
}
/**
* Supported background mode type.
*
* @enum { string }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 16
*/
export enum BackgroundModeType {
/**
* subMode type
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 16
*/
SUB_MODE = 'subMode'
}
/**
* Type of continuous task suspend reason.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
export enum ContinuousTaskSuspendReason {
/**
* Low network speed when request data transfer mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_DATA_TRANSFER_LOW_SPEED = 4,
/**
* Not use avsession when request audio playback mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_AUDIO_PLAYBACK_NOT_USE_AVSESSION = 5,
/**
* Audio is not running when request audio playback mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_AUDIO_PLAYBACK_NOT_RUNNING = 6,
/**
* Audio is not running when request audio recording mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_AUDIO_RECORDING_NOT_RUNNING = 7,
/**
* Not use location when request location mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_LOCATION_NOT_USED = 8,
/**
* Not use bluetooth when request bluetooth interaction mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_BLUETOOTH_NOT_USED = 9,
/**
* Not use multi device when request multi-device connection mode.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_MULTI_DEVICE_NOT_USED = 10,
/**
* Use some mode illegally.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_USED_ILLEGALLY = 11,
/**
* System load warning.
*
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @since 20
*/
SYSTEM_SUSPEND_SYSTEM_LOAD_WARNING = 12,
}
}
export default backgroundTaskManager;