summaryrefslogtreecommitdiff
path: root/telephony
diff options
context:
space:
mode:
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;
}
}