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

Commit 6e7a6784 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Propagate the call substate changed message to the UI"

parents 166dae33 8fe75ac4
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public abstract class Connection {
        public void onVideoProviderChanged(
                android.telecom.Connection.VideoProvider videoProvider);
        public void onAudioQualityChanged(int audioQuality);
        public void onCallSubstateChanged(int callSubstate);
    }

    /**
@@ -62,6 +63,8 @@ public abstract class Connection {
                android.telecom.Connection.VideoProvider videoProvider) {}
        @Override
        public void onAudioQualityChanged(int audioQuality) {}
        @Override
        public void onCallSubstateChanged(int callSubstate) {}
    }

    public static final int AUDIO_QUALITY_STANDARD = 1;
@@ -103,6 +106,7 @@ public abstract class Connection {
    private boolean mLocalVideoCapable;
    private boolean mRemoteVideoCapable;
    private int mAudioQuality;
    private int mCallSubstate;
    private android.telecom.Connection.VideoProvider mVideoProvider;

    /* Instance Methods */
@@ -474,6 +478,17 @@ public abstract class Connection {
        return mAudioQuality;
    }


    /**
     * Returns the current call substate of the connection.
     *
     * @return The call substate of the connection.
     */
    public int getCallSubstate() {
        return mCallSubstate;
    }


    /**
     * Sets the videoState for the current connection and reports the changes to all listeners.
     * Valid video states are defined in {@link android.telecom.VideoProfile}.
@@ -523,6 +538,19 @@ public abstract class Connection {
        }
    }

    /**
     * Sets the call substate for the current connection and reports the changes to all listeners.
     * Valid call substates are defined in {@link android.telecom.Connection}.
     *
     * @return The call substate.
     */
    public void setCallSubstate(int callSubstate) {
        mCallSubstate = callSubstate;
        for (Listener l : mListeners) {
            l.onCallSubstateChanged(mCallSubstate);
        }
    }

    /**
     * Sets the {@link android.telecom.Connection.VideoProvider} for the connection.
     *
+10 −0
Original line number Diff line number Diff line
@@ -675,6 +675,16 @@ public class ImsPhoneConnection extends Connection {
                        changed = true;
                    }
                }

                // Check if call substate has changed. If so notify listeners of call state changed.
                int callSubstate = getCallSubstate();
                int newCallSubstate = imsCall.getCallSubstate();

                if (callSubstate != newCallSubstate) {
                    setCallSubstate(newCallSubstate);
                    changed = true;
                }

            } catch (ImsException e) {
                // No session in place -- no change
            }