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

Commit 580f3106 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7557463 from c9ee4750 to sc-v2-release

Change-Id: Icc3c4b1c72daabd8fd55679540c64f4953c6abbc
parents b08c7fa5 c9ee4750
Loading
Loading
Loading
Loading
+38 −6
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ public class GsmCdmaPhone extends Phone {
    private IccSmsInterfaceManager mIccSmsInterfaceManager;

    private boolean mResetModemOnRadioTechnologyChange = false;
    private boolean mSsOverCdmaSupported = false;

    private int mRilVersion;
    private boolean mBroadcastEmergencyCallStateChanges = false;
@@ -2200,6 +2201,11 @@ public class GsmCdmaPhone extends Phone {
        return false;
    }

    private void updateSsOverCdmaSupported(PersistableBundle b) {
        if (b == null) return;
        mSsOverCdmaSupported = b.getBoolean(CarrierConfigManager.KEY_SUPPORT_SS_OVER_CDMA_BOOL);
    }

    @Override
    public boolean useSsOverIms(Message onComplete) {
        boolean isUtEnabled = isUtEnabled();
@@ -2239,9 +2245,17 @@ public class GsmCdmaPhone extends Phone {
                }
                mCi.queryCallForwardStatus(commandInterfaceCFReason, serviceClass, null, resp);
            }
        } else {
            if (!mSsOverCdmaSupported) {
                // If SS over CDMA is not supported and UT is not at the time, notify the user of
                // the error and disable the option.
                AsyncResult.forMessage(onComplete, null,
                        new CommandException(CommandException.Error.INVALID_STATE,
                                "Call Forwarding over CDMA unavailable"));
            } else {
                loge("getCallForwardingOption: not possible in CDMA, just return empty result");
                AsyncResult.forMessage(onComplete, makeEmptyCallForward(), null);
            }
            onComplete.sendToTarget();
        }
    }
@@ -2289,7 +2303,7 @@ public class GsmCdmaPhone extends Phone {
                        timerSeconds,
                        resp);
            }
        } else {
        } else if (mSsOverCdmaSupported) {
            String formatNumber = GsmCdmaConnection.formatDialString(dialingNumber);
            String cfNumber = CdmaMmiCode.getCallForwardingPrefixAndNumber(
                    commandInterfaceCFAction, commandInterfaceCFReason, formatNumber);
@@ -2306,6 +2320,10 @@ public class GsmCdmaPhone extends Phone {

            AsyncResult.forMessage(onComplete, CommandsInterface.SS_STATUS_UNKNOWN, null);
            onComplete.sendToTarget();
        } else {
            loge("setCallForwardingOption: SS over CDMA not supported, can not complete");
            AsyncResult.forMessage(onComplete, CommandsInterface.SS_STATUS_UNKNOWN, null);
            onComplete.sendToTarget();
        }
    }

@@ -2429,8 +2447,17 @@ public class GsmCdmaPhone extends Phone {
            //class parameter in call waiting interrogation  to network
            mCi.queryCallWaiting(CommandsInterface.SERVICE_CLASS_NONE, onComplete);
        } else {
            int arr[] = {CommandsInterface.SS_STATUS_UNKNOWN, CommandsInterface.SERVICE_CLASS_NONE};
            if (!mSsOverCdmaSupported) {
                // If SS over CDMA is not supported and UT is not at the time, notify the user of
                // the error and disable the option.
                AsyncResult.forMessage(onComplete, null,
                        new CommandException(CommandException.Error.INVALID_STATE,
                                "Call Waiting over CDMA unavailable"));
            } else {
                int[] arr =
                        {CommandsInterface.SS_STATUS_UNKNOWN, CommandsInterface.SERVICE_CLASS_NONE};
                AsyncResult.forMessage(onComplete, arr, null);
            }
            onComplete.sendToTarget();
        }
    }
@@ -2458,7 +2485,7 @@ public class GsmCdmaPhone extends Phone {

        if (isPhoneTypeGsm()) {
            mCi.setCallWaiting(enable, serviceClass, onComplete);
        } else {
        } else if (mSsOverCdmaSupported) {
            String cwPrefix = CdmaMmiCode.getCallWaitingPrefix(enable);
            Rlog.i(LOG_TAG, "setCallWaiting in CDMA : dial for set call waiting" + " prefix= " + cwPrefix);

@@ -2472,6 +2499,10 @@ public class GsmCdmaPhone extends Phone {

            AsyncResult.forMessage(onComplete, CommandsInterface.SS_STATUS_UNKNOWN, null);
            onComplete.sendToTarget();
        } else {
            loge("setCallWaiting: SS over CDMA not supported, can not complete");
            AsyncResult.forMessage(onComplete, CommandsInterface.SS_STATUS_UNKNOWN, null);
            onComplete.sendToTarget();
        }
    }

@@ -2924,6 +2955,7 @@ public class GsmCdmaPhone extends Phone {
                updateCdmaRoamingSettingsAfterCarrierConfigChanged(b);

                updateNrSettingsAfterCarrierConfigChanged(b);
                updateSsOverCdmaSupported(b);
                loadAllowedNetworksFromSubscriptionDatabase();
                // Obtain new radio capabilities from the modem, since some are SIM-dependent
                mCi.getRadioCapability(obtainMessage(EVENT_GET_RADIO_CAPABILITY));
+5 −1
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@ public class EmergencyNumberTracker extends Handler {
            }
            EmergencyNumber.mergeSameNumbersInEmergencyNumberList(updatedAssetEmergencyNumberList);
        } catch (IOException ex) {
            loge("Cache asset emergency database failure: " + ex);
            logw("Cache asset emergency database failure: " + ex);
        } finally {
            // close quietly by catching non-runtime exceptions.
            if (inputStream != null) {
@@ -1143,6 +1143,10 @@ public class EmergencyNumberTracker extends Handler {
        Rlog.d(TAG, str);
    }

    private static void logw(String str) {
        Rlog.w(TAG, str);
    }

    private static void loge(String str) {
        Rlog.e(TAG, str);
    }