Fix ICU-related failures in Robolectric.
A recent change to HostRuntime modified it to read the ICU data
file location from an android.os.SystemProperties using a native call instead of a java.lang.System property.
This breaks Robolectric tests which specify icu.data.path as a
java.lang.System property.
It appears layoutlib makes this work by calling back to Bridge.setSystemProperties from JNI *after* the native SystemProperties methods have been bound. It feels circular to add a JNI to java call just to avoid a JNI to java.lang.System.getProperty call.
This commit fixes the issue by falling back to read ICU data path from a java property if the android system property is not set.
This also refactors out a common getJavaProperty method.
Flag: NONE host-only change
Test: atest android.database.SQLiteDatabaseTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:990cc8ae811d581edfea8b540459f40e55e26ac9)
Merged-In: I728594fa3408d60fa4f199a72605f52db75dc205
Change-Id: I728594fa3408d60fa4f199a72605f52db75dc205
1 file changed