diff options
author | Tobias Thierer <tobiast@google.com> | 2019-08-18 15:19:45 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2019-08-21 14:46:50 +0100 |
commit | 53f15f39f82ef4c4bd99c6d22f3563bae0c35269 (patch) | |
tree | f1f711cc5f2bb2e105ab42eadbc22286dd582d21 /opengl/java | |
parent | 4c322503bb6ad612970d64f7d4f29ca6d2d1f1b0 (diff) |
Move default MimeMap implementation to frameworks.
This CL topic moves the default MimeMap implementation to frameworks.
Libcore starts with a minimal implementation sufficient to pass
CtsLibcoreTestCases, but frameworks can inject the real implementation.
Before this CL topic, the data files and logic (MimeMapImpl) were part of
core-*.jar on device; after this CL, they instead live in framework.jar.
Tests from MimeMapTest that check behavior of that default
implementation also move to a non-libcore CTS test.
Specifically, the logic and android.mime.types now live in
frameworks/base/mime. The default implementation is injected
into libcore from RuntimeInit. I chose to use a separate directory
(frameworks/base/mime/) and build java_library target ("mimemap")
in order to keep this as separate as possible from the rest of
frameworks code, to make it as easy as possible to factor this
out into a separate APEX module if we ever choose to do so.
Planned work for follow-up CL:
1. Make CTS more opinionated, with a plan to assert that all of
the default mappings are present. How exactly the expectated
mapping will be bundled in CTS is still TBD.
2. Add a vendor.mime.types file (defaults to empty) where vendors
can add additional mappings; I plan to make it such that mappings
in that file are parsed last but never override any earlier
mappings, as if each mime type / file extension was prefixed
with '?'.
3. Perhaps enforce that public APIs android.webkit.MimeTypeMap
and java.net.URLConnection.getFileNameMap() behave consistently
with MimeMap.getDefault().
Test: atest CtsLibcoreTestCases
Test: atest CtsMimeMapTestCases
Bug: 136256059
Change-Id: Ib955699694d24a25c33ef2445443afb7c35ed9e7
Diffstat (limited to 'opengl/java')
0 files changed, 0 insertions, 0 deletions