Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b80adec authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Expect MCC/MNC to be an empty or null string

Bug: 372814636
Test: m
Flag: EXEMPT bugfix
Change-Id: I902948139b6ba7312c4c07b26272f8009e663368
parent 2bdcb10b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
        }
    }