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

Commit 760b646f authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Added log to print slot/sub mapping"

parents 432ab45e af43adb2
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -926,6 +926,7 @@ public class SubscriptionManagerService extends ISub.Stub {
                    mSlotIndexToSubId.remove(simSlotIndex);
                });
        updateGroupDisabled();
        logl("markSubscriptionsInactive: " + slotMappingToString());
    }

    /**
@@ -1289,6 +1290,7 @@ public class SubscriptionManagerService extends ISub.Stub {
                mSlotIndexToSubId.put(phoneId, subId);
                // Update the SIM slot index. This will make the subscription active.
                mSubscriptionDatabaseManager.setSimSlotIndex(subId, phoneId);
                logl("updateSubscriptions: " + slotMappingToString());
            }

            // Update the card id.
@@ -1365,6 +1367,7 @@ public class SubscriptionManagerService extends ISub.Stub {
        } else {
            log("updateSubscriptions: No ICCID available for phone " + phoneId);
            mSlotIndexToSubId.remove(phoneId);
            logl("updateSubscriptions: " + slotMappingToString());
        }

        if (areAllSubscriptionsLoaded()) {
@@ -1931,6 +1934,7 @@ public class SubscriptionManagerService extends ISub.Stub {
                int subId = insertSubscriptionInfo(iccId, slotIndex, displayName, subscriptionType);
                updateGroupDisabled();
                mSlotIndexToSubId.put(slotIndex, subId);
                logl("addSubInfo: " + slotMappingToString());
            } else {
                // Record already exists.
                loge("Subscription record already existed.");
@@ -3828,6 +3832,16 @@ public class SubscriptionManagerService extends ISub.Stub {
        }
    }

    /**
     * @return The logical SIM slot/sub mapping to string.
     */
    @NonNull
    private String slotMappingToString() {
        return mSlotIndexToSubId.entrySet().stream()
                .map(e -> "Slot " + e.getKey() + ": subId=" + e.getValue())
                .collect(Collectors.joining(", "));
    }

    /**
     * Log debug messages.
     *
@@ -3882,6 +3896,12 @@ public class SubscriptionManagerService extends ISub.Stub {
        mSlotIndexToSubId.forEach((slotIndex, subId)
                -> pw.println("Logical SIM slot " + slotIndex + ": subId=" + subId));
        pw.decreaseIndent();
        pw.println("ICCID:");
        pw.increaseIndent();
        for (int i = 0; i < mTelephonyManager.getActiveModemCount(); i++) {
            pw.println("slot " + i + ": " + getIccId(i));
        }
        pw.decreaseIndent();
        pw.println();
        pw.println("defaultSubId=" + getDefaultSubId());
        pw.println("defaultVoiceSubId=" + getDefaultVoiceSubId());