161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit BackgroundTasksKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Provides methods for managing bundle usage statistics, 2561847f8eSopenharmony_ci * including the methods for querying bundle usage information and state data. 2661847f8eSopenharmony_ci * 2761847f8eSopenharmony_ci * <p>You can use the methods defined in this class to query 2861847f8eSopenharmony_ci * the usage history and states of bundles in a specified period. 2961847f8eSopenharmony_ci * The system stores the query result in a {@link BundleStatsInfo} instance and 3061847f8eSopenharmony_ci * then returns it to you. 3161847f8eSopenharmony_ci * 3261847f8eSopenharmony_ci * @namespace usageStatistics 3361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 3461847f8eSopenharmony_ci * @since 9 3561847f8eSopenharmony_ci */ 3661847f8eSopenharmony_cideclare namespace usageStatistics { 3761847f8eSopenharmony_ci /** 3861847f8eSopenharmony_ci * @interface BundleStatsInfo 3961847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 4061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4161847f8eSopenharmony_ci * @since 9 4261847f8eSopenharmony_ci */ 4361847f8eSopenharmony_ci interface BundleStatsInfo { 4461847f8eSopenharmony_ci /** 4561847f8eSopenharmony_ci * The identifier of BundleStatsInfo. 4661847f8eSopenharmony_ci * @type { number } 4761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 4861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4961847f8eSopenharmony_ci * @since 9 5061847f8eSopenharmony_ci */ 5161847f8eSopenharmony_ci id: number; 5261847f8eSopenharmony_ci 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * The total duration, in milliseconds. 5561847f8eSopenharmony_ci * @type { ?number } 5661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 5761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 5861847f8eSopenharmony_ci * @since 9 5961847f8eSopenharmony_ci */ 6061847f8eSopenharmony_ci abilityInFgTotalTime?: number; 6161847f8eSopenharmony_ci 6261847f8eSopenharmony_ci /** 6361847f8eSopenharmony_ci * The last time when the application was accessed, in milliseconds. 6461847f8eSopenharmony_ci * @type { ?number } 6561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 6661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6761847f8eSopenharmony_ci * @since 9 6861847f8eSopenharmony_ci */ 6961847f8eSopenharmony_ci abilityPrevAccessTime?: number; 7061847f8eSopenharmony_ci 7161847f8eSopenharmony_ci /** 7261847f8eSopenharmony_ci * The last time when the application was visible in the foreground, in milliseconds. 7361847f8eSopenharmony_ci * @type { ?number } 7461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 7561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 7661847f8eSopenharmony_ci * @since 9 7761847f8eSopenharmony_ci */ 7861847f8eSopenharmony_ci abilityPrevSeenTime?: number; 7961847f8eSopenharmony_ci 8061847f8eSopenharmony_ci /** 8161847f8eSopenharmony_ci * The total duration, in milliseconds. 8261847f8eSopenharmony_ci * @type { ?number } 8361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 8461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 8561847f8eSopenharmony_ci * @since 9 8661847f8eSopenharmony_ci */ 8761847f8eSopenharmony_ci abilitySeenTotalTime?: number; 8861847f8eSopenharmony_ci 8961847f8eSopenharmony_ci /** 9061847f8eSopenharmony_ci * The bundle name of the application. 9161847f8eSopenharmony_ci * @type { ?string } 9261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 9361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 9461847f8eSopenharmony_ci * @since 9 9561847f8eSopenharmony_ci */ 9661847f8eSopenharmony_ci bundleName?: string; 9761847f8eSopenharmony_ci 9861847f8eSopenharmony_ci /** 9961847f8eSopenharmony_ci * The total duration, in milliseconds. 10061847f8eSopenharmony_ci * @type { ?number } 10161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 10261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 10361847f8eSopenharmony_ci * @since 9 10461847f8eSopenharmony_ci */ 10561847f8eSopenharmony_ci fgAbilityAccessTotalTime?: number; 10661847f8eSopenharmony_ci 10761847f8eSopenharmony_ci /** 10861847f8eSopenharmony_ci * The last time when the foreground application was accessed, in milliseconds. 10961847f8eSopenharmony_ci * @type { ?number } 11061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 11161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 11261847f8eSopenharmony_ci * @since 9 11361847f8eSopenharmony_ci */ 11461847f8eSopenharmony_ci fgAbilityPrevAccessTime?: number; 11561847f8eSopenharmony_ci 11661847f8eSopenharmony_ci /** 11761847f8eSopenharmony_ci * The time of the first bundle usage record in this {@code BundleActiveInfo} object, 11861847f8eSopenharmony_ci * in milliseconds. 11961847f8eSopenharmony_ci * @type { ?number } 12061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 12161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 12261847f8eSopenharmony_ci * @since 9 12361847f8eSopenharmony_ci */ 12461847f8eSopenharmony_ci infosBeginTime?: number; 12561847f8eSopenharmony_ci 12661847f8eSopenharmony_ci /** 12761847f8eSopenharmony_ci * The time of the last bundle usage record in this {@code BundleActiveInfo} object, 12861847f8eSopenharmony_ci * in milliseconds. 12961847f8eSopenharmony_ci * @type { ?number } 13061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 13161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 13261847f8eSopenharmony_ci * @since 9 13361847f8eSopenharmony_ci */ 13461847f8eSopenharmony_ci infosEndTime?: number; 13561847f8eSopenharmony_ci } 13661847f8eSopenharmony_ci 13761847f8eSopenharmony_ci /** 13861847f8eSopenharmony_ci * @interface HapFormInfo 13961847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 14061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 14161847f8eSopenharmony_ci * @since 9 14261847f8eSopenharmony_ci */ 14361847f8eSopenharmony_ci interface HapFormInfo { 14461847f8eSopenharmony_ci /** 14561847f8eSopenharmony_ci * The form name. 14661847f8eSopenharmony_ci * @type { string } 14761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 14861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 14961847f8eSopenharmony_ci * @since 9 15061847f8eSopenharmony_ci */ 15161847f8eSopenharmony_ci formName: string; 15261847f8eSopenharmony_ci 15361847f8eSopenharmony_ci /** 15461847f8eSopenharmony_ci * The form dimension. 15561847f8eSopenharmony_ci * @type { number } 15661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 15761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 15861847f8eSopenharmony_ci * @since 9 15961847f8eSopenharmony_ci */ 16061847f8eSopenharmony_ci formDimension: number; 16161847f8eSopenharmony_ci 16261847f8eSopenharmony_ci /** 16361847f8eSopenharmony_ci * The form id. 16461847f8eSopenharmony_ci * @type { number } 16561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 16661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 16761847f8eSopenharmony_ci * @since 9 16861847f8eSopenharmony_ci */ 16961847f8eSopenharmony_ci formId: number; 17061847f8eSopenharmony_ci 17161847f8eSopenharmony_ci /** 17261847f8eSopenharmony_ci * The last time when the form was accessed, in milliseconds.. 17361847f8eSopenharmony_ci * @type { number } 17461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 17561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 17661847f8eSopenharmony_ci * @since 9 17761847f8eSopenharmony_ci */ 17861847f8eSopenharmony_ci formLastUsedTime: number; 17961847f8eSopenharmony_ci 18061847f8eSopenharmony_ci /** 18161847f8eSopenharmony_ci * The click count of module. 18261847f8eSopenharmony_ci * @type { number } 18361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 18461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 18561847f8eSopenharmony_ci * @since 9 18661847f8eSopenharmony_ci */ 18761847f8eSopenharmony_ci count: number; 18861847f8eSopenharmony_ci } 18961847f8eSopenharmony_ci 19061847f8eSopenharmony_ci /** 19161847f8eSopenharmony_ci * @interface HapModuleInfo 19261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 19361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 19461847f8eSopenharmony_ci * @since 9 19561847f8eSopenharmony_ci */ 19661847f8eSopenharmony_ci interface HapModuleInfo { 19761847f8eSopenharmony_ci /** 19861847f8eSopenharmony_ci * The device id of module. 19961847f8eSopenharmony_ci * @type { ?string } 20061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 20161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 20261847f8eSopenharmony_ci * @since 9 20361847f8eSopenharmony_ci */ 20461847f8eSopenharmony_ci deviceId?: string; 20561847f8eSopenharmony_ci 20661847f8eSopenharmony_ci /** 20761847f8eSopenharmony_ci * The bundle name. 20861847f8eSopenharmony_ci * @type { string } 20961847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 21061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 21161847f8eSopenharmony_ci * @since 9 21261847f8eSopenharmony_ci */ 21361847f8eSopenharmony_ci bundleName: string; 21461847f8eSopenharmony_ci 21561847f8eSopenharmony_ci /** 21661847f8eSopenharmony_ci * The module name. 21761847f8eSopenharmony_ci * @type { string } 21861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 21961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 22061847f8eSopenharmony_ci * @since 9 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci moduleName: string; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * The main ability name of module. 22661847f8eSopenharmony_ci * @type { ?string } 22761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 22861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 22961847f8eSopenharmony_ci * @since 9 23061847f8eSopenharmony_ci */ 23161847f8eSopenharmony_ci abilityName?: string; 23261847f8eSopenharmony_ci 23361847f8eSopenharmony_ci /** 23461847f8eSopenharmony_ci * The label id of application. 23561847f8eSopenharmony_ci * @type { ?number } 23661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 23761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 23861847f8eSopenharmony_ci * @since 9 23961847f8eSopenharmony_ci */ 24061847f8eSopenharmony_ci appLabelId?: number; 24161847f8eSopenharmony_ci 24261847f8eSopenharmony_ci /** 24361847f8eSopenharmony_ci * The label id of module. 24461847f8eSopenharmony_ci * @type { ?number } 24561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 24661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 24761847f8eSopenharmony_ci * @since 9 24861847f8eSopenharmony_ci */ 24961847f8eSopenharmony_ci labelId?: number; 25061847f8eSopenharmony_ci 25161847f8eSopenharmony_ci /** 25261847f8eSopenharmony_ci * The description id of application. 25361847f8eSopenharmony_ci * @type { ?number } 25461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 25561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 25661847f8eSopenharmony_ci * @since 9 25761847f8eSopenharmony_ci */ 25861847f8eSopenharmony_ci descriptionId?: number; 25961847f8eSopenharmony_ci 26061847f8eSopenharmony_ci /** 26161847f8eSopenharmony_ci * The ability id of main ability. 26261847f8eSopenharmony_ci * @type { ?number } 26361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 26461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 26561847f8eSopenharmony_ci * @since 9 26661847f8eSopenharmony_ci */ 26761847f8eSopenharmony_ci abilityLableId?: number; 26861847f8eSopenharmony_ci 26961847f8eSopenharmony_ci /** 27061847f8eSopenharmony_ci * The description id of main ability. 27161847f8eSopenharmony_ci * @type { ?number } 27261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 27361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 27461847f8eSopenharmony_ci * @since 9 27561847f8eSopenharmony_ci */ 27661847f8eSopenharmony_ci abilityDescriptionId?: number; 27761847f8eSopenharmony_ci 27861847f8eSopenharmony_ci /** 27961847f8eSopenharmony_ci * The icon id of main ability. 28061847f8eSopenharmony_ci * @type { ?number } 28161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 28261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 28361847f8eSopenharmony_ci * @since 9 28461847f8eSopenharmony_ci */ 28561847f8eSopenharmony_ci abilityIconId?: number; 28661847f8eSopenharmony_ci 28761847f8eSopenharmony_ci /** 28861847f8eSopenharmony_ci * The launch count of module. 28961847f8eSopenharmony_ci * @type { number } 29061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 29161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 29261847f8eSopenharmony_ci * @since 9 29361847f8eSopenharmony_ci */ 29461847f8eSopenharmony_ci launchedCount: number; 29561847f8eSopenharmony_ci 29661847f8eSopenharmony_ci /** 29761847f8eSopenharmony_ci * The last time when the module was accessed, in milliseconds. 29861847f8eSopenharmony_ci * @type { number } 29961847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 30061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 30161847f8eSopenharmony_ci * @since 9 30261847f8eSopenharmony_ci */ 30361847f8eSopenharmony_ci lastModuleUsedTime: number; 30461847f8eSopenharmony_ci 30561847f8eSopenharmony_ci /** 30661847f8eSopenharmony_ci * The form usage record list of current module. 30761847f8eSopenharmony_ci * @type { Array<HapFormInfo> } 30861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 30961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 31061847f8eSopenharmony_ci * @since 9 31161847f8eSopenharmony_ci */ 31261847f8eSopenharmony_ci formRecords: Array<HapFormInfo>; 31361847f8eSopenharmony_ci } 31461847f8eSopenharmony_ci 31561847f8eSopenharmony_ci /** 31661847f8eSopenharmony_ci * @interface DeviceEventStats 31761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 31861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 31961847f8eSopenharmony_ci * @since 9 32061847f8eSopenharmony_ci */ 32161847f8eSopenharmony_ci interface DeviceEventStats { 32261847f8eSopenharmony_ci /** 32361847f8eSopenharmony_ci * The bundle name or system event name. 32461847f8eSopenharmony_ci * @type { string } 32561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 32661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 32761847f8eSopenharmony_ci * @since 9 32861847f8eSopenharmony_ci */ 32961847f8eSopenharmony_ci name: string; 33061847f8eSopenharmony_ci 33161847f8eSopenharmony_ci /** 33261847f8eSopenharmony_ci * The event id. 33361847f8eSopenharmony_ci * @type { number } 33461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 33561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 33661847f8eSopenharmony_ci * @since 9 33761847f8eSopenharmony_ci */ 33861847f8eSopenharmony_ci eventId: number; 33961847f8eSopenharmony_ci 34061847f8eSopenharmony_ci /** 34161847f8eSopenharmony_ci * The the event occurrence number. 34261847f8eSopenharmony_ci * @type { number } 34361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 34461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 34561847f8eSopenharmony_ci * @since 9 34661847f8eSopenharmony_ci */ 34761847f8eSopenharmony_ci count: number; 34861847f8eSopenharmony_ci } 34961847f8eSopenharmony_ci 35061847f8eSopenharmony_ci /** 35161847f8eSopenharmony_ci * @interface BundleEvents 35261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 35361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 35461847f8eSopenharmony_ci * @since 9 35561847f8eSopenharmony_ci */ 35661847f8eSopenharmony_ci interface BundleEvents { 35761847f8eSopenharmony_ci /** 35861847f8eSopenharmony_ci * The usage group of the application. 35961847f8eSopenharmony_ci * @type { ?number } 36061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 36161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 36261847f8eSopenharmony_ci * @since 9 36361847f8eSopenharmony_ci */ 36461847f8eSopenharmony_ci appGroup?: number; 36561847f8eSopenharmony_ci 36661847f8eSopenharmony_ci /** 36761847f8eSopenharmony_ci * The bundle name. 36861847f8eSopenharmony_ci * @type { ?string } 36961847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 37061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 37161847f8eSopenharmony_ci * @since 9 37261847f8eSopenharmony_ci */ 37361847f8eSopenharmony_ci bundleName?: string; 37461847f8eSopenharmony_ci 37561847f8eSopenharmony_ci /** 37661847f8eSopenharmony_ci * The shortcut ID. 37761847f8eSopenharmony_ci * @type { ?string } 37861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 37961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 38061847f8eSopenharmony_ci * @since 9 38161847f8eSopenharmony_ci */ 38261847f8eSopenharmony_ci indexOfLink?: string; 38361847f8eSopenharmony_ci 38461847f8eSopenharmony_ci /** 38561847f8eSopenharmony_ci * The class name. 38661847f8eSopenharmony_ci * @type { ?string } 38761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 38861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 38961847f8eSopenharmony_ci * @since 9 39061847f8eSopenharmony_ci */ 39161847f8eSopenharmony_ci nameOfClass?: string; 39261847f8eSopenharmony_ci 39361847f8eSopenharmony_ci /** 39461847f8eSopenharmony_ci * The time when this state occurred, in milliseconds. 39561847f8eSopenharmony_ci * @type { ?number } 39661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 39761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 39861847f8eSopenharmony_ci * @since 9 39961847f8eSopenharmony_ci */ 40061847f8eSopenharmony_ci eventOccurredTime?: number; 40161847f8eSopenharmony_ci 40261847f8eSopenharmony_ci /** 40361847f8eSopenharmony_ci * The event id. 40461847f8eSopenharmony_ci * @type { ?number } 40561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 40661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 40761847f8eSopenharmony_ci * @since 9 40861847f8eSopenharmony_ci */ 40961847f8eSopenharmony_ci eventId?: number; 41061847f8eSopenharmony_ci } 41161847f8eSopenharmony_ci 41261847f8eSopenharmony_ci /** 41361847f8eSopenharmony_ci * @interface AppGroupCallbackInfo 41461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 41561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 41661847f8eSopenharmony_ci * @since 9 41761847f8eSopenharmony_ci */ 41861847f8eSopenharmony_ci interface AppGroupCallbackInfo { 41961847f8eSopenharmony_ci /** 42061847f8eSopenharmony_ci * The usage old group of the application 42161847f8eSopenharmony_ci * @type { number } 42261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 42361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 42461847f8eSopenharmony_ci * @since 9 42561847f8eSopenharmony_ci */ 42661847f8eSopenharmony_ci appOldGroup: number; 42761847f8eSopenharmony_ci 42861847f8eSopenharmony_ci /** 42961847f8eSopenharmony_ci * The usage new group of the application 43061847f8eSopenharmony_ci * @type { number } 43161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 43261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 43361847f8eSopenharmony_ci * @since 9 43461847f8eSopenharmony_ci */ 43561847f8eSopenharmony_ci appNewGroup: number; 43661847f8eSopenharmony_ci 43761847f8eSopenharmony_ci /** 43861847f8eSopenharmony_ci * The use id 43961847f8eSopenharmony_ci * @type { number } 44061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 44161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 44261847f8eSopenharmony_ci * @since 9 44361847f8eSopenharmony_ci */ 44461847f8eSopenharmony_ci userId: number; 44561847f8eSopenharmony_ci 44661847f8eSopenharmony_ci /** 44761847f8eSopenharmony_ci * The change reason 44861847f8eSopenharmony_ci * @type { number } 44961847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 45061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 45161847f8eSopenharmony_ci * @since 9 45261847f8eSopenharmony_ci */ 45361847f8eSopenharmony_ci changeReason: number; 45461847f8eSopenharmony_ci 45561847f8eSopenharmony_ci /** 45661847f8eSopenharmony_ci * The bundle name 45761847f8eSopenharmony_ci * @type { string } 45861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 45961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 46061847f8eSopenharmony_ci * @since 9 46161847f8eSopenharmony_ci */ 46261847f8eSopenharmony_ci bundleName: string; 46361847f8eSopenharmony_ci } 46461847f8eSopenharmony_ci 46561847f8eSopenharmony_ci /** 46661847f8eSopenharmony_ci * Checks whether the application with a specified bundle name is in the idle state. 46761847f8eSopenharmony_ci * 46861847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 46961847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to query. 47061847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of isIdleState. 47161847f8eSopenharmony_ci * <p> boolean value is true mean the application is idle in a particular period; false mean otherwise. 47261847f8eSopenharmony_ci * The time range of the particular period is defined by the system, which may be hours or days.</p> 47361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 47461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 47561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 47661847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 47761847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 47861847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 47961847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 48061847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 48161847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 48261847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 48361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 48461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 48561847f8eSopenharmony_ci * @since 9 48661847f8eSopenharmony_ci */ 48761847f8eSopenharmony_ci function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void; 48861847f8eSopenharmony_ci 48961847f8eSopenharmony_ci /** 49061847f8eSopenharmony_ci * Checks whether the application with a specified bundle name is in the idle state. 49161847f8eSopenharmony_ci * 49261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 49361847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to query. 49461847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by isIdleState. 49561847f8eSopenharmony_ci * <p> boolean value is true mean the application is idle in a particular period; false mean otherwise. 49661847f8eSopenharmony_ci * The time range of the particular period is defined by the system, which may be hours or days.</p> 49761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 49861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 49961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 50061847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 50161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 50261847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 50361847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 50461847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 50561847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 50661847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 50761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 50861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 50961847f8eSopenharmony_ci * @since 9 51061847f8eSopenharmony_ci */ 51161847f8eSopenharmony_ci function isIdleState(bundleName: string): Promise<boolean>; 51261847f8eSopenharmony_ci 51361847f8eSopenharmony_ci /** 51461847f8eSopenharmony_ci * Checks whether the application with a specified bundle name is in the idle state. 51561847f8eSopenharmony_ci * 51661847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 51761847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to query. 51861847f8eSopenharmony_ci * @returns { boolean } 51961847f8eSopenharmony_ci * <p> boolean value is true mean the application is idle in a particular period; false mean otherwise. 52061847f8eSopenharmony_ci * The time range of the particular period is defined by the system, which may be hours or days.</p> 52161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 52261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 52361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 52461847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 52561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 52661847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 52761847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 52861847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 52961847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 53061847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 53161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 53261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 53361847f8eSopenharmony_ci * @since 10 53461847f8eSopenharmony_ci */ 53561847f8eSopenharmony_ci function isIdleStateSync(bundleName: string): boolean; 53661847f8eSopenharmony_ci 53761847f8eSopenharmony_ci /** 53861847f8eSopenharmony_ci * Queries the app group of the calling application. 53961847f8eSopenharmony_ci * <p>The priority defined in a priority group restricts the resource usage of an application, 54061847f8eSopenharmony_ci * for example, restricting the running of background tasks. </p> 54161847f8eSopenharmony_ci * 54261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 54361847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of queryAppGroup. 54461847f8eSopenharmony_ci * <p> Returns the app group of the calling application.</p> 54561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 54661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 54761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 54861847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 54961847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 55061847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 55161847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 55261847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 55361847f8eSopenharmony_ci * @throws { BusinessError } 10000005 - Application is not installed. 55461847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 55561847f8eSopenharmony_ci * @throws { BusinessError } 10100002 - Failed to get the application group information. 55661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 55761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 55861847f8eSopenharmony_ci * @since 9 55961847f8eSopenharmony_ci */ 56061847f8eSopenharmony_ci function queryAppGroup(callback: AsyncCallback<number>): void; 56161847f8eSopenharmony_ci 56261847f8eSopenharmony_ci /** 56361847f8eSopenharmony_ci * Queries the app group of the calling application. 56461847f8eSopenharmony_ci * <p>The priority defined in a priority group restricts the resource usage of an application, 56561847f8eSopenharmony_ci * for example, restricting the running of background tasks. </p> 56661847f8eSopenharmony_ci * 56761847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 56861847f8eSopenharmony_ci * @returns { Promise<number> } the promise returned by queryAppGroup. 56961847f8eSopenharmony_ci * <p> Returns the app group of the calling application.</p> 57061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 57161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 57261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 57361847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 57461847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 57561847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 57661847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 57761847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 57861847f8eSopenharmony_ci * @throws { BusinessError } 10000005 - Application is not installed. 57961847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 58061847f8eSopenharmony_ci * @throws { BusinessError } 10100002 - Failed to get the application group information. 58161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 58261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 58361847f8eSopenharmony_ci * @since 9 58461847f8eSopenharmony_ci */ 58561847f8eSopenharmony_ci function queryAppGroup(): Promise<number>; 58661847f8eSopenharmony_ci 58761847f8eSopenharmony_ci /** 58861847f8eSopenharmony_ci * Queries the app group of the calling application. 58961847f8eSopenharmony_ci * <p>The priority defined in a priority group restricts the resource usage of an application, 59061847f8eSopenharmony_ci * for example, restricting the running of background tasks. </p> 59161847f8eSopenharmony_ci * 59261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 59361847f8eSopenharmony_ci * @returns { number } Returns the app group of the calling application. 59461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 59561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 59661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 59761847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 59861847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 59961847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 60061847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 60161847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 60261847f8eSopenharmony_ci * @throws { BusinessError } 10000005 - Application is not installed. 60361847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 60461847f8eSopenharmony_ci * @throws { BusinessError } 10100002 - Failed to get the application group information. 60561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 60661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 60761847f8eSopenharmony_ci * @since 10 60861847f8eSopenharmony_ci */ 60961847f8eSopenharmony_ci function queryAppGroupSync(): number; 61061847f8eSopenharmony_ci 61161847f8eSopenharmony_ci /** 61261847f8eSopenharmony_ci * Queries the usage priority group by bundleName. 61361847f8eSopenharmony_ci * <p>The priority defined in a priority group restricts the resource usage of an application, 61461847f8eSopenharmony_ci * for example, restricting the running of background tasks. </p> 61561847f8eSopenharmony_ci * 61661847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 61761847f8eSopenharmony_ci * @param { string } bundleName - name of the application. 61861847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of queryAppGroup. 61961847f8eSopenharmony_ci * <p> the usage priority group of the calling application.</p> 62061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 62161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 62261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 62361847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 62461847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 62561847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 62661847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 62761847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 62861847f8eSopenharmony_ci * @throws { BusinessError } 10000005 - Application is not installed. 62961847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 63061847f8eSopenharmony_ci * @throws { BusinessError } 10100002 - Failed to get the application group information. 63161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 63261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 63361847f8eSopenharmony_ci * @since 9 63461847f8eSopenharmony_ci */ 63561847f8eSopenharmony_ci function queryAppGroup(bundleName: string, callback: AsyncCallback<number>): void; 63661847f8eSopenharmony_ci 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Queries the usage priority group by bundleName. 63961847f8eSopenharmony_ci * <p>The priority defined in a priority group restricts the resource usage of an application, 64061847f8eSopenharmony_ci * for example, restricting the running of background tasks. </p> 64161847f8eSopenharmony_ci * 64261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 64361847f8eSopenharmony_ci * @param { string } bundleName - name of the application. 64461847f8eSopenharmony_ci * @returns { Promise<number> } the promise returned by queryAppGroup. 64561847f8eSopenharmony_ci * <p> the usage priority group of the calling application.</p> 64661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 64761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 64861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 64961847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 65061847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 65161847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 65261847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 65361847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 65461847f8eSopenharmony_ci * @throws { BusinessError } 10000005 - Application is not installed. 65561847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 65661847f8eSopenharmony_ci * @throws { BusinessError } 10100002 - Failed to get the application group information. 65761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 65861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 65961847f8eSopenharmony_ci * @since 9 66061847f8eSopenharmony_ci */ 66161847f8eSopenharmony_ci function queryAppGroup(bundleName: string): Promise<number>; 66261847f8eSopenharmony_ci 66361847f8eSopenharmony_ci /** 66461847f8eSopenharmony_ci * Queries the usage priority group by bundleName. 66561847f8eSopenharmony_ci * <p>The priority defined in a priority group restricts the resource usage of an application, 66661847f8eSopenharmony_ci * for example, restricting the running of background tasks. </p> 66761847f8eSopenharmony_ci * 66861847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 66961847f8eSopenharmony_ci * @param { string } bundleName - name of the application. 67061847f8eSopenharmony_ci * @returns { number } the usage priority group of the calling application. 67161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 67261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 67361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 67461847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 67561847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 67661847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 67761847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 67861847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 67961847f8eSopenharmony_ci * @throws { BusinessError } 10000005 - Application is not installed. 68061847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 68161847f8eSopenharmony_ci * @throws { BusinessError } 10100002 - Failed to get the application group information. 68261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 68361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 68461847f8eSopenharmony_ci * @since 10 68561847f8eSopenharmony_ci */ 68661847f8eSopenharmony_ci function queryAppGroupSync(bundleName: string): number; 68761847f8eSopenharmony_ci 68861847f8eSopenharmony_ci /** 68961847f8eSopenharmony_ci * @typedef { Record<string, BundleStatsInfo> } 69061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 69161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 69261847f8eSopenharmony_ci * @since 9 69361847f8eSopenharmony_ci */ 69461847f8eSopenharmony_ci type BundleStatsMap = Record<string, BundleStatsInfo>; 69561847f8eSopenharmony_ci 69661847f8eSopenharmony_ci /** 69761847f8eSopenharmony_ci * Queries usage information about each bundle within a specified period. 69861847f8eSopenharmony_ci * <p>This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.</p> 69961847f8eSopenharmony_ci * 70061847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 70161847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 70261847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 70361847f8eSopenharmony_ci * @param { AsyncCallback<BundleStatsMap> } callback - the callback of queryBundleStatsInfos, 70461847f8eSopenharmony_ci * <p> the {@link BundleStatsMap} objects containing the usage information about each bundle.</p> 70561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 70661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 70761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 70861847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 70961847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 71061847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 71161847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 71261847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 71361847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 71461847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 71561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 71661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 71761847f8eSopenharmony_ci * @since 9 71861847f8eSopenharmony_ci */ 71961847f8eSopenharmony_ci function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<BundleStatsMap>): void; 72061847f8eSopenharmony_ci 72161847f8eSopenharmony_ci /** 72261847f8eSopenharmony_ci * Queries usage information about each bundle within a specified period. 72361847f8eSopenharmony_ci * <p>This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.</p> 72461847f8eSopenharmony_ci * 72561847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 72661847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 72761847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 72861847f8eSopenharmony_ci * @returns { Promise<BundleStatsMap> } the promise returned by queryBundleStatsInfos. 72961847f8eSopenharmony_ci * <p> the {@link BundleStatsMap} objects containing the usage information about each bundle.</p> 73061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 73161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 73261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 73361847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 73461847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 73561847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 73661847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 73761847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 73861847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 73961847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 74061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 74161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 74261847f8eSopenharmony_ci * @since 9 74361847f8eSopenharmony_ci */ 74461847f8eSopenharmony_ci function queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>; 74561847f8eSopenharmony_ci 74661847f8eSopenharmony_ci /** 74761847f8eSopenharmony_ci * Declares interval type. 74861847f8eSopenharmony_ci * 74961847f8eSopenharmony_ci * @enum { number } 75061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 75161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 75261847f8eSopenharmony_ci * @since 9 75361847f8eSopenharmony_ci */ 75461847f8eSopenharmony_ci export enum IntervalType { 75561847f8eSopenharmony_ci /** 75661847f8eSopenharmony_ci * Indicates the interval type that will determine the optimal interval based on the start and end time. 75761847f8eSopenharmony_ci * 75861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 75961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 76061847f8eSopenharmony_ci * @since 9 76161847f8eSopenharmony_ci */ 76261847f8eSopenharmony_ci BY_OPTIMIZED = 0, 76361847f8eSopenharmony_ci 76461847f8eSopenharmony_ci /** 76561847f8eSopenharmony_ci * Indicates the daily interval. 76661847f8eSopenharmony_ci * 76761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 76861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 76961847f8eSopenharmony_ci * @since 9 77061847f8eSopenharmony_ci */ 77161847f8eSopenharmony_ci BY_DAILY = 1, 77261847f8eSopenharmony_ci 77361847f8eSopenharmony_ci /** 77461847f8eSopenharmony_ci * Indicates the weekly interval. 77561847f8eSopenharmony_ci * 77661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 77761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 77861847f8eSopenharmony_ci * @since 9 77961847f8eSopenharmony_ci */ 78061847f8eSopenharmony_ci BY_WEEKLY = 2, 78161847f8eSopenharmony_ci 78261847f8eSopenharmony_ci /** 78361847f8eSopenharmony_ci * Indicates the monthly interval. 78461847f8eSopenharmony_ci * 78561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 78661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 78761847f8eSopenharmony_ci * @since 9 78861847f8eSopenharmony_ci */ 78961847f8eSopenharmony_ci BY_MONTHLY = 3, 79061847f8eSopenharmony_ci 79161847f8eSopenharmony_ci /** 79261847f8eSopenharmony_ci * Indicates the annually interval. 79361847f8eSopenharmony_ci * 79461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 79561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 79661847f8eSopenharmony_ci * @since 9 79761847f8eSopenharmony_ci */ 79861847f8eSopenharmony_ci BY_ANNUALLY = 4 79961847f8eSopenharmony_ci } 80061847f8eSopenharmony_ci 80161847f8eSopenharmony_ci /** 80261847f8eSopenharmony_ci * Queries usage information about each bundle within a specified period at a specified interval. 80361847f8eSopenharmony_ci * 80461847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 80561847f8eSopenharmony_ci * @param { IntervalType } byInterval - Indicates the interval at which the usage statistics are queried. 80661847f8eSopenharmony_ci * <p> The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, 80761847f8eSopenharmony_ci * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.</p> 80861847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 80961847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 81061847f8eSopenharmony_ci * @param { AsyncCallback<Array<BundleStatsInfo>> } callback - the callback of queryBundleStatsInfoByInterval. 81161847f8eSopenharmony_ci * <p> the list of {@link BundleStatsInfo} objects containing the usage information about each bundle.</p> 81261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 81361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 81461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 81561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 81661847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 81761847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 81861847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 81961847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 82061847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 82161847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 82261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 82361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 82461847f8eSopenharmony_ci * @since 9 82561847f8eSopenharmony_ci */ 82661847f8eSopenharmony_ci function queryBundleStatsInfoByInterval( 82761847f8eSopenharmony_ci byInterval: IntervalType, 82861847f8eSopenharmony_ci begin: number, 82961847f8eSopenharmony_ci end: number, 83061847f8eSopenharmony_ci callback: AsyncCallback<Array<BundleStatsInfo>> 83161847f8eSopenharmony_ci ): void; 83261847f8eSopenharmony_ci 83361847f8eSopenharmony_ci /** 83461847f8eSopenharmony_ci * Queries usage information about each bundle within a specified period at a specified interval. 83561847f8eSopenharmony_ci * 83661847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 83761847f8eSopenharmony_ci * @param { IntervalType } byInterval - Indicates the interval at which the usage statistics are queried. 83861847f8eSopenharmony_ci * <p> The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, 83961847f8eSopenharmony_ci * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.</p> 84061847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 84161847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 84261847f8eSopenharmony_ci * @returns { Promise<Array<BundleStatsInfo>> } the promise returned by queryBundleStatsInfoByInterval. 84361847f8eSopenharmony_ci * <p> the list of {@link BundleStatsInfo} objects containing the usage information about each bundle.</p> 84461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 84561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 84661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: Parameter verification failed. 84761847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 84861847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 84961847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 85061847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 85161847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 85261847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 85361847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 85461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 85561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 85661847f8eSopenharmony_ci * @since 9 85761847f8eSopenharmony_ci */ 85861847f8eSopenharmony_ci function queryBundleStatsInfoByInterval( 85961847f8eSopenharmony_ci byInterval: IntervalType, 86061847f8eSopenharmony_ci begin: number, 86161847f8eSopenharmony_ci end: number 86261847f8eSopenharmony_ci ): Promise<Array<BundleStatsInfo>>; 86361847f8eSopenharmony_ci 86461847f8eSopenharmony_ci /** 86561847f8eSopenharmony_ci * Queries state data of all bundles within a specified period identified by the start and end time. 86661847f8eSopenharmony_ci * 86761847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 86861847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 86961847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 87061847f8eSopenharmony_ci * @param { AsyncCallback<Array<BundleEvents>> } callback - the promise returned by queryBundleEvents. 87161847f8eSopenharmony_ci * <p> the list of {@link BundleEvents} objects containing the state data of all bundles.</p> 87261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 87361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 87461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 87561847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 87661847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 87761847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 87861847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 87961847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 88061847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 88161847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 88261847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 88361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 88461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 88561847f8eSopenharmony_ci * @since 9 88661847f8eSopenharmony_ci */ 88761847f8eSopenharmony_ci function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void; 88861847f8eSopenharmony_ci 88961847f8eSopenharmony_ci /** 89061847f8eSopenharmony_ci * Queries state data of all bundles within a specified period identified by the start and end time. 89161847f8eSopenharmony_ci * 89261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 89361847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 89461847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 89561847f8eSopenharmony_ci * @returns { Promise<Array<BundleEvents>> } the promise returned by queryBundleEvents. 89661847f8eSopenharmony_ci * <p> the list of {@link BundleEvents} objects containing the state data of all bundles.</p> 89761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 89861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 89961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 90061847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 90161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 90261847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 90361847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 90461847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 90561847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 90661847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 90761847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 90861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 90961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 91061847f8eSopenharmony_ci * @since 9 91161847f8eSopenharmony_ci */ 91261847f8eSopenharmony_ci function queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>; 91361847f8eSopenharmony_ci 91461847f8eSopenharmony_ci /** 91561847f8eSopenharmony_ci * Queries state data of the current bundle within a specified period. 91661847f8eSopenharmony_ci * 91761847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 91861847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 91961847f8eSopenharmony_ci * @param { AsyncCallback<Array<BundleEvents>> } callback - the callback of queryCurrentBundleEvents. 92061847f8eSopenharmony_ci * <p> the {@link BundleEvents} object Array containing the state data of the current bundle.</p> 92161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 92261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 92361847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 92461847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 92561847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 92661847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 92761847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 92861847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 92961847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 93061847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 93161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 93261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 93361847f8eSopenharmony_ci * @since 9 93461847f8eSopenharmony_ci */ 93561847f8eSopenharmony_ci function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array<BundleEvents>>): void; 93661847f8eSopenharmony_ci 93761847f8eSopenharmony_ci /** 93861847f8eSopenharmony_ci * Queries state data of the current bundle within a specified period. 93961847f8eSopenharmony_ci * 94061847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 94161847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 94261847f8eSopenharmony_ci * @returns { Promise<Array<BundleEvents>> } the promise returned by queryCurrentBundleEvents. 94361847f8eSopenharmony_ci * <p> the {@link BundleEvents} object Array containing the state data of the current bundle.</p> 94461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 94561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 94661847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 94761847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 94861847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 94961847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 95061847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 95161847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 95261847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 95361847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 95461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 95561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 95661847f8eSopenharmony_ci * @since 9 95761847f8eSopenharmony_ci */ 95861847f8eSopenharmony_ci function queryCurrentBundleEvents(begin: number, end: number): Promise<Array<BundleEvents>>; 95961847f8eSopenharmony_ci 96061847f8eSopenharmony_ci /** 96161847f8eSopenharmony_ci * Queries recently module usage records with maxNum. 96261847f8eSopenharmony_ci * 96361847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 96461847f8eSopenharmony_ci * @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000. 96561847f8eSopenharmony_ci * @param { AsyncCallback<Array<HapModuleInfo>> } callback - the callback of queryModuleUsageRecords. 96661847f8eSopenharmony_ci * <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p> 96761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 96861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 96961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 97061847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 97161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 97261847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 97361847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 97461847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 97561847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 97661847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 97761847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 97861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 97961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 98061847f8eSopenharmony_ci * @since 9 98161847f8eSopenharmony_ci */ 98261847f8eSopenharmony_ci function queryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapModuleInfo>>): void; 98361847f8eSopenharmony_ci 98461847f8eSopenharmony_ci /** 98561847f8eSopenharmony_ci * Queries recently module usage records with maxNum. 98661847f8eSopenharmony_ci * 98761847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 98861847f8eSopenharmony_ci * @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000. 98961847f8eSopenharmony_ci * @returns { Promise<Array<HapModuleInfo>> } the promise returned by queryModuleUsageRecords. 99061847f8eSopenharmony_ci * <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p> 99161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 99261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 99361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 99461847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 99561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 99661847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 99761847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 99861847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 99961847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 100061847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 100161847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 100261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 100361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 100461847f8eSopenharmony_ci * @since 9 100561847f8eSopenharmony_ci */ 100661847f8eSopenharmony_ci function queryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>>; 100761847f8eSopenharmony_ci 100861847f8eSopenharmony_ci /** 100961847f8eSopenharmony_ci * Queries recently module usage records. 101061847f8eSopenharmony_ci * 101161847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 101261847f8eSopenharmony_ci * @param { AsyncCallback<Array<HapModuleInfo>> } callback - the callback of queryModuleUsageRecords. 101361847f8eSopenharmony_ci * <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p> 101461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 101561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 101661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 101761847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 101861847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 101961847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 102061847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 102161847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 102261847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 102361847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 102461847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 102561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 102661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 102761847f8eSopenharmony_ci * @since 9 102861847f8eSopenharmony_ci */ 102961847f8eSopenharmony_ci function queryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>): void; 103061847f8eSopenharmony_ci 103161847f8eSopenharmony_ci /** 103261847f8eSopenharmony_ci * Queries recently module usage records. 103361847f8eSopenharmony_ci * 103461847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 103561847f8eSopenharmony_ci * @returns { Promise<Array<HapModuleInfo>> } the promise returned by queryModuleUsageRecords. 103661847f8eSopenharmony_ci * <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p> 103761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 103861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 103961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 104061847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 104161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 104261847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 104361847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 104461847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 104561847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 104661847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 104761847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 104861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 104961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 105061847f8eSopenharmony_ci * @since 9 105161847f8eSopenharmony_ci */ 105261847f8eSopenharmony_ci function queryModuleUsageRecords(): Promise<Array<HapModuleInfo>>; 105361847f8eSopenharmony_ci 105461847f8eSopenharmony_ci /** 105561847f8eSopenharmony_ci * Declares group type. 105661847f8eSopenharmony_ci * 105761847f8eSopenharmony_ci * @enum { number } 105861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 105961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 106061847f8eSopenharmony_ci * @since 9 106161847f8eSopenharmony_ci */ 106261847f8eSopenharmony_ci export enum GroupType { 106361847f8eSopenharmony_ci /** 106461847f8eSopenharmony_ci * Indicates the alive group. 106561847f8eSopenharmony_ci * 106661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 106761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 106861847f8eSopenharmony_ci * @since 9 106961847f8eSopenharmony_ci */ 107061847f8eSopenharmony_ci ALIVE_GROUP = 10, 107161847f8eSopenharmony_ci 107261847f8eSopenharmony_ci /** 107361847f8eSopenharmony_ci * Indicates the daily group. 107461847f8eSopenharmony_ci * 107561847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 107661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 107761847f8eSopenharmony_ci * @since 9 107861847f8eSopenharmony_ci */ 107961847f8eSopenharmony_ci DAILY_GROUP = 20, 108061847f8eSopenharmony_ci 108161847f8eSopenharmony_ci /** 108261847f8eSopenharmony_ci * Indicates the fixed group. 108361847f8eSopenharmony_ci * 108461847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 108561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 108661847f8eSopenharmony_ci * @since 9 108761847f8eSopenharmony_ci */ 108861847f8eSopenharmony_ci FIXED_GROUP = 30, 108961847f8eSopenharmony_ci 109061847f8eSopenharmony_ci /** 109161847f8eSopenharmony_ci * Indicates the rare group. 109261847f8eSopenharmony_ci * 109361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 109461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 109561847f8eSopenharmony_ci * @since 9 109661847f8eSopenharmony_ci */ 109761847f8eSopenharmony_ci RARE_GROUP = 40, 109861847f8eSopenharmony_ci 109961847f8eSopenharmony_ci /** 110061847f8eSopenharmony_ci * Indicates the limit group. 110161847f8eSopenharmony_ci * 110261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 110361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 110461847f8eSopenharmony_ci * @since 9 110561847f8eSopenharmony_ci */ 110661847f8eSopenharmony_ci LIMITED_GROUP = 50, 110761847f8eSopenharmony_ci 110861847f8eSopenharmony_ci /** 110961847f8eSopenharmony_ci * Indicates the never group. 111061847f8eSopenharmony_ci * 111161847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 111261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 111361847f8eSopenharmony_ci * @since 9 111461847f8eSopenharmony_ci */ 111561847f8eSopenharmony_ci NEVER_GROUP = 60 111661847f8eSopenharmony_ci } 111761847f8eSopenharmony_ci 111861847f8eSopenharmony_ci /** 111961847f8eSopenharmony_ci * Set app group by bundleName. 112061847f8eSopenharmony_ci * 112161847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 112261847f8eSopenharmony_ci * @param { string } bundleName - name of the application. 112361847f8eSopenharmony_ci * @param { GroupType } newGroup - the group of the application whose name is bundleName. 112461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setAppGroup. 112561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 112661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 112761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 112861847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 112961847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 113061847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 113161847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 113261847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 113361847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 113461847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 113561847f8eSopenharmony_ci * @throws { BusinessError } 10100001 - Repeated operation on the application group. 113661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 113761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 113861847f8eSopenharmony_ci * @since 9 113961847f8eSopenharmony_ci */ 114061847f8eSopenharmony_ci function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<void>): void; 114161847f8eSopenharmony_ci 114261847f8eSopenharmony_ci /** 114361847f8eSopenharmony_ci * Set app group by bundleName. 114461847f8eSopenharmony_ci * 114561847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 114661847f8eSopenharmony_ci * @param { string } bundleName - name of the application. 114761847f8eSopenharmony_ci * @param { GroupType } newGroup - the group of the application whose name is bundleName. 114861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by setAppGroup. 114961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 115061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 115161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 115261847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 115361847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 115461847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 115561847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 115661847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 115761847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 115861847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 115961847f8eSopenharmony_ci * @throws { BusinessError } 10100001 - Repeated operation on the application group. 116061847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 116161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 116261847f8eSopenharmony_ci * @since 9 116361847f8eSopenharmony_ci */ 116461847f8eSopenharmony_ci function setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>; 116561847f8eSopenharmony_ci 116661847f8eSopenharmony_ci /** 116761847f8eSopenharmony_ci * Register appGroup change callback to service. 116861847f8eSopenharmony_ci * 116961847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 117061847f8eSopenharmony_ci * @param { Callback<AppGroupCallbackInfo> } groupCallback - 117161847f8eSopenharmony_ci * <p> callback of AppGroupCallbackInfo when the group of app changed.</p> 117261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of registerAppGroupCallBack. 117361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 117461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 117561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 117661847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 117761847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 117861847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 117961847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 118061847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 118161847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 118261847f8eSopenharmony_ci * @throws { BusinessError } 10100001 - Repeated operation on the application group. 118361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 118461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 118561847f8eSopenharmony_ci * @since 9 118661847f8eSopenharmony_ci */ 118761847f8eSopenharmony_ci function registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>, callback: AsyncCallback<void>): void; 118861847f8eSopenharmony_ci 118961847f8eSopenharmony_ci /** 119061847f8eSopenharmony_ci * Register appGroup change callback to service. 119161847f8eSopenharmony_ci * 119261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 119361847f8eSopenharmony_ci * @param { Callback<AppGroupCallbackInfo> } groupCallback - 119461847f8eSopenharmony_ci * <p> callback of AppGroupCallbackInfo when the group of app changed.</p> 119561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by registerAppGroupCallBack. 119661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 119761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 119861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 119961847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 120061847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 120161847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 120261847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 120361847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 120461847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 120561847f8eSopenharmony_ci * @throws { BusinessError } 10100001 - Repeated operation on the application group. 120661847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 120761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 120861847f8eSopenharmony_ci * @since 9 120961847f8eSopenharmony_ci */ 121061847f8eSopenharmony_ci function registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>): Promise<void>; 121161847f8eSopenharmony_ci 121261847f8eSopenharmony_ci /** 121361847f8eSopenharmony_ci * Unregister appGroup change callback from service. 121461847f8eSopenharmony_ci * 121561847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 121661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of unregisterAppGroupCallBack. 121761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 121861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 121961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 122061847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 122161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 122261847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 122361847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 122461847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 122561847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 122661847f8eSopenharmony_ci * @throws { BusinessError } 10100001 - Repeated operation on the application group. 122761847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 122861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 122961847f8eSopenharmony_ci * @since 9 123061847f8eSopenharmony_ci */ 123161847f8eSopenharmony_ci function unregisterAppGroupCallBack(callback: AsyncCallback<void>): void; 123261847f8eSopenharmony_ci 123361847f8eSopenharmony_ci /** 123461847f8eSopenharmony_ci * Unregister appGroup change callback from service. 123561847f8eSopenharmony_ci * 123661847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 123761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by unregisterAppGroupCallBack. 123861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 123961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 124061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 124161847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 124261847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 124361847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 124461847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 124561847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 124661847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 124761847f8eSopenharmony_ci * @throws { BusinessError } 10100001 - Repeated operation on the application group. 124861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup 124961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 125061847f8eSopenharmony_ci * @since 9 125161847f8eSopenharmony_ci */ 125261847f8eSopenharmony_ci function unregisterAppGroupCallBack(): Promise<void>; 125361847f8eSopenharmony_ci 125461847f8eSopenharmony_ci /** 125561847f8eSopenharmony_ci * Queries device event states data within a specified period identified by the start and end time. 125661847f8eSopenharmony_ci * 125761847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 125861847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 125961847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 126061847f8eSopenharmony_ci * @param { AsyncCallback<Array<DeviceEventStats>> } callback - the callback of queryDeviceEventStats. 126161847f8eSopenharmony_ci * <p> the {@link DeviceEventStats} object Array containing the event states data.</p> 126261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 126361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 126461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 126561847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 126661847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 126761847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 126861847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 126961847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 127061847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 127161847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 127261847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 127361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 127461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 127561847f8eSopenharmony_ci * @since 9 127661847f8eSopenharmony_ci */ 127761847f8eSopenharmony_ci function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array<DeviceEventStats>>): void; 127861847f8eSopenharmony_ci 127961847f8eSopenharmony_ci /** 128061847f8eSopenharmony_ci * Queries device event states data within a specified period identified by the start and end time. 128161847f8eSopenharmony_ci * 128261847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 128361847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 128461847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 128561847f8eSopenharmony_ci * @returns { Promise<Array<DeviceEventStats>> } the promise returned by queryDeviceEventStats. 128661847f8eSopenharmony_ci * <p> the {@link DeviceEventStats} object Array containing the event states data.</p> 128761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 128861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 128961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 129061847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 129161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 129261847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 129361847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 129461847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 129561847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 129661847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 129761847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 129861847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 129961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 130061847f8eSopenharmony_ci * @since 9 130161847f8eSopenharmony_ci */ 130261847f8eSopenharmony_ci function queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>; 130361847f8eSopenharmony_ci 130461847f8eSopenharmony_ci /** 130561847f8eSopenharmony_ci * Queries app notification number within a specified period identified by the start and end time. 130661847f8eSopenharmony_ci * 130761847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 130861847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 130961847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 131061847f8eSopenharmony_ci * @param { AsyncCallback<Array<DeviceEventStats>> } callback - the callback of queryNotificationEventStats. 131161847f8eSopenharmony_ci * <p> the {@link DeviceEventStats} object Array containing the event states data.</p> 131261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 131361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 131461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 131561847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 131661847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 131761847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 131861847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 131961847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 132061847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 132161847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 132261847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 132361847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 132461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 132561847f8eSopenharmony_ci * @since 9 132661847f8eSopenharmony_ci */ 132761847f8eSopenharmony_ci function queryNotificationEventStats( 132861847f8eSopenharmony_ci begin: number, 132961847f8eSopenharmony_ci end: number, 133061847f8eSopenharmony_ci callback: AsyncCallback<Array<DeviceEventStats>> 133161847f8eSopenharmony_ci ): void; 133261847f8eSopenharmony_ci 133361847f8eSopenharmony_ci /** 133461847f8eSopenharmony_ci * Queries app notification number within a specified period identified by the start and end time. 133561847f8eSopenharmony_ci * 133661847f8eSopenharmony_ci * @permission ohos.permission.BUNDLE_ACTIVE_INFO 133761847f8eSopenharmony_ci * @param { number } begin - Indicates the start time of the query period, in milliseconds. 133861847f8eSopenharmony_ci * @param { number } end - Indicates the end time of the query period, in milliseconds. 133961847f8eSopenharmony_ci * @returns { Promise<Array<DeviceEventStats>> } the promise returned by queryNotificationEventStats. 134061847f8eSopenharmony_ci * <p> the {@link DeviceEventStats} object Array containing the event states data.</p> 134161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 134261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 134361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; 134461847f8eSopenharmony_ci * <br> 2. Incorrect parameters types; 3. Parameter verification failed. 134561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 134661847f8eSopenharmony_ci * @throws { BusinessError } 10000001 - Memory operation failed. 134761847f8eSopenharmony_ci * @throws { BusinessError } 10000002 - Parcel operation failed. 134861847f8eSopenharmony_ci * @throws { BusinessError } 10000003 - System service operation failed. 134961847f8eSopenharmony_ci * @throws { BusinessError } 10000004 - IPC failed. 135061847f8eSopenharmony_ci * @throws { BusinessError } 10000006 - Failed to get the application information. 135161847f8eSopenharmony_ci * @throws { BusinessError } 10000007 - Failed to get the system time. 135261847f8eSopenharmony_ci * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App 135361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 135461847f8eSopenharmony_ci * @since 9 135561847f8eSopenharmony_ci */ 135661847f8eSopenharmony_ci function queryNotificationEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>; 135761847f8eSopenharmony_ci} 135861847f8eSopenharmony_ci 135961847f8eSopenharmony_ciexport default usageStatistics; 1360