• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef DEVICE_GOOGLE_WAHOO_POWERSTATS_EASELSTATERESIDENCYDATAPROVIDER_H
17 #define DEVICE_GOOGLE_WAHOO_POWERSTATS_EASELSTATERESIDENCYDATAPROVIDER_H
18 
19 #include <pixelpowerstats/PowerStats.h>
20 
21 using android::hardware::power::stats::V1_0::PowerEntityStateResidencyResult;
22 using android::hardware::power::stats::V1_0::PowerEntityStateSpace;
23 using android::hardware::google::pixel::powerstats::IStateResidencyDataProvider;
24 
25 namespace android {
26 namespace device {
27 namespace google {
28 namespace wahoo {
29 namespace powerstats {
30 
31 class EaselStateResidencyDataProvider : public IStateResidencyDataProvider {
32   public:
33     EaselStateResidencyDataProvider(uint32_t id);
34     ~EaselStateResidencyDataProvider() = default;
35     bool getResults(std::unordered_map<uint32_t, PowerEntityStateResidencyResult>
36             &results) override;
37     std::vector<PowerEntityStateSpace> getStateSpaces() override;
38 
39   private:
40     std::mutex mLock;
41     const uint32_t mPowerEntityId;
42     uint64_t mTotalOnSnapshotCount;
43     uint64_t mTotalNotOnSnapshotCount;
44 };
45 
46 }  // namespace powerstats
47 }  // namespace wahoo
48 }  // namespace google
49 }  // namespace device
50 }  // namespace android
51 
52 #endif  // DEVICE_GOOGLE_WAHOO_POWERSTATS_EASELSTATERESIDENCYDATAPROVIDER_H
53