Chenjie Yu | 1a317ba | 2017-10-05 16:05:32 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
| 17 | #ifndef STATSD_STATSPULLERMANAGER_H |
| 18 | #define STATSD_STATSPULLERMANAGER_H |
| 19 | |
| 20 | #include <utils/String16.h> |
| 21 | #include <unordered_map> |
| 22 | #include "StatsPuller.h" |
| 23 | |
| 24 | namespace android { |
| 25 | namespace os { |
| 26 | namespace statsd { |
| 27 | |
| 28 | const static int KERNEL_WAKELOCKS = 1; |
| 29 | |
| 30 | class StatsPullerManager { |
| 31 | public: |
| 32 | // Enums of pulled data types (pullCodes) |
| 33 | // These values must be kept in sync with com/android/server/stats/StatsCompanionService.java. |
| 34 | // TODO: pull the constant from stats_events.proto instead |
| 35 | const static int KERNEL_WAKELOCKS; |
| 36 | StatsPullerManager(); |
| 37 | |
| 38 | String16 pull(const int pullCode); |
| 39 | |
| 40 | private: |
| 41 | std::unordered_map<int, std::unique_ptr<StatsPuller>> mStatsPullers; |
| 42 | }; |
| 43 | |
| 44 | |
| 45 | } // namespace statsd |
| 46 | } // namespace os |
| 47 | } // namespace android |
| 48 | |
| 49 | #endif // STATSD_STATSPULLERMANAGER_H |