Merge "Start primary storage move outside lock." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a3290363e1
@@ -2030,6 +2030,9 @@ class MountService extends IMountService.Stub
|
|||||||
enforcePermission(android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS);
|
enforcePermission(android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS);
|
||||||
waitForReady();
|
waitForReady();
|
||||||
|
|
||||||
|
final VolumeInfo from;
|
||||||
|
final VolumeInfo to;
|
||||||
|
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (Objects.equals(mPrimaryStorageUuid, volumeUuid)) {
|
if (Objects.equals(mPrimaryStorageUuid, volumeUuid)) {
|
||||||
throw new IllegalArgumentException("Primary storage already at " + volumeUuid);
|
throw new IllegalArgumentException("Primary storage already at " + volumeUuid);
|
||||||
@@ -2049,10 +2052,11 @@ class MountService extends IMountService.Stub
|
|||||||
onMoveStatusLocked(MOVE_STATUS_COPY_FINISHED);
|
onMoveStatusLocked(MOVE_STATUS_COPY_FINISHED);
|
||||||
onMoveStatusLocked(PackageManager.MOVE_SUCCEEDED);
|
onMoveStatusLocked(PackageManager.MOVE_SUCCEEDED);
|
||||||
mHandler.obtainMessage(H_RESET).sendToTarget();
|
mHandler.obtainMessage(H_RESET).sendToTarget();
|
||||||
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
final VolumeInfo from = findStorageForUuid(mPrimaryStorageUuid);
|
from = findStorageForUuid(mPrimaryStorageUuid);
|
||||||
final VolumeInfo to = findStorageForUuid(volumeUuid);
|
to = findStorageForUuid(volumeUuid);
|
||||||
|
|
||||||
if (from == null) {
|
if (from == null) {
|
||||||
Slog.w(TAG, "Failing move due to missing from volume " + mPrimaryStorageUuid);
|
Slog.w(TAG, "Failing move due to missing from volume " + mPrimaryStorageUuid);
|
||||||
@@ -2063,14 +2067,14 @@ class MountService extends IMountService.Stub
|
|||||||
onMoveStatusLocked(PackageManager.MOVE_FAILED_INTERNAL_ERROR);
|
onMoveStatusLocked(PackageManager.MOVE_FAILED_INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
mConnector.execute("volume", "move_storage", from.id, to.id);
|
|
||||||
} catch (NativeDaemonConnectorException e) {
|
|
||||||
throw e.rethrowAsParcelableException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
mConnector.execute("volume", "move_storage", from.id, to.id);
|
||||||
|
} catch (NativeDaemonConnectorException e) {
|
||||||
|
throw e.rethrowAsParcelableException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user