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

Commit f95afafa authored by Tyler Gunn's avatar Tyler Gunn Committed by Etan Cohen
Browse files

Enable video telephony support. (1/4)

- Add "isVideoEnabled" method to phone classes to pass up the
"isVideoEnabled" attribute from the ImsPhone.
- Sip phones do not support video.

Bug: 19062133
Change-Id: I9c2616b75319cba3d31df110f556db7399509057
parent 1e79fea3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1978,4 +1978,11 @@ public interface Phone {
     * @return true if IMS is Registered
     */
    public boolean isImsRegistered();

    /**
     * Determines if video calling is enabled for the phone.
     *
     * @return {@code true} if video calling is enabled, {@code false} otherwise.
     */
    public boolean isVideoEnabled();
}
+15 −0
Original line number Diff line number Diff line
@@ -2149,6 +2149,21 @@ public abstract class PhoneBase extends Handler implements Phone {
        return imsUseEnabled;
    }

    /**
     * Determines if video calling is enabled for the IMS phone.
     *
     * @return {@code true} if video calling is enabled.
     */
    @Override
    public boolean isVideoEnabled() {
        ImsPhone imsPhone = mImsPhone;
        if ((imsPhone != null)
                && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)) {
            return imsPhone.isVideoEnabled();
        }
        return false;
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("PhoneBase: subId=" + getSubId());
        pw.println(" mPhoneId=" + mPhoneId);
+10 −0
Original line number Diff line number Diff line
@@ -1512,6 +1512,16 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.isImsRegistered();
    }

    /**
     * Determines if video calling is enabled for the IMS phone.
     *
     * @return {@code true} if video calling is enabled.
     */
    @Override
    public boolean isVideoEnabled() {
        return mActivePhone.isVideoEnabled();
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        try {
            ((PhoneBase)mActivePhone).dump(fd, pw, args);
+10 −0
Original line number Diff line number Diff line
@@ -502,6 +502,16 @@ abstract class SipPhoneBase extends PhoneBase {
        return null;
    }

    /**
     * Determines if video calling is enabled.  Always {@code false} for SIP.
     *
     * @return {@code false} since SIP does not support video calling.
     */
    @Override
    public boolean isVideoEnabled() {
        return false;
    }

    void updatePhoneState() {
        PhoneConstants.State oldState = mState;