diff options
Diffstat (limited to 'powerstats/include/dataproviders/DisplayStateResidencyDataProvider.h')
-rw-r--r-- | powerstats/include/dataproviders/DisplayStateResidencyDataProvider.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/powerstats/include/dataproviders/DisplayStateResidencyDataProvider.h b/powerstats/include/dataproviders/DisplayStateResidencyDataProvider.h index 70c814b9..41783216 100644 --- a/powerstats/include/dataproviders/DisplayStateResidencyDataProvider.h +++ b/powerstats/include/dataproviders/DisplayStateResidencyDataProvider.h @@ -33,7 +33,8 @@ namespace hardware { namespace power { namespace stats { -class DisplayStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { +class DisplayStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider, + public ::android::Thread { public: // name = powerEntityName to be associated with this data provider // path = path to the display state file descriptor @@ -48,8 +49,8 @@ class DisplayStateResidencyDataProvider : public PowerStats::IStateResidencyData std::unordered_map<std::string, std::vector<State>> getInfo() override; private: - // Poll for display state changes - void pollLoop(); + // Method associated with ::android::Thread. Poll for display state changes + bool threadLoop() override; // Main function to update the stats when display state change is detected void updateStats(); @@ -68,9 +69,7 @@ class DisplayStateResidencyDataProvider : public PowerStats::IStateResidencyData // Index of current state int mCurState; // Looper to facilitate polling of display state file desciptor - ::android::sp<::android::Looper> mLooper; - - std::thread mThread; + sp<::android::Looper> mLooper; }; } // namespace stats |