Loading src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java +9 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static com.android.internal.telephony.cdnr.EfData.EF_SOURCE_VOICE_OPERATO import android.annotation.NonNull; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; Loading Loading @@ -340,8 +341,14 @@ public class CarrierDisplayNameResolver { CarrierDisplayNameData rawCarrierDisplayNameData) { PersistableBundle config = getCarrierConfig(); boolean useRootLocale = config.getBoolean(CarrierConfigManager.KEY_WFC_SPN_USE_ROOT_LOCALE); Resources r = mContext.getResources(); if (useRootLocale) r.getConfiguration().setLocale(Locale.ROOT); Context displayNameContext = mContext; if (useRootLocale) { Configuration displayNameConfig = mContext.getResources().getConfiguration(); displayNameConfig.setLocale(Locale.ROOT); // Create a new Context for this temporary change displayNameContext = mContext.createConfigurationContext(displayNameConfig); } Resources r = displayNameContext.getResources(); String[] wfcSpnFormats = r.getStringArray(com.android.internal.R.array.wfcSpnFormats); WfcCarrierNameFormatter wfcFormatter = new WfcCarrierNameFormatter(config, wfcSpnFormats, getServiceState().getState() == ServiceState.STATE_POWER_OFF); Loading Loading
src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java +9 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static com.android.internal.telephony.cdnr.EfData.EF_SOURCE_VOICE_OPERATO import android.annotation.NonNull; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; Loading Loading @@ -340,8 +341,14 @@ public class CarrierDisplayNameResolver { CarrierDisplayNameData rawCarrierDisplayNameData) { PersistableBundle config = getCarrierConfig(); boolean useRootLocale = config.getBoolean(CarrierConfigManager.KEY_WFC_SPN_USE_ROOT_LOCALE); Resources r = mContext.getResources(); if (useRootLocale) r.getConfiguration().setLocale(Locale.ROOT); Context displayNameContext = mContext; if (useRootLocale) { Configuration displayNameConfig = mContext.getResources().getConfiguration(); displayNameConfig.setLocale(Locale.ROOT); // Create a new Context for this temporary change displayNameContext = mContext.createConfigurationContext(displayNameConfig); } Resources r = displayNameContext.getResources(); String[] wfcSpnFormats = r.getStringArray(com.android.internal.R.array.wfcSpnFormats); WfcCarrierNameFormatter wfcFormatter = new WfcCarrierNameFormatter(config, wfcSpnFormats, getServiceState().getState() == ServiceState.STATE_POWER_OFF); Loading