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

Commit 682afe07 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Fix handling for no default phone.

When there's no sub available the SubscriptionManager gives
DEFAULT_PHONE_INDEX when asking for the default phone.  Handle
that (gracefully do nothing).

bug:24939067
Change-Id: I43211b3026d358ec915d3426b0d89a1ac54c3cd5
parent 2cde5544
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -375,7 +375,7 @@ public class DctController extends Handler {
        //2-2. If no, set data not allow on the current PS subscription
        //2-2-1. Set data allow on the selected subscription

        int requestedPhoneId = getTopPriorityRequestPhoneId();
        final int requestedPhoneId = getTopPriorityRequestPhoneId();
        int activePhoneId = INVALID_PHONE_INDEX;

        for (int i=0; i<mDcSwitchStateMachine.length; i++) {
@@ -525,7 +525,12 @@ public class DctController extends Handler {
        } else {
            subId = Integer.parseInt(topSubId);
        }
        return mSubController.getPhoneId(subId);
        final int phoneId = mSubController.getPhoneId(subId);
        if (phoneId == DEFAULT_PHONE_INDEX) {
            // that means there isn't a phone for the default sub
            return INVALID_PHONE_INDEX;
        }
        return phoneId;
    }

    private void onSubInfoReady() {