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

Unverified Commit 0db0c90a authored by jrior001's avatar jrior001 Committed by Michael Bestas
Browse files

incallui: remove qti framework dependency for DSDA

Currently the check for DSDA enabled devices relies on a qcom specific
funcction. Allow non-qcom devices to enable the DSDA InCallUi with the
persist.radio.multisim.config prop already used elsewhere.

Change-Id: Id91641e026c6108124a839aa84e5195a5efa6594
parent 31eaffee
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.content.pm.ActivityInfo;
import android.telecom.InCallService.VideoCall;
import android.telephony.PhoneNumberUtils;
@@ -48,6 +49,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;

import com.android.incallui.util.TelecomCallUtil;
import com.android.internal.telephony.TelephonyProperties;

import java.lang.reflect.*;
import java.util.ArrayList;
@@ -462,19 +464,24 @@ public class QtiCallUtils {

    static Boolean dsdaEnabled = null;
    static boolean isDsdaEnabled() {
        try {
            if (dsdaEnabled == null) {
                IExtTelephony mExtTelephony = getIExtTelephony();
                Log.d(LOG_TAG, "isDsdaEnabled, mExtTelephony:" + mExtTelephony);
                dsdaEnabled = mExtTelephony.isDsdaEnabled();
        if (dsdaEnabled != null) {
            return dsdaEnabled;
        }

        String config = SystemProperties.get(TelephonyProperties.PROPERTY_MULTI_SIM_CONFIG);
        IExtTelephony extTelephony = getIExtTelephony();
        if (extTelephony == null) {
            dsdaEnabled = config.equals("dsda");
        } else {
            try {
                dsdaEnabled = extTelephony.isDsdaEnabled();
            } catch (RemoteException ex) {
            Log.e(LOG_TAG, "Exception : " + ex);
        } catch (NullPointerException ex) {
            Log.e(LOG_TAG, "Exception : " + ex);
                Log.e(LOG_TAG, "RemoteException: " + ex);
                dsdaEnabled = config.equals("dsda");
            }
        return (dsdaEnabled == null) ? false : dsdaEnabled;
        }

        return dsdaEnabled;
    }

    public static void downgradeToVoiceCall(final Call call) {