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

Commit eb561d89 authored by Alexandre Roux's avatar Alexandre Roux
Browse files

Merge branch 'v1-t' into v1.21-t

parents 583cf1b6 4a87b067
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+11 −0
Original line number Diff line number Diff line
stages:
  - auto-merge-main
  - update-from-upstream

include:
  - project: 'e/templates'
    ref: master
    file: '/gitlab-ci/.gitlab-ci-auto-merge-main.yml'
  - project: 'e/templates'
    ref: master
    file: '/gitlab-ci/.gitlab-ci-import-updates-from-upstream.yml'
+3 −3
Original line number Diff line number Diff line
@@ -289,10 +289,10 @@ public class RadioMessagingProxy extends RadioServiceProxy {
        if (isAidl()) {
            android.hardware.radio.messaging.ImsSmsMessage msg =
                    new android.hardware.radio.messaging.ImsSmsMessage();
            msg.tech = android.hardware.radio.RadioTechnologyFamily.THREE_GPP;
            msg.retry = (byte) retry >= 1;
            msg.messageRef = messageRef;
            if (gsmPdu != null) {
                msg.tech = android.hardware.radio.RadioTechnologyFamily.THREE_GPP;
                msg.gsmMessage = new android.hardware.radio.messaging.GsmSmsMessage[]{
                        RILUtils.convertToHalGsmSmsMessageAidl(smscPdu, gsmPdu)};
                msg.cdmaMessage = new android.hardware.radio.messaging.CdmaSmsMessage[0];
@@ -307,14 +307,14 @@ public class RadioMessagingProxy extends RadioServiceProxy {
        } else {
            android.hardware.radio.V1_0.ImsSmsMessage msg =
                    new android.hardware.radio.V1_0.ImsSmsMessage();
            msg.tech = android.hardware.radio.V1_0.RadioTechnologyFamily.THREE_GPP;
            msg.retry = (byte) retry >= 1;
            msg.messageRef = messageRef;
            if (gsmPdu != null) {
                msg.tech = android.hardware.radio.V1_0.RadioTechnologyFamily.THREE_GPP;
                msg.gsmMessage.add(RILUtils.convertToHalGsmSmsMessage(smscPdu, gsmPdu));
            }
            if (cdmaPdu != null) {
                msg.tech = android.hardware.radio.RadioTechnologyFamily.THREE_GPP2;
                msg.tech = android.hardware.radio.V1_0.RadioTechnologyFamily.THREE_GPP2;
                msg.cdmaMessage.add(RILUtils.convertToHalCdmaSmsMessage(cdmaPdu));
            }
            mRadioProxy.sendImsSms(serial, msg);
+16 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.provider.Telephony.Sms.Intents;
import android.telephony.ServiceState;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.telephony.TelephonyManager;

import com.android.ims.ImsManager;
import com.android.internal.annotations.VisibleForTesting;
@@ -103,6 +104,8 @@ public class SmsDispatchersController extends Handler {
    private final CommandsInterface mCi;
    private final Context mContext;

    private TelephonyManager mTelephonyManager;

    /** true if IMS is registered and sms is supported, false otherwise.*/
    private boolean mIms = false;
    private String mImsSmsFormat = SmsConstants.FORMAT_UNKNOWN;
@@ -367,9 +370,21 @@ public class SmsDispatchersController extends Handler {
        }
    }


    private void updateImsInfo(AsyncResult ar) {
        int[] responseArray = (int[]) ar.result;
        int mcc, mnc;

        mTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);

        String carrierMccMnc = mTelephonyManager.getNetworkOperator();

        if ("20820".equals(carrierMccMnc)) { // Check if MCC is 208 and MNC is 20 (Bouygues)
            setImsSmsFormat(PhoneConstants.PHONE_TYPE_GSM); // Sets 3GPP format
        } else {
            setImsSmsFormat(responseArray[1]);
        }

        mIms = responseArray[0] == 1 && !SmsConstants.FORMAT_UNKNOWN.equals(mImsSmsFormat);
        Rlog.d(TAG, "IMS registration state: " + mIms + " format: " + mImsSmsFormat);
    }