Merge "Remove the rename() interceptor"

This commit is contained in:
Eric Biggers
2019-06-25 18:33:00 +00:00
committed by Android (Google) Code Review

View File

@@ -189,7 +189,6 @@ import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.nio.file.Files;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -7293,24 +7292,6 @@ public final class ActivityThread extends ClientTransactionHandler {
super.remove(path);
}
}
@Override
public void rename(String oldPath, String newPath) throws ErrnoException {
try {
super.rename(oldPath, newPath);
} catch (ErrnoException e) {
if (e.errno == OsConstants.EXDEV) {
Log.v(TAG, "Recovering failed rename " + oldPath + " to " + newPath);
try {
Files.move(new File(oldPath).toPath(), new File(newPath).toPath());
} catch (IOException e2) {
throw e;
}
} else {
throw e;
}
}
}
}
public static void main(String[] args) {