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

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

Snap for 12722466 from 842f9f9d to 25Q1-release

Change-Id: I5e05ea92b539b5e3c3aeb96d473808ffd9885914
parents 1f6d7d36 842f9f9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# See system/core/logcat/event.logtags for a description of the format of this file.
# See system/logging/logcat/event.logtags for a description of the format of this file.

option java_package com.android.internal.telephony;

+17 −2
Original line number Diff line number Diff line
@@ -3775,6 +3775,13 @@ public class GsmCdmaPhone extends Phone {
                        && disclosure != null) {
                    mIdentifierDisclosureNotifier.addDisclosure(mContext, getSubId(), disclosure);
                }
                if (mFeatureFlags.cellularIdentifierDisclosureIndications()
                        && mIdentifierDisclosureNotifier != null
                        && disclosure != null) {
                    logd("EVENT_CELL_IDENTIFIER_DISCLOSURE for non-Safety Center listeners "
                            + "phoneId = " + getPhoneId());
                    mNotifier.notifyCellularIdentifierDisclosedChanged(this, disclosure);
                }
                break;

            case EVENT_SET_IDENTIFIER_DISCLOSURE_ENABLED_DONE:
@@ -3785,13 +3792,21 @@ public class GsmCdmaPhone extends Phone {

            case EVENT_SECURITY_ALGORITHM_UPDATE:
                logd("EVENT_SECURITY_ALGORITHM_UPDATE phoneId = " + getPhoneId());
                if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents()
                        && mNullCipherNotifier != null) {

                ar = (AsyncResult) msg.obj;
                SecurityAlgorithmUpdate update = (SecurityAlgorithmUpdate) ar.result;

                if (mFeatureFlags.enableModemCipherTransparencyUnsolEvents()
                        && mNullCipherNotifier != null) {
                    mNullCipherNotifier.onSecurityAlgorithmUpdate(mContext, getPhoneId(),
                            getSubId(), update);
                }
                if (mFeatureFlags.securityAlgorithmsUpdateIndications()
                        && mNullCipherNotifier != null) {
                    logd("EVENT_SECURITY_ALGORITHM_UPDATE for non-Safety Center listeners "
                              + "phoneId = " + getPhoneId());
                    mNotifier.notifySecurityAlgorithmsChanged(this, update);
                }
                break;

            case EVENT_SET_SECURITY_ALGORITHMS_UPDATED_ENABLED_DONE:
+5 −3
Original line number Diff line number Diff line
@@ -753,6 +753,8 @@ public class DatagramDispatcher extends Handler {

    private void reportSendDatagramCompleted(@NonNull SendSatelliteDatagramArgument argument,
            @NonNull @SatelliteManager.SatelliteResult int resultCode) {
        long datagramTransmissionTime = argument.datagramStartTime > 0
                ? (System.currentTimeMillis() - argument.datagramStartTime) : 0;
        SatelliteStats.getInstance().onSatelliteOutgoingDatagramMetrics(
                new SatelliteStats.SatelliteOutgoingDatagramParams.Builder()
                        .setDatagramType(argument.datagramType)
@@ -760,15 +762,15 @@ public class DatagramDispatcher extends Handler {
                        .setDatagramSizeBytes(argument.getDatagramRoundedSizeBytes())
                        /* In case pending datagram has not been attempted to send to modem
                        interface. transfer time will be 0. */
                        .setDatagramTransferTimeMillis(argument.datagramStartTime > 0
                                ? (System.currentTimeMillis() - argument.datagramStartTime) : 0)
                        .setDatagramTransferTimeMillis(datagramTransmissionTime)
                        .setIsDemoMode(mIsDemoMode)
                        .setCarrierId(SatelliteController.getInstance().getSatelliteCarrierId())
                        .build());
        if (resultCode == SatelliteManager.SATELLITE_RESULT_SUCCESS) {
            mControllerMetricsStats.reportOutgoingDatagramSuccessCount(argument.datagramType,
                    mIsDemoMode);
            mSessionMetricsStats.addCountOfSuccessfulOutgoingDatagram(argument.datagramType);
            mSessionMetricsStats.addCountOfSuccessfulOutgoingDatagram(argument.datagramType,
                    datagramTransmissionTime);
        } else {
            mControllerMetricsStats.reportOutgoingDatagramFailCount(argument.datagramType,
                    mIsDemoMode);
+66 −14
Original line number Diff line number Diff line
@@ -436,9 +436,9 @@ public class SatelliteController extends Handler {
    private final ConcurrentHashMap<IBinder, ISelectedNbIotSatelliteSubscriptionCallback>
            mSelectedNbIotSatelliteSubscriptionChangedListeners = new ConcurrentHashMap<>();

    private final Object mIsSatelliteSupportedLock = new Object();
    protected final Object mIsSatelliteSupportedLock = new Object();
    @GuardedBy("mIsSatelliteSupportedLock")
    private Boolean mIsSatelliteSupported = null;
    protected Boolean mIsSatelliteSupported = null;
    private boolean mIsDemoModeEnabled = false;
    private boolean mIsEmergency = false;
    private final Object mIsSatelliteEnabledLock = new Object();
@@ -577,6 +577,9 @@ public class SatelliteController extends Handler {
     * carrierPlmnList. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    private final SparseArray<List<String>> mMergedPlmnListPerCarrier = new SparseArray<>();
    /** Key Subscription ID, value : map to plmn info with related data plan. */
    @GuardedBy("mSupportedSatelliteServicesLock")
    SparseArray<Map<String, Integer>> mEntitlementDataPlanMapPerCarrier = new SparseArray<>();
    private static AtomicLong sNextSatelliteEnableRequestId = new AtomicLong(0);
    // key : subscriberId, value : provisioned or not.
    @GuardedBy("mSatelliteTokenProvisionedLock")
@@ -662,6 +665,10 @@ public class SatelliteController extends Handler {
    @GuardedBy("mSatelliteModemStateLock")
    @SatelliteManager.SatelliteModemState
    private int mSatelliteModemState = SatelliteManager.SATELLITE_MODEM_STATE_UNKNOWN;

    // Data Plan types at entitlement for the plmn allowed
    public static final int SATELLITE_DATA_PLAN_METERED = 0;
    public static final int SATELLITE_DATA_PLAN_UNMETERED = 1;
    private BroadcastReceiver
            mDefaultSmsSubscriptionChangedBroadcastReceiver = new BroadcastReceiver() {
                @Override
@@ -731,12 +738,13 @@ public class SatelliteController extends Handler {
     *               (e.g., class name and method name)
     */
    public void incrementResultReceiverCount(String caller) {
        if (mFeatureFlags.geofenceEnhancementForBetterUx()) {
        if (mFeatureFlags.carrierRoamingNbIotNtn()) {
            synchronized (mResultReceiverTotalCountLock) {
                mResultReceiverTotalCount++;
                logd("[incrementResultReceiverCount] : " + caller
                        + " | ResultReceiver total count= " + mResultReceiverTotalCount);
                mResultReceiverCountPerMethodMap.compute(caller, (k, v) -> v == null ? 1 : v + 1);
                mResultReceiverCountPerMethodMap.compute(caller,
                        (k, v) -> v == null ? 1 : v + 1);

                if (mResultReceiverTotalCount > RESULT_RECEIVER_COUNT_ANOMALY_THRESHOLD) {
                    loge("[mResultReceiverTotalCount] is exceeds limits : "
@@ -750,7 +758,7 @@ public class SatelliteController extends Handler {
                }
            }
        } else {
            logd("[incrementResultReceiverCount]: geofenceEnhancementForBetterUx is not enabled");
            logd("[incrementResultReceiverCount]: carrierRoamingNbIotNtn is not enabled");
        }
    }

@@ -762,7 +770,7 @@ public class SatelliteController extends Handler {
     *               (e.g., class name and method name)
     */
    public void decrementResultReceiverCount(String caller) {
        if (mFeatureFlags.geofenceEnhancementForBetterUx()) {
        if (mFeatureFlags.carrierRoamingNbIotNtn()) {
            synchronized (mResultReceiverTotalCountLock) {
                if (mResultReceiverTotalCount > 0) {
                    mResultReceiverTotalCount--;
@@ -773,7 +781,7 @@ public class SatelliteController extends Handler {
                        (k, v) -> v > 0 ? v - 1 : v);
            }
        } else {
            logd("[decrementResultReceiverCount]: geofenceEnhancementForBetterUx is not enabled");
            logd("[decrementResultReceiverCount]: carrierRoamingNbIotNtn is not enabled");
        }
    }

@@ -4201,6 +4209,7 @@ public class SatelliteController extends Handler {
     */
    public void onSatelliteEntitlementStatusUpdated(int subId, boolean entitlementEnabled,
            @Nullable List<String> allowedPlmnList, @Nullable List<String> barredPlmnList,
            @Nullable Map<String,Integer> plmnDataPlanMap,
            @Nullable IIntegerConsumer callback) {
        if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
            logd("onSatelliteEntitlementStatusUpdated: carrierEnabledSatelliteFlag is not enabled");
@@ -4221,6 +4230,9 @@ public class SatelliteController extends Handler {
        if (barredPlmnList == null) {
            barredPlmnList = new ArrayList<>();
        }
        if (plmnDataPlanMap == null) {
            plmnDataPlanMap = new HashMap<>();
        }
        logd("onSatelliteEntitlementStatusUpdated subId=" + subId + ", entitlementEnabled="
                + entitlementEnabled + ", allowedPlmnList=["
                + String.join(",", allowedPlmnList) + "]" + ", barredPlmnList=["
@@ -4249,6 +4261,7 @@ public class SatelliteController extends Handler {
                mMergedPlmnListPerCarrier.remove(subId);
                mEntitlementPlmnListPerCarrier.put(subId, allowedPlmnList);
                mEntitlementBarredPlmnListPerCarrier.put(subId, barredPlmnList);
                mEntitlementDataPlanMapPerCarrier.put(subId, plmnDataPlanMap);
                updatePlmnListPerCarrier(subId);
                configureSatellitePlmnForCarrier(subId);
                mSubscriptionManagerService.setSatelliteEntitlementPlmnList(subId, allowedPlmnList);
@@ -5487,7 +5500,7 @@ public class SatelliteController extends Handler {

    /** If the provision state per subscriberId for the cached is not exist, check the database for
     * the corresponding value and use it. */
    private void updateSatelliteProvisionedStatePerSubscriberId() {
    protected void updateSatelliteProvisionedStatePerSubscriberId() {
        if (!mFeatureFlags.carrierRoamingNbIotNtn()) {
            return;
        }
@@ -5565,7 +5578,7 @@ public class SatelliteController extends Handler {
                KEY_SATELLITE_ROAMING_TURN_OFF_SESSION_FOR_EMERGENCY_CALL_BOOL);
    }

    private int getCarrierRoamingNtnConnectType(int subId) {
    public int getCarrierRoamingNtnConnectType(int subId) {
        return getConfigForSubId(subId).getInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT);
    }

@@ -6478,6 +6491,23 @@ public class SatelliteController extends Handler {
        updateSatelliteSystemNotification(-1, -1,/*visible*/ false);
    }

    public boolean isSatelliteSystemNotificationsEnabled(int carrierRoamingNtnConnectType) {
        if (!mFeatureFlags.carrierRoamingNbIotNtn()) {
            return false;
        }
        if (carrierRoamingNtnConnectType
            != CarrierConfigManager.CARRIER_ROAMING_NTN_CONNECT_MANUAL) {
            return true;
        }
        boolean notifySatelliteAvailabilityEnabled =
            mContext.getResources().getBoolean(R.bool.config_satellite_should_notify_availability);
        Boolean isSatelliteSupported = getIsSatelliteSupported();
        if(isSatelliteSupported == null) {
            return false;
        }
        return notifySatelliteAvailabilityEnabled && isSatelliteSupported;
    }

    /**
     * Update the system notification to reflect the current satellite status, that's either already
     * connected OR needs to be manually enabled. The device should only display one notification
@@ -6491,9 +6521,7 @@ public class SatelliteController extends Handler {
     */
    private void updateSatelliteSystemNotification(int subId,
            @CARRIER_ROAMING_NTN_CONNECT_TYPE int carrierRoamingNtnConnectType, boolean visible) {
        boolean notifySatelliteAvailabilityEnabled =
            mContext.getResources().getBoolean(R.bool.config_satellite_should_notify_availability);
        if (!mFeatureFlags.carrierRoamingNbIotNtn() || !notifySatelliteAvailabilityEnabled) {
        if (!isSatelliteSystemNotificationsEnabled(carrierRoamingNtnConnectType)) {
            plogd("updateSatelliteSystemNotification: satellite notifications are not enabled.");
            return;
        }
@@ -7212,7 +7240,7 @@ public class SatelliteController extends Handler {
                            + ", provisioned=" + provisioned);
                    list.add(new SatelliteSubscriberProvisionStatus.Builder()
                            .setSatelliteSubscriberInfo(satelliteSubscriberInfo)
                            .setProvisionStatus(provisioned).build());
                            .setProvisioned(provisioned).build());
                    mSubscriberIdPerSub.put(subscriberId, info.getSubscriptionId());
                }
            }
@@ -7268,7 +7296,7 @@ public class SatelliteController extends Handler {
            // TODO: need to check if satellite is allowed at current location for the subscription
            int subId = getSubIdFromSubscriberId(
                    status.getSatelliteSubscriberInfo().getSubscriberId());
            if (status.getProvisionStatus() && isActiveSubId(subId)) {
            if (status.isProvisioned() && isActiveSubId(subId)) {
                selectedSubId = subId;
                break;
            }
@@ -8262,4 +8290,28 @@ public class SatelliteController extends Handler {
            return mWifiStateEnabled;
        }
    }

    /**
     * Method to return the current data plan for the registered plmn based on entitlement
     * provisioning information. Note: If no information at
     * provisioning is supported this is overridden with operator carrier config information.
     *
     * @param subId current subscription id
     * @param plmn current registered plmn information
     *
     * @return Data supported modes {@link SatelliteController#SATELLITE_DATA_PLAN_METERED}
     */
    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;
    }
}
+29 −2
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ import static android.telephony.TelephonyManager.EXTRA_EMERGENCY_CALL_TO_SATELLI
import static android.telephony.TelephonyManager.EXTRA_EMERGENCY_CALL_TO_SATELLITE_LAUNCH_INTENT;
import static android.telephony.satellite.SatelliteManager.EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE_SOS;
import static android.telephony.satellite.SatelliteManager.EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE_T911;
import static android.telephony.satellite.SatelliteManager.SATELLITE_DISALLOWED_REASON_NOT_PROVISIONED;
import static android.telephony.satellite.SatelliteManager.SATELLITE_DISALLOWED_REASON_NOT_SUPPORTED;
import static android.telephony.satellite.SatelliteManager.SATELLITE_DISALLOWED_REASON_UNSUPPORTED_DEFAULT_MSG_APP;

import static com.android.internal.telephony.flags.Flags.satellitePersistentLogging;
import static com.android.internal.telephony.satellite.SatelliteController.INVALID_EMERGENCY_CALL_TO_SATELLITE_HANDOVER_TYPE;
@@ -262,6 +265,26 @@ public class SatelliteSOSMessageRecommender extends Handler {
        return SmsApplication.getDefaultSendToApplication(mContext, false);
    }

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    protected boolean updateAndGetProvisionState() {
        mSatelliteController.updateSatelliteProvisionedStatePerSubscriberId();
        return isDeviceProvisioned();
    }

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    protected boolean isSatelliteAllowedByReasons() {
        SatelliteManager satelliteManager = mContext.getSystemService(SatelliteManager.class);
        List<Integer> disallowedReasons = satelliteManager.getSatelliteDisallowedReasons();
        if (disallowedReasons.stream().anyMatch(r ->
                (r == SATELLITE_DISALLOWED_REASON_UNSUPPORTED_DEFAULT_MSG_APP
                        || r == SATELLITE_DISALLOWED_REASON_NOT_PROVISIONED
                        || r == SATELLITE_DISALLOWED_REASON_NOT_SUPPORTED))) {
            plogd("isAllowedForDefaultMessageApp:false, disallowedReasons=" + disallowedReasons);
            return false;
        }
        return true;
    }

    private void handleEmergencyCallStartedEvent(@NonNull Connection connection) {
        plogd("handleEmergencyCallStartedEvent: connection=" + connection);
        mSatelliteController.setLastEmergencyCallTime();
@@ -310,6 +333,8 @@ public class SatelliteSOSMessageRecommender extends Handler {
                return;
            }

            updateAndGetProvisionState();

            /*
             * The device might be connected to satellite after the emergency call started. Thus, we
             * need to do this check again so that we will have higher chance of sending the event
@@ -321,7 +346,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
            boolean isCellularAvailable = SatelliteServiceUtils.isCellularAvailable();
            if (!isCellularAvailable
                    && isSatelliteAllowed()
                    && (isDeviceProvisioned()
                    && ((isDeviceProvisioned() && isSatelliteAllowedByReasons())
                    || isSatelliteConnectedViaCarrierWithinHysteresisTime())
                    && shouldTrackCall(mEmergencyConnection.getState())) {
                plogd("handleTimeoutEvent: Sent EVENT_DISPLAY_EMERGENCY_MESSAGE to Dialer");
@@ -737,7 +762,9 @@ public class SatelliteSOSMessageRecommender extends Handler {

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    public int getEmergencyCallToSatelliteHandoverType() {
        if (Flags.carrierRoamingNbIotNtn() && isDeviceProvisioned()
        if (Flags.carrierRoamingNbIotNtn()
                && isDeviceProvisioned()
                && isSatelliteAllowedByReasons()
                && isSatelliteConnectedViaCarrierWithinHysteresisTime()) {
            int satelliteSubId = mSatelliteController.getSelectedSatelliteSubId();
            return mSatelliteController.getCarrierRoamingNtnEmergencyCallToSatelliteHandoverType(
Loading