2022-09-09 02:53:50 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
import { AsyncCallback } from './@ohos.base';
|
2022-09-09 02:53:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Work scheduler interface.
|
|
|
|
*
|
2023-01-18 09:03:00 +00:00
|
|
|
* @namespace workScheduler
|
2022-09-09 02:53:50 +00:00
|
|
|
* @StageModelOnly
|
2023-01-18 09:03:00 +00:00
|
|
|
* @since 9
|
2022-09-09 02:53:50 +00:00
|
|
|
*/
|
|
|
|
declare namespace workScheduler {
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* The info of work.
|
|
|
|
*
|
|
|
|
* @interface WorkInfo
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
export interface WorkInfo {
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The id of the current work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
workId: number;
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The bundle name of the current work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
bundleName: string;
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The ability name of the current work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
abilityName: string;
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Whether the current work will be saved.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
isPersisted?: boolean;
|
2023-01-18 09:03:00 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The network type of the current work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
networkType?: NetworkType;
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Whether a charging state has been set for triggering the work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
isCharging?: boolean;
|
2023-01-18 09:03:00 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The charger type based on which the work is triggered.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
chargerType?: ChargingType;
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The battery level for triggering a work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
batteryLevel?: number;
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* The battery status for triggering a work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
batteryStatus?: BatteryStatus;
|
|
|
|
/**
|
|
|
|
* Whether a storage state has been set for triggering the work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
storageRequest?: StorageRequest;
|
|
|
|
/**
|
|
|
|
* The interval at which the work is repeated.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
repeatCycleTime?: number;
|
|
|
|
/**
|
|
|
|
* Whether the work has been set to repeat at the specified interval.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
isRepeat?: boolean;
|
|
|
|
/**
|
|
|
|
* The repeat of the current work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
repeatCount?: number;
|
2023-01-18 09:03:00 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Whether the device deep idle state has been set for triggering the work.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
isDeepIdle?: boolean;
|
|
|
|
/**
|
|
|
|
* The idle wait time based on which the work is triggered.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
idleWaitTime?: number;
|
|
|
|
/**
|
|
|
|
* The parameters of the work. The value is only supported basic type(Number, String, Boolean).
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
parameters?: { [key: string]: number | string | boolean };
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a work to the queue. A work can be executed only when it meets the preset triggering condition
|
|
|
|
* <p> and complies with the rules of work scheduler manager. </p>
|
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* @param { number } workId - The id of work.
|
|
|
|
* @param { AsyncCallback<WorkInfo> } 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
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function getWorkStatus(workId: number, callback: AsyncCallback<WorkInfo>): void;
|
2022-09-09 02:53:50 +00:00
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Obtains the work info of the wordId.
|
|
|
|
*
|
|
|
|
* @param { number } workId - The id of work.
|
|
|
|
* @returns { Promise<WorkInfo> } 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): Promise<WorkInfo>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all works of the calling application.
|
|
|
|
*
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback of the function.
|
|
|
|
* @returns { Array<WorkInfo> } 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
|
2023-09-27 14:30:26 +00:00
|
|
|
* @since 10
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
function obtainAllWorks(callback: AsyncCallback<void>): Array<WorkInfo>;
|
|
|
|
|
2023-09-27 14:30:26 +00:00
|
|
|
/**
|
|
|
|
* Get all works of the calling application.
|
|
|
|
*
|
|
|
|
* @param { AsyncCallback<void> } 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.
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function obtainAllWorks(callback: AsyncCallback<Array<WorkInfo>>): void;
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Get all works of the calling application.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Array<WorkInfo>> } 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(): Promise<Array<WorkInfo>>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stop all and clear all works of the calling application.
|
|
|
|
*
|
|
|
|
* @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 stopAndClearWorks(): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check whether last work running is timeout. The interface is for repeating work.
|
|
|
|
*
|
|
|
|
* @param { number } workId - The id of work.
|
|
|
|
* @param { AsyncCallback<void> } 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
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function isLastWorkTimeOut(workId: number, callback: AsyncCallback<void>): boolean;
|
|
|
|
|
2023-09-27 14:30:26 +00:00
|
|
|
/**
|
|
|
|
* Check whether last work running is timeout. The interface is for repeating work.
|
|
|
|
*
|
|
|
|
* @param { number } workId - The id of work.
|
|
|
|
* @param { AsyncCallback<void> } 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
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function isLastWorkTimeOut(workId: number, callback: AsyncCallback<boolean>): void;
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Check whether last work running is timeout. The interface is for repeating work.
|
|
|
|
*
|
|
|
|
* @param { number } workId - The id of work.
|
|
|
|
* @returns { Promise<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
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function isLastWorkTimeOut(workId: number): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes network type.
|
|
|
|
*
|
|
|
|
* @name NetworkType
|
2023-05-08 09:49:00 +00:00
|
|
|
* @enum { number }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
export enum NetworkType {
|
|
|
|
/**
|
|
|
|
* Describes any network connection.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
NETWORK_TYPE_ANY = 0,
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Describes a mobile network connection.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
NETWORK_TYPE_MOBILE,
|
|
|
|
/**
|
|
|
|
* Describes a wifi network connection.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
NETWORK_TYPE_WIFI,
|
|
|
|
/**
|
|
|
|
* Describes a bluetooth network connection.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
NETWORK_TYPE_BLUETOOTH,
|
|
|
|
/**
|
|
|
|
* Describes a wifi p2p network connection.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
NETWORK_TYPE_WIFI_P2P,
|
|
|
|
/**
|
|
|
|
* Describes a wifi wire network connection.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
NETWORK_TYPE_ETHERNET
|
|
|
|
}
|
2022-09-09 02:53:50 +00:00
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Describes charging type.
|
|
|
|
*
|
|
|
|
* @name ChargingType
|
2023-05-08 09:49:00 +00:00
|
|
|
* @enum { number }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
export enum ChargingType {
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Describes any charger is connected.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
CHARGING_PLUGGED_ANY = 0,
|
|
|
|
/**
|
|
|
|
* Describes ac charger is connected.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
CHARGING_PLUGGED_AC,
|
|
|
|
/**
|
|
|
|
* Describes usb charger is connected.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
CHARGING_PLUGGED_USB,
|
|
|
|
/**
|
|
|
|
* Describes wireless charger is connected.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
CHARGING_PLUGGED_WIRELESS
|
|
|
|
}
|
2022-09-09 02:53:50 +00:00
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Describes the battery status.
|
|
|
|
*
|
|
|
|
* @name BatteryStatus
|
2023-05-08 09:49:00 +00:00
|
|
|
* @enum { number }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
export enum BatteryStatus {
|
|
|
|
/**
|
|
|
|
* Describes battery status is to low.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
BATTERY_STATUS_LOW = 0,
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Describes battery status is to ok.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
BATTERY_STATUS_OKAY,
|
|
|
|
/**
|
|
|
|
* Describes battery status is to low or ok.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
BATTERY_STATUS_LOW_OR_OKAY
|
|
|
|
}
|
2022-09-09 02:53:50 +00:00
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Describes the storage request.
|
|
|
|
*
|
|
|
|
* @name StorageRequest
|
2023-05-08 09:49:00 +00:00
|
|
|
* @enum { number }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
export enum StorageRequest {
|
|
|
|
/**
|
|
|
|
* Describes storage is to low.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
STORAGE_LEVEL_LOW = 0,
|
|
|
|
/**
|
|
|
|
* Describes storage is to ok.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
STORAGE_LEVEL_OKAY,
|
2022-09-09 02:53:50 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Describes storage is to low or ok.
|
2023-05-08 09:49:00 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
|
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
|
|
|
STORAGE_LEVEL_LOW_OR_OKAY
|
|
|
|
}
|
2022-09-09 02:53:50 +00:00
|
|
|
}
|
|
|
|
export default workScheduler;
|