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

Commit 0403dc4d authored by Omkar Kolangade's avatar Omkar Kolangade Committed by Steve Kondik
Browse files

IMS Hold/Resume Supp. Serv. Notification

Adding logic to listen for, and process
the MT Hold/Resume notifications, allowing
the UI to show a toast reflecting the same.

Change-Id: I18c5a22969d4e108f7b4126dad1ad8f69309bf7c
CRs-Fixed: 731627
parent 4fd309d3
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.cdma.CDMAPhone;
import com.android.internal.telephony.gsm.GSMPhone;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.uicc.IccRecords;

import java.util.ArrayList;
@@ -127,6 +128,9 @@ public class ImsPhone extends ImsPhoneBase {

    private final RegistrantList mSilentRedialRegistrants = new RegistrantList();

    // List of Registrants to send supplementary service notifications to.
    RegistrantList mSsnRegistrants = new RegistrantList();

    // Variable to cache the video capabilitity. In cases where we delete/re-create the phone
    // this information is getting lost.
    private boolean mIsVideoCapable = false;
@@ -423,6 +427,13 @@ public class ImsPhone extends ImsPhoneBase {
        return true;
    }

    public void notifySuppSvcNotification(SuppServiceNotification suppSvc) {
        Rlog.d(LOG_TAG, "notifySuppSvcNotification: suppSvc = " + suppSvc);

        AsyncResult ar = new AsyncResult(null, suppSvc, null);
        mSsnRegistrants.notifyRegistrants(ar);
    }

    @Override
    public boolean handleInCallMmiCommands(String dialString) {
        if (!isInCall()) {
@@ -1030,6 +1041,17 @@ public class ImsPhone extends ImsPhoneBase {
        mSilentRedialRegistrants.remove(h);
    }

    @Override
    public void registerForSuppServiceNotification(
            Handler h, int what, Object obj) {
        mSsnRegistrants.addUnique(h, what, obj);
    }

    @Override
    public void unregisterForSuppServiceNotification(Handler h) {
        mSsnRegistrants.remove(h);
    }

    @Override
    public long getSubId() {
        return mDefaultPhone.getSubId();
+15 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.gsm.SuppServiceNotification;

/**
 * {@hide}
@@ -1180,6 +1181,13 @@ public final class ImsPhoneCallTracker extends CallTracker {
                mPhone.stopOnHoldTone();
                mOnHoldToneStarted = false;
            }

            SuppServiceNotification supp = new SuppServiceNotification();
            // Type of notification: 0 = MO; 1 = MT
            // Refer SuppServiceNotification class documentation.
            supp.notificationType = 1;
            supp.code = SuppServiceNotification.MT_CODE_CALL_RETRIEVED;
            mPhone.notifySuppSvcNotification(supp);
        }

        @Override
@@ -1193,6 +1201,13 @@ public final class ImsPhoneCallTracker extends CallTracker {
                    mOnHoldToneStarted = true;
                }
            }

            SuppServiceNotification supp = new SuppServiceNotification();
            // Type of notification: 0 = MO; 1 = MT
            // Refer SuppServiceNotification class documentation.
            supp.notificationType = 1;
            supp.code = SuppServiceNotification.MT_CODE_CALL_ON_HOLD;
            mPhone.notifySuppSvcNotification(supp);
        }

        @Override