WAI
Status Update
Comments
ad...@google.com <ad...@google.com>
ad...@google.com <ad...@google.com> #2
We have passed this to the development team and will update this issue with more information as it becomes available.
ad...@google.com <ad...@google.com> #3
Thanks for the report. We heartfully agree with your assessment of the problem, and that fixing the bugs wouldn't really be useful.
That being said, we try to avoid deprecating classes without a replacement, and we don't think there is value in making one in this day and age. In documentation, we could advise developers to write their own code or use third party libraries, but it's not really useful to any developer who's been using this class for the parts that work.
So as sad as it is, we think the best course of action is probably not to do anything beyond maybe updating the documentation to explain the bugs.
Thank you very much for your contribution.
That being said, we try to avoid deprecating classes without a replacement, and we don't think there is value in making one in this day and age. In documentation, we could advise developers to write their own code or use third party libraries, but it's not really useful to any developer who's been using this class for the parts that work.
So as sad as it is, we think the best course of action is probably not to do anything beyond maybe updating the documentation to explain the bugs.
Thank you very much for your contribution.
Description
### Steps to reproduce the problem:
- Clone the Git repository at
- Run the tests with `gradlew connectedCheck`
### What happened:
The following mailto URIs are examples of URIs that are not parsed properly with `MailTo.parse()`:
1. `mailto:alice@example.com?body=a%26b` -> part of the body value is dropped
2. `mailto:alice@example.com?body=a%3Db` -> part of the body value is dropped
3. `mailto:alice@example.com?body=%2525` -> the body value is double decoded
4. `mailto:alice@example.com?body=one:two` -> neither the recipient nor the body is returned
### What (I think) the correct behavior should be:
The expected values can also be found in
1. The returned body value should be "a&b" instead of "a"
2. The returned body value should be "a=b" instead of "a"
3. The returned body value should be "%25" instead of "%"
4. The returned "to" recipient should be "alice@example.com", the returned body should be "one:two"
### Affected Android versions:
All of them (Android 1.5 - Android 10). The class `android.net.MailTo` hasn't been changed meaningfully since API 1.
### Related issues:
-
-
-
### Opinion:
Given that these bugs have been present in the `MailTo` class since the very first Android release, I don't think fixing them would do much good. It'd be years before apps used a `minSdkVersion` value high enough to be able to rely on the fixed platform version. Instead I think the class should be marked as deprecated.
If people really need to use the `MailTo` class (I believe the target audience for this class is very small), they can use my drop-in replacement where all of these bugs have been fixed: