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

Commit 2758d200 authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "Remove DummySubIds" am: 5b7f0fe4

am: 46709523

Change-Id: I675989aec0aec968e469b023c7979d2aa5361460
parents 6c13d607 46709523
Loading
Loading
Loading
Loading
+4 −25
Original line number Diff line number Diff line
@@ -1447,10 +1447,10 @@ public class SubscriptionController extends ISub.Stub {
        int size = sSlotIndexToSubId.size();
        if (size == 0) {
            if (VDBG) {
                logd("[getSubId]- sSlotIndexToSubId.size == 0, return DummySubIds slotIndex="
                logd("[getSubId]- sSlotIndexToSubId.size == 0, return null slotIndex="
                        + slotIndex);
            }
            return getDummySubIds(slotIndex);
            return null;
        }

        // Create an array of subIds that are in this slot?
@@ -1473,8 +1473,8 @@ public class SubscriptionController extends ISub.Stub {
            if (VDBG) logd("[getSubId]- subIdArr=" + subIdArr);
            return subIdArr;
        } else {
            if (DBG) logd("[getSubId]- numSubIds == 0, return DummySubIds slotIndex=" + slotIndex);
            return getDummySubIds(slotIndex);
            if (DBG) logd("[getSubId]- numSubIds == 0, return null slotIndex=" + slotIndex);
            return null;
        }
    }

@@ -1522,27 +1522,6 @@ public class SubscriptionController extends ISub.Stub {

    }

    private int[] getDummySubIds(int slotIndex) {
        // FIXME: Remove notion of Dummy SUBSCRIPTION_ID.
        // I tested this returning null as no one appears to care,
        // but no connection came up on sprout with two sims.
        // We need to figure out why and hopefully remove DummySubsIds!!!
        int numSubs = getActiveSubInfoCountMax();
        if (numSubs > 0) {
            int[] dummyValues = new int[numSubs];
            for (int i = 0; i < numSubs; i++) {
                dummyValues[i] = SubscriptionManager.DUMMY_SUBSCRIPTION_ID_BASE - slotIndex;
            }
            if (VDBG) {
                logd("getDummySubIds: slotIndex=" + slotIndex
                    + " return " + numSubs + " DummySubIds with each subId=" + dummyValues[0]);
            }
            return dummyValues;
        } else {
            return null;
        }
    }

    /**
     * @return the number of records cleared
     */