Loading packages/Keyguard/src/com/android/keyguard/CarrierText.java +23 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 { Loading Loading @@ -120,10 +123,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); Loading Loading
packages/Keyguard/src/com/android/keyguard/CarrierText.java +23 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 { Loading Loading @@ -120,10 +123,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); Loading