diff options
| author | 2024-08-06 17:40:56 +0000 | |
|---|---|---|
| committer | 2024-10-11 15:39:23 +0000 | |
| commit | 2b592f4ed64f6f38b3d7043fcb8b6874c52d5c99 (patch) | |
| tree | 22c9dc7d8a8530a7556aa55dd14796eef44e67d7 /libs/androidfw/StringPool.cpp | |
| parent | d6a86e849982b07432eecc452fd2178d9149a455 (diff) | |
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
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions