Use TextDirectionHeuristics to detect text direction in Html

Previously, AndroidBidi was used instead, whch did a lot of extra work
just to detect a paragraph's direction. TextDirectionHeuristics stops as
soon as the direction is found, and avoids JNI too.

Bug: 21455837
Test: cts-tradefed run cts-dev --module CtsTextTestCases --test android.text.cts.HtmlTest
Change-Id: Iea196fb5ca43dca99e65a367a2da701b1c1b98b8
1 file changed