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

Commit 80cdd701 authored by Meng Wang's avatar Meng Wang Committed by Automerger Merge Worker
Browse files

Merge "Defend against invalid subId in setPhoneNumberForSourceIms" am:...

Merge "Defend against invalid subId in setPhoneNumberForSourceIms" am: 281485c4 am: 87b015d6 am: abf1532b

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1983928

Change-Id: Idf1b287a8743d8755b8e02ff118719516d08e9e3
parents fa975da8 abf1532b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2511,8 +2511,15 @@ public class ImsPhone extends ImsPhoneBase {
        if (phoneNumber == null) {
            return;
        }
        SubscriptionController subController = SubscriptionController.getInstance();
        int subId = getSubId();
        if (!SubscriptionManager.isValidSubscriptionId(subId)) {
            // Defending b/219080264:
            // SubscriptionController.setSubscriptionProperty validates input subId
            // so do not proceed if subId invalid. This may be happening because cached
            // IMS callbacks are sent back to telephony after SIM state changed.
            return;
        }
        SubscriptionController subController = SubscriptionController.getInstance();
        String countryIso = getCountryIso(subController, subId);
        // Format the number as one more defense to reject garbage values:
        // phoneNumber will become null.