summaryrefslogtreecommitdiff
path: root/telephony
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-04 00:21:52 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-04 00:21:52 -0800
commit654205b32bb852f7eec5bf23fee26d3f13290b0a (patch)
tree99848d8978425e9bb96b32626272624f336e113b /telephony
parentc7c29d5485899f635f86a4031557a7e5b82f3772 (diff)
parent6b80adecb6e1d4efb0344570cd3162898abd09cd (diff)
Merge "Expect MCC/MNC to be an empty or null string" into main
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/SubscriptionInfo.java8
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;
}
}