-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up
Util.inferContentType
methods
This fixes some small niggles: 1. `inferContentType(String)` is documented to take a path, but in the tests we're passing full URIs. 2. A `String` parameter is usually a path, but also a MIME type or an extension. In the new methods, the meaning of a `String` parameter is always clear from the name of the method. 3. `inferContentType(String)` is always passed an extension in 'production' code (which has to be manually prefixed with a dot). 4. `inferContentType(Uri, @nullable String)` always ignores the Uri if the String is non-null. IMO this logic is clearer to a reader if it's just in-lined at the call-site. These methods are used from the demo apps, so will be part of the stable API. PiperOrigin-RevId: 444826053
- Loading branch information
Showing
6 changed files
with
141 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters