Permalink
Browse files

Merge "HTMLViewer could not open UTF-8 encoded file path."

  • Loading branch information...
2 parents 78afabc + 0207e4a commit 4222180dd0d4f3e1f094bf72a78d6d88a876bac8 John Reck committed with android code review Aug 31, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/com/android/htmlviewer/FileContentProvider.java
View
3 src/com/android/htmlviewer/FileContentProvider.java
@@ -38,7 +38,6 @@
public static final String BASE_URI =
"content://com.android.htmlfileprovider";
- public static final int BASE_URI_LEN = BASE_URI.length();
@Override
public String getType(Uri uri) {
@@ -57,7 +56,7 @@ public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundEx
if (!"r".equals(mode)) {
throw new FileNotFoundException("Bad mode for " + uri + ": " + mode);
}
- String filename = uri.toString().substring(BASE_URI_LEN);
+ String filename = uri.getPath();
return ParcelFileDescriptor.open(new File(filename),
ParcelFileDescriptor.MODE_READ_ONLY);
}

0 comments on commit 4222180

Please sign in to comment.