diff --git a/Checkpoint.cpp b/Checkpoint.cpp
index d9c0cd1..5d1ec1f 100644
--- a/Checkpoint.cpp
+++ b/Checkpoint.cpp
@@ -26,6 +26,7 @@
 #include <android-base/logging.h>
 #include <android-base/parseint.h>
 #include <android-base/unique_fd.h>
+#include <android/hardware/boot/1.0/IBootControl.h>
 #include <cutils/android_reboot.h>
 #include <fcntl.h>
 #include <fs_mgr.h>
@@ -34,6 +35,11 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 
+using android::hardware::hidl_string;
+using android::hardware::boot::V1_0::BoolResult;
+using android::hardware::boot::V1_0::IBootControl;
+using android::hardware::boot::V1_0::Slot;
+
 namespace android {
 namespace vold {
 
@@ -60,6 +66,14 @@
 bool cp_startCheckpoint(int retry) {
     if (retry < -1) return false;
     std::string content = std::to_string(retry);
+    if (retry == -1) {
+        sp<IBootControl> module = IBootControl::getService();
+        if (module) {
+            std::string suffix;
+            auto cb = [&suffix](hidl_string s) { suffix = s; };
+            if (module->getSuffix(module->getCurrentSlot(), cb).isOk()) content += " " + suffix;
+        }
+    }
     return android::base::WriteStringToFile(content, kMetadataCPFile);
 }
 
@@ -101,19 +115,35 @@
     android_reboot(ANDROID_RB_RESTART2, 0, nullptr);
 }
 
-bool cp_needRollback(const std::string& id) {
+bool cp_needsRollback() {
     std::string content;
     bool ret;
 
     ret = android::base::ReadFileToString(kMetadataCPFile, &content);
-    if (ret) return content == "0";
+    if (ret) {
+        if (content == "0") return true;
+        if (content.substr(0, 3) == "-1 ") {
+            std::string oldSuffix = content.substr(3);
+            sp<IBootControl> module = IBootControl::getService();
+            std::string newSuffix;
+
+            if (module) {
+                auto cb = [&newSuffix](hidl_string s) { newSuffix = s; };
+                module->getSuffix(module->getCurrentSlot(), cb);
+                if (oldSuffix == newSuffix) return true;
+            }
+        }
+    }
     return false;
 }
 
 bool cp_needsCheckpoint(void) {
     bool ret;
     std::string content;
+    sp<IBootControl> module = IBootControl::getService();
 
+    if (module && module->isSlotMarkedSuccessful(module->getCurrentSlot()) == BoolResult::FALSE)
+        return true;
     ret = android::base::ReadFileToString(kMetadataCPFile, &content);
     if (ret) return content != "0";
     return false;
@@ -297,8 +327,9 @@
     std::string oldContent, newContent;
     int retry = 0;
     if (!android::base::ReadFileToString(kMetadataCPFile, &oldContent)) return false;
+    std::string retryContent = oldContent.substr(0, oldContent.find_first_of(" "));
 
-    if (!android::base::ParseInt(oldContent, &retry)) return false;
+    if (!android::base::ParseInt(retryContent, &retry)) return false;
     if (retry > 0) retry--;
 
     newContent = std::to_string(retry);
