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

Commit b14b61e5 authored by Jang Hayeong's avatar Jang Hayeong Committed by Sungjae
Browse files

callwaiting: Support cdma call waiting setting



CDMA call waiting should be supported by setting UI
regarding CDMA VoLTE case.
Getting query call waiting is useless in no VoLTE case.
SS_STATUS_UNKNOWN will be returned for empty result.
Place call to set call waiting with prefix.

Bug: 146533000

Change-Id: Ib8b580781154543c87269786c8ecf9cf71d0d93b
Signed-off-by: default avatarJang Hayeong <hayeong.jang@samsung.com>
Signed-off-by: default avatarSungjae <sung_jae.kim@samsung.com>
parent 63ad79f9
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -2235,7 +2235,9 @@ public class GsmCdmaPhone extends Phone {
            //class parameter in call waiting interrogation  to network
            mCi.queryCallWaiting(CommandsInterface.SERVICE_CLASS_NONE, onComplete);
        } else {
            mCi.queryCallWaiting(CommandsInterface.SERVICE_CLASS_VOICE, onComplete);
            int arr[] = {CommandsInterface.SS_STATUS_UNKNOWN, CommandsInterface.SERVICE_CLASS_NONE};
            AsyncResult.forMessage(onComplete, arr, null);
            onComplete.sendToTarget();
        }
    }

@@ -2264,9 +2266,17 @@ public class GsmCdmaPhone extends Phone {
            }
            mCi.setCallWaiting(enable, serviceClass, onComplete);
        } else {
            loge("method setCallWaiting is NOT supported in CDMA without IMS!");
            AsyncResult.forMessage(onComplete, null,
                    CommandException.fromRilErrno(RILConstants.REQUEST_NOT_SUPPORTED));
            String cwPrefix = CdmaMmiCode.getCallWaitingPrefix(enable);
            Rlog.i(LOG_TAG, "setCallWaiting in CDMA : dial for set call waiting" + " prefix= " + cwPrefix);

            PhoneAccountHandle phoneAccountHandle = subscriptionIdToPhoneAccountHandle(getSubId());
            Bundle extras = new Bundle();
            extras.putParcelable(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle);

            final TelecomManager telecomManager = TelecomManager.from(mContext);
            telecomManager.placeCall(Uri.parse(PhoneAccount.SCHEME_TEL + cwPrefix), extras);

            AsyncResult.forMessage(onComplete, CommandsInterface.SS_STATUS_UNKNOWN, null);
            onComplete.sendToTarget();
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -429,4 +429,12 @@ public final class CdmaMmiCode extends Handler implements MmiCode {
        }
        return prefixWithNum;
    }

    public static String getCallWaitingPrefix(boolean enable) {
        if (enable) {
            return "*74";
        } else {
            return "*740";
        }
    }
}