diff --git a/README.md b/README.md index 8a66d30ddefd16b8d4899499c677bf7d624ef7c5..59fc520a7067b662261ff2bdd45675b07e6d02da 100644 --- a/README.md +++ b/README.md @@ -60,10 +60,6 @@ Taking app usage interface as an example, the main exposed interfaces are as fol
Queries application usage duration statistics by time interval(callback).
queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>
Queries application usage duration statistics by time interval(Promise).
-queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void
-Queries (returns) the priority group used by the current caller application(callback).
-Queries (returns) the priority group used by the current caller application(Promise).
isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void
Judges whether the application of the specified bundle name is currently idle(callback).
getRecentlyUsedModules(maxNum?: number): Promise<Array<BundleActiveModuleInfo>>
Query FA usage records. The maximum returned quantity does not exceed the value set by maxnum. FA usage records are sorted from near to far. The maximum maxnum is 1000. If the maxnum parameter is not filled in, the default maxnum is 1000(Promise).
queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void
-Use the optional parameters to query the usage priority group of the current caller application(callback).
+Query the group of the current application or the application of specified bundlename.
queryAppUsagePriorityGroup(bundleName? : string): Promise<number>
-Use the optional parameters to query the usage priority group of the current caller application(Promise).
+Query the group of the current application or the application of specified bundlename.
setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<boolean>): void
Set the group of the specified application as the group provided by the parameter(callback).
setBundleGroup(bundleName: string, newGroup: GroupType): Promise<boolean>
@@ -101,6 +97,7 @@ Taking app usage interface as an example, the main exposed interfaces are as fol + ### Usage Guidelines There are many interfaces for device usage statistics. Take app usage interface as an example to introduce the interface logic. @@ -114,14 +111,13 @@ There are many interfaces for device usage statistics. Take app usage interface >2. Query the usage duration of the application according to the start and end time; >3. Query the event collection of the current application according to the start and end time; >4. Query the usage duration of the application according to the type of interval (day, week, month, year) and the start and end time; ->5. Query the priority group of the caller application; ->6. Judge whether the specified application is currently idle; ->7. Query the statistical information of system events (sleep, wake-up, unlock and screen lock) according to the start and end time; ->8. Query the application notification times according to the start and end time; ->9. Query FA usage records. The maximum returned quantity does not exceed the value set by maxnum. FA usage records are sorted from near to far. The maximum maxnum is 1000. If the maxnum parameter is not filled in, the default maxnum is 1000; ->10. Use the optional parameters to query the usage priority group of the current caller application; ->11. Set the group of the specified application as the group provided by the parameter; ->12. Register callback for application group change; +>5. Judge whether the specified application is currently idle; +>6. Query the statistical information of system events (sleep, wake-up, unlock and screen lock) according to the start and end time; +>7. Query the application notification times according to the start and end time; +>8. Query FA usage records. The maximum returned quantity does not exceed the value set by maxnum. FA usage records are sorted from near to far. The maximum maxnum is 1000. If the maxnum parameter is not filled in, the default maxnum is 1000; +>9. Query the group of the current application or the application of specified bundlename; +>10. Set the group of the specified application as the group provided by the parameter; +>11. Register callback for application group change; >13. Unregister the registered application group callback; ## Repositories Involved diff --git a/README_zh.md b/README_zh.md index 3e044dca7a50d1235c8515051bcc7d867584d230..dd85e8697a6984dea36a8f37665b41f575ca4dbe 100644 --- a/README_zh.md +++ b/README_zh.md @@ -58,10 +58,6 @@queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>
queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void
-isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void
isIdleState(bundleName: string): Promise<boolean>
@@ -113,14 +109,13 @@ >2. 根据起止时间查询应用的使用时长; >3. 根据起止时间查询当前应用的事件集合; >4. 根据interval(日、周、月、年)类型和起止时间查询应用的使用时长; ->5. 查询调用者应用的优先级群组; ->6. 判断指定应用当前是否是空闲状态; ->7. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息; ->8. 根据起止时间查询应用通知次数; ->9. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000; ->10. 使用可选参数查询当前调用者应用的使用优先级群组; ->11. 将指定应用的分组设置为参数提供的分组; ->12. 给应用分组变化注册回调; +>5. 判断指定应用当前是否是空闲状态; +>6. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息; +>7. 根据起止时间查询应用通知次数; +>8. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000; +>9. 查询当前应用或指定bundlename对应的应用的分组; +>10. 将指定应用的分组设置为参数提供的分组; +>11. 给应用分组变化注册回调; >13. 将已注册过的应用分组回调解除注册; ## 相关仓 diff --git a/services/common/src/bundle_active_core.cpp b/services/common/src/bundle_active_core.cpp index b6b5dad0c4726a1dacd4a4bb998d798e8133387b..3ab62373c8b883864d1aab9292d582d4f41e9a58 100644 --- a/services/common/src/bundle_active_core.cpp +++ b/services/common/src/bundle_active_core.cpp @@ -702,13 +702,22 @@ int64_t BundleActiveCore::GetSystemTimeMs() void BundleActiveCore::OnBundleGroupChanged(const BundleActiveGroupCallbackInfo& callbackInfo) { std::lock_guard