• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 BATTERY_SRV_STUB_H
17 #define BATTERY_SRV_STUB_H
18 
19 #include "ibattery_srv.h"
20 #include "nocopyable.h"
21 #include "iremote_stub.h"
22 
23 namespace OHOS {
24 namespace PowerMgr {
25 class BatterySrvStub : public IRemoteStub<IBatterySrv> {
26 public:
27     DISALLOW_COPY_AND_MOVE(BatterySrvStub);
28 
29     BatterySrvStub() = default;
30 
31     virtual ~BatterySrvStub() = default;
32 
33     int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override;
34 
35 private:
36     int32_t GetCapacityStub(MessageParcel& reply);
37     int32_t GetChargingStatusStub(MessageParcel& reply);
38     int32_t GetHealthStatusStub(MessageParcel& reply);
39     int32_t GetPluggedTypeStub(MessageParcel& reply);
40     int32_t GetVoltageStub(MessageParcel& reply);
41     int32_t GetPresentStub(MessageParcel& reply);
42     int32_t GetTechnologyStub(MessageParcel& reply);
43     int32_t GetBatteryTemperatureStub(MessageParcel& reply);
44     int32_t GetBatteryLevelStub(MessageParcel& reply);
45     int64_t GetRemainingChargeTimeStub(MessageParcel& reply);
46     int32_t CheckRequestCode(const uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option);
47 };
48 } // namespace PowerMgr
49 } // namespace OHOS
50 #endif // BATTERY_SRV_STUB_H
51