blob: 50089121ceebd1c7479521d9b2900c61d9698fd4 [file] [log] [blame]
Robin Pengc2b5ca92021-02-23 20:00:28 +08001/*
2 * Copyright (C) 2020 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 */
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080016#pragma once
Robin Pengc2b5ca92021-02-23 20:00:28 +080017
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080018#include <dataproviders/GenericStateResidencyDataProvider.h>
19#include <PowerStatsAidl.h>
Robin Pengc2b5ca92021-02-23 20:00:28 +080020
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080021namespace aidl {
Robin Pengc2b5ca92021-02-23 20:00:28 +080022namespace android {
23namespace hardware {
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080024namespace power {
25namespace stats {
Robin Pengc2b5ca92021-02-23 20:00:28 +080026
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080027class AocStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
Robin Pengc2b5ca92021-02-23 20:00:28 +080028 public:
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080029 AocStateResidencyDataProvider(std::vector<std::pair<std::string, std::string>> ids,
Robin Pengc2b5ca92021-02-23 20:00:28 +080030 std::vector<std::pair<std::string, std::string>> states);
31 ~AocStateResidencyDataProvider() = default;
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080032 bool getStateResidencies(
33 std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
34 std::unordered_map<std::string, std::vector<State>> getInfo() override;
Robin Pengc2b5ca92021-02-23 20:00:28 +080035
36 private:
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080037 std::unordered_map<std::string /* entity name */,
38 std::vector<std::unique_ptr<GenericStateResidencyDataProvider>> /* providers */> mProviders;
Robin Pengc2b5ca92021-02-23 20:00:28 +080039};
40
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080041} // namespace stats
42} // namespace power
Robin Pengc2b5ca92021-02-23 20:00:28 +080043} // namespace hardware
44} // namespace android
Benjamin Schwartz0d6392e2021-03-09 09:02:06 -080045} // namespace aidl