Merge "Add an isCheckpointing() binder call for adb remount." am: b50480bb96 am: 60e41b7084 am: 026ae1a9ac am: 3fe914dd6a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1330854
Change-Id: I3d88a258147fcc3b454e339d081159d46bd6f982
diff --git a/Checkpoint.cpp b/Checkpoint.cpp
index df5fc88..61035e5 100644
--- a/Checkpoint.cpp
+++ b/Checkpoint.cpp
@@ -294,6 +294,10 @@
return false;
}
+bool cp_isCheckpointing() {
+ return isCheckpointing;
+}
+
namespace {
const std::string kSleepTimeProp = "ro.sys.cp_msleeptime";
const uint32_t msleeptime_default = 1000; // 1 s
diff --git a/Checkpoint.h b/Checkpoint.h
index c1fb2b7..6f3acac 100644
--- a/Checkpoint.h
+++ b/Checkpoint.h
@@ -39,6 +39,8 @@
bool cp_needsCheckpoint();
+bool cp_isCheckpointing();
+
android::binder::Status cp_prepareCheckpoint();
android::binder::Status cp_restoreCheckpoint(const std::string& mountPoint, int count = 0);
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index ec46fac..241c2a0 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -809,6 +809,14 @@
return Ok();
}
+binder::Status VoldNativeService::isCheckpointing(bool* _aidl_return) {
+ ENFORCE_SYSTEM_OR_ROOT;
+ ACQUIRE_LOCK;
+
+ *_aidl_return = cp_isCheckpointing();
+ return Ok();
+}
+
binder::Status VoldNativeService::commitChanges() {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_LOCK;
diff --git a/VoldNativeService.h b/VoldNativeService.h
index e19d493..4436e30 100644
--- a/VoldNativeService.h
+++ b/VoldNativeService.h
@@ -139,6 +139,7 @@
binder::Status startCheckpoint(int32_t retry);
binder::Status needsCheckpoint(bool* _aidl_return);
binder::Status needsRollback(bool* _aidl_return);
+ binder::Status isCheckpointing(bool* _aidl_return);
binder::Status commitChanges();
binder::Status prepareCheckpoint();
binder::Status restoreCheckpoint(const std::string& mountPoint);
diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl
index 6d14959..54b86d0 100644
--- a/binder/android/os/IVold.aidl
+++ b/binder/android/os/IVold.aidl
@@ -115,6 +115,7 @@
void startCheckpoint(int retry);
boolean needsCheckpoint();
boolean needsRollback();
+ boolean isCheckpointing();
void abortChanges(in @utf8InCpp String device, boolean retry);
void commitChanges();
void prepareCheckpoint();