summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-10-14 23:12:04 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-10-14 23:12:04 +0000
commita6d19c7c0655c08b35143f64ed702865e528d07c (patch)
tree079beac2b7d1e6288e5d7dbc80624d84be05ecc7
parent76c0c8b4bc09caf87b8dd338d90aab772e5422d4 (diff)
parent3cabda015d88c6f09b4cd74f68912fc1bbf3d945 (diff)
Snap for 6906085 from 3cabda015d88c6f09b4cd74f68912fc1bbf3d945 to rvc-qpr2-release
Change-Id: I3de2e14144c3543043f9728dbe7d04b43c8d3189
-rw-r--r--src/com/android/providers/media/MediaProvider.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index 772ee64e..0be8891d 100644
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -2074,7 +2074,8 @@ public class MediaProvider extends ContentProvider {
// Rename not allowed on paths that can't be translated to RELATIVE_PATH.
Log.e(TAG, errorMessage + "Invalid path.");
return OsConstants.EPERM;
- } else if (oldRelativePath.length == 1 && TextUtils.isEmpty(oldRelativePath[0])) {
+ }
+ if (oldRelativePath.length == 1 && TextUtils.isEmpty(oldRelativePath[0])) {
// Allow rename of files/folders other than default directories.
final String displayName = extractDisplayName(oldPath);
for (String defaultFolder : sDefaultFolderNames) {
@@ -2084,7 +2085,8 @@ public class MediaProvider extends ContentProvider {
return OsConstants.EPERM;
}
}
- } else if (newRelativePath.length == 1 && TextUtils.isEmpty(newRelativePath[0])) {
+ }
+ if (newRelativePath.length == 1 && TextUtils.isEmpty(newRelativePath[0])) {
Log.e(TAG, errorMessage + newPath + " is in root folder."
+ " Renaming a file/directory to root folder is not allowed");
return OsConstants.EPERM;