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

Commit 3204b0e4 authored by Huilong Yin's avatar Huilong Yin Committed by arunvoddu
Browse files

Add uicc applications size check

If the SIM application count is 0, UiccCarrierPrivilegeRules
cannot retrieve any application information. So no need new
UiccCarrierPrivilegeRules if applications size < 0.

Bug: 349966950
Test: Manual
Flag: com.android.internal.telephony.flags.uicc_app_count_check_to_create_channel

1.Start by booting with no enabled profile
2.Enable one eSIM profile
3.eSIM shall load UiccCarrierPrivilegeRules success.

Change-Id: I5c98315ebc4058417169e7b8db78baa0cad42f67
parent 663644e6
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -58,3 +58,14 @@ flag {
    description: "This flag controls the visibility of the setCarrierRestrictionStatus API in carrierRestrictionRules class."
    bug:"342411308"
}

# OWNER=arunvoddu TARGET=24Q4
flag {
    name: "uicc_app_count_check_to_create_channel"
    namespace: "telephony"
    description: "This flag controls to create the open channel when uicc application count is greater than 0."
    bug:"349966950"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+4 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyStatsLog;
import com.android.internal.telephony.cat.CatService;
import com.android.internal.telephony.flags.FeatureFlags;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.subscription.SubscriptionInfoInternal;
import com.android.internal.telephony.subscription.SubscriptionManagerService;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType;
@@ -1155,7 +1156,9 @@ public class UiccProfile extends IccCard {

            // Reload the carrier privilege rules if necessary.
            log("Before privilege rules: " + mCarrierPrivilegeRules + " : " + ics.mCardState);
            if (mCarrierPrivilegeRules == null && ics.mCardState == CardState.CARDSTATE_PRESENT) {
            if (mCarrierPrivilegeRules == null && ics.mCardState == CardState.CARDSTATE_PRESENT && (
                    !Flags.uiccAppCountCheckToCreateChannel()
                            || mLastReportedNumOfUiccApplications > 0)) {
                mCarrierPrivilegeRules = new UiccCarrierPrivilegeRules(this,
                        mHandler.obtainMessage(EVENT_CARRIER_PRIVILEGES_LOADED));
            } else if (mCarrierPrivilegeRules != null