1d590543dSopenharmony_ci/* 2d590543dSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3d590543dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4d590543dSopenharmony_ci * you may not use this file except in compliance with the License. 5d590543dSopenharmony_ci * You may obtain a copy of the License at 6d590543dSopenharmony_ci * 7d590543dSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8d590543dSopenharmony_ci * 9d590543dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10d590543dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11d590543dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12d590543dSopenharmony_ci * See the License for the specific language governing permissions and 13d590543dSopenharmony_ci * limitations under the License. 14d590543dSopenharmony_ci */ 15d590543dSopenharmony_ci 16d590543dSopenharmony_ci#ifndef IBATTERY_STATS_H 17d590543dSopenharmony_ci#define IBATTERY_STATS_H 18d590543dSopenharmony_ci 19d590543dSopenharmony_ci#include "iremote_broker.h" 20d590543dSopenharmony_ci#include "iremote_object.h" 21d590543dSopenharmony_ci 22d590543dSopenharmony_ci#include "battery_stats_errors.h" 23d590543dSopenharmony_ci#include "battery_stats_info.h" 24d590543dSopenharmony_ci 25d590543dSopenharmony_cinamespace OHOS { 26d590543dSopenharmony_cinamespace PowerMgr { 27d590543dSopenharmony_ciclass IBatteryStats : public IRemoteBroker { 28d590543dSopenharmony_cipublic: 29d590543dSopenharmony_ci virtual BatteryStatsInfoList GetBatteryStats() = 0; 30d590543dSopenharmony_ci virtual void SetOnBattery(bool isOnBattery) = 0; 31d590543dSopenharmony_ci virtual double GetAppStatsMah(const int32_t& uid) = 0; 32d590543dSopenharmony_ci virtual double GetAppStatsPercent(const int32_t& uid) = 0; 33d590543dSopenharmony_ci virtual double GetPartStatsMah(const BatteryStatsInfo::ConsumptionType& type) = 0; 34d590543dSopenharmony_ci virtual double GetPartStatsPercent(const BatteryStatsInfo::ConsumptionType& type) = 0; 35d590543dSopenharmony_ci virtual uint64_t GetTotalTimeSecond(const StatsUtils::StatsType& statsType, 36d590543dSopenharmony_ci const int32_t& uid = StatsUtils::INVALID_VALUE) = 0; 37d590543dSopenharmony_ci virtual uint64_t GetTotalDataBytes(const StatsUtils::StatsType& statsType, 38d590543dSopenharmony_ci const int32_t& uid = StatsUtils::INVALID_VALUE) = 0; 39d590543dSopenharmony_ci virtual void Reset() = 0; 40d590543dSopenharmony_ci virtual std::string ShellDump(const std::vector<std::string>& args, uint32_t argc) = 0; 41d590543dSopenharmony_ci virtual StatsError GetLastError() = 0; 42d590543dSopenharmony_cipublic: 43d590543dSopenharmony_ci DECLARE_INTERFACE_DESCRIPTOR(u"ohos.powermgr.IBatteryStats"); 44d590543dSopenharmony_ci}; 45d590543dSopenharmony_ci} // namespace PowerMgr 46d590543dSopenharmony_ci} // namespace OHOS 47d590543dSopenharmony_ci 48d590543dSopenharmony_ci#endif // IBATTERY_STATS_H 49