|
|
|
@ -182,8 +182,11 @@ void MoveTask::run() {
|
|
|
|
|
|
|
|
|
|
// Step 1: tear down volumes and mount silently without making
|
|
|
|
|
// visible to userspace apps
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(VolumeManager::Instance()->getLock());
|
|
|
|
|
bringOffline(mFrom);
|
|
|
|
|
bringOffline(mTo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fromPath = mFrom->getInternalPath();
|
|
|
|
|
toPath = mTo->getInternalPath();
|
|
|
|
@ -201,8 +204,11 @@ void MoveTask::run() {
|
|
|
|
|
// NOTE: MountService watches for this magic value to know
|
|
|
|
|
// that move was successful
|
|
|
|
|
notifyProgress(82);
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(VolumeManager::Instance()->getLock());
|
|
|
|
|
bringOnline(mFrom);
|
|
|
|
|
bringOnline(mTo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 4: clean up old data
|
|
|
|
|
if (execRm(fromPath, 85, 15) != OK) {
|
|
|
|
@ -213,8 +219,11 @@ void MoveTask::run() {
|
|
|
|
|
release_wake_lock(kWakeLock);
|
|
|
|
|
return;
|
|
|
|
|
fail:
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(VolumeManager::Instance()->getLock());
|
|
|
|
|
bringOnline(mFrom);
|
|
|
|
|
bringOnline(mTo);
|
|
|
|
|
}
|
|
|
|
|
notifyProgress(kMoveFailedInternalError);
|
|
|
|
|
release_wake_lock(kWakeLock);
|
|
|
|
|
return;
|
|
|
|
|