Fix PrintStream ctor ignoring Charset parameter.

Libcore commit de626ec8a109ea18283d96c720cc57e2f32f67fa
changed PrintStream's fields charOut and textOut to be
lazily initialized from a (new) field charset, but
forgot to initialize that field in the constructor.

That lead to PrintStream always using the system default
encoding (UTF-8 on Android) when writing character data,
rather than the specified charset.

This CL fixes the PrintStream constructor to initialize
the charset field. It also tweaks the Android-changed
comments, and adds tests for the previously buggy ctor.

Since the original CL didn't specify a reason, it's not
clear why the change was made. It may be possible to
revert the entire change in future, or to contribute it
back to upstream.

Bug: 37313782
Test: PrintStreamTest

Change-Id: I80f9bc4e5a6f0b84867e402930dd517062169342
2 files changed