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

Commit a6abfa91 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Merge "Add support for CALL_WAITING supp service notification." am: 660aba4a am: f8ef27f3

am: 6663eead

Change-Id: I7c4f656b7e636ca245fb5812954865b57f1a81cc
parents 5e1aad84 6663eead
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -530,7 +530,7 @@ public abstract class Connection {
        mUserData = null;
        mUserData = null;
    }
    }


    public final void addPostDialListener(PostDialListener listener) {
    public void addPostDialListener(PostDialListener listener) {
        if (!mPostDialListeners.contains(listener)) {
        if (!mPostDialListeners.contains(listener)) {
            mPostDialListeners.add(listener);
            mPostDialListeners.add(listener);
        }
        }
@@ -674,7 +674,7 @@ public abstract class Connection {
     *
     *
     * @param listener A listener.
     * @param listener A listener.
     */
     */
    public final void addListener(Listener listener) {
    public void addListener(Listener listener) {
        mListeners.add(listener);
        mListeners.add(listener);
    }
    }


+4 −2
Original line number Original line Diff line number Diff line
@@ -103,7 +103,7 @@ public class TelephonyTester {
            "com.android.internal.telephony.TestSuppSrvcNotification";
            "com.android.internal.telephony.TestSuppSrvcNotification";


    private static final String EXTRA_CODE = "code";
    private static final String EXTRA_CODE = "code";

    private static final String EXTRA_TYPE = "type";


    private static final String ACTION_TEST_SERVICE_STATE =
    private static final String ACTION_TEST_SERVICE_STATE =
            "com.android.internal.telephony.TestServiceState";
            "com.android.internal.telephony.TestServiceState";
@@ -317,8 +317,9 @@ public class TelephonyTester {
    }
    }


    private void sendTestSuppServiceNotification(Intent intent) {
    private void sendTestSuppServiceNotification(Intent intent) {
        if (intent.hasExtra(EXTRA_CODE)) {
        if (intent.hasExtra(EXTRA_CODE) && intent.hasExtra(EXTRA_TYPE)) {
            int code = intent.getIntExtra(EXTRA_CODE, -1);
            int code = intent.getIntExtra(EXTRA_CODE, -1);
            int type = intent.getIntExtra(EXTRA_TYPE, -1);
            ImsPhone imsPhone = (ImsPhone) mPhone;
            ImsPhone imsPhone = (ImsPhone) mPhone;
            if (imsPhone == null) {
            if (imsPhone == null) {
                return;
                return;
@@ -326,6 +327,7 @@ public class TelephonyTester {
            log("Test supp service notification:" + code);
            log("Test supp service notification:" + code);
            SuppServiceNotification suppServiceNotification = new SuppServiceNotification();
            SuppServiceNotification suppServiceNotification = new SuppServiceNotification();
            suppServiceNotification.code = code;
            suppServiceNotification.code = code;
            suppServiceNotification.notificationType = type;
            imsPhone.notifySuppSvcNotification(suppServiceNotification);
            imsPhone.notifySuppSvcNotification(suppServiceNotification);
        }
        }
    }
    }
+155 −22
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ import android.telephony.PhoneNumberUtils;
 * {@hide}
 * {@hide}
 */
 */
public class SuppServiceNotification {
public class SuppServiceNotification {
    /** Type of notification: 0 = MO; 1 = MT */
    /** Type of notification: 0 = code1; 1 = code2 */
    public int notificationType;
    public int notificationType;
    /** TS 27.007 7.17 "code1" or "code2" */
    /** TS 27.007 7.17 "code1" or "code2" */
    public int code;
    public int code;
@@ -38,27 +38,160 @@ public class SuppServiceNotification {
    /** List of forwarded numbers, if any */
    /** List of forwarded numbers, if any */
    public String[] history;
    public String[] history;


    static public final int MO_CODE_UNCONDITIONAL_CF_ACTIVE     = 0;
    /**
    static public final int MO_CODE_SOME_CF_ACTIVE              = 1;
     * Notification type is from the "code 1" group (per TS 27.007 7.17).
    static public final int MO_CODE_CALL_FORWARDED              = 2;
     * This means the {@link #code} will be a code such as {@link #CODE_1_CALL_FORWARDED}.
    static public final int MO_CODE_CALL_IS_WAITING             = 3;
     */
    static public final int MO_CODE_CUG_CALL                    = 4;
    public static final int NOTIFICATION_TYPE_CODE_1 = 0;
    static public final int MO_CODE_OUTGOING_CALLS_BARRED       = 5;

    static public final int MO_CODE_INCOMING_CALLS_BARRED       = 6;
    /**
    static public final int MO_CODE_CLIR_SUPPRESSION_REJECTED   = 7;
     * Notification type is from the "code 2" group (per TS 27.007 7.17).
    static public final int MO_CODE_CALL_DEFLECTED              = 8;
     * This means the {@link #code} will be a code such as {@link #CODE_2_CALL_ON_HOLD}.

     */
    static public final int MT_CODE_FORWARDED_CALL              = 0;
    public static final int NOTIFICATION_TYPE_CODE_2 = 1;
    static public final int MT_CODE_CUG_CALL                    = 1;

    static public final int MT_CODE_CALL_ON_HOLD                = 2;
    /**
    static public final int MT_CODE_CALL_RETRIEVED              = 3;
     * Indicates that unconditional call forwarding is active.
    static public final int MT_CODE_MULTI_PARTY_CALL            = 4;
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
    static public final int MT_CODE_ON_HOLD_CALL_RELEASED       = 5;
     * See TS 27.007 7.17.
    static public final int MT_CODE_FORWARD_CHECK_RECEIVED      = 6;
     */
    static public final int MT_CODE_CALL_CONNECTING_ECT         = 7;
    public static final int CODE_1_UNCONDITIONAL_CF_ACTIVE     = 0;
    static public final int MT_CODE_CALL_CONNECTED_ECT          = 8;

    static public final int MT_CODE_DEFLECTED_CALL              = 9;
    /**
    static public final int MT_CODE_ADDITIONAL_CALL_FORWARDED   = 10;
     * Indicates that some conditional call forwarding options are active.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_SOME_CF_ACTIVE              = 1;

    /**
     * Indicates that an outgoing call has been forwarded to another number.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_CALL_FORWARDED              = 2;

    /**
     * Indicates that an outgoing call is waiting.  This means that the called party is already in
     * another call and is hearing the call waiting tone.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_CALL_IS_WAITING             = 3;

    /**
     * Indicates that an outgoing call is to a number in a closed user group.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_CUG_CALL                    = 4;

    /**
     * Indicates that outgoing calls are barred.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_OUTGOING_CALLS_BARRED       = 5;

    /**
     * Indicates that incoming calls are barred.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_INCOMING_CALLS_BARRED       = 6;

    /**
     * Indicates that CLIR suppression has been rejected for an outgoing call.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_CLIR_SUPPRESSION_REJECTED   = 7;

    /**
     * Indicates that an outgoing call bas been deflected to another number.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_1}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_1_CALL_DEFLECTED              = 8;

    /**
     * Indicates that an incoming call is a forwarded call.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_FORWARDED_CALL              = 0;

    /**
     * Indicates that an incoming call is from a member of a closed user group.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_CUG_CALL                    = 1;

    /**
     * Indicates that a call has been remotely put on hold.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_CALL_ON_HOLD                = 2;

    /**
     * Indicates that a call has been remotely resumed (retrieved).
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_CALL_RETRIEVED              = 3;

    /**
     * Indicates that a conference call has been entered.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_MULTI_PARTY_CALL            = 4;

    /**
     * Indicates that an ongoing call on hold has been released.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_ON_HOLD_CALL_RELEASED       = 5;

    /**
     * Indicates that a forward check message was received.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_FORWARD_CHECK_RECEIVED      = 6;

    /**
     * Indicates that a call is being connected (alerting) with another party as a result of an
     * explicit call transfer operation.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_CALL_CONNECTING_ECT         = 7;

    /**
     * Indicates that a call has been connected with another party as a result of an explicit call
     * transfer operation.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_CALL_CONNECTED_ECT          = 8;

    /**
     * Indicates that an outgoing call has been deflected to another number.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_DEFLECTED_CALL              = 9;

    /**
     * Indicates that an additional incoming call has been forwarded.
     * Valid {@link #code} when {@link #type} is {@link #NOTIFICATION_TYPE_CODE_2}.
     * See TS 27.007 7.17.
     */
    public static final int CODE_2_ADDITIONAL_CALL_FORWARDED   = 10;


    @Override
    @Override
    public String toString()
    public String toString()
+3 −5
Original line number Original line Diff line number Diff line
@@ -2529,7 +2529,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            // Type of notification: 0 = MO; 1 = MT
            // Type of notification: 0 = MO; 1 = MT
            // Refer SuppServiceNotification class documentation.
            // Refer SuppServiceNotification class documentation.
            supp.notificationType = 1;
            supp.notificationType = 1;
            supp.code = SuppServiceNotification.MT_CODE_CALL_RETRIEVED;
            supp.code = SuppServiceNotification.CODE_2_CALL_RETRIEVED;
            mPhone.notifySuppSvcNotification(supp);
            mPhone.notifySuppSvcNotification(supp);
            mMetrics.writeOnImsCallResumeReceived(mPhone.getPhoneId(), imsCall.getCallSession());
            mMetrics.writeOnImsCallResumeReceived(mPhone.getPhoneId(), imsCall.getCallSession());
        }
        }
@@ -3881,10 +3881,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        }
        }


        SuppServiceNotification supp = new SuppServiceNotification();
        SuppServiceNotification supp = new SuppServiceNotification();
        // Type of notification: 0 = MO; 1 = MT
        supp.notificationType = SuppServiceNotification.NOTIFICATION_TYPE_CODE_2;
        // Refer SuppServiceNotification class documentation.
        supp.code = SuppServiceNotification.CODE_2_CALL_ON_HOLD;
        supp.notificationType = 1;
        supp.code = SuppServiceNotification.MT_CODE_CALL_ON_HOLD;
        mPhone.notifySuppSvcNotification(supp);
        mPhone.notifySuppSvcNotification(supp);
        mMetrics.writeOnImsCallHoldReceived(mPhone.getPhoneId(), imsCall.getCallSession());
        mMetrics.writeOnImsCallHoldReceived(mPhone.getPhoneId(), imsCall.getCallSession());
    }
    }