diff options
author | Jason Monk <jmonk@google.com> | 2015-02-26 23:47:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-26 23:47:27 +0000 |
commit | bd61b2a1fd6a8369a986a8bb1d840589b752c94e (patch) | |
tree | d6998c1bc956439cf3ae9c7ab47c3978bf37c685 /packages/Keyguard/src/com/android/keyguard | |
parent | c2f30a9df06caa2673a2192d175f62faea0310a4 (diff) | |
parent | 58ae213c3df42d9aa7501071a03460ff69ba44e2 (diff) | |
download | frameworks_base-bd61b2a1fd6a8369a986a8bb1d840589b752c94e.zip frameworks_base-bd61b2a1fd6a8369a986a8bb1d840589b752c94e.tar.gz frameworks_base-bd61b2a1fd6a8369a986a8bb1d840589b752c94e.tar.bz2 |
am 58ae213c: am 0ac63669: am 057fd382: am 9df42df2: Merge "Keyguard: Use plmn/spn broadcast when no SIMs" into lmp-mr1-dev
* commit '58ae213c3df42d9aa7501071a03460ff69ba44e2':
Keyguard: Use plmn/spn broadcast when no SIMs
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/CarrierText.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/packages/Keyguard/src/com/android/keyguard/CarrierText.java index c023dc6..ca947af 100644 --- a/packages/Keyguard/src/com/android/keyguard/CarrierText.java +++ b/packages/Keyguard/src/com/android/keyguard/CarrierText.java @@ -20,6 +20,8 @@ import java.util.List; import java.util.Locale; import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.content.res.TypedArray; import android.net.ConnectivityManager; import android.telephony.SubscriptionInfo; @@ -33,6 +35,7 @@ import android.widget.TextView; import com.android.internal.telephony.IccCardConstants; import com.android.internal.telephony.IccCardConstants.State; +import com.android.internal.telephony.TelephonyIntents; import com.android.internal.widget.LockPatternUtils; public class CarrierText extends TextView { @@ -122,10 +125,27 @@ public class CarrierText extends TextView { subs.get(0).getCarrierName()); } else { // We don't have a SubscriptionInfo to get the emergency calls only from. - // Lets just make it ourselves. + // Grab it from the old sticky broadcast if possible instead. We can use it + // here because no subscriptions are active, so we don't have + // to worry about MSIM clashing. + CharSequence text = + getContext().getText(com.android.internal.R.string.emergency_calls_only); + Intent i = getContext().registerReceiver(null, + new IntentFilter(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION)); + if (i != null) { + String spn = ""; + String plmn = ""; + if (i.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_SPN, false)) { + spn = i.getStringExtra(TelephonyIntents.EXTRA_SPN); + } + if (i.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_PLMN, false)) { + plmn = i.getStringExtra(TelephonyIntents.EXTRA_PLMN); + } + if (DEBUG) Log.d(TAG, "Getting plmn/spn sticky brdcst " + plmn + "/" + spn); + text = concatenate(plmn, spn); + } displayText = makeCarrierStringOnEmergencyCapable( - getContext().getText(R.string.keyguard_missing_sim_message_short), - getContext().getText(com.android.internal.R.string.emergency_calls_only)); + getContext().getText(R.string.keyguard_missing_sim_message_short), text); } } setText(displayText); |