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

Commit 14c5ea7b authored by Peter Wang's avatar Peter Wang Committed by Android (Google) Code Review
Browse files

Merge "Hide unprovisioned MDN (phone number) at select profile dialog" into rvc-dev

parents 5acd959e 2fa2d083
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Bundle;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
@@ -179,11 +180,16 @@ public class SimListDialogFragment extends SimDialogFragment implements
                        Utils.getColorAttr(mContext, android.R.attr.textColorSecondary));
                        Utils.getColorAttr(mContext, android.R.attr.textColorSecondary));
            } else {
            } else {
                title.setText(sub.getDisplayName());
                title.setText(sub.getDisplayName());
                summary.setText(sub.getNumber());
                summary.setText(isMdnProvisioned(sub.getNumber()) ? sub.getNumber() : "");
                icon.setImageBitmap(sub.createIconBitmap(mContext));
                icon.setImageBitmap(sub.createIconBitmap(mContext));


            }
            }
            return convertView;
            return convertView;
        }
        }

        // An MDN is considered not provisioned if it's empty or all 0's
        private boolean isMdnProvisioned(String mdn) {
            return !(TextUtils.isEmpty(mdn) || mdn.matches("[\\D0]+"));
        }
    }
    }
}
}