import android.content.Context;
import android.support.annotation.VisibleForTesting;
+import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import java.util.Locale;
-import libcore.icu.ICU;
-
public class LocaleSetManager {
private static final String TAG = LocaleSetManager.class.getSimpleName();
// if our icu version has changed, return true
final String storedICUversion = PropertiesStore.getInstance(mContext)
.getProperty(PropertiesStore.DbProperties.ICU_VERSION);
- if (!ICU.getIcuVersion().equals(storedICUversion)) {
+ if (!String.valueOf(Build.VERSION.SDK_INT).equals(storedICUversion)) {
Log.d(TAG, "ICU version has changed from: " + storedICUversion + " to "
- + ICU.getIcuVersion());
+ + String.valueOf(Build.VERSION.SDK_INT));
return true;
}
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
+import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import java.util.Collection;
import java.util.List;
-import libcore.icu.ICU;
-
/**
* Because sqlite localized collator isn't sufficient, we need to store more specialized logic
* into our own db similar to contacts db. This is most noticeable in languages like Chinese,
// Update the ICU version used to generate the locale derived data
// so we can tell when we need to rebuild with new ICU versions.
+ // But assume that ICU versions are only able to change on Android version upgrades and
+ // use SDK INT as identifier.
PropertiesStore.getInstance(mContext).storeProperty(
- PropertiesStore.DbProperties.ICU_VERSION, ICU.getIcuVersion());
+ PropertiesStore.DbProperties.ICU_VERSION, String.valueOf(Build.VERSION.SDK_INT));
PropertiesStore.getInstance(mContext).storeProperty(PropertiesStore.DbProperties.LOCALE,
locales.toString());