Loading packages/Keyguard/src/com/android/keyguard/CarrierText.java +13 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import java.util.Locale; import android.content.Context; import android.content.res.TypedArray; import android.net.ConnectivityManager; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.text.TextUtils; Loading Loading @@ -140,15 +141,24 @@ public class CarrierText extends TextView { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (ConnectivityManager.from(mContext).isNetworkSupported( ConnectivityManager.TYPE_MOBILE)) { mKeyguardUpdateMonitor = KeyguardUpdateMonitor.getInstance(mContext); mKeyguardUpdateMonitor.registerCallback(mCallback); } else { // Don't listen and clear out the text when the device isn't a phone. mKeyguardUpdateMonitor = null; setText(""); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mKeyguardUpdateMonitor != null) { mKeyguardUpdateMonitor.removeCallback(mCallback); } } /** * Top-level function for creating carrier text. Makes text based on simState, PLMN Loading Loading
packages/Keyguard/src/com/android/keyguard/CarrierText.java +13 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import java.util.Locale; import android.content.Context; import android.content.res.TypedArray; import android.net.ConnectivityManager; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.text.TextUtils; Loading Loading @@ -140,15 +141,24 @@ public class CarrierText extends TextView { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (ConnectivityManager.from(mContext).isNetworkSupported( ConnectivityManager.TYPE_MOBILE)) { mKeyguardUpdateMonitor = KeyguardUpdateMonitor.getInstance(mContext); mKeyguardUpdateMonitor.registerCallback(mCallback); } else { // Don't listen and clear out the text when the device isn't a phone. mKeyguardUpdateMonitor = null; setText(""); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mKeyguardUpdateMonitor != null) { mKeyguardUpdateMonitor.removeCallback(mCallback); } } /** * Top-level function for creating carrier text. Makes text based on simState, PLMN Loading