aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-11-29 23:38:49 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-11-29 23:38:49 +0000
commitb07d12e1bc0772f8826aa2f7b3659e63126da697 (patch)
tree921405828694cfcf3c5479937d3317c05aaecefb
parent45c2f21a66a6152000dacfd72e6cec3652194ecd (diff)
parent71f93d89cbd4088c14900fd9523f9eb6189ffb27 (diff)
downloadandroid_packages_apps_CMFileManager-b07d12e1bc0772f8826aa2f7b3659e63126da697.tar.gz
android_packages_apps_CMFileManager-b07d12e1bc0772f8826aa2f7b3659e63126da697.tar.bz2
android_packages_apps_CMFileManager-b07d12e1bc0772f8826aa2f7b3659e63126da697.zip
Merge "CMFM: Fix move infinite loop" into cm-10.2
-rw-r--r--src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
index c2923f3e..33e0b985 100644
--- a/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
+++ b/src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
@@ -349,7 +349,6 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
* @param dst The destination file
* @param operation Indicates the operation to do
*/
- @SuppressWarnings("hiding")
private void doOperation(
Context ctx, File src, File dst, COPY_MOVE_OPERATION operation)
throws Throwable {
@@ -357,18 +356,23 @@ public final class CopyMoveActionPolicy extends ActionsPolicy {
if (src.compareTo(dst) == 0) return;
try {
+ // Be sure to append a / if source is a folder (otherwise system crashes
+ // under using absolute paths) Issue: CYAN-2791
+ String source = src.getAbsolutePath() +
+ (src.isDirectory() ? File.separator : "");
+
// Copy or move?
if (operation.compareTo(COPY_MOVE_OPERATION.MOVE) == 0 ||
operation.compareTo(COPY_MOVE_OPERATION.RENAME) == 0) {
CommandHelper.move(
ctx,
- src.getAbsolutePath(),
+ source,
dst.getAbsolutePath(),
null);
} else {
CommandHelper.copy(
ctx,
- src.getAbsolutePath(),
+ source,
dst.getAbsolutePath(),
null);
}