Commit ef01c1ef authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Commit Bot

Fix Log usage in ContentUriUtils.java

I removed "import android.util.Log;" from ContentUriUtils.java in
crrev.com/c/1788428. So org.chromium.base.Log is used for logging in the file.
org.chromium.base.Log uses the second argument to call String.format().
So this may cause UnknownFormatConversionException if the second argument
contains format specifiers.

Bug: 995177
Change-Id: I032a83828dac43d99097727788cedae5d80e172f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795529
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695176}
parent 7270a493
......@@ -20,7 +20,6 @@ import android.webkit.MimeTypeMap;
import org.chromium.base.annotations.CalledByNative;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
......@@ -165,12 +164,8 @@ public abstract class ContentUriUtils {
return new AssetFileDescriptor(pfd, 0, AssetFileDescriptor.UNKNOWN_LENGTH);
}
}
} catch (FileNotFoundException e) {
Log.w(TAG, "Cannot find content uri: " + uriString, e);
} catch (SecurityException e) {
Log.w(TAG, "Cannot open content uri: " + uriString, e);
} catch (Exception e) {
Log.w(TAG, "Unknown content uri: " + uriString, e);
Log.w(TAG, "Cannot open content uri: %s", uriString, e);
}
return null;
}
......@@ -238,7 +233,7 @@ public abstract class ContentUriUtils {
// There are a few Exceptions we can hit here (e.g. SecurityException), but we don't
// particularly care what kind of Exception we hit. If we hit one, just don't return a
// display name.
Log.w(TAG, "Cannot open content uri: " + uriString, e);
Log.w(TAG, "Cannot open content uri: %s", uriString, e);
}
// If we are unable to query the content URI, just return null.
......@@ -323,7 +318,7 @@ public abstract class ContentUriUtils {
}
} catch (IllegalArgumentException e) {
// This happens when the given File is outside the paths supported by the provider.
Log.e(TAG, "Cannot retrieve content uri from file: " + filePathString, e);
Log.e(TAG, "Cannot retrieve content uri from file: %s", filePathString, e);
}
return null;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment