Revert "Revert "Fix bug #12422326 Unable to change text direction programmatically using setTextDirection Android SDK API - DO NOT MERGE""

This reverts commit 00977d59a00dd7e01c6c31e1383951b29a0fa6b7.
base: DocumentUI: handle NPE gracefully

http://jira.omnirom.org/browse/OMNI-956

Change-Id: I8d50d71a9c91486dfc9e5da01538c6b5a626f054