1 /* 2 * Copyright (C) 2021 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 HARDWARE_GOOGLE_PIXEL_PIXELSTATS_STATSHELPER_H 18 #define HARDWARE_GOOGLE_PIXEL_PIXELSTATS_STATSHELPER_H 19 20 #include <aidl/android/frameworks/stats/IStats.h> 21 #include <hardware/google/pixel/pixelstats/pixelatoms.pb.h> 22 23 namespace android { 24 namespace hardware { 25 namespace google { 26 namespace pixel { 27 28 using aidl::android::frameworks::stats::IStats; 29 30 std::shared_ptr<IStats> getStatsService(); 31 32 void reportSpeakerImpedance(const std::shared_ptr<IStats> &stats_client, 33 const PixelAtoms::VendorSpeakerImpedance &speakerImpedance); 34 35 void reportSlowIo(const std::shared_ptr<IStats> &stats_client, 36 const PixelAtoms::VendorSlowIo &slowIo); 37 38 void reportChargeCycles(const std::shared_ptr<IStats> &stats_client, 39 const std::vector<int32_t> &chargeCycles); 40 41 void reportHardwareFailed(const std::shared_ptr<IStats> &stats_client, 42 const PixelAtoms::VendorHardwareFailed &failure); 43 44 void reportSpeechDspStat(const std::shared_ptr<IStats> &stats_client, 45 const PixelAtoms::VendorSpeechDspStat &dsp_stats); 46 47 void reportPhysicalDropDetected(const std::shared_ptr<IStats> &stats_client, 48 const PixelAtoms::VendorPhysicalDropDetected &dropDetected); 49 50 void reportUsbPortOverheat(const std::shared_ptr<IStats> &stats_client, 51 const PixelAtoms::VendorUsbPortOverheat &overheat_info); 52 53 void reportSpeakerHealthStat(const std::shared_ptr<IStats> &stats_client, 54 const PixelAtoms::VendorSpeakerStatsReported &speakerHealthStat); 55 56 } // namespace pixel 57 } // namespace google 58 } // namespace hardware 59 } // namespace android 60 61 #endif // HARDWARE_GOOGLE_PIXEL_PIXELSTATS_STATSHELPER_H 62