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

Commit 1321ae8e authored by Etan Cohen's avatar Etan Cohen Committed by Wink Saville
Browse files

DctController onSettingsChange race condition with active phone ID - crash (NPE).

Change-Id: I84d8e97a9854638fb78b4c68ae9248188de5f57c
parent 8fdd68af
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -378,9 +378,8 @@ public class DctController extends Handler {
    }

    private void onSettingsChange() {
        long dataSubId = SubscriptionManager.INVALID_SUB_ID;
        //Sub Selection
        dataSubId = mSubController.getDefaultDataSubId();
        long dataSubId = mSubController.getDefaultDataSubId();

        int activePhoneId = -1;
        for (int i=0; i<mDcSwitchState.length; i++) {
@@ -391,6 +390,10 @@ public class DctController extends Handler {
        }

        long[] subIds = SubscriptionManager.getSubId(activePhoneId);
        if (subIds ==  null || subIds.length == 0) {
            loge("onSettingsChange, subIds null or length 0 for activePhoneId " + activePhoneId);
            return;
        }
        logd("onSettingsChange, data sub: " + dataSubId + ", active data sub: " + subIds[0]);

        if (subIds[0] != dataSubId) {