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

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

Snap for 13572966 from 46a5f3a9 to 25Q3-release

Change-Id: I49ecba266847d91526cedd46175ca5bc8675719b
parents 07c42fb3 46a5f3a9
Loading
Loading
Loading
Loading
+387 −441
Original line number Diff line number Diff line
@@ -155,8 +155,6 @@ import android.telephony.satellite.SystemSelectionSpecifier;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.uwb.UwbManager;
import android.view.WindowManager;

@@ -458,9 +456,6 @@ public class SatelliteController extends Handler {
    @GuardedBy("mNtnSignalsStrengthLock")
    private NtnSignalStrength mNtnSignalStrength =
            new NtnSignalStrength(NTN_SIGNAL_STRENGTH_NONE);
    @NonNull private final Object mCarrierConfigArrayLock = new Object();
    @GuardedBy("mCarrierConfigArrayLock")
    @NonNull private final SparseArray<PersistableBundle> mCarrierConfigArray = new SparseArray<>();
    private final Object mCarrierRoamingNtnAllSatellitePlmnSetLock = new Object();
    @GuardedBy("mCarrierRoamingNtnAllSatellitePlmnSetLock")
    private Set<String> mCarrierRoamingNtnAllSatellitePlmnSet = null;
@@ -491,13 +486,11 @@ public class SatelliteController extends Handler {
    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 last ICC ID that framework configured to modem.
    @GuardedBy("mSatelliteTokenProvisionedLock")
    private String mLastConfiguredIccId;
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)

    private final AtomicBoolean mRegisteredForPendingDatagramCountWithSatelliteService =
            new AtomicBoolean(false);
@@ -518,6 +511,12 @@ public class SatelliteController extends Handler {
            new AtomicBoolean(false);
    private final AtomicBoolean mRegisteredForSatelliteCommunicationAccessStateChanged =
        new AtomicBoolean(false);

    /**
     * Map key: subId, value: PersistableBundle
     */
    @NonNull private final ConcurrentHashMap<Integer, PersistableBundle> mCarrierConfigArray =
            new ConcurrentHashMap<>();
    /**
     * Map key: subId, value: callback to get error code of the provision request.
     */
@@ -580,8 +579,6 @@ public class SatelliteController extends Handler {
    @NonNull private final ConcurrentHashMap<Integer, List<Integer>>
            mSatModeCapabilitiesForCarrierRoaming = new ConcurrentHashMap<>();


    @NonNull private final Object mSupportedSatelliteServicesLock = new Object();
    @NonNull private final List<String> mSatellitePlmnListFromOverlayConfig;
    @NonNull private final CarrierConfigManager mCarrierConfigManager;
    @NonNull private final CarrierConfigManager.CarrierConfigChangeListener
@@ -609,27 +606,21 @@ public class SatelliteController extends Handler {
    protected ConcurrentHashMap<String, Integer> mSubscriberIdPerSub = new ConcurrentHashMap<>();

    @NonNull private final FeatureFlags mFeatureFlags;
    @NonNull private final Object mSatelliteConnectedLock = new Object();
    /** Key: Subscription ID; Value: Last satellite connected time */
    @GuardedBy("mSatelliteConnectedLock")
    @NonNull private final SparseArray<Long> mLastSatelliteDisconnectedTimesMillis =
            new SparseArray<>();
    @NonNull private final ConcurrentHashMap<Integer, Long> mLastSatelliteDisconnectedTimesMillis =
            new ConcurrentHashMap<>();
    /**
     * Key: Subscription ID; Value: {@code true} if satellite was just connected,
     * {@code false} otherwise.
     */
    @GuardedBy("mSatelliteConnectedLock")
    @NonNull private final SparseBooleanArray
            mWasSatelliteConnectedViaCarrier = new SparseBooleanArray();

    @GuardedBy("mSatelliteConnectedLock")
    @NonNull private final SparseBooleanArray mLastNotifiedNtnMode = new SparseBooleanArray();

    @GuardedBy("mSatelliteConnectedLock")
    @NonNull private final SparseBooleanArray mInitialized = new SparseBooleanArray();
    @GuardedBy("mSatelliteConnectedLock")
    private SparseArray<NtnSignalStrength> mLastNotifiedCarrierRoamingNtnSignalStrength =
            new SparseArray<>();
    @NonNull private final ConcurrentHashMap<Integer, Boolean>
            mWasSatelliteConnectedViaCarrier = new ConcurrentHashMap<>();
    @NonNull private final ConcurrentHashMap<Integer, Boolean> mLastNotifiedNtnMode =
            new ConcurrentHashMap<>();
    @NonNull private final ConcurrentHashMap<Integer, Boolean> mInitialized =
            new ConcurrentHashMap<>();
    private ConcurrentHashMap<Integer, NtnSignalStrength>
            mLastNotifiedCarrierRoamingNtnSignalStrength = new ConcurrentHashMap<>();
    @NonNull private SharedPreferences mSharedPreferences = null;

    @Nullable private PersistentLogger mPersistentLogger = null;
@@ -638,34 +629,31 @@ public class SatelliteController extends Handler {
     * Key : Subscription ID, Value: {@code true} if the EntitlementStatus is enabled,
     * {@code false} otherwise.
     */
    @GuardedBy("mSupportedSatelliteServicesLock")
    private SparseBooleanArray mSatelliteEntitlementStatusPerCarrier = new SparseBooleanArray();
    private ConcurrentHashMap<Integer, Boolean> mSatelliteEntitlementStatusPerCarrier =
            new ConcurrentHashMap<>();
    /** Key Subscription ID, value : PLMN allowed list from entitlement. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    private SparseArray<List<String>> mEntitlementPlmnListPerCarrier = new SparseArray<>();
    private ConcurrentHashMap<Integer, List<String>> mEntitlementPlmnListPerCarrier =
            new ConcurrentHashMap<>();
    /** Key Subscription ID, value : PLMN barred list from entitlement. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    private SparseArray<List<String>> mEntitlementBarredPlmnListPerCarrier = new SparseArray<>();
    private ConcurrentHashMap<Integer, List<String>> mEntitlementBarredPlmnListPerCarrier =
            new ConcurrentHashMap<>();
    /**
     * Key : Subscription ID, Value : If there is an entitlementPlmnList, use it. Otherwise, use the
     * carrierPlmnList. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    private final SparseArray<List<String>> mMergedPlmnListPerCarrier = new SparseArray<>();
    private final ConcurrentHashMap<Integer, List<String>> mMergedPlmnListPerCarrier =
            new ConcurrentHashMap<>();
    /** Key Subscription ID, value : map to plmn info with related data plan. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    SparseArray<Map<String, Integer>> mEntitlementDataPlanMapPerCarrier = new SparseArray<>();
    ConcurrentHashMap<Integer, Map<String, Integer>> mEntitlementDataPlanMapPerCarrier =
            new ConcurrentHashMap<>();
    /** Key Subscription ID, value : map to plmn info with related service type. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    SparseArray<Map<String, List<Integer>>> mEntitlementServiceTypeMapPerCarrier =
            new SparseArray<>();
    ConcurrentHashMap<Integer, Map<String, List<Integer>>> mEntitlementServiceTypeMapPerCarrier =
            new ConcurrentHashMap<>();
    /** Key Subscription ID, value : map to plmn info with related service policy for data service */
    @GuardedBy("mSupportedSatelliteServicesLock")
    SparseArray<Map<String, Integer>> mEntitlementDataServicePolicyMapPerCarrier =
            new SparseArray<>();
    ConcurrentHashMap<Integer, Map<String, Integer>> mEntitlementDataServicePolicyMapPerCarrier =
            new ConcurrentHashMap<>();
    /** Key Subscription ID, value : map to plmn info with related service policy for voice service */
    @GuardedBy("mSupportedSatelliteServicesLock")
    SparseArray<Map<String, Integer>> mEntitlementVoiceServicePolicyMapPerCarrier =
            new SparseArray<>();
    ConcurrentHashMap<Integer, Map<String, Integer>> mEntitlementVoiceServicePolicyMapPerCarrier =
            new ConcurrentHashMap<>();
    private static final int DEFAULT_SATELLITE_EMERGENCY_MODE_DURATION_SECONDS = 300;
    private AlertDialog mNetworkSelectionModeAutoDialog = null;

@@ -4486,7 +4474,6 @@ public class SatelliteController extends Handler {
            logd("getSupportedSatelliteServices: invalid sub id");
            return new ArrayList<>();
        }
        synchronized (mSupportedSatelliteServicesLock) {
        if (plmn != null && !plmn.isEmpty()) {
            Map<String, List<Integer>> allowedServicesList =
                    mEntitlementServiceTypeMapPerCarrier.get(subId);
@@ -4511,8 +4498,6 @@ public class SatelliteController extends Handler {
        return getSatelliteSupportedServicesFromConfig(subId, plmn);
    }

    }

    /**
     * Check whether satellite modem has to attach to a satellite network before sending/receiving
     * datagrams.
@@ -4641,7 +4626,6 @@ public class SatelliteController extends Handler {
            return false;
        }

        synchronized (mSatelliteConnectedLock) {
        Long lastDisconnectedTime = mLastSatelliteDisconnectedTimesMillis.get(subId);
        long satelliteConnectionHysteresisTime =
                getSatelliteConnectionHysteresisTimeMillis(subId);
@@ -4656,7 +4640,6 @@ public class SatelliteController extends Handler {
            return false;
        }
    }
    }

    /**
     * @return {@code true} if should exit satellite mode unless already sent a datagram in this
@@ -4886,8 +4869,8 @@ public class SatelliteController extends Handler {
                + ", plmnDataServicePolicyMap=" + plmnDataServicePolicyMap.toString()
                + ", plmnVoiceServicePolicyMap=" + plmnVoiceServicePolicyMap.toString());

        synchronized (mSupportedSatelliteServicesLock) {
            if (mSatelliteEntitlementStatusPerCarrier.get(subId, false) != entitlementEnabled) {
        if (mSatelliteEntitlementStatusPerCarrier.computeIfAbsent(
                subId, k -> false) != entitlementEnabled) {
            logd("update the carrier satellite enabled to " + entitlementEnabled);
            handleIndividualEntitlementMetricReport(subId, entitlementEnabled);
            try {
@@ -4921,7 +4904,7 @@ public class SatelliteController extends Handler {
                    + "or invalid barredPlmnList");
        }

            if (mSatelliteEntitlementStatusPerCarrier.get(subId, false)) {
        if (mSatelliteEntitlementStatusPerCarrier.computeIfAbsent(subId, k -> false)) {
            removeAttachRestrictionForCarrier(subId,
                    SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT, callback);
        } else {
@@ -4929,7 +4912,6 @@ public class SatelliteController extends Handler {
                    SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT, callback);
        }
    }
    }

    /**
     * A list of PLMNs is considered valid if either the list is empty or all PLMNs in the list
@@ -5835,16 +5817,13 @@ public class SatelliteController extends Handler {
    }

    private List<String> getCarrierPlmnList(int subId) {
        synchronized (mSupportedSatelliteServicesLock) {
            return mMergedPlmnListPerCarrier.get(subId, new ArrayList<>()).stream().toList();
        }
        return mMergedPlmnListPerCarrier.computeIfAbsent(
                subId, k -> new ArrayList<>()).stream().toList();
    }

    private List<String> getBarredPlmnList(int subId) {
        synchronized (mSupportedSatelliteServicesLock) {
            return mEntitlementBarredPlmnListPerCarrier.get(
                    subId, new ArrayList<>()).stream().toList();
        }
        return mEntitlementBarredPlmnListPerCarrier.computeIfAbsent(
                subId, k -> new ArrayList<>()).stream().toList();
    }

    private void persistCarrierRoamingNtnAllSatellitePlmnSet(Set<String> allSatellitePlmnSet) {
@@ -5907,7 +5886,6 @@ public class SatelliteController extends Handler {
    }

    private void updateSupportedSatelliteServicesForActiveSubscriptions() {
        synchronized (mSupportedSatelliteServicesLock) {
        mSatelliteServicesSupportedByCarriersFromConfig.clear();
        mMergedPlmnListPerCarrier.clear();
        int[] activeSubIds = mSubscriptionManagerService.getActiveSubIdList(true);
@@ -5921,7 +5899,6 @@ public class SatelliteController extends Handler {
                    + "activeSubIds is null");
        }
    }
    }

    /**
     * If the entitlementPlmnList exist then used it.
@@ -5929,12 +5906,11 @@ public class SatelliteController extends Handler {
     */
    private void updatePlmnListPerCarrier(int subId) {
        plogd("updatePlmnListPerCarrier: subId=" + subId);
        synchronized (mSupportedSatelliteServicesLock) {
        List<String> carrierPlmnList, entitlementPlmnList;
        if (getConfigForSubId(subId).getBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL,
                false)) {
                entitlementPlmnList = mEntitlementPlmnListPerCarrier.get(subId,
                        new ArrayList<>()).stream().toList();
            entitlementPlmnList = mEntitlementPlmnListPerCarrier.computeIfAbsent(subId,
                    k -> new ArrayList<>()).stream().toList();
            plogd("updatePlmnListPerCarrier: entitlementPlmnList="
                    + String.join(",", entitlementPlmnList)
                    + " size=" + entitlementPlmnList.size());
@@ -5977,7 +5953,6 @@ public class SatelliteController extends Handler {
        }
        mMergedPlmnListPerCarrier.put(subId, carrierPlmnList);
    }
    }

    private void updateSupportedSatelliteServices(int subId) {
        plogd("updateSupportedSatelliteServices with subId " + subId);
@@ -6169,10 +6144,8 @@ public class SatelliteController extends Handler {

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    protected void updateCarrierConfig(int subId) {
        synchronized (mCarrierConfigArrayLock) {
        mCarrierConfigArray.put(subId, getConfigForSubId(subId));
    }
    }

    /**
     * If there is no cached entitlement plmn list, read it from the db and use it if it is not an
@@ -6184,8 +6157,7 @@ public class SatelliteController extends Handler {
            return;
        }

        synchronized (mSupportedSatelliteServicesLock) {
            if (mEntitlementPlmnListPerCarrier.indexOfKey(subId) < 0) {
        if (!mEntitlementPlmnListPerCarrier.containsKey(subId)) {
            plogd("updateEntitlementPlmnListPerCarrier: no correspondent cache, load from "
                    + "persist storage");
            List<String> entitlementPlmnList =
@@ -6199,7 +6171,7 @@ public class SatelliteController extends Handler {
            mEntitlementPlmnListPerCarrier.put(subId, entitlementPlmnList);
        }

            if (mEntitlementBarredPlmnListPerCarrier.indexOfKey(subId) < 0) {
        if (!mEntitlementBarredPlmnListPerCarrier.containsKey(subId)) {
            plogd("updateEntitlementBarredPlmnList: no correspondent cache, load from "
                    + "persist storage");
            List<String> entitlementBarredPlmnList =
@@ -6213,7 +6185,7 @@ public class SatelliteController extends Handler {
            mEntitlementBarredPlmnListPerCarrier.put(subId, entitlementBarredPlmnList);
        }

            if (mEntitlementDataPlanMapPerCarrier.indexOfKey(subId) < 0) {
        if (!mEntitlementDataPlanMapPerCarrier.containsKey(subId)) {
            plogd("updateEntitlementDataPlanForPlmns: no correspondent cache, load from "
                    + "persist storage");
            Map<String, Integer> entitlementDataPlanForPlmns =
@@ -6227,7 +6199,7 @@ public class SatelliteController extends Handler {
            mEntitlementDataPlanMapPerCarrier.put(subId, entitlementDataPlanForPlmns);
        }

            if (mEntitlementServiceTypeMapPerCarrier.indexOfKey(subId) < 0) {
        if (!mEntitlementServiceTypeMapPerCarrier.containsKey(subId)) {
            plogd("updateEntitlementTypeMapPerCarrier: no correspondent cache, load from "
                    + "persist storage");
            Map<String, List<Integer>> entitlementTypeMapPerCarrier =
@@ -6242,7 +6214,7 @@ public class SatelliteController extends Handler {
            mEntitlementServiceTypeMapPerCarrier.put(subId, entitlementTypeMapPerCarrier);
        }

            if (mEntitlementDataServicePolicyMapPerCarrier.indexOfKey(subId) < 0) {
        if (!mEntitlementDataServicePolicyMapPerCarrier.containsKey(subId)) {
            plogd("updateEntitlementDataServicePolicy: no correspondent cache, load from "
                    + "persist storage");
            Map<String, Integer> entitlementDataServicePolicy =
@@ -6257,7 +6229,7 @@ public class SatelliteController extends Handler {
            mEntitlementDataServicePolicyMapPerCarrier.put(subId, entitlementDataServicePolicy);
        }

            if (mEntitlementVoiceServicePolicyMapPerCarrier.indexOfKey(subId) < 0) {
        if (!mEntitlementVoiceServicePolicyMapPerCarrier.containsKey(subId)) {
            plogd("updateEntitlementVoiceServicePolicy: no correspondent cache, load from "
                    + "persist storage");
            Map<String, Integer> entitlementVoiceServicePolicy =
@@ -6273,7 +6245,6 @@ public class SatelliteController extends Handler {
                    entitlementVoiceServicePolicy);
        }
    }
    }

    /**
     * Update the value of SimInfo.COLUMN_SATELLITE_ESOS_SUPPORTED stored in the database based
@@ -6476,8 +6447,7 @@ public class SatelliteController extends Handler {
                plogd("updateRestrictReasonForEntitlementPerCarrier:" + result);
            }
        };
        synchronized (mSupportedSatelliteServicesLock) {
            if (mSatelliteEntitlementStatusPerCarrier.indexOfKey(subId) < 0) {
        if (!mSatelliteEntitlementStatusPerCarrier.containsKey(subId)) {
            plogd("updateRestrictReasonForEntitlementPerCarrier: no correspondent cache, "
                    + "load from persist storage");
            String entitlementStatus = null;
@@ -6505,12 +6475,11 @@ public class SatelliteController extends Handler {
            handleIndividualEntitlementMetricReport(subId, result);
        }

            if (!mSatelliteEntitlementStatusPerCarrier.get(subId, false)) {
        if (!mSatelliteEntitlementStatusPerCarrier.computeIfAbsent(subId, k -> false)) {
            addAttachRestrictionForCarrier(subId,
                    SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT, callback);
        }
    }
    }

    /**
     * Save user setting for enabling satellite attach for the carrier associated with the
@@ -6720,7 +6689,6 @@ public class SatelliteController extends Handler {
                continue;
            }

            synchronized (mSatelliteConnectedLock) {
            CarrierRoamingSatelliteSessionStats sessionStats =
                    mCarrierRoamingSatelliteSessionStatsMap.get(subId);
            if (DEBUG) {
@@ -6731,7 +6699,7 @@ public class SatelliteController extends Handler {
            if (serviceState.isUsingNonTerrestrialNetwork()) {
                if (sessionStats != null) {
                    sessionStats.onSignalStrength(phone);
                        if (!mWasSatelliteConnectedViaCarrier.get(subId)) {
                    if (!mWasSatelliteConnectedViaCarrier.computeIfAbsent(subId, k -> false)) {
                        // Log satellite connection start
                        sessionStats.onConnectionStart(phone);
                    }
@@ -6748,7 +6716,8 @@ public class SatelliteController extends Handler {
                    }
                }
            } else {
                    Boolean connected = mWasSatelliteConnectedViaCarrier.get(subId);
                Boolean connected = mWasSatelliteConnectedViaCarrier.computeIfAbsent(
                        subId, k -> false);
                if (getWwanIsInService(serviceState)
                        || serviceState.getState() == ServiceState.STATE_POWER_OFF) {
                    resetCarrierRoamingSatelliteModeParams(subId);
@@ -6774,7 +6743,6 @@ public class SatelliteController extends Handler {
            updateLastNotifiedNtnModeAndNotify(phone);
            updateLastNotifiedCarrierRoamingNtnSignalStrengthAndNotify(phone);
        }
        }
        determineAutoConnectSystemNotification();
    }

@@ -6785,9 +6753,8 @@ public class SatelliteController extends Handler {
        }

        int subId = phone.getSubId();
        synchronized (mSatelliteConnectedLock) {
            boolean initialized = mInitialized.get(subId);
            boolean lastNotifiedNtnMode = mLastNotifiedNtnMode.get(subId);
        boolean initialized = mInitialized.computeIfAbsent(subId, k -> false);
        boolean lastNotifiedNtnMode = mLastNotifiedNtnMode.computeIfAbsent(subId, k -> false);
        boolean currNtnMode = isInSatelliteModeForCarrierRoaming(phone);
        plogd("updateLastNotifiedNtnModeAndNotify: subId=" + subId
                + " initialized=" + initialized
@@ -6804,7 +6771,6 @@ public class SatelliteController extends Handler {
            }
        }
    }
    }

    /**
     * map data policy to support unknown case at metrics
@@ -7608,12 +7574,10 @@ public class SatelliteController extends Handler {
    }

    private void resetCarrierRoamingSatelliteModeParams(int subId) {
        synchronized (mSatelliteConnectedLock) {
            mLastSatelliteDisconnectedTimesMillis.put(subId, null);
        mLastSatelliteDisconnectedTimesMillis.remove(subId);
        mSatModeCapabilitiesForCarrierRoaming.remove(subId);
        mWasSatelliteConnectedViaCarrier.put(subId, false);
    }
    }

    /**
     * Read carrier config items for satellite
@@ -7624,7 +7588,6 @@ public class SatelliteController extends Handler {
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    @NonNull
    protected PersistableBundle getPersistableBundle(int subId) {
        synchronized (mCarrierConfigArrayLock) {
        PersistableBundle config = mCarrierConfigArray.get(subId);
        if (config == null) {
            config = getConfigForSubId(subId);
@@ -7632,7 +7595,6 @@ public class SatelliteController extends Handler {
        }
        return config;
    }
    }

    // Should be invoked only when session termination done or session termination failed.
    private int calculateSessionDurationTimeSec() {
@@ -9242,9 +9204,7 @@ public class SatelliteController extends Handler {
            Map<String, List<Integer>> plmnServiceTypeMap) {
        // If a service list is already cached, check it for changes
        int[] existingServices = getSupportedServicesOnCarrierRoamingNtn(subId);
        synchronized (mSupportedSatelliteServicesLock) {
        mEntitlementServiceTypeMapPerCarrier.put(subId, plmnServiceTypeMap);
        }
        int[] updatedServices = getSupportedServicesOnCarrierRoamingNtn(subId);
        if (existingServices.length > 0 && Arrays.equals(existingServices, updatedServices)) {
            plogd("No change in Entitlement service support data");
@@ -9298,7 +9258,6 @@ public class SatelliteController extends Handler {
    }

    private int[] getAvailableServicesWithEntitlementForSubId(int subId) {
        synchronized (mSupportedSatelliteServicesLock) {
        Map<String, List<Integer>> allowedServicesList =
                mEntitlementServiceTypeMapPerCarrier.get(subId);
        if (allowedServicesList != null && !allowedServicesList.isEmpty()) {
@@ -9317,7 +9276,6 @@ public class SatelliteController extends Handler {
            return new int[0]; // Return an empty array if the map is null or empty
        }
    }
    }

    /**
     * Given a subscription ID, this returns the carriers' supported services on
@@ -9520,7 +9478,6 @@ public class SatelliteController extends Handler {

        NtnSignalStrength currSignalStrength = getCarrierRoamingNtnSignalStrength(phone);
        int subId = phone.getSubId();
        synchronized (mSatelliteConnectedLock) {
        NtnSignalStrength lastNotifiedSignalStrength =
                mLastNotifiedCarrierRoamingNtnSignalStrength.get(subId);
        if (lastNotifiedSignalStrength == null
@@ -9529,7 +9486,6 @@ public class SatelliteController extends Handler {
            phone.notifyCarrierRoamingNtnSignalStrengthChanged(currSignalStrength);
        }
    }
    }

    /** Returns whether to send SMS to DatagramDispatcher or not. */
    public boolean shouldSendSmsToDatagramDispatcher(@Nullable Phone phone) {
@@ -9656,11 +9612,11 @@ public class SatelliteController extends Handler {
    }

    private void handleEntireEntitlementMetricReport() {
        synchronized (mSupportedSatelliteServicesLock) {
        int[] activeSubIds = mSubscriptionManagerService.getActiveSubIdList(true);
        if (activeSubIds != null && activeSubIds.length > 0) {
            for (int subId : activeSubIds) {
                    boolean isSubIdEntitled = mSatelliteEntitlementStatusPerCarrier.get(subId);
                boolean isSubIdEntitled = mSatelliteEntitlementStatusPerCarrier.computeIfAbsent(
                        subId, k -> false);
                mCarrierRoamingSatelliteControllerStats.reportIsDeviceEntitled(subId,
                        isSubIdEntitled);
                plogd("handleEntitlementMetricReport: subId=" + subId + ", isSubEntitled="
@@ -9669,18 +9625,15 @@ public class SatelliteController extends Handler {
        } else {
            loge("handleEntireEntitlementMetricReport: no active subId");
        }
        }
        scheduleRegularMetricReportTimer();
    }

    private void handleIndividualEntitlementMetricReport(int subId,
            boolean isSubscriptionEntitled) {
        synchronized (mSupportedSatelliteServicesLock) {
        mSatelliteEntitlementStatusPerCarrier.put(subId, isSubscriptionEntitled);
        mCarrierRoamingSatelliteControllerStats.reportIsDeviceEntitled(subId,
                isSubscriptionEntitled);
    }
    }

    private void handleEntireProvisionMetricReport() {
        logd("handleEntireProvisionMetricReport:");
@@ -9787,14 +9740,12 @@ public class SatelliteController extends Handler {
     */
    public int getSatelliteDataPlanForPlmn(int subId, String plmn) {
        if (plmn != null) {
            synchronized (mSupportedSatelliteServicesLock) {
            Map<String, Integer> dataplanMap = mEntitlementDataPlanMapPerCarrier.get(subId);
            logd("data plan available for sub id:" + dataplanMap);
            if (dataplanMap != null && dataplanMap.containsKey(plmn)) {
                return dataplanMap.get(plmn);
            }
        }
        }
        // TODO (Override with carrier config value when configuration defined)
        return SATELLITE_DATA_PLAN_METERED;
    }
@@ -9850,13 +9801,10 @@ public class SatelliteController extends Handler {
        }

        if (isValidSubscriptionId(subId)) {
            Map<String, Integer> dataServicePolicy;
            synchronized (mSupportedSatelliteServicesLock) {
                dataServicePolicy = getConfigForSubId(subId).getBoolean(
            Map<String, Integer> dataServicePolicy = getConfigForSubId(subId).getBoolean(
                    KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, false)
                    ? mEntitlementDataServicePolicyMapPerCarrier.get(subId)
                    : null;
            }
            plogd("getSatelliteDataServicePolicyForPlmn: dataServicePolicy=" + dataServicePolicy);

            if (dataServicePolicy != null && !dataServicePolicy.isEmpty()) {
@@ -9952,7 +9900,6 @@ public class SatelliteController extends Handler {
     */
    public int getSatelliteVoiceServicePolicyForPlmn(int subId, String plmn) {
        if (plmn != null) {
            synchronized (mSupportedSatelliteServicesLock) {
            Map<String, Integer> voiceServicePolicy =
                    mEntitlementVoiceServicePolicyMapPerCarrier.get(
                            subId);
@@ -9962,7 +9909,6 @@ public class SatelliteController extends Handler {
                return voiceServicePolicy.get(plmn);
            }
        }
        }
        // TODO (Replace below code with related enum value, when voice service policy support mode
        // is added)
        return 0; // Restricted
+11 −6

File changed.

Preview size limit exceeded, changes collapsed.

+25 −25

File changed.

Preview size limit exceeded, changes collapsed.