diff --git a/BUILD.gn b/BUILD.gn index 5a542017679de70b9e634a39e1ec2f3d6bde2da7..7a444088955600f2219d4f9972ac6e37736e15b9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -52,7 +52,7 @@ ohos_prebuilt_etc("device_usage_statistics_service_init") { subsystem_name = "resourceschedule" } -ohos_shared_library("usagestatskit") { +ohos_shared_library("bundlestate") { sources = [ "frameworks/src/bundle_state_common.cpp", "frameworks/src/bundle_state_init.cpp", diff --git a/bundle.json b/bundle.json index 1dcaacce264cc21f1c00c5c2372a39d378288136..014b937c47539a991fbf1ee2fb9efc57e3ba89d0 100644 --- a/bundle.json +++ b/bundle.json @@ -52,7 +52,7 @@ "//foundation/resourceschedule/device_usage_statistics:usagestatservice", "//foundation/resourceschedule/device_usage_statistics:device_usage_statistics_sa_profile", "//foundation/resourceschedule/device_usage_statistics:device_usage_statistics_service_init", - "//foundation/resourceschedule/device_usage_statistics:usagestatskit" + "//foundation/resourceschedule/device_usage_statistics:bundlestate" ], "inner_kits": [ { diff --git a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts index e28bf6ccf5a6c0ef29c37cb7bb20b0f5f26b2119..eb724fd056044215e00f8d7b64e79b1b2906762e 100644 --- a/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts +++ b/interfaces/kits/bundlestats/js/@ohos.bundleState.d.ts @@ -25,14 +25,14 @@ import { AsyncCallback } from './basic'; * then returns it to you. * * @since 7 - * @devices phone, tablet, tv, wearable, car */ declare namespace bundleState { /** * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. */ interface BundleStateInfo { /** @@ -83,8 +83,9 @@ declare namespace bundleState { * The bundle name of both objects must be the same. * * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. * if the bundle names of the two {@link BundleActiveInfo} objects are different. */ @@ -93,8 +94,9 @@ declare namespace bundleState { /** * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. */ interface BundleActiveState { /** @@ -127,8 +129,9 @@ declare namespace bundleState { * Checks whether the application with a specified bundle name is in the idle state. * * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @param bundleName Indicates the bundle name of the application to query. * @return Returns {@code true} if the application is idle in a particular period; * returns {@code false} otherwise. The time range of the particular period is defined by the system, @@ -144,8 +147,9 @@ declare namespace bundleState { * for example, restricting the running of background tasks.

* * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @return Returns the usage priority group of the calling application. */ function queryAppUsagePriorityGroup(callback: AsyncCallback): void; @@ -153,8 +157,9 @@ declare namespace bundleState { /** * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. */ interface BundleActiveInfoResponse { [key: string]: BundleStateInfo; @@ -166,8 +171,9 @@ declare namespace bundleState { *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

* * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. @@ -179,8 +185,9 @@ declare namespace bundleState { * Declares interval type. * * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. */ export enum IntervalType { /** @@ -213,8 +220,9 @@ declare namespace bundleState { * Queries usage information about each bundle within a specified period at a specified interval. * * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @param byInterval Indicates the interval at which the usage statistics are queried. * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. @@ -229,8 +237,9 @@ declare namespace bundleState { * Queries state data of all bundles within a specified period identified by the start and end time. * * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. @@ -242,8 +251,9 @@ declare namespace bundleState { * Queries state data of the current bundle within a specified period. * * @since 7 - * @sysCap SystemCapability.ResourceSchedule.UsageStatistics.App - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App. + * @permission ohos.permission.BUNDLE_ACTIVE_INFO. + * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. diff --git a/interfaces/kits/bundlestats/napi/include/bundle_state_init.h b/interfaces/kits/bundlestats/napi/include/bundle_state_init.h index 045d7bb9eb7cc6080286972913d8b939c3b25ee4..7547c2a40376c489f9d621ed81ed566302668efa 100644 --- a/interfaces/kits/bundlestats/napi/include/bundle_state_init.h +++ b/interfaces/kits/bundlestats/napi/include/bundle_state_init.h @@ -40,7 +40,7 @@ napi_module _module = { .nm_flags = 0, .nm_filename = nullptr, .nm_register_func = BundleStateInit, - .nm_modname = "usagestatskit", + .nm_modname = "bundleState", .nm_priv = ((void *)0), .reserved = {0} };