UICC : discard language setting of SIM
duho.ro [Wed, 12 Nov 2014 04:16:39 +0000 (13:16 +0900)]
Some carrier card has incorrect language file.
This is to disable loading language setting from SIM card.

Bug: 18095177
Bug: 18108786
Change-Id: I40881fc64fea52480c968a18440740af9c8cff57

src/java/com/android/internal/telephony/uicc/RuimRecords.java
src/java/com/android/internal/telephony/uicc/SIMRecords.java

index 85792ba..57355ce 100644 (file)
@@ -36,6 +36,7 @@ import android.telephony.TelephonyManager;
 import android.telephony.Rlog;
 import android.text.TextUtils;
 import android.util.Log;
+import android.content.res.Resources;
 
 import com.android.internal.telephony.CommandsInterface;
 import com.android.internal.telephony.GsmAlphabet;
@@ -853,13 +854,16 @@ public final class RuimRecords extends IccRecords {
                 obtainMessage(EVENT_GET_ICCID_DONE));
         mRecordsToLoad++;
 
-        mFh.loadEFTransparent(EF_PL,
-                obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfPlLoaded()));
-        mRecordsToLoad++;
+        Resources resource = Resources.getSystem();
+        if (resource.getBoolean(com.android.internal.R.bool.config_use_sim_language_file)) {
+            mFh.loadEFTransparent(EF_PL,
+                    obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfPlLoaded()));
+            mRecordsToLoad++;
 
-        mFh.loadEFTransparent(EF_CSIM_LI,
-                obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimLiLoaded()));
-        mRecordsToLoad++;
+            mFh.loadEFTransparent(EF_CSIM_LI,
+                    obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimLiLoaded()));
+            mRecordsToLoad++;
+        }
 
         mFh.loadEFTransparent(EF_CSIM_SPN,
                 obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimSpnLoaded()));
index 7580110..f8fe606 100644 (file)
@@ -1503,6 +1503,12 @@ public class SIMRecords extends IccRecords {
     }
 
     private void loadEfLiAndEfPl() {
+        Resources resource = Resources.getSystem();
+        if (!resource.getBoolean(com.android.internal.R.bool.config_use_sim_language_file)) {
+            if (DBG) log ("Not using EF LI/EF PL");
+            return;
+        }
+
         if (mParentApp.getType() == AppType.APPTYPE_USIM) {
             mRecordsRequested = true;
             mFh.loadEFTransparent(EF_LI,