From bbc6b6e9e02d7f2549c24dbd477bd81803d1ab9a Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Wed, 8 Jun 2022 15:43:18 +0800 Subject: [PATCH 1/5] =?UTF-8?q?d.ts=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index 265e869..7f073cb 100644 --- a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts +++ b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts @@ -226,8 +226,8 @@ declare namespace bundleState { stateType?: number; } /** - * @since 7 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup */ interface BundleActiveGroupCallbackInfo { /* @@ -433,7 +433,7 @@ declare namespace bundleState { * set bundle group by bundleName and number. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @return Returns the result of setBundleGroup, true of false. */ function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; @@ -443,7 +443,7 @@ declare namespace bundleState { * register callback to service. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. */ function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; @@ -453,7 +453,7 @@ declare namespace bundleState { * unRegister callback from service. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @return Returns the result of unRegisterGroupCallBack, true of false. */ function unRegisterGroupCallBack(callback: AsyncCallback): void; -- Gitee From f63c2b4cc9f66ecefc03d06effb26f544554d760 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Wed, 8 Jun 2022 15:52:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?d.ts=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index 7f073cb..889065a 100644 --- a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts +++ b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts @@ -182,7 +182,7 @@ declare namespace bundleState { /** * the bundle name or system event name. */ - name?: string; + name: string; /** * the event id. -- Gitee From d1e55e762eb7301c1bf636a5458e0eaf48e70f15 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Wed, 8 Jun 2022 16:14:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?d.ts=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- .../bundlestats/js/@ohos.bundleState.d.ts | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index 889065a..8c0eeff 100644 --- a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts +++ b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts @@ -233,23 +233,23 @@ declare namespace bundleState { /* * the usage old group of the application */ - appUsageOldGroup?: number; + appUsageOldGroup: number; /* * the usage new group of the application */ - appUsageNewGroup?: number; + appUsageNewGroup: number; /* - * the use id + * the use id */ - userId?: number; + userId: number; /* - * the change reason + * the change reason */ - changeReason?: number; + changeReason: number; /* - * the bundle name + * the bundle name */ - bundleName?: string; + bundleName: string; } /** @@ -366,14 +366,14 @@ declare namespace bundleState { function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; /** - * Queries module usage records. + * Queries recently module usage records. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. - * @return Returns the {@link BundleActiveModuleInfo} object Array containing the state data of the current module. + * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. */ function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; function getRecentlyUsedModules(maxNum?: number): Promise>; @@ -386,6 +386,9 @@ declare namespace bundleState { * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. * @return Returns the usage priority group of the calling application. */ function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; @@ -395,7 +398,7 @@ declare namespace bundleState { * Declares group type. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup */ export enum GroupType { /** @@ -422,7 +425,7 @@ declare namespace bundleState { * Indicates the limit group. */ ACTIVE_GROUP_LIMIT = 50, - + /** * Indicates the never group. */ @@ -434,6 +437,10 @@ declare namespace bundleState { * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. + * @param newGroup,the group of the application whose name is bundleName. * @return Returns the result of setBundleGroup, true of false. */ function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; @@ -444,16 +451,21 @@ declare namespace bundleState { * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. */ function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; function registerGroupCallBack(callback: Callback): Promise; - + /** * unRegister callback from service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. * @return Returns the result of unRegisterGroupCallBack, true of false. */ function unRegisterGroupCallBack(callback: AsyncCallback): void; -- Gitee From a971c9ba06f937a1a2d75106ae21adff457965d7 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Wed, 8 Jun 2022 16:20:20 +0800 Subject: [PATCH 4/5] =?UTF-8?q?d.ts=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- .../bundlestats/js/@ohos.bundleState.d.ts | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index 8c0eeff..f60c425 100644 --- a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts +++ b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts @@ -231,25 +231,25 @@ declare namespace bundleState { */ interface BundleActiveGroupCallbackInfo { /* - * the usage old group of the application - */ - appUsageOldGroup: number; + * the usage old group of the application + */ + appUsageOldGroup: number; + /* + * the usage new group of the application + */ + appUsageNewGroup: number; + /* + * the use id + */ + userId: number; /* - * the usage new group of the application - */ - appUsageNewGroup: number; - /* - * the use id - */ - userId: number; - /* - * the change reason - */ - changeReason: number; - /* - * the bundle name - */ - bundleName: string; + * the change reason + */ + changeReason: number; + /* + * the bundle name + */ + bundleName: string; } /** -- Gitee From eb58855e7853d47421f451b5f94cc31413cbddc5 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Wed, 8 Jun 2022 16:52:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?d.ts=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- .../kits/bundlestats/js/@ohos.bundleState.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index f60c425..0518178 100644 --- a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts +++ b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts @@ -265,6 +265,19 @@ declare namespace bundleState { function isIdleState(bundleName: string, callback: AsyncCallback): void; function isIdleState(bundleName: string): Promise; + /** + * Queries the usage priority group of the calling application. + * + *

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

+ * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @return Returns the usage priority group of the calling application. + */ + function queryAppUsagePriorityGroup(callback: AsyncCallback): void; + function queryAppUsagePriorityGroup(): Promise; + /** * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App -- Gitee