diff options
| author | 2025-01-17 14:22:16 -0800 | |
|---|---|---|
| committer | 2025-01-17 14:22:16 -0800 | |
| commit | 6b80adecb6e1d4efb0344570cd3162898abd09cd (patch) | |
| tree | f46b47cb1633da15149f70e22e37512577e02c97 | |
| parent | 2bdcb10b5e1a7f802b078eba55cdf5378d79beea (diff) | |
Expect MCC/MNC to be an empty or null string
Bug: 372814636
Test: m
Flag: EXEMPT bugfix
Change-Id: I902948139b6ba7312c4c07b26272f8009e663368
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionInfo.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index d164c8851f5b..4b175c134d84 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -618,9 +618,9 @@ public class SubscriptionInfo implements Parcelable { @Deprecated public int getMcc() { try { - return mMcc == null ? 0 : Integer.parseInt(mMcc); + return TextUtils.isEmpty(mMcc) ? 0 : Integer.parseInt(mMcc); } catch (NumberFormatException e) { - Log.w(SubscriptionInfo.class.getSimpleName(), "MCC string is not a number"); + Log.w(SubscriptionInfo.class.getSimpleName(), "MCC string is not a number: " + mMcc); return 0; } } @@ -633,9 +633,9 @@ public class SubscriptionInfo implements Parcelable { @Deprecated public int getMnc() { try { - return mMnc == null ? 0 : Integer.parseInt(mMnc); + return TextUtils.isEmpty(mMnc) ? 0 : Integer.parseInt(mMnc); } catch (NumberFormatException e) { - Log.w(SubscriptionInfo.class.getSimpleName(), "MNC string is not a number"); + Log.w(SubscriptionInfo.class.getSimpleName(), "MNC string is not a number: " + mMnc); return 0; } } |