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

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

Snap for 11822896 from da5f1fc0 to 24Q3-release

Change-Id: Ifd06acd07a544095f2894517751f3b6b78bffe8f
parents 667525a8 da5f1fc0
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -1295,23 +1295,22 @@ public class RIL extends BaseCommands implements CommandsInterface {
        } else if (proxy instanceof RadioImsProxy) {
            service = HAL_SERVICE_IMS;
        }

        if (mHalVersion.get(service).less(version)) {
            riljLoge(String.format("%s not supported on service %s < %s.",
                    request, serviceToString(service), version));
        if (proxy == null || proxy.isEmpty()) {
            riljLoge(String.format("Unable to complete %s because service %s is not available.",
                    request, serviceToString(service)));
            if (result != null) {
                AsyncResult.forMessage(result, null,
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                result.sendToTarget();
            }
            return false;
        }
        if (proxy == null || proxy.isEmpty()) {
            riljLoge(String.format("Unable to complete %s because service %s is not available.",
                    request, serviceToString(service)));
        if (mHalVersion.get(service).less(version)) {
            riljLoge(String.format("%s not supported on service %s < %s.",
                    request, serviceToString(service), version));
            if (result != null) {
                AsyncResult.forMessage(result, null,
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                result.sendToTarget();
            }
            return false;
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ public class SimultaneousCallingTracker {
                l.onSimultaneousCallingSupportChanged(simultaneousCallSubscriptionIdMap);
            }
        } catch (Exception e) {
            Log.w(LOG_TAG, "handleVideoCapabilitiesChanged: Exception = " + e);
            Log.w(LOG_TAG, "handleSimultaneousCallingSupportChanged: Exception = " + e);
        }
    }

+8 −7
Original line number Diff line number Diff line
@@ -302,15 +302,16 @@ public class SmsController extends ISmsImplBase {
        SubscriptionInfo info;
        try {
            info = getSubscriptionInfo(subId);
        } finally {
            Binder.restoreCallingIdentity(token);
        }

            if (isBluetoothSubscription(info)) {
                sendBluetoothText(info, destAddr, text, sentIntent, deliveryIntent);
            } else {
            sendIccText(subId, callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent,
                    persistMessageForNonDefaultSmsApp, messageId, skipShortCodeCheck);
                sendIccText(subId, callingPackage, destAddr, scAddr, text, sentIntent,
                        deliveryIntent, persistMessageForNonDefaultSmsApp, messageId,
                        skipShortCodeCheck);
            }
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }

+86 −5
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ public class EmergencyStateTracker {
    private Runnable mOnEcmExitCompleteRunnable;
    private int mOngoingCallProperties;
    private boolean mSentEmergencyCallState;
    private android.telecom.Connection mNormalRoutingEmergencyConnection;

    /** For emergency SMS */
    private final Set<String> mOngoingEmergencySmsIds = new ArraySet<>();
@@ -633,8 +634,14 @@ public class EmergencyStateTracker {
        mOngoingConnection = c;
        mIsTestEmergencyNumber = isTestEmergencyNumber;
        sendEmergencyCallStateChange(mPhone, true);
        final android.telecom.Connection expectedConnection = mOngoingConnection;
        maybeRejectIncomingCall(result -> {
            Rlog.i(TAG, "maybeRejectIncomingCall : result = " + result);
            if (!Objects.equals(mOngoingConnection, expectedConnection)) {
                Rlog.i(TAG, "maybeRejectIncomingCall "
                        + expectedConnection.getTelecomCallId() + " canceled.");
                return;
            }
            turnOnRadioAndSwitchDds(mPhone, EMERGENCY_TYPE_CALL, mIsTestEmergencyNumber);
        });
        return mCallEmergencyModeFuture;
@@ -1933,6 +1940,27 @@ public class EmergencyStateTracker {
        }
    }

    private Call getRingingCall(Phone phone) {
        if (phone == null) return null;
        Call ringingCall = phone.getRingingCall();
        if (ringingCall != null
                && ringingCall.getState() != Call.State.IDLE
                && ringingCall.getState() != Call.State.DISCONNECTED) {
            return ringingCall;
        }
        // Check the ImsPhoneCall in DISCONNECTING state.
        Phone imsPhone = phone.getImsPhone();
        if (imsPhone != null) {
            ringingCall = imsPhone.getRingingCall();
        }
        if (imsPhone != null && ringingCall != null
                && ringingCall.getState() != Call.State.IDLE
                && ringingCall.getState() != Call.State.DISCONNECTED) {
            return ringingCall;
        }
        return null;
    }

    /**
     * Ensures that there is no incoming call.
     *
@@ -1951,14 +1979,14 @@ public class EmergencyStateTracker {

        Call ringingCall = null;
        for (Phone phone : phones) {
            ringingCall = phone.getRingingCall();
            if (ringingCall != null && ringingCall.isRinging()) {
            ringingCall = getRingingCall(phone);
            if (ringingCall != null) {
                Rlog.i(TAG, "maybeRejectIncomingCall found a ringing call");
                break;
            }
        }

        if (ringingCall == null || !ringingCall.isRinging()) {
        if (ringingCall == null) {
            if (completeConsumer != null) {
                completeConsumer.accept(true);
            }
@@ -2007,9 +2035,13 @@ public class EmergencyStateTracker {
     */
    private void handleNewRingingConnection(Message msg) {
        Connection c = (Connection) ((AsyncResult) msg.obj).result;
        if (c == null || mOngoingConnection == null
        if (c == null) return;
        if ((mNormalRoutingEmergencyConnection == null
                || mNormalRoutingEmergencyConnection.getState() == STATE_ACTIVE
                || mNormalRoutingEmergencyConnection.getState() == STATE_DISCONNECTED)
                && (mOngoingConnection == null
                || mOngoingConnection.getState() == STATE_ACTIVE
                || mOngoingConnection.getState() == STATE_DISCONNECTED) {
                || mOngoingConnection.getState() == STATE_DISCONNECTED)) {
            return;
        }
        if ((c.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS)
@@ -2024,4 +2056,53 @@ public class EmergencyStateTracker {
            }
        }
    }

    /**
     * Indicates the start of a normal routing emergency call.
     *
     * <p>
     * Handles turning on radio and switching DDS.
     *
     * @param phone the {@code Phone} on which to process the emergency call.
     * @param c the {@code Connection} on which to process the emergency call.
     * @param completeConsumer The consumer to call once rejecting incoming call completes,
     *        provides {@code true} result if operation completes successfully
     *        or {@code false} if the operation timed out/failed.
     */
    public void startNormalRoutingEmergencyCall(@NonNull Phone phone,
            @NonNull android.telecom.Connection c, @NonNull Consumer<Boolean> completeConsumer) {
        Rlog.i(TAG, "startNormalRoutingEmergencyCall: phoneId=" + phone.getPhoneId()
                + ", callId=" + c.getTelecomCallId());

        mNormalRoutingEmergencyConnection = c;
        maybeRejectIncomingCall(completeConsumer);
    }

    /**
     * Indicates the termination of a normal routing emergency call.
     *
     * @param c the normal routing emergency call disconnected.
     */
    public void endNormalRoutingEmergencyCall(@NonNull android.telecom.Connection c) {
        if (c != mNormalRoutingEmergencyConnection) return;
        Rlog.i(TAG, "endNormalRoutingEmergencyCall: callId=" + c.getTelecomCallId());
        mNormalRoutingEmergencyConnection = null;
    }

    /**
     * Handles the normal routing emergency call state change.
     *
     * @param c the call whose state has changed
     * @param state the new call state
     */
    public void onNormalRoutingEmergencyCallStateChanged(android.telecom.Connection c,
            @android.telecom.Connection.ConnectionState int state) {
        if (c != mNormalRoutingEmergencyConnection) return;

        // If the call is connected, we don't need to monitor incoming call any more.
        if (state == android.telecom.Connection.STATE_ACTIVE
                || state == android.telecom.Connection.STATE_DISCONNECTED) {
            endNormalRoutingEmergencyCall(c);
        }
    }
}
+21 −2
Original line number Diff line number Diff line
@@ -1181,7 +1181,7 @@ public class SubscriptionManagerService extends ISub.Stub {
                                SubscriptionManager.INVALID_SIM_SLOT_INDEX,
                                null, SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM);
                        mSubscriptionDatabaseManager.setDisplayName(subId, mContext.getResources()
                                .getString(R.string.default_card_name, subId));
                                .getString(R.string.default_card_name, getCardNumber(subId)));
                        subInfo = mSubscriptionDatabaseManager.getSubscriptionInfoInternal(subId);
                    }

@@ -1495,7 +1495,8 @@ public class SubscriptionManagerService extends ISub.Stub {
                    subId = insertSubscriptionInfo(iccId, phoneId, null,
                            SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM);
                    mSubscriptionDatabaseManager.setDisplayName(subId,
                            mContext.getResources().getString(R.string.default_card_name, subId));
                            mContext.getResources().getString(R.string.default_card_name,
                                    getCardNumber(subId)));
                } else {
                    subId = subInfo.getSubscriptionId();
                    log("updateSubscription: Found existing subscription. subId= " + subId
@@ -4732,6 +4733,24 @@ public class SubscriptionManagerService extends ISub.Stub {
                || SystemProperties.getBoolean(BOOT_ALLOW_MOCK_MODEM_PROPERTY, false));
    }

    /**
     * Iterates through previously subscribed SIMs to excludes subscriptions that are not visible
     * to the users to provide a more appropriate number to describe the current SIM.
     * @param subId current subscription id.
     * @return cardNumber subId excluding invisible subscriptions.
     */
    private int getCardNumber(int subId) {
        int cardNumber = subId; // Initialize with the potential card number
        for (int i = subId - 1; i > 0; i--) {
            SubscriptionInfoInternal subInfo = getSubscriptionInfoInternal(i);
            if (subInfo != null && !subInfo.isVisible()) {
                cardNumber--;
            }
        }

        return cardNumber;
    }

    /**
     * Log debug messages.
     *
Loading