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

Commit 59bc49af authored by Sudheer Reddy Yampalla's avatar Sudheer Reddy Yampalla Committed by Linux Build Service Account
Browse files

Telephony: Add support for new OEMHOOK requests/responses

1. Tune Away
2. Priority Subscription
3. Local Call Hold
4. Default Voice Subscription
5. Voice SystemId

Change-Id: I656ad53bad97a48e11b6499d68ff362ff3eda3c9
CRs-fixed: 464483
(cherry picked from commit 317e0acb5e7f6b29dea710e38221d2136aa861c9)
parent 65dbfc6e
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public abstract class BaseCommands implements CommandsInterface {
    protected RegistrantList mCdmaFwdContDtmfStartRegistrants = new RegistrantList();
    protected RegistrantList mCdmaFwdContDtmfStopRegistrants = new RegistrantList();
    protected RegistrantList mWmsReadyRegistrants = new RegistrantList();
    protected RegistrantList mVoiceSystemIdRegistrants = new RegistrantList();

    protected Registrant mGsmSmsRegistrant;
    protected Registrant mCdmaSmsRegistrant;
@@ -726,6 +727,14 @@ public abstract class BaseCommands implements CommandsInterface {
        mWmsReadyRegistrants.remove(h);
    }

    public void registerForUnsolVoiceSystemId(Handler h, int what, Object obj) {
        mVoiceSystemIdRegistrants.addUnique(h, what, obj);
    }

    public void unregisterForUnsolVoiceSystemId(Handler h) {
        mVoiceSystemIdRegistrants.remove(h);
    }

    /**
     * {@inheritDoc}
     */
@@ -789,6 +798,18 @@ public abstract class BaseCommands implements CommandsInterface {
    protected void onRadioAvailable() {
    }

    public void setTuneAway(boolean tuneAway, Message response) {
    }

    public void setPrioritySub(int subIndex, Message response) {
    }

    public void setDefaultVoiceSub(int subIndex, Message response) {
    }

    public void setLocalCallHold(int lchStatus, Message response) {
    }

    /**
     * {@inheritDoc}
     */
+38 −0
Original line number Diff line number Diff line
@@ -600,6 +600,17 @@ public interface CommandsInterface {
     void registerForRilConnected(Handler h, int what, Object obj);
     void unregisterForRilConnected(Handler h);

    /**
     * Registers the handler for voice system id changed events
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     *
     */
    void registerForUnsolVoiceSystemId(Handler h, int what, Object obj);
    void unregisterForUnsolVoiceSystemId(Handler h);

    /**
     * Supply the ICC PIN to the ICC card
     *
@@ -1765,4 +1776,31 @@ public interface CommandsInterface {
     */
    public void setDataSubscription (Message result);

    /**
     * Request to enable or disable the tune away state.
     * @param tuneAway true to enable, false to disable
     * @param response is callback message
     */
    void setTuneAway(boolean tuneAway, Message response);

    /**
     * Sets the provided subIndex as priority subscription index.
     * @param subIndex Subscription index
     * @param response is callback message
     */
    void setPrioritySub(int subIndex, Message response);

    /**
     * Set the default voice subscription id.
     * @param subIndex subscription index
     * @param response is callback message
     */
    void setDefaultVoiceSub(int subIndex, Message response);

    /**
     * Request to update the current local call hold state.
     * @param lchStatus, true if call is in lch state
     * @param response is callback message
     */
    void setLocalCallHold(int lchStatus, Message response);
}
+3 −2
Original line number Diff line number Diff line
@@ -320,9 +320,7 @@ public class ExtCallManager extends CallManager {
                Rlog.d(LOG_TAG, "Set parameters for Lch sub = " + sub);
                setAudioParameters(sub);
            }
            /* Unsol OEM Hook changes are required to enable it.
            offHookPhone.setLocalCallHold(lchStatus, mHandler.obtainMessage(EVENT_LOCAL_CALL_HOLD));
            */
            mLchStatus[sub] = lchStatus;
        }
    }
@@ -509,11 +507,14 @@ public class ExtCallManager extends CallManager {
    @Override
    protected void registerForPhoneStates(Phone phone) {
        super.registerForPhoneStates(phone);
        phone.registerForUnsolVoiceSystemId(mHandler, EVENT_VOICE_SYSTEM_ID,
                phone.getSubscription());
    }

    @Override
    protected void unregisterForPhoneStates(Phone phone) {
        super.unregisterForPhoneStates(phone);
        phone.unregisterForUnsolVoiceSystemId(mHandler);
    }

    /**
+42 −0
Original line number Diff line number Diff line
@@ -683,6 +683,20 @@ public interface Phone {
     */
    public void unregisterForSimRecordsLoaded(Handler h);

     /**
     * Registration point for Voice system id change
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj placed in Message.obj
     */
    public void registerForUnsolVoiceSystemId(Handler h, int what, Object obj);

    /**
     * Unregister for notifications for Voice system id change
     * @param h Handler to be removed from the registrant list.
     */
    public void unregisterForUnsolVoiceSystemId(Handler h);

    /**
     * Returns SIM record load state. Use
     * <code>getSimCard().registerForReady()</code> for change notification.
@@ -1954,4 +1968,32 @@ public interface Phone {
     * Returns the subscription id.
     */
    public int getSubscription();

    /**
     * Request to enable or disable the tune away state.
     * @param tuneAway true to enable, false to disable
     * @param response is callback message
     */
    void setTuneAway(boolean tuneAway, Message response);

    /**
     * Sets the provided subIndex as priority subscription index.
     * @param subIndex Subscription index
     * @param response is callback message
     */
    void setPrioritySub(int subIndex, Message response);

    /**
     * Set the default voice subscription id.
     * @param subIndex subscription index
     * @param response is callback message
     */
    void setDefaultVoiceSub(int subIndex, Message response);

    /**
     * Request to update the current local call hold state.
     * @param lchStatus, true if call is in lch state
     * @param response is callback message
     */
    void setLocalCallHold(int lchStatus, Message response);
}
+30 −0
Original line number Diff line number Diff line
@@ -679,6 +679,16 @@ public abstract class PhoneBase extends Handler implements Phone {
        mCi.unregisterForResendIncallMute(h);
    }

    @Override
    public void registerForUnsolVoiceSystemId(Handler h, int what, Object obj) {
        mCi.registerForUnsolVoiceSystemId(h,what,obj);
    }

    @Override
    public void unregisterForUnsolVoiceSystemId(Handler h) {
        mCi.unregisterForUnsolVoiceSystemId(h);
    }

    @Override
    public void setEchoSuppressionEnabled(boolean enabled) {
        // no need for regular phone
@@ -1570,4 +1580,24 @@ public abstract class PhoneBase extends Handler implements Phone {
    public int getSubscription() {
        return DEFAULT_SUBSCRIPTION;
    }

    @Override
    public void setTuneAway(boolean tuneAway, Message response) {
        mCi.setTuneAway(tuneAway, response);
    }

    @Override
    public void setPrioritySub(int subIndex, Message response) {
        mCi.setPrioritySub(subIndex, response);
    }

    @Override
    public void setDefaultVoiceSub(int subIndex, Message response) {
        mCi.setDefaultVoiceSub(subIndex, response);
    }

    @Override
    public void setLocalCallHold(int lchStatus, Message response) {
        mCi.setLocalCallHold(lchStatus, response);
    }
}
Loading