sm6375-common: power-libperfmgr: Make HintManager a singleton class

HintManager is unique and widely used in many different components.
This is for making it easiler to be reloaded for debugging.

Bug: 172285365
Test: adb push \
      out/target/product/raven/data/nativetest64/libperfmgr_test/libperfmgr_test \
      /data/nativetest64/libperfmgr_test/libperfmgr_test && \
      adb shell /data/nativetest64/libperfmgr_test/libperfmgr_test
Change-Id: I3affdfe780073ebbc50fac7bfbdd1530ee9dc8c2
This commit is contained in:
Jimmy Shiu 2024-07-18 20:16:00 +05:30 committed by Anand S
commit 53f1fc4eee
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
9 changed files with 68 additions and 96 deletions

View file

@ -22,8 +22,6 @@
#include <string>
#include <thread>
#include <perfmgr/HintManager.h>
namespace aidl {
namespace google {
namespace hardware {
@ -31,8 +29,6 @@ namespace power {
namespace impl {
namespace pixel {
using ::android::perfmgr::HintManager;
enum InteractionState {
INTERACTION_STATE_UNINITIALIZED,
INTERACTION_STATE_IDLE,
@ -42,7 +38,7 @@ enum InteractionState {
class InteractionHandler {
public:
InteractionHandler(std::shared_ptr<HintManager> const &hint_manager);
InteractionHandler();
~InteractionHandler();
bool Init();
void Exit();
@ -65,7 +61,6 @@ class InteractionHandler {
std::unique_ptr<std::thread> mThread;
std::mutex mLock;
std::condition_variable mCond;
std::shared_ptr<HintManager> mHintManager;
};
} // namespace pixel