• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 资源调度子系统ChangeLog
2
3## cl.resourceschedule.backgroundTaskManager
4对资源调度子系统backgroundTaskManager仓原有接口进行整改,原有API8及之前的接口全部废弃,原有API9接口删除,需要使用新的API9接口。新的API9接口符合错误码规范。
5
6**变更影响**
7
8基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
9
10**关键接口/组件变更**
11
12以下方法、属性、枚举和常量均从API9变更。废弃@ohos.backgroundTaskManager.d.ts文件,新增@ohos.resourceschedule.backgroundTaskManager.d.ts文件,将相关接口变更至对应的文件。
13
14| 类名 | 接口类型 | 接口声明 | 说明 |
15|  -- | -- | -- | -- |
16| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
17| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
18| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts,修改为function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; |
19| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise<void>; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
20| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
21| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise<void>; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
22| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback<void>): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
23| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback<void>): DelaySuspendInfo; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
24| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise<number>; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
25| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback<number>): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
26| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
27| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
28| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
29| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
30| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
31| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
32| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
33| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
34| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
35| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
36| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
37| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
38| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
39| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
40| backgroundTaskManager.ResourceType | enum | export enum ResourceType | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
41| backgroundTaskManager.ResourceType | enum | CPU = 1 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
42| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
43| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
44| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
45| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
46| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
47| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
48| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
49| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
50| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
51| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
52| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
53| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
54| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
55
56
57**适配指导**<br>
58
59导入backgroundTaskManager模块。
60```
61import bundle form '@ohos.resourceschedule.backgroundTaskManager'
62```
63此外还需要适配异常处理,具体参考[backgroundTaskManager接口文档](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md)。
64
65## c2.resourceschedule.usageStatistics
66对资源调度子系统deviceUsageStatistics仓原有接口进行整改,原有API8及之前的接口全部废弃,原有API9接口删除,需要使用新的API9接口。新的API9接口符合错误码规范。
67
68**变更影响**
69
70基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
71
72**关键接口/组件变更**
73
74以下方法、属性、枚举和常量均从API9变更,废弃@ohos.bundleState.d.ts文件,新增@ohos.resourceschedule.usageStatistics.d.ts文件,类名也将从bundleState变更为usageStatistics。
75
76| 类名                                      | 接口类型  | 方法/属性/枚举/常量                                          | 变更类型                                                     |
77| ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
78| bundleState                               | method    | function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void; | 废弃,移动到usageStatistics.isIdleState                      |
79| bundleState                               | method    | function isIdleState(bundleName: string): Promise<boolean>;  | 废弃,移动到usageStatistics.isIdleState                      |
80| bundleState                               | method    | function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void; | 废弃,修改为function queryAppGroup(callback: AsyncCallback<number>): void; |
81| bundleState                               | method    | function queryAppUsagePriorityGroup(): Promise<number>;      | 废弃,修改为function queryAppGroup(): Promise<number>;       |
82| bundleState                               | method    | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void; | 废弃,修改为function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<BundleStatsMap>): void; |
83| bundleState                               | method    | function queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoResponse>; | 废弃, 修改为function queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>; |
84| bundleState                               | method    | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>; | 废弃,修改为function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStatsInfo>>; |
85| bundleState                               | method    | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStateInfo>>): void; | 废弃,修改为function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStatsInfo>>): void; |
86| bundleState                               | method    | function queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | 废弃,修改为function queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>; |
87| bundleState                               | method    | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | 废弃,修改为function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void; |
88| bundleState                               | method    | function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | 废弃,修改为function queryCurrentBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>; |
89| bundleState                               | method    | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void; | 废弃,修改为function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void; |
90| bundleState                               | method    | function getRecentlyUsedModules(maxNum?: number): Promise<Array<BundleActiveModuleInfo>>; | 废弃,修改为两个接口function QueryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>>; function QueryModuleUsageRecords(): Promise<Array<HapModuleInfo>>; |
91| bundleState                               | method    | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void; | 废弃,修改为两个接口function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapModuleInfo>>): void; function QueryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>): void; |
92| bundleState                               | method    | function queryAppUsagePriorityGroup(bundleName? : string): Promise<number>; | 废弃,修改为function queryAppGroup(bundleName: string): Promise<number>; |
93| bundleState                               | method    | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void; | 废弃,修改为function queryAppGroup(bundleName: string, callback: AsyncCallback<number>): void; |
94| bundleState                               | method    | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void; | 废弃,修改为function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void; |
95| bundleState                               | method    | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise<void>; | 废弃,修改为function setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>; |
96| bundleState                               | method    | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>, callback: AsyncCallback<void>): void; | 废弃,修改为function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>, callback: AsyncCallback<void>): void; |
97| bundleState                               | method    | function registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>): Promise<void>; | 废弃,修改为function registerAppGroupCallBack(callback: Callback<AppGroupCallbackInfo>): Promise<void>; |
98| bundleState                               | method    | function unRegisterGroupCallBack(callback: AsyncCallback<void>): void; | 变更,修改为function unregisterAppGroupCallBack(): Promise<void>; |
99| bundleState                               | method    | function unRegisterGroupCallBack(): Promise<void>;           | 变更,修改为function unregisterAppGroupCallBack(): Promise<void>; |
100| bundleState                               | method    | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | 变更,修改为function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array<DeviceEventStats>>): void; |
101| bundleState                               | method    | function queryBundleActiveEventStates(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | 接口从API9变更,修改为function queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>; |
102| bundleState                               | method    | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void; | 接口从API9变更,修改为function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array<NotificationEventStats >>): void; |
103| bundleState                               | method    | function queryAppNotificationNumber(begin: number, end: number): Promise<Array<BundleActiveEventState>>; | 接口从API9变更,修改为function queryNotificationEventStats(begin: number, end: number): Promise<Array<NotificationEventStats >>; |
104| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo                      | 变更,修改为usageStatistics.AppGroupCallbackInfo             |
105| bundleState.BundleActiveGroupCallbackInfo | field     | bundleName: string                                           | 变更,移动到usageStatistics.AppGroupCallbackInfo             |
106| bundleState.BundleActiveGroupCallbackInfo | field     | changeReason: number                                         | 变更,移动到usageStatistics.AppGroupCallbackInfo             |
107| bundleState.BundleActiveGroupCallbackInfo | field     | userId: number                                               | 变更,移动到usageStatistics.AppGroupCallbackInfo             |
108| bundleState.BundleActiveGroupCallbackInfo | field     | appUsageNewGroup: number                                     | 废弃,修改为appNewGroup                                      |
109| bundleState.BundleActiveGroupCallbackInfo | field     | appUsageOldGroup: number                                     | 废弃,修改为appOldGroup                                      |
110| bundleState.BundleActiveEventState        | interface | interface BundleActiveEventState                             | 废弃,修改为usageStatistics.DeviceEventStats                 |
111| bundleState.BundleActiveEventState        | field     | count: number                                                | 变更,移动到usageStatistics.DeviceEventStats                 |
112| bundleState.BundleActiveEventState        | field     | eventId: number                                              | 变更,移动到usageStatistics.DeviceEventStats                 |
113| bundleState.BundleActiveEventState        | field     | name: string                                                 | 变更,移动到usageStatistics.DeviceEventStats                 |
114| bundleState.BundleActiveModuleInfo        | interface | interface BundleActiveModuleInfo                             | 接口从API9变更,修改为usageStatistics.HapModuleInfo          |
115| bundleState.BundleActiveModuleInfo        | field     | formRecords: Array<BundleActiveFormInfo>                     | 变更,修改为formRecords: Array<HapModuleInfo>                |
116| bundleState.BundleActiveModuleInfo        | field     | lastModuleUsedTime: number                                   | 变更,移动到usageStatistics.HapModuleInfo                    |
117| bundleState.BundleActiveModuleInfo        | field     | launchedCount: number                                        | 变更,移动到usageStatistics.HapModuleInfo                    |
118| bundleState.BundleActiveModuleInfo        | field     | abilityIconId?: number                                       | 变更,移动到usageStatistics.HapModuleInfo                    |
119| bundleState.BundleActiveModuleInfo        | field     | abilityDescriptionId?: number                                | 变更,移动到usageStatistics.HapModuleInfo                    |
120| bundleState.BundleActiveModuleInfo        | field     | abilityLableId?: number                                      | 变更,移动到usageStatistics.HapModuleInfo                    |
121| bundleState.BundleActiveModuleInfo        | field     | descriptionId?: number;                                      | 变更,移动到usageStatistics.HapModuleInfo                    |
122| bundleState.BundleActiveModuleInfo        | field     | labelId?: number                                             | 变更,移动到usageStatistics.HapModuleInfo                    |
123| bundleState.BundleActiveModuleInfo        | field     | appLabelId?: number                                          | 变更,移动到usageStatistics.HapModuleInfo                    |
124| bundleState.BundleActiveModuleInfo        | field     | abilityName?: string                                         | 变更,移动到usageStatistics.HapModuleInfo                    |
125| bundleState.BundleActiveModuleInfo        | field     | moduleName: string                                           | 变更,移动到usageStatistics.HapModuleInfo                    |
126| bundleState.BundleActiveModuleInfo        | field     | bundleName: string                                           | 变更,移动到usageStatistics.HapModuleInfo                    |
127| bundleState.BundleActiveModuleInfo        | field     | deviceId?: string                                            | 变更,移动到usageStatistics.HapModuleInfo                    |
128| bundleState.GroupType                     | enum      | enum GroupType                                               | 变更,移动到usageStatistics.GroupType                        |
129| bundleState.GroupType                     | enum      | ACTIVE_GROUP_ALIVE                                           | 废弃,修改为ALIVE_GROUP                                      |
130| bundleState.GroupType                     | enum      | ACTIVE_GROUP_DAILY                                           | 废弃,修改为DAILY_GROUP                                      |
131| bundleState.GroupType                     | enum      | ACTIVE_GROUP_FIXED                                           | 废弃,修改为FIXED_GROUP                                      |
132| bundleState.GroupType                     | enum      | ACTIVE_GROUP_RARE                                            | 废弃,修改为RARE_GROUP                                       |
133| bundleState.GroupType                     | enum      | ACTIVE_GROUP_LIMIT                                           | 废弃,修改为LIMITED_GROUP                                    |
134| bundleState.GroupType                     | enum      | ACTIVE_GROUP_NEVER                                           | 废弃,修改为NEVER_GROUP                                      |
135| bundleState.IntervalType                  | enum      | enum IntervalType                                            | 废弃,移动到usageStatistics.IntervalType                     |
136| bundleState.IntervalType                  | enum      | BY_OPTIMIZED                                                 | 废弃,移动到usageStatistics.IntervalType                     |
137| bundleState.IntervalType                  | enum      | BY_DAILY                                                     | 废弃,移动到usageStatistics.IntervalType                     |
138| bundleState.IntervalType                  | enum      | BY_WEEKLY                                                    | 废弃,移动到usageStatistics.IntervalType                     |
139| bundleState.IntervalType                  | enum      | BY_MONTHLY                                                   | 废弃,移动到usageStatistics.IntervalType                     |
140| bundleState.IntervalType                  | enum      | BY_ANNUALLY                                                  | 废弃,移动到usageStatistics.IntervalType                     |
141| bundleState.BundleActiveInfoResponse      | interface | interface BundleActiveInfoResponse                           | 废弃,修改为usageStatistics.BundleStatsMap                   |
142| bundleState.BundleActiveState             | interface | interface BundleActiveState                                  | 废弃,修改为usageStatistics.BundleEvents                     |
143| bundleState.BundleActiveState             | field     | stateType?: number                                           | 废弃,修改为eventId                                          |
144| bundleState.BundleActiveState             | field     | stateOccurredTime?: number                                   | 废弃,修改为eventOccurredTime                                |
145| bundleState.BundleActiveState             | field     | nameOfClass?: string                                         | 废弃,移动到usageStatistics.BundleEvents                     |
146| bundleState.BundleActiveState             | field     | indexOfLink?: string                                         | 废弃,移动到usageStatistics.BundleEvents                     |
147| bundleState.BundleActiveState             | field     | bundleName?: string                                          | 废弃,移动到usageStatistics.BundleEvents                     |
148| bundleState.BundleActiveState             | field     | appUsagePriorityGroup?: number                               | 废弃,修改为appGroup                                         |
149| bundleState.BundleStateInfo               | interface | interface BundleStateInfo                                    | 废弃,修改为usageStatistics.BundleStatsInfo                  |
150| bundleState.BundleStateInfo               | method    | merge(toMerge: BundleStateInfo): void                        | 废弃                                                         |
151| bundleState.BundleStateInfo               | field     | infosEndTime?: number                                        | 废弃,移动到usageStatistics.BundleStatsInfo                  |
152| bundleState.BundleStateInfo               | field     | infosBeginTime?: number                                      | 废弃,移动到usageStatistics.BundleStatsInfo                  |
153| bundleState.BundleStateInfo               | field     | fgAbilityPrevAccessTime?: number                             | 废弃,移动到usageStatistics.BundleStatsInfo                  |
154| bundleState.BundleStateInfo               | field     | fgAbilityAccessTotalTime?: number                            | 废弃,移动到usageStatistics.BundleStatsInfo                  |
155| bundleState.BundleStateInfo               | field     | bundleName?: string                                          | 废弃,移动到usageStatistics.BundleStatsInfo                  |
156| bundleState.BundleStateInfo               | field     | abilitySeenTotalTime?: number                                | 废弃,移动到usageStatistics.BundleStatsInfo                  |
157| bundleState.BundleStateInfo               | field     | abilityPrevSeenTime?: number                                 | 废弃,移动到usageStatistics.BundleStatsInfo                  |
158| bundleState.BundleStateInfo               | field     | abilityPrevAccessTime?: number                               | 废弃,移动到usageStatistics.BundleStatsInfo                  |
159| bundleState.BundleStateInfo               | field     | abilityInFgTotalTime?: number                                | 废弃,移动到usageStatistics.BundleStatsInfo                  |
160| bundleState.BundleStateInfo               | field     | id: number                                                   | 废弃,移动到usageStatistics.BundleStatsInfo                  |
161| bundleState                               | namespace | declare namespace bundleState                                | 废弃,修改为usageStatistics,移植到ohos.resourceschedule.usageStatistics.d.ts |
162
163
164**适配指导**<br>
165
166导入usageStatistics模块。
167```
168import bundle form '@ohos.resourceschedule.usageStatistics'
169```
170此外还需要适配异常处理,具体参考[usageStatistics接口文档](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md)。
171
172
173## c3.resourceschedule.workScheduler
174对资源调度子系统workScheduler仓原有接口进行整改,原有API9接口变更为新的API9接口。新的API9接口符合错误码规范。
175
176**变更影响**
177
178基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
179
180**关键接口/组件变更**
181
182以下方法、属性、枚举和常量均从API9变更。废弃@ohos.workScheduler.d.ts文件,新增@ohos.resourceschedule.workScheduler.d.ts文件,将相关接口变更至对应的文件中。
183
184| 类名 | 接口类型 | 接口声明 | 变更类型 |
185|  -- | -- | -- | -- |
186| workScheduler | namespace | declare namespace workScheduler | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
187| workScheduler.WorkInfo | interface | export interface WorkInfo | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
188| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
189| workScheduler.WorkInfo | field | idleWaitTime?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
190| workScheduler.WorkInfo | field | isDeepIdle?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
191| workScheduler.WorkInfo | field | repeatCount?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
192| workScheduler.WorkInfo | field | isRepeat?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
193| workScheduler.WorkInfo | field | repeatCycleTime?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
194| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
195| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
196| workScheduler.WorkInfo | field | batteryLevel?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
197| workScheduler.WorkInfo | field | chargerType?: ChargingType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
198| workScheduler.WorkInfo | field | isCharging?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
199| workScheduler.WorkInfo | field | networkType?: NetworkType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
200| workScheduler.WorkInfo | field | isPersisted?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
201| workScheduler.WorkInfo | field | abilityName: string | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
202| workScheduler.WorkInfo | field | bundleName: string | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
203| workScheduler.WorkInfo | field | workId: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
204| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
205| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback<void>): boolean; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
206| workScheduler | method | function stopAndClearWorks(): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopAndClearWorks(): boolean; |
207| workScheduler | method | function obtainAllWorks(): Promise<Array<WorkInfo>>; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
208| workScheduler | method | function obtainAllWorks(callback: AsyncCallback<void>): Array<WorkInfo>; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
209| workScheduler | method | function getWorkStatus(workId: number): Promise<WorkInfo>; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
210| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback<WorkInfo>): void; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
211| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopWork(work: WorkInfo, needCancel?: boolean): void; |
212| workScheduler | method | function startWork(work: WorkInfo): boolean; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function startWork(work: WorkInfo): void; |
213| workScheduler.NetworkType | enum | export enum NetworkType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
214| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
215| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
216| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
217| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
218| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
219| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
220| workScheduler.ChargingType | enum | export enum ChargingType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
221| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
222| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
223| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
224| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
225| workScheduler.BatteryStatus | enum | export enum BatteryStatus | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
226| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
227| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
228| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
229| workScheduler.StorageRequest | enum | export enum StorageRequest | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
230| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
231| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
232| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
233
234
235**适配指导**<br>
236
237导入workScheduler模块。
238```
239import bundle form '@ohos.resourceschedule.workScheduler'
240```
241此外还需要适配异常处理,具体参考[workScheduler接口文档](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md)。
242
243
244## c4.resourceschedule.reminderAgent
245对资源调度子系统提醒代理原有接口进行整改,原有API8及之前的接口全部废弃,原有API9接口删除,需要使用新的API9接口。新的API9接口符合错误码规范。
246
247**变更影响**
248
249基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
250
251**关键接口/组件变更**
252
253以下方法、属性、枚举和常量均从API9变更,废弃@ohos.reminderAgent.d.ts文件,新增@ohos.reminderAgentManager.d.ts文件,类名也将从reminderAgent变更为reminderAgentManager。
254
255| 类名                | 接口类型        | 方法/属性/枚举/常量                                          | 变更类型                                                     |
256| --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
257| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void; | 废弃,移动到reminderAgentManager |
258| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise<number>;  | 废弃,移动到reminderAgentManager |
259| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback<void>): void; | 废弃,移动到reminderAgentManager |
260| reminderAgent | method | cancelReminder(reminderId: number): Promise<void>; | 废弃,移动到reminderAgentManager |
261| reminderAgent | method | getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void; | 废弃,移动到reminderAgentManager |
262| reminderAgent | method | getValidReminders(): Promise<Array<ReminderRequest>>; | 废弃,移动到reminderAgentManager |
263| reminderAgent | method | cancelAllReminders(callback: AsyncCallback<void>): void; | 废弃,移动到reminderAgentManager |
264| reminderAgent | method | cancelAllReminders(): Promise<void>; |  废弃,移动到reminderAgentManager |
265| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; | 废弃,移动到reminderAgentManager |
266| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise<void>; | 废弃,移动到reminderAgentManager |
267| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void; | 废弃,移动到reminderAgentManager |
268| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise<void>; | 废弃,移动到reminderAgentManager |
269| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | 废弃,移动到reminderAgentManager.ActionButtonType |
270| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE |  废弃,移动到reminderAgentManager.ActionButtonType |
271| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | 废弃,移动到reminderAgentManager.ReminderType |
272| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | 废弃,移动到reminderAgentManager.ReminderType |
273| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | 废弃,移动到reminderAgentManager.ReminderType |
274| reminderAgent.ActionButton | field | title:string | 废弃,移动到reminderAgentManager.ActionButton |
275| reminderAgent.ActionButton | field | type:ActionButtonType | 废弃,移动到reminderAgentManager.ActionButton |
276| reminderAgent.WantAgent | field | pkgName:string | 废弃,移动到reminderAgentManager.WantAgent |
277| reminderAgent.WantAgent | field | abilityName:string | 废弃,移动到reminderAgentManager.WantAgent |
278| reminderAgent.MaxScreenWantAgent | field | pkgName:string | 废弃,移动到reminderAgentManager.MaxScreenWantAgent |
279| reminderAgent.MaxScreenWantAgent | field | abilityName:string | 废弃,移动到reminderAgentManager.MaxScreenWantAgent |
280| reminderAgent.ReminderRequest | field | reminderType:ReminderType | 废弃,移动到reminderAgentManager.ReminderRequest |
281| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | 废弃,移动到reminderAgentManager.ReminderRequest |
282| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | 废弃,移动到reminderAgentManager.ReminderRequest |
283| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | 废弃,移动到reminderAgentManager.ReminderRequest |
284| reminderAgent.ReminderRequest | field | ringDuration?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
285| reminderAgent.ReminderRequest | field | snoozeTimes?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
286| reminderAgent.ReminderRequest | field | timeInterval?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
287| reminderAgent.ReminderRequest | field | title?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
288| reminderAgent.ReminderRequest | field | content?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
289| reminderAgent.ReminderRequest | field | expiredContent?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
290| reminderAgent.ReminderRequest | field | snoozeContent?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
291| reminderAgent.ReminderRequest | field | notificationId?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
292| reminderAgent.ReminderRequest | field | slotType?:	notification.SlotType | 废弃,移动到reminderAgentManager.ReminderRequest |
293| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | 废弃,移动到reminderAgentManager.ReminderRequestCalendar |
294| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array<number> | 废弃,移动到reminderAgentManager.ReminderRequestCalendar |
295| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array<number> | 废弃,移动到reminderAgentManager.ReminderRequestCalendar |
296| reminderAgent.ReminderRequestAlarm | field | hour:number | 废弃,移动到reminderAgentManager.ReminderRequestAlarm |
297| reminderAgent.ReminderRequestAlarm | field | minute:number | 废弃,移动到reminderAgentManager.ReminderRequestAlarm |
298| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array<number> | 废弃,移动到reminderAgentManager.ReminderRequestAlarm |
299| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | 废弃,移动到reminderAgentManager.ReminderRequestTimer |
300| reminderAgent.LocalDateTime | field | year:number | 废弃,移动到reminderAgentManager.LocalDateTime |
301| reminderAgent.LocalDateTime | field | month:number | 废弃,移动到reminderAgentManager.LocalDateTime |
302| reminderAgent.LocalDateTime | field | day:number | 废弃,移动到reminderAgentManager.LocalDateTime |
303| reminderAgent.LocalDateTime | field | hour:number | 废弃,移动到reminderAgentManager.LocalDateTime |
304| reminderAgent.LocalDateTime | field | minute:number | 废弃,移动到reminderAgentManager.LocalDateTime |
305| reminderAgent.LocalDateTime | field | second?:number | 废弃,移动到reminderAgentManager.LocalDateTime |
306
307
308**适配指导**<br>
309
310导入reminderAgentManager模块。
311```
312import bundle form '@ohos.reminderAgentManager'
313```
314此外还需要适配异常处理,具体参考[reminderAgentManager接口文档](../../../application-dev/reference/apis/js-apis-reminderAgentManager.md)。
315
316
317