From 4d556c3f37756be7ae910b64709c0737912e39b8 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 24 Jun 2019 11:13:20 -0700 Subject: [PATCH] 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 --- core/java/android/app/ActivityThread.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 6b931b8fb26ee..5ab694faca64c 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -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) {