Remove the rename() interceptor

Remove the rename() interceptor which was added by change
I7f4461bcacada80398eb95d051a0d29456f63499, since the design of scoped
storage was changed to not use bind mounts.  So, the reason for adding
the rename() interceptor in the first place no longer exists.

Bug: 131115422
Bug: 135278311
Test: atest android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageRename
Change-Id: I0f9ac456104759887c0410fe64acc32cab19b62b
This commit is contained in:
Eric Biggers
2019-06-24 11:13:20 -07:00
parent 8ccd63b057
commit 4d556c3f37

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) {