-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Froyo. #12
Support Froyo. #12
Conversation
try { | ||
return new String(out, 0, index, "US-ASCII"); | ||
} catch (UnsupportedEncodingException e) { | ||
throw new AssertionError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why AssertionError, and why not wrap e?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AssertionError means 'this code is unreachable'. I could wrap 'e' but it's mostly academic; because the code is unreachable. This would only trigger on a hypothetical runtime that doesn't include the "US-ASCII" charset, a charset that's required by the spec. (similarly for ISO-8859-1 and UTF-8).
That said, I do like including the 'e' so I'll fix that.
This makes a bunch of sad changes for compatibility: - Using String.length() rather than String.isEmpty() - Using String.getBytes(String) rather than String.getBytes(Charset) - Using new String(..., String) rather than new String(..., Charset) - Avoiding TimeUnit.DAYS I've tested this and the HTTP tests run perfectly fine on Froyo. The HTTPS tests time out due to a bug in Froyo that prevents its TLS library from working as a server. I manually verified that TLS works as a client without problem. I also tested this on Gingerbread. It passes all tests except for testConnectViaHttpProxyToHttpsUsingProxySystemProperty, which fails because of a bug in Gingerbread's java.net.ProxySelector. This change introduces caching reflective objects for NPN access. That'll make clients that make multiple SSL connections slightly more efficient.
This makes a bunch of sad changes for compatibility:
I've tested this and the HTTP tests run perfectly fine on Froyo.
The HTTPS tests time out due to a bug in Froyo that prevents
its TLS library from working as a server. I manually verified
that TLS works as a client without problem.
I also tested this on Gingerbread. It passes all tests except
for testConnectViaHttpProxyToHttpsUsingProxySystemProperty, which
fails because of a bug in Gingerbread's java.net.ProxySelector.
This change introduces caching reflective objects for NPN access.
That'll make clients that make multiple SSL connections slightly
more efficient.