diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index 265e869506739754977a864cdc48021b3858c804..05181789aab5090b0122af7922d79018fda1dc9c 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. @@ -226,30 +226,30 @@ declare namespace bundleState { stateType?: number; } /** - * @since 7 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup */ 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 change reason + */ + changeReason: 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 bundle name + */ + bundleName: string; } /** @@ -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 @@ -366,14 +379,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 +399,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 +411,7 @@ declare namespace bundleState { * Declares group type. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup */ export enum GroupType { /** @@ -422,7 +438,7 @@ declare namespace bundleState { * Indicates the limit group. */ ACTIVE_GROUP_LIMIT = 50, - + /** * Indicates the never group. */ @@ -433,7 +449,11 @@ declare namespace bundleState { * set bundle group by bundleName and number. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @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; @@ -443,17 +463,22 @@ declare namespace bundleState { * register callback to service. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @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.App + * @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;