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:
parent
c515a81911
commit
473d400819
9 changed files with 68 additions and 96 deletions
|
|
@ -16,13 +16,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <aidl/android/hardware/power/BnPower.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#include <aidl/android/hardware/power/BnPower.h>
|
||||
#include <perfmgr/HintManager.h>
|
||||
|
||||
#include "InteractionHandler.h"
|
||||
|
||||
namespace aidl {
|
||||
|
|
@ -35,11 +34,10 @@ namespace pixel {
|
|||
using ::aidl::android::hardware::power::Boost;
|
||||
using ::aidl::android::hardware::power::IPowerHintSession;
|
||||
using ::aidl::android::hardware::power::Mode;
|
||||
using ::android::perfmgr::HintManager;
|
||||
|
||||
class Power : public ::aidl::android::hardware::power::BnPower {
|
||||
public:
|
||||
Power(std::shared_ptr<HintManager> hm);
|
||||
Power();
|
||||
ndk::ScopedAStatus setMode(Mode type, bool enabled) override;
|
||||
ndk::ScopedAStatus isModeSupported(Mode type, bool *_aidl_return) override;
|
||||
ndk::ScopedAStatus setBoost(Boost type, int32_t durationMs) override;
|
||||
|
|
@ -52,7 +50,6 @@ class Power : public ::aidl::android::hardware::power::BnPower {
|
|||
binder_status_t dump(int fd, const char **args, uint32_t numArgs) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<HintManager> mHintManager;
|
||||
std::unique_ptr<InteractionHandler> mInteractionHandler;
|
||||
std::atomic<bool> mSustainedPerfModeOn;
|
||||
const int64_t mAdpfRateNs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue