OSDN Git Service

Localization: do not use private ICU APIs
[android-x86/packages-apps-Eleven.git] / src / org / lineageos / eleven / provider / LocalizedStore.java
index 363ae20..76c7ea3 100644 (file)
@@ -19,6 +19,7 @@ import android.content.ContentValues;
 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;
@@ -38,8 +39,6 @@ import java.util.ArrayList;
 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,
@@ -178,8 +177,10 @@ public class LocalizedStore {
 
             // 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());