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

Commit d76d0e11 authored by Tyler Gunn's avatar Tyler Gunn Committed by Gerrit Code Review
Browse files

Merge "Add onDisconnect callback in root radio connection class."

parents 7abeb535 47b078c2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ public abstract class Connection {
        public void onConnectionEvent(String event, Bundle extras);
        public void onRttModifyRequestReceived();
        public void onRttModifyResponseReceived(int status);
        public void onDisconnect(int cause);
    }

    /**
@@ -143,6 +144,8 @@ public abstract class Connection {
        public void onRttModifyRequestReceived() {}
        @Override
        public void onRttModifyResponseReceived(int status) {}
        @Override
        public void onDisconnect(int cause) {}
    }

    public static final int AUDIO_QUALITY_STANDARD = 1;
@@ -1054,6 +1057,18 @@ public abstract class Connection {
        }
    }

    /**
     * Notify interested parties that this connection disconnected.
     * {@code TelephonyConnection}, for example, uses this.
     * @param reason the disconnect code, per {@link DisconnectCause}.
     */
    protected void notifyDisconnect(int reason) {
        Rlog.i(TAG, "notifyDisconnect: callId=" + getTelecomCallId() + ", reason=" + reason);
        for (Listener l : mListeners) {
            l.onDisconnect(reason);
        }
    }

    /**
     *
     */
+1 −0
Original line number Diff line number Diff line
@@ -583,6 +583,7 @@ public class GsmCdmaConnection extends Connection {
            if (DBG) Rlog.d(LOG_TAG, "onDisconnect: cause=" + cause);

            mOwner.getPhone().notifyDisconnect(this);
            notifyDisconnect(cause);

            if (mParent != null) {
                changed = mParent.connectionDisconnected(this);
+1 −0
Original line number Diff line number Diff line
@@ -428,6 +428,7 @@ public class ImsPhoneConnection extends Connection implements
            mDisconnected = true;

            mOwner.mPhone.notifyDisconnect(this);
            notifyDisconnect(mCause);

            if (mParent != null) {
                changed = mParent.connectionDisconnected(this);