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

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

Snap for 12658558 from d3a9f8ab to 25Q1-release

Change-Id: I152de5ba1147fdddde3fc5124adadd80eeb48d39
parents 1ee375b9 d3a9f8ab
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -78,6 +78,15 @@ flag {
  bug: "309896524"
}

# OWNER=rambowang TARGET=24Q3
flag {
    name: "reset_mobile_network_settings"
    is_exported: true
    namespace: "telephony"
    description: "Allows applications to launch Reset Mobile Network Settings page in Settings app."
    bug:"271921464"
}

# OWNER=sangyun TARGET=24Q3
flag {
    name: "roaming_notification_for_single_data_network"
+28 −0
Original line number Diff line number Diff line
@@ -4131,6 +4131,34 @@ public class RILUtils {
        return carrierInfoList;
    }

    /**
     * This API is for fallback to support getAllowedCarriers too.
     *
     * Convert an array of CarrierInfo defined in
     * radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl to a list of CarrierIdentifiers.
     *
     * @param carrierInfos array of CarrierInfo defined in
     *                     radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
     * @return The converted list of CarrierIdentifiers
     */
    public static List<CarrierIdentifier> convertAidlCarrierInfoListToHalCarrierList(
            android.hardware.radio.sim.CarrierInfo[] carrierInfos) {
        List<CarrierIdentifier> ret = new ArrayList<>();
        if (carrierInfos == null) {
            return ret;
        }
        for (android.hardware.radio.sim.CarrierInfo carrierInfo : carrierInfos) {
            String mcc = carrierInfo.mcc;
            String mnc = carrierInfo.mnc;
            String spn = carrierInfo.spn;
            String imsi = carrierInfo.imsiPrefix;
            String gid1 = carrierInfo.gid1;
            String gid2 = carrierInfo.gid2;
            ret.add(new CarrierIdentifier(mcc, mnc, spn, imsi, gid1, gid2));
        }
        return ret;
    }

    /**
     * Convert the sim policy defined in
     * radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl to the equivalent sim
+28 −13
Original line number Diff line number Diff line
@@ -123,19 +123,34 @@ public class SimResponse extends IRadioSimResponse.Stub {
        if (!carrierRestrictions.allowedCarriersPrioritized) {
            carrierRestrictionDefault = CarrierRestrictionRules.CARRIER_RESTRICTION_DEFAULT_ALLOWED;
        }

        CarrierRestrictionRules ret = CarrierRestrictionRules.newBuilder().setAllowedCarriers(
                RILUtils.convertHalCarrierList(
                        carrierRestrictions.allowedCarriers)).setExcludedCarriers(
                RILUtils.convertHalCarrierList(
                        carrierRestrictions.excludedCarriers)).setDefaultCarrierRestriction(
                carrierRestrictionDefault).setMultiSimPolicy(policy).setCarrierRestrictionStatus(
        CarrierRestrictionRules ret = null;
        if (carrierLockInfoSupported) {
            // In order to support the old API { @link TelephonyManager#getAllowedCarriers() } we
            // are parsing the allowedCarrierInfoList to CarrierIdentifier List also along with
            // CarrierInfo List
            ret = CarrierRestrictionRules.newBuilder().setAllowedCarriers(
                    RILUtils.convertAidlCarrierInfoListToHalCarrierList(
                            carrierRestrictions.allowedCarrierInfoList)).setExcludedCarriers(
                    RILUtils.convertAidlCarrierInfoListToHalCarrierList(
                            carrierRestrictions.excludedCarrierInfoList)).
                    setDefaultCarrierRestriction(
                    carrierRestrictionDefault).setMultiSimPolicy(
                    policy).setCarrierRestrictionStatus(
                    carrierRestrictions.status).setAllowedCarrierInfo(
                    RILUtils.convertAidlCarrierInfoList(
                            carrierRestrictions.allowedCarrierInfoList)).setExcludedCarrierInfo(
                    RILUtils.convertAidlCarrierInfoList(
                            carrierRestrictions.excludedCarrierInfoList)).setCarrierLockInfoFeature(
                carrierLockInfoSupported).build();
                            true).build();
        } else {
            ret = CarrierRestrictionRules.newBuilder().setAllowedCarriers(
                    RILUtils.convertHalCarrierList(
                            carrierRestrictions.allowedCarriers)).setExcludedCarriers(
                    RILUtils.convertHalCarrierList(
                            carrierRestrictions.excludedCarriers)).setDefaultCarrierRestriction(
                    carrierRestrictionDefault).setMultiSimPolicy(
                    policy).build();
        }
        if (responseInfo.error == RadioError.NONE) {
            RadioResponse.sendMessageResponse(rr.mResult, ret);
        }
+17 −3
Original line number Diff line number Diff line
@@ -625,6 +625,13 @@ public class DatagramDispatcher extends Handler {
                    pendingDatagram.iterator().next().getValue();
            if (mDatagramController.needsWaitingForSatelliteConnected(datagramArg.datagramType)) {
                plogd("sendPendingDatagrams: wait for satellite connected");
                mDatagramController.updateSendStatus(datagramArg.subId,
                        datagramArg.datagramType,
                        SatelliteManager.SATELLITE_DATAGRAM_TRANSFER_STATE_WAITING_TO_CONNECT,
                        getPendingMessagesCount(),
                        SatelliteManager.SATELLITE_RESULT_SUCCESS);
                startDatagramWaitForConnectedStateTimer(
                        datagramArg.datagramType);
                return;
            }

@@ -1144,16 +1151,23 @@ public class DatagramDispatcher extends Handler {
        }

        if (pendingSms != null && pendingSms.iterator().hasNext()) {
            PendingRequest pendingRequest = pendingSms.iterator().next().getValue();
            int datagramType = pendingRequest.isMtSmsPolling
                    ? DATAGRAM_TYPE_CHECK_PENDING_INCOMING_SMS : DATAGRAM_TYPE_SMS;
            if (mDatagramController.needsWaitingForSatelliteConnected(DATAGRAM_TYPE_SMS)) {
                plogd("sendPendingSms: wait for satellite connected");
                mDatagramController.updateSendStatus(subId,
                        datagramType,
                        SatelliteManager.SATELLITE_DATAGRAM_TRANSFER_STATE_WAITING_TO_CONNECT,
                        getPendingMessagesCount(),
                        SatelliteManager.SATELLITE_RESULT_SUCCESS);
                startDatagramWaitForConnectedStateTimer(datagramType);
                return;
            }

            mSendingInProgress = true;
            PendingRequest pendingRequest = pendingSms.iterator().next().getValue();
            mDatagramController.updateSendStatus(subId,
                    pendingRequest.isMtSmsPolling ?
                            DATAGRAM_TYPE_CHECK_PENDING_INCOMING_SMS : DATAGRAM_TYPE_SMS,
                    datagramType,
                    SatelliteManager.SATELLITE_DATAGRAM_TRANSFER_STATE_SENDING,
                    getPendingMessagesCount(), SATELLITE_RESULT_SUCCESS);
            sendMessage(obtainMessage(CMD_SEND_SMS, pendingRequest));
+53 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.provider.Settings.ACTION_SATELLITE_SETTING;
import static android.telephony.CarrierConfigManager.CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC;
import static android.telephony.CarrierConfigManager.CARRIER_ROAMING_NTN_CONNECT_MANUAL;
import static android.telephony.CarrierConfigManager.CARRIER_ROAMING_NTN_CONNECT_TYPE;
import static android.telephony.CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL;
import static android.telephony.CarrierConfigManager.KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT;
import static android.telephony.CarrierConfigManager.KEY_CARRIER_ROAMING_NTN_EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE_INT;
import static android.telephony.CarrierConfigManager.KEY_CARRIER_ROAMING_SATELLITE_DEFAULT_SERVICES_INT_ARRAY;
@@ -567,6 +568,11 @@ public class SatelliteController extends Handler {
    @GuardedBy("mSatelliteTokenProvisionedLock")
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    protected TreeMap<Integer, List<SubscriptionInfo>> mSubsInfoListPerPriority = new TreeMap<>();
    // List of subscriber information and status at the time of last evaluation
    @GuardedBy("mSatelliteTokenProvisionedLock")
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    private List<SatelliteSubscriberProvisionStatus> mLastEvaluatedSubscriberProvisionStatus =
            new ArrayList<>();
    // The ID of the satellite subscription that has highest priority and is provisioned.
    @GuardedBy("mSatelliteTokenProvisionedLock")
    private int mSelectedSatelliteSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
@@ -6788,6 +6794,11 @@ public class SatelliteController extends Handler {
                if (!isActive && !isNtnOnly) {
                    continue;
                }
                if (!isNtnOnly && !isCarrierConfigLoaded(subId)) {
                    // Skip to add priority list if the carrier config is not loaded properly
                    // for the given carrier subscription.
                    continue;
                }

                int keyPriority = (isESOSSupported && isActive && isDefaultSmsSubId) ? 0
                        : (isESOSSupported && isActive) ? 1
@@ -6828,9 +6839,15 @@ public class SatelliteController extends Handler {

        // If priority has changed, send broadcast for provisioned ESOS subs IDs
        synchronized (mSatelliteTokenProvisionedLock) {
            List<SatelliteSubscriberProvisionStatus> newEvaluatedSubscriberProvisionStatus =
                    getPrioritizedSatelliteSubscriberProvisionStatusList(
                            newSubsInfoListPerPriority);
            if (isPriorityChanged(mSubsInfoListPerPriority, newSubsInfoListPerPriority)
                    || isSubscriberContentChanged(mLastEvaluatedSubscriberProvisionStatus,
                            newEvaluatedSubscriberProvisionStatus)
                    || isChanged) {
                mSubsInfoListPerPriority = newSubsInfoListPerPriority;
                mLastEvaluatedSubscriberProvisionStatus = newEvaluatedSubscriberProvisionStatus;
                sendBroadCastForProvisionedESOSSubs();
                mHasSentBroadcast = true;
                selectBindingSatelliteSubscription(false);
@@ -6838,6 +6855,14 @@ public class SatelliteController extends Handler {
        }
    }

    // to check if the contents of carrier config is loaded properly
    private Boolean isCarrierConfigLoaded(int subId) {
        PersistableBundle carrierConfig = mCarrierConfigManager
                .getConfigForSubId(subId, KEY_CARRIER_CONFIG_APPLIED_BOOL);
        return carrierConfig != null ? carrierConfig.getBoolean(
                CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL) : false;
    }

    // The subscriberId for ntnOnly SIMs is the Iccid, whereas for ESOS supported SIMs, the
    // subscriberId is the Imsi prefix 6 digit + phone number.
    private Pair<String, Integer> getSubscriberIdAndType(@Nullable SubscriptionInfo info) {
@@ -6900,6 +6925,24 @@ public class SatelliteController extends Handler {
        return false;
    }

    // Checks if there are any changes between subscriberInfos. return false if the same.
    // Note that, Use lists with the same priority so we can compare contents properly.
    private boolean isSubscriberContentChanged(List<SatelliteSubscriberProvisionStatus> currentList,
            List<SatelliteSubscriberProvisionStatus> newList) {
        if (currentList.size() != newList.size()) {
            return true;
        }
        for (int i = 0; i < currentList.size(); i++) {
            SatelliteSubscriberProvisionStatus curSub = currentList.get(i);
            SatelliteSubscriberProvisionStatus newSub = newList.get(i);
            if (!curSub.getSatelliteSubscriberInfo().equals(newSub.getSatelliteSubscriberInfo())) {
                logd("isSubscriberContentChanged: cur=" + curSub + " , new=" + newSub);
                return true;
            }
        }
        return false;
    }

    private void sendBroadCastForProvisionedESOSSubs() {
        String packageName = getConfigSatelliteGatewayServicePackage();
        String className = getConfigSatelliteCarrierRoamingEsosProvisionedClass();
@@ -6953,10 +6996,18 @@ public class SatelliteController extends Handler {

    private List<SatelliteSubscriberProvisionStatus>
            getPrioritizedSatelliteSubscriberProvisionStatusList() {
        synchronized (mSatelliteTokenProvisionedLock) {
            return getPrioritizedSatelliteSubscriberProvisionStatusList(mSubsInfoListPerPriority);
        }
    }

    private List<SatelliteSubscriberProvisionStatus>
            getPrioritizedSatelliteSubscriberProvisionStatusList(
                    Map<Integer, List<SubscriptionInfo>> subsInfoListPerPriority) {
        List<SatelliteSubscriberProvisionStatus> list = new ArrayList<>();
        synchronized (mSatelliteTokenProvisionedLock) {
            for (int priority : mSubsInfoListPerPriority.keySet()) {
                List<SubscriptionInfo> infoList = mSubsInfoListPerPriority.get(priority);
            for (int priority : subsInfoListPerPriority.keySet()) {
                List<SubscriptionInfo> infoList = subsInfoListPerPriority.get(priority);
                if (infoList == null) {
                    logd("getPrioritySatelliteSubscriberProvisionStatusList: no exist this "
                            + "priority " + priority);
Loading