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

Commit 08d40bc3 authored by Etan Cohen's avatar Etan Cohen
Browse files

Do not update RAF for invalid sub IDs.

Bug: 22076899
Change-Id: I44c6744d6464d13a0803a6480ee72f07bda7c087
parent ac464da4
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -618,7 +618,6 @@ public class ProxyController {
        int maxNumRafBit = 0;
        int maxRaf = RadioAccessFamily.RAF_UNKNOWN;

        int number;
        for (int len = 0; len < mProxyPhones.length; len++) {
            numRafSupported[len] = Integer.bitCount(mProxyPhones[len].getRadioAccessFamily());
            if (maxNumRafBit < numRafSupported[len]) {
@@ -637,7 +636,6 @@ public class ProxyController {
        int minNumRafBit = 0;
        int minRaf = RadioAccessFamily.RAF_UNKNOWN;

        int number;
        for (int len = 0; len < mProxyPhones.length; len++) {
            numRafSupported[len] = Integer.bitCount(mProxyPhones[len].getRadioAccessFamily());
            if ((minNumRafBit == 0) || (minNumRafBit > numRafSupported[len])) {
+7 −1
Original line number Diff line number Diff line
@@ -1414,6 +1414,7 @@ public class SubscriptionController extends ISub.Stub {
        if (SubscriptionManager.isValidSubscriptionId(subId)) {
            // Only re-map modems if the new default data sub is valid
            RadioAccessFamily[] rafs = new RadioAccessFamily[len];
            boolean atLeastOneMatch = false;
            for (int phoneId = 0; phoneId < len; phoneId++) {
                PhoneProxy phone = sProxyPhones[phoneId];
                int raf;
@@ -1421,6 +1422,7 @@ public class SubscriptionController extends ISub.Stub {
                if (id == subId) {
                    // TODO Handle the general case of N modems and M subscriptions.
                    raf = proxyController.getMaxRafSupported();
                    atLeastOneMatch = true;
                } else {
                    // TODO Handle the general case of N modems and M subscriptions.
                    raf = proxyController.getMinRafSupported();
@@ -1428,7 +1430,11 @@ public class SubscriptionController extends ISub.Stub {
                logdl("[setDefaultDataSubId] phoneId=" + phoneId + " subId=" + id + " RAF=" + raf);
                rafs[phoneId] = new RadioAccessFamily(phoneId, raf);
            }
            if (atLeastOneMatch) {
                proxyController.setRadioCapability(rafs);
            } else {
                if (DBG) logdl("[setDefaultDataSubId] no valid subId's found - not updating.");
            }
        }

        // FIXME is this still needed?