diff --git a/aidl/power-libperfmgr/Power.cpp b/aidl/power-libperfmgr/Power.cpp
index 7fb113e..f1f3db9 100644
--- a/aidl/power-libperfmgr/Power.cpp
+++ b/aidl/power-libperfmgr/Power.cpp
@@ -90,7 +90,7 @@
 ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
     LOG(DEBUG) << "Power setMode: " << toString(type) << " to: " << enabled;
     ATRACE_INT(toString(type).c_str(), enabled);
-    PowerSessionManager::getInstance().updateHintMode(toString(type), enabled);
+    PowerSessionManager::getInstance()->updateHintMode(toString(type), enabled);
 #ifdef MODE_EXT
     if (setDeviceSpecificMode(type, enabled)) {
         return ndk::ScopedAStatus::ok();
diff --git a/aidl/power-libperfmgr/PowerExt.cpp b/aidl/power-libperfmgr/PowerExt.cpp
index c3c2252..58dfd2e 100644
--- a/aidl/power-libperfmgr/PowerExt.cpp
+++ b/aidl/power-libperfmgr/PowerExt.cpp
@@ -47,7 +47,7 @@
     } else {
         mHintManager->EndHint(mode);
     }
-    PowerSessionManager::getInstance().updateHintMode(mode, enabled);
+    PowerSessionManager::getInstance()->updateHintMode(mode, enabled);
 
     return ndk::ScopedAStatus::ok();
 }
diff --git a/aidl/power-libperfmgr/PowerHintSession.cpp b/aidl/power-libperfmgr/PowerHintSession.cpp
index 908983f..be27209 100644
--- a/aidl/power-libperfmgr/PowerHintSession.cpp
+++ b/aidl/power-libperfmgr/PowerHintSession.cpp
@@ -146,7 +146,7 @@
     mDescriptor = new AppHintDesc(tgid, uid, threadIds, sUclampCap);
     mDescriptor->duration = std::chrono::nanoseconds(durationNanos);
     mStaleHandler = sp<StaleHandler>(new StaleHandler(this, sStaleTimeoutMs));
-    mPowerManagerHandler = sp<MessageHandler>(&PowerSessionManager::getInstance());
+    mPowerManagerHandler = PowerSessionManager::getInstance();
 
     if (ATRACE_ENABLED()) {
         std::string sz =
@@ -157,7 +157,7 @@
                           mDescriptor->uid, reinterpret_cast<uintptr_t>(this) & 0xffff);
         ATRACE_INT(sz.c_str(), mDescriptor->is_active.load());
     }
-    PowerSessionManager::getInstance().addPowerSession(this);
+    PowerSessionManager::getInstance()->addPowerSession(this);
     ALOGD("PowerHintSession created: %s", mDescriptor->toString().c_str());
 }
 
@@ -180,7 +180,7 @@
 }
 
 void PowerHintSession::updateUniveralBoostMode() {
-    PowerHintMonitor::getInstance().getLooper()->sendMessage(mPowerManagerHandler, NULL);
+    PowerHintMonitor::getInstance()->getLooper()->sendMessage(mPowerManagerHandler, NULL);
 }
 
 int PowerHintSession::setUclamp(int32_t min, int32_t max) {
@@ -247,10 +247,10 @@
 }
 
 ndk::ScopedAStatus PowerHintSession::close() {
-    PowerHintMonitor::getInstance().getLooper()->removeMessages(mStaleHandler);
+    PowerHintMonitor::getInstance()->getLooper()->removeMessages(mStaleHandler);
     // Reset to (0, 1024) uclamp value -- instead of threads' original setting.
     setUclamp(0, 1024);
-    PowerSessionManager::getInstance().removePowerSession(this);
+    PowerSessionManager::getInstance()->removePowerSession(this);
     updateUniveralBoostMode();
     return ndk::ScopedAStatus::ok();
 }
@@ -291,7 +291,7 @@
         ALOGE("Error: shouldn't report duration during pause state.");
         return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
     }
-    if (PowerHintMonitor::getInstance().isRunning() && isStale()) {
+    if (PowerHintMonitor::getInstance()->isRunning() && isStale()) {
         if (ATRACE_ENABLED()) {
             std::string sz = StringPrintf("adpf.%" PRId32 "-%" PRId32 "-%" PRIxPTR "-stale",
                                           mDescriptor->tgid, mDescriptor->uid,
@@ -401,7 +401,7 @@
 
 void PowerHintSession::StaleHandler::updateStaleTimer() {
     std::lock_guard<std::mutex> guard(mStaleLock);
-    if (PowerHintMonitor::getInstance().isRunning()) {
+    if (PowerHintMonitor::getInstance()->isRunning()) {
         auto when = getStaleTime();
         auto now = std::chrono::steady_clock::now();
         mLastUpdatedTime.store(now);
@@ -410,7 +410,7 @@
         }
         if (!mIsMonitoringStale.load()) {
             auto next = getStaleTime();
-            PowerHintMonitor::getInstance().getLooper()->sendMessageDelayed(
+            PowerHintMonitor::getInstance()->getLooper()->sendMessageDelayed(
                     duration_cast<nanoseconds>(next - now).count(), this, NULL);
             mIsMonitoringStale.store(true);
         }
@@ -432,7 +432,7 @@
         return;
     }
     // Schedule for the next checking time.
-    PowerHintMonitor::getInstance().getLooper()->sendMessageDelayed(
+    PowerHintMonitor::getInstance()->getLooper()->sendMessageDelayed(
             duration_cast<nanoseconds>(when - now).count(), this, NULL);
 }
 
diff --git a/aidl/power-libperfmgr/PowerSessionManager.cpp b/aidl/power-libperfmgr/PowerSessionManager.cpp
index f3cb29d..79dea6e 100644
--- a/aidl/power-libperfmgr/PowerSessionManager.cpp
+++ b/aidl/power-libperfmgr/PowerSessionManager.cpp
@@ -116,7 +116,7 @@
     return true;
 }
 
-Looper *PowerHintMonitor::getLooper() {
+sp<Looper> PowerHintMonitor::getLooper() {
     return mLooper;
 }
 
diff --git a/aidl/power-libperfmgr/PowerSessionManager.h b/aidl/power-libperfmgr/PowerSessionManager.h
index 992e876..006a565 100644
--- a/aidl/power-libperfmgr/PowerSessionManager.h
+++ b/aidl/power-libperfmgr/PowerSessionManager.h
@@ -53,8 +53,8 @@
     void setHintManager(std::shared_ptr<HintManager> const &hint_manager);
 
     // Singleton
-    static PowerSessionManager &getInstance() {
-        static PowerSessionManager instance;
+    static sp<PowerSessionManager> getInstance() {
+        static sp<PowerSessionManager> instance = new PowerSessionManager();
         return instance;
     }
 
@@ -80,17 +80,17 @@
   public:
     void start();
     bool threadLoop() override;
-    Looper *getLooper();
+    sp<Looper> getLooper();
     // Singleton
-    static PowerHintMonitor &getInstance() {
-        static PowerHintMonitor instance;
+    static sp<PowerHintMonitor> getInstance() {
+        static sp<PowerHintMonitor> instance = new PowerHintMonitor();
         return instance;
     }
     PowerHintMonitor(PowerHintMonitor const &) = delete;
     void operator=(PowerHintMonitor const &) = delete;
 
   private:
-    Looper *mLooper;
+    sp<Looper> mLooper;
     // Singleton
     PowerHintMonitor() : Thread(false), mLooper(new Looper(true)) {}
 };
diff --git a/aidl/power-libperfmgr/service.cpp b/aidl/power-libperfmgr/service.cpp
index 09a8429..bc10e0e 100644
--- a/aidl/power-libperfmgr/service.cpp
+++ b/aidl/power-libperfmgr/service.cpp
@@ -69,8 +69,8 @@
     LOG(INFO) << "Xiaomi Power HAL AIDL Service with Extension is started.";
 
     if (::android::base::GetIntProperty("vendor.powerhal.adpf.rate", -1) != -1) {
-        PowerHintMonitor::getInstance().start();
-        PowerSessionManager::getInstance().setHintManager(hm);
+        PowerHintMonitor::getInstance()->start();
+        PowerSessionManager::getInstance()->setHintManager(hm);
     }
 
     std::thread initThread([&]() {
