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

Commit 22f2f483 authored by sandeepjs's avatar sandeepjs Committed by Jack Yu
Browse files

Adding Anamoly report to detect invalid portIndex

Adding Anomaly report to detect invalid portIndex in the active
subscriptions.
Test: Manual
Bug: 263789560

Merged-In: I100409fc9feddbd06addb7cbf860e0f5627b5c7f
Change-Id: I100409fc9feddbd06addb7cbf860e0f5627b5c7f
parent a7277582
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import android.service.euicc.EuiccService;
import android.service.euicc.GetEuiccProfileInfoListResult;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.AnomalyReporter;
import android.telephony.CarrierConfigManager;
import android.telephony.RadioAccessFamily;
import android.telephony.SubscriptionInfo;
@@ -1107,6 +1108,19 @@ public class SubscriptionManagerService extends ISub.Stub {
                        mSubscriptionDatabaseManager.setEmbedded(
                                subInfo.getSubscriptionId(), false);
                    });
            if (mSubscriptionDatabaseManager.getAllSubscriptions().stream()
                    .anyMatch(subInfo -> subInfo.isEmbedded()
                            && subInfo.isActive()
                            && subInfo.getPortIndex()
                            == TelephonyManager.INVALID_PORT_INDEX
                            && mSimState[subInfo.getSimSlotIndex()]
                            == TelephonyManager.SIM_STATE_LOADED)) {
                //Report Anomaly if invalid portIndex is updated in Active subscriptions
                AnomalyReporter.reportAnomaly(
                        UUID.fromString("38fdf63c-3bd9-4fc2-ad33-a20246a32fa7"),
                        "SubscriptionManagerService: Found Invalid portIndex"
                                + " in active subscriptions");
            }
        });
        log("updateEmbeddedSubscriptions: Finished embedded subscription update.");
        if (callback != null) {