diff --git a/Benchmark.cpp b/Benchmark.cpp
index 9548956..b0a3b85 100644
--- a/Benchmark.cpp
+++ b/Benchmark.cpp
@@ -181,7 +181,7 @@
 void Benchmark(const std::string& path,
                const android::sp<android::os::IVoldTaskListener>& listener) {
     std::lock_guard<std::mutex> lock(kBenchmarkLock);
-    android::power::WakeLock wl{kWakeLock};
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
 
     PerformanceBoost boost;
     android::os::PersistableBundle extras;
@@ -190,6 +190,8 @@
     if (listener) {
         listener->onFinished(res, extras);
     }
+
+    release_wake_lock(kWakeLock);
 }
 
 }  // namespace vold
diff --git a/IdleMaint.cpp b/IdleMaint.cpp
index 164986c..a2d0f91 100644
--- a/IdleMaint.cpp
+++ b/IdleMaint.cpp
@@ -145,7 +145,7 @@
 }
 
 void Trim(const android::sp<android::os::IVoldTaskListener>& listener) {
-    android::power::WakeLock wl{kWakeLock};
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
 
     // Collect both fstab and vold volumes
     std::list<std::string> paths;
@@ -195,6 +195,7 @@
         listener->onFinished(0, extras);
     }
 
+    release_wake_lock(kWakeLock);
 }
 
 static bool waitForGc(const std::list<std::string>& paths) {
@@ -369,7 +370,7 @@
 
     LOG(DEBUG) << "idle maintenance started";
 
-    android::power::WakeLock wl{kWakeLock};
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
 
     std::list<std::string> paths;
     addFromFstab(&paths, PathTypes::kBlkDevice);
@@ -399,11 +400,13 @@
 
     LOG(DEBUG) << "idle maintenance completed";
 
+    release_wake_lock(kWakeLock);
+
     return android::OK;
 }
 
 int AbortIdleMaint(const android::sp<android::os::IVoldTaskListener>& listener) {
-    android::power::WakeLock wl{kWakeLock};
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
 
     std::unique_lock<std::mutex> lk(cv_m);
     if (idle_maint_stat != IdleMaintStats::kStopped) {
@@ -421,6 +424,8 @@
         listener->onFinished(0, extras);
     }
 
+    release_wake_lock(kWakeLock);
+
     LOG(DEBUG) << "idle maintenance stopped";
 
     return android::OK;
diff --git a/MoveStorage.cpp b/MoveStorage.cpp
index 9b806ec..79a47ae 100644
--- a/MoveStorage.cpp
+++ b/MoveStorage.cpp
@@ -258,13 +258,15 @@
 
 void MoveStorage(const std::shared_ptr<VolumeBase>& from, const std::shared_ptr<VolumeBase>& to,
                  const android::sp<android::os::IVoldTaskListener>& listener) {
-    android::power::WakeLock wl{kWakeLock};
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
 
     android::os::PersistableBundle extras;
     status_t res = moveStorageInternal(from, to, listener);
     if (listener) {
         listener->onFinished(res, extras);
     }
+
+    release_wake_lock(kWakeLock);
 }
 
 }  // namespace vold
diff --git a/cryptfs.cpp b/cryptfs.cpp
index 7d59b2d..c5d0307 100644
--- a/cryptfs.cpp
+++ b/cryptfs.cpp
@@ -2007,7 +2007,6 @@
     off64_t previously_encrypted_upto = 0;
     bool rebootEncryption = false;
     bool onlyCreateHeader = false;
-    std::unique_ptr<android::power::WakeLock> wakeLock = nullptr;
 
     if (get_crypt_ftr_and_key(&crypt_ftr) == 0) {
         if (crypt_ftr.flags & CRYPT_ENCRYPTION_IN_PROGRESS) {
@@ -2074,7 +2073,7 @@
      * wants to keep the screen on, it can grab a full wakelock.
      */
     snprintf(lockid, sizeof(lockid), "enablecrypto%d", (int)getpid());
-    wakeLock = std::make_unique<android::power::WakeLock>(lockid);
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, lockid);
 
     /* The init files are setup to stop the class main and late start when
      * vold sets trigger_shutdown_framework.
@@ -2255,6 +2254,7 @@
                 /* default encryption - continue first boot sequence */
                 property_set("ro.crypto.state", "encrypted");
                 property_set("ro.crypto.type", "block");
+                release_wake_lock(lockid);
                 if (rebootEncryption && crypt_ftr.crypt_type != CRYPT_TYPE_DEFAULT) {
                     // Bring up cryptkeeper that will check the password and set it
                     property_set("vold.decrypt", "trigger_shutdown_framework");
@@ -2291,6 +2291,7 @@
         } else {
             /* set property to trigger dialog */
             property_set("vold.encrypt_progress", "error_partially_encrypted");
+            release_wake_lock(lockid);
         }
         return -1;
     }
@@ -2300,10 +2301,14 @@
      * Set the property and return.  Hope the framework can deal with it.
      */
     property_set("vold.encrypt_progress", "error_reboot_failed");
+    release_wake_lock(lockid);
     return rc;
 
 error_unencrypted:
     property_set("vold.encrypt_progress", "error_not_encrypted");
+    if (lockid[0]) {
+        release_wake_lock(lockid);
+    }
     return -1;
 
 error_shutting_down:
@@ -2318,6 +2323,9 @@
 
     /* shouldn't get here */
     property_set("vold.encrypt_progress", "error_shutting_down");
+    if (lockid[0]) {
+        release_wake_lock(lockid);
+    }
     return -1;
 }
 
