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

Commit 8f3a62d1 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13525848 from bfe3ada6 to 25Q3-release

Change-Id: I82273e1064c088a42a73e7037247fe1030e07c6d
parents 4c47f34d bfe3ada6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -142,3 +142,11 @@ flag {
    description: "This flag reset the cache if the sim phonebook is empty"
    bug:"404094844"
}

# OWNER=arunvoddu TARGET=25Q4
flag {
    name: "cat_service_creation_fix"
    namespace: "telephony"
    description: "This flag reset the cache if the sim phonebook is empty"
    bug:"417398404"
}
 No newline at end of file
+37 −18
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.telephony.cat;
import static com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.IDLE_SCREEN_AVAILABLE_EVENT;
import static com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.LANGUAGE_SELECTION_EVENT;
import static com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.USER_ACTIVITY_EVENT;
import static com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType.APPTYPE_UNKNOWN;

import android.app.Activity;
import android.app.ActivityManager;
@@ -52,6 +53,7 @@ import com.android.internal.telephony.ProxyController;
import com.android.internal.telephony.SmsController;
import com.android.internal.telephony.flags.FeatureFlags;
import com.android.internal.telephony.flags.FeatureFlagsImpl;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.subscription.SubscriptionManagerService;
import com.android.internal.telephony.uicc.IccCardStatus.CardState;
import com.android.internal.telephony.uicc.IccFileHandler;
@@ -218,6 +220,34 @@ public class CatService extends Handler implements AppInterface {
        mContext.registerReceiver(mSmsBroadcastReceiver, new IntentFilter(SMS_SENT_ACTION));
    }

    private static UiccCardApplication getValidUiccApplication(UiccProfile uiccProfile) {
        UiccCardApplication ca = null;
        if (uiccProfile != null) {
            /* Since Cat is not tied to any application, but rather is Uicc application
             * in itself - just get first FileHandler and IccRecords object
             */
            ca = uiccProfile.getApplicationIndex(0);

            /**
             * Case where the SIMs reporting "UNKNOWN" application type.
             * If an "UNKNOWN" application is detected, its file handler won't be initialized
             * correctly.
             * To avoid issues, always use the file handler from a known, valid SIM application.
             */
            if (Flags.catServiceCreationFix() && ca.getType() == APPTYPE_UNKNOWN
                    && uiccProfile.getNumApplications() > 1) {
                for (int i = 1; i < uiccProfile.getNumApplications(); i++) {
                    UiccCardApplication tmpCa = uiccProfile.getApplicationIndex(i);
                    if (tmpCa.getType() != APPTYPE_UNKNOWN) {
                        ca = tmpCa;
                        break;
                    }
                }
            }
        }
        return ca;
    }

    /**
     * Used for instantiating the Service from the Card.
     *
@@ -238,16 +268,11 @@ public class CatService extends Handler implements AppInterface {
        UiccCardApplication ca = null;
        IccFileHandler fh = null;
        IccRecords ir = null;
        if (uiccProfile != null) {
            /* Since Cat is not tied to any application, but rather is Uicc application
             * in itself - just get first FileHandler and IccRecords object
             */
            ca = uiccProfile.getApplicationIndex(0);
        ca = getValidUiccApplication(uiccProfile);
        if (ca != null) {
            fh = ca.getIccFileHandler();
            ir = ca.getIccRecords();
        }
        }

        synchronized (sInstanceLock) {
            if (sInstance == null) {
@@ -1302,16 +1327,10 @@ public class CatService extends Handler implements AppInterface {
            Context context, UiccProfile uiccProfile) {
        UiccCardApplication ca = null;
        IccRecords ir = null;

        if (uiccProfile != null) {
            /* Since Cat is not tied to any application, but rather is Uicc application
             * in itself - just get first FileHandler and IccRecords object
             */
            ca = uiccProfile.getApplicationIndex(0);
        ca = getValidUiccApplication(uiccProfile);
        if (ca != null) {
            ir = ca.getIccRecords();
        }
        }

        synchronized (sInstanceLock) {
            if ((ir != null) && (mIccRecords != ir)) {
+142 −126

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+17 −0

File changed.

Preview size limit exceeded, changes collapsed.

Loading