Skip to content
Browse files

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

* commit '4222180dd0d4f3e1f094bf72a78d6d88a876bac8':
  HTMLViewer could not open UTF-8 encoded file path.
  • Loading branch information...
2 parents 958d752 + 4222180 commit e688d4d402ed98a6c82a1706c16894e6d59f458d John Reck committed with Android Git Automerger
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 e688d4d

Please sign in to comment.
Something went wrong with that request. Please try again.