diff options
author | John Wang <johnwang@google.com> | 2010-01-28 10:47:27 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-01-28 10:47:27 -0800 |
commit | 5bb33718236cee8dea9457ffa5ba99ba930ac9ab (patch) | |
tree | c0fb6ce2540bcb77e8425c954c3524f5d1399af3 /telephony/java/com | |
parent | f95a61746e72ba6fce6afb5b94f2ff051af681b9 (diff) | |
parent | 89fec7b155981d6e99eb1e05793f343a5d04aa59 (diff) | |
download | frameworks_base-5bb33718236cee8dea9457ffa5ba99ba930ac9ab.zip frameworks_base-5bb33718236cee8dea9457ffa5ba99ba930ac9ab.tar.gz frameworks_base-5bb33718236cee8dea9457ffa5ba99ba930ac9ab.tar.bz2 |
am 89fec7b1: am 098295a5: Merge "Updated emergency string when locale changes." into eclair
Merge commit '89fec7b155981d6e99eb1e05793f343a5d04aa59'
* commit '89fec7b155981d6e99eb1e05793f343a5d04aa59':
Updated emergency string when locale changes.
Diffstat (limited to 'telephony/java/com')
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java index f61c9a4..917fbfe 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java @@ -20,9 +20,12 @@ import android.app.AlarmManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; +import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; +import android.content.res.Resources; import android.database.ContentObserver; import android.os.AsyncResult; import android.os.Handler; @@ -166,6 +169,16 @@ final class GsmServiceStateTracker extends ServiceStateTracker { static final int MAX_NUM_DATA_STATE_READS = 15; + private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (intent.getAction().equals(Intent.ACTION_LOCALE_CHANGED)) { + // update emergency string whenever locale changed + updateSpnDisplay(); + } + } + }; + private ContentObserver mAutoTimeObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { @@ -211,6 +224,11 @@ final class GsmServiceStateTracker extends ServiceStateTracker { mAutoTimeObserver); setSignalStrengthDefaultValues(); mNeedToRegForSimLoaded = true; + + // Monitor locale change + IntentFilter filter = new IntentFilter(); + filter.addAction(Intent.ACTION_LOCALE_CHANGED); + phone.getContext().registerReceiver(mIntentReceiver, filter); } public void dispose() { @@ -567,20 +585,18 @@ final class GsmServiceStateTracker extends ServiceStateTracker { // For emergency calls only, pass the EmergencyCallsOnly string via EXTRA_PLMN if (mEmergencyOnly && cm.getRadioState().isOn()) { - plmn = phone.getContext().getText(com.android.internal.R.string.emergency_calls_only).toString(); + plmn = Resources.getSystem(). + getText(com.android.internal.R.string.emergency_calls_only).toString(); } if (rule != curSpnRule || !TextUtils.equals(spn, curSpn) || !TextUtils.equals(plmn, curPlmn)) { - boolean showSpn = - (rule & SIMRecords.SPN_RULE_SHOW_SPN) == SIMRecords.SPN_RULE_SHOW_SPN; + boolean showSpn = mEmergencyOnly + || (rule & SIMRecords.SPN_RULE_SHOW_SPN) == SIMRecords.SPN_RULE_SHOW_SPN; boolean showPlmn = (rule & SIMRecords.SPN_RULE_SHOW_PLMN) == SIMRecords.SPN_RULE_SHOW_PLMN; - if (mEmergencyOnly) - showPlmn = true; - Intent intent = new Intent(Intents.SPN_STRINGS_UPDATED_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); intent.putExtra(Intents.EXTRA_SHOW_SPN, showSpn); |