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

Commit c70a5888 authored by Jordan Liu's avatar Jordan Liu Committed by Gerrit Code Review
Browse files

Merge "Add null guard and wtf log to getSubId"

parents 4a5499ed 4b5d7329
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3134,6 +3134,13 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * Returns the subscription id.
     */
    public int getSubId() {
        if (SubscriptionController.getInstance() == null) {
            // TODO b/78359408 getInstance sometimes returns null in Treehugger tests, which causes
            // flakiness. Even though we haven't seen this crash in the wild we should keep this
            // check in until we've figured out the root cause.
            Rlog.e(LOG_TAG, "SubscriptionController.getInstance = null! Returning default subId");
            return SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
        }
        return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
    }