• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef MOCK_BATTERY_SRV_PROXY_H
17 #define MOCK_BATTERY_SRV_PROXY_H
18 
19 #include "battery_srv_proxy.h"
20 
21 namespace OHOS {
22 namespace PowerMgr {
23 class MockBatterySrvProxy : public BatterySrvProxy {
24 public:
MockBatterySrvProxy(const sptr<IRemoteObject> & remote)25     explicit MockBatterySrvProxy(const sptr<IRemoteObject>& remote)
26         : BatterySrvProxy(remote)
27     {}
~MockBatterySrvProxy()28     ~MockBatterySrvProxy() {};
29     int32_t GetCapacity(int32_t& capacity) override;
30     int32_t GetChargingStatus(uint32_t& chargeState) override;
31     int32_t GetHealthStatus(uint32_t& healthState) override;
32     int32_t GetPluggedType(uint32_t& pluggedType) override;
33     int32_t GetVoltage(int32_t& voltage) override;
34     int32_t GetPresent(bool& present) override;
35     int32_t GetTechnology(std::string& technology) override;
36     int32_t GetTotalEnergy(int32_t& totalEnergy) override;
37     int32_t GetCurrentAverage(int32_t& curAverage) override;
38     int32_t GetNowCurrent(int32_t& nowCurr) override;
39     int32_t GetRemainEnergy(int32_t& remainEnergy) override;
40     int32_t GetBatteryTemperature(int32_t& temperature) override;
41     int32_t GetCapacityLevel(uint32_t& batteryCapacityLevel) override;
42     int32_t GetRemainingChargeTime(int64_t& remainTime) override;
43     int32_t SetBatteryConfig(const std::string& sceneName, const std::string& value, int32_t& batteryErr) override;
44     int32_t GetBatteryConfig(const std::string& sceneName, std::string& getResult, int32_t& batteryErr) override;
45     int32_t IsBatteryConfigSupported(const std::string& featureName, bool& isResult, int32_t& batteryErr) override;
46 };
47 } // namespace PowerMgr
48 } // namespace OHOS
49 #endif // MOCK_BATTERY_SRV_PROXY_H
50