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

Commit 8d83fa9b authored by Tyler Gunn's avatar Tyler Gunn
Browse files

API support for reporting of changes to call features.

(eg VoLTE, VoWIFI, etc)

Bug: 15987281
Change-Id: Iae351ca2fe7b36c067106695f611cca6b3230556
parent 5dfb86bb
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -27451,6 +27451,12 @@ package android.telecomm {
    field public static final int SWAP_CALLS = 8; // 0x8
  }
  public final class CallFeatures {
    field public static final int NONE = 0; // 0x0
    field public static final int VoLTE = 1; // 0x1
    field public static final int VoWIFI = 2; // 0x2
  }
  public final class CallInfo implements android.os.Parcelable {
    ctor public CallInfo(java.lang.String, android.telecomm.CallState, android.net.Uri);
    method public int describeContents();
@@ -27487,6 +27493,7 @@ package android.telecomm {
    method protected void onAdapterAttached(android.telecomm.CallServiceAdapter);
    method public abstract void onAudioStateChanged(java.lang.String, android.telecomm.CallAudioState);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract void onFeaturesChanged(java.lang.String, int);
    method public void onPostDialContinue(java.lang.String, boolean);
    method public abstract void playDtmfTone(java.lang.String, char);
    method public abstract void reject(java.lang.String);
@@ -27508,6 +27515,7 @@ package android.telecomm {
    method public void setCallVideoProvider(java.lang.String, android.telecomm.CallVideoProvider);
    method public void setDialing(java.lang.String);
    method public void setDisconnected(java.lang.String, int, java.lang.String);
    method public void setFeatures(java.lang.String, int);
    method public void setOnHold(java.lang.String);
    method public void setRequestingRingback(java.lang.String, boolean);
    method public void setRinging(java.lang.String);
@@ -27590,6 +27598,7 @@ package android.telecomm {
    ctor protected Connection();
    method public final android.telecomm.CallAudioState getCallAudioState();
    method public final java.util.List<android.telecomm.Connection> getChildConnections();
    method public final int getFeatures();
    method public final android.net.Uri getHandle();
    method public final android.telecomm.Connection getParentConnection();
    method public final int getState();
@@ -27615,6 +27624,7 @@ package android.telecomm {
    method public final void setDestroyed();
    method public final void setDialing();
    method public final void setDisconnected(int, java.lang.String);
    method public final void setFeatures(int);
    method public final void setHandle(android.net.Uri);
    method public final void setIsConferenceCapable(boolean);
    method public final void setOnHold();
@@ -27626,6 +27636,35 @@ package android.telecomm {
    method public static java.lang.String stateToString(int);
  }
  public static abstract interface Connection.Listener {
    method public abstract void onAudioStateChanged(android.telecomm.Connection, android.telecomm.CallAudioState);
    method public abstract void onConferenceCapableChanged(android.telecomm.Connection, boolean);
    method public abstract void onDestroyed(android.telecomm.Connection);
    method public abstract void onDisconnected(android.telecomm.Connection, int, java.lang.String);
    method public abstract void onFeaturesChanged(android.telecomm.Connection, int);
    method public abstract void onHandleChanged(android.telecomm.Connection, android.net.Uri);
    method public abstract void onParentConnectionChanged(android.telecomm.Connection, android.telecomm.Connection);
    method public abstract void onRequestingRingback(android.telecomm.Connection, boolean);
    method public abstract void onSetCallVideoProvider(android.telecomm.Connection, android.telecomm.CallVideoProvider);
    method public abstract void onSignalChanged(android.telecomm.Connection, android.os.Bundle);
    method public abstract void onStateChanged(android.telecomm.Connection, int);
  }
  public static class Connection.ListenerBase implements android.telecomm.Connection.Listener {
    ctor public Connection.ListenerBase();
    method public void onAudioStateChanged(android.telecomm.Connection, android.telecomm.CallAudioState);
    method public void onConferenceCapableChanged(android.telecomm.Connection, boolean);
    method public void onDestroyed(android.telecomm.Connection);
    method public void onDisconnected(android.telecomm.Connection, int, java.lang.String);
    method public void onFeaturesChanged(android.telecomm.Connection, int);
    method public void onHandleChanged(android.telecomm.Connection, android.net.Uri);
    method public void onParentConnectionChanged(android.telecomm.Connection, android.telecomm.Connection);
    method public void onRequestingRingback(android.telecomm.Connection, boolean);
    method public void onSetCallVideoProvider(android.telecomm.Connection, android.telecomm.CallVideoProvider);
    method public void onSignalChanged(android.telecomm.Connection, android.os.Bundle);
    method public void onStateChanged(android.telecomm.Connection, int);
  }
  public final class Connection.State {
    field public static final int ACTIVE = 3; // 0x3
    field public static final int DIALING = 2; // 0x2
@@ -27665,6 +27704,9 @@ package android.telecomm {
    method protected void onCreateConferenceConnection(java.lang.String, android.telecomm.Connection, android.telecomm.Response<java.lang.String, android.telecomm.Connection>);
    method protected void onCreateConnections(android.telecomm.ConnectionRequest, android.telecomm.ConnectionService.OutgoingCallResponse<android.telecomm.Connection>);
    method protected void onCreateIncomingConnection(android.telecomm.ConnectionRequest, android.telecomm.Response<android.telecomm.ConnectionRequest, android.telecomm.Connection>);
    method public final void onFeaturesChanged(java.lang.String, int);
    method public final void onPostDialContinue(java.lang.String, boolean);
    method public final void onPostDialWait(android.telecomm.Connection, java.lang.String);
    method public final void playDtmfTone(java.lang.String, char);
    method public final void reject(java.lang.String);
    method public final void setIncomingCallId(java.lang.String, android.os.Bundle);
@@ -27711,6 +27753,7 @@ package android.telecomm {
    method public android.telecomm.CallServiceDescriptor getCurrentCallServiceDescriptor();
    method public int getDisconnectCauseCode();
    method public java.lang.String getDisconnectCauseMsg();
    method public int getFeatures();
    method public android.telecomm.GatewayInfo getGatewayInfo();
    method public android.net.Uri getHandle();
    method public android.telecomm.CallServiceDescriptor getHandoffCallServiceDescriptor();
+29 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.telecomm;

/**
 * Defines features of a call.  These features represent properties of a call for which it may be
 * desirable to display an in-call indicator.
 */
public final class CallFeatures {
    private CallFeatures() {};

    public static final int NONE = 0x0;
    public static final int VoLTE = 0x1;
    public static final int VoWIFI = 0x2;
}
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
@@ -408,4 +408,16 @@ public abstract class CallService extends Service {
    public abstract void splitFromConference(String callId);

    public void onPostDialContinue(String callId, boolean proceed) {}

    public void onPostDialWait(Connection conn, String remaining) {}

    /**
     * Called when changes to the features of a call occurs. Features are defined in
     * {@link android.telecomm.CallFeatures}.  The active features for the call are represented as
     * bits in the features bit-mask.
     *
     * @param callId The call to set the features for.
     * @param features The new features of the call.
     */
    public abstract void onFeaturesChanged(String callId, int features);
}
+18 −0
Original line number Diff line number Diff line
@@ -354,4 +354,22 @@ public final class CallServiceAdapter implements DeathRecipient {
            }
        }
    }

    /**
    * Set the features associated with the given call.
    * Features are defined in {@link android.telecomm.CallFeatures} and are passed in as a
    * bit-mask.
    *
    * @param callId The unique ID of the call to set features for.
    * @param features The features.
    */
    public void setFeatures(String callId, int features) {
        Log.v(this, "setFeatures: %d", features);
        for (ICallServiceAdapter adapter : mAdapters) {
            try {
                adapter.setFeatures(callId, features);
            } catch (RemoteException ignored) {
            }
        }
    }
}
+29 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ public abstract class Connection {
    /** @hide */
    public interface Listener {
        void onStateChanged(Connection c, int state);
        void onFeaturesChanged(Connection c, int features);
        void onAudioStateChanged(Connection c, CallAudioState state);
        void onHandleChanged(Connection c, Uri newHandle);
        void onSignalChanged(Connection c, Bundle details);
@@ -51,6 +52,11 @@ public abstract class Connection {
        @Override
        public void onStateChanged(Connection c, int state) {}

        /** {@inheritDoc} */
        @Override
        public void onFeaturesChanged(Connection c, int features) {}

        /** {@inheritDoc} */
         @Override
        public void onAudioStateChanged(Connection c, CallAudioState state) {}

@@ -97,6 +103,7 @@ public abstract class Connection {
    private final List<Connection> mChildConnections = new ArrayList<>();

    private int mState = State.NEW;
    private int mFeatures = CallFeatures.NONE;
    private CallAudioState mCallAudioState;
    private Uri mHandle;
    private boolean mRequestingRingback = false;
@@ -130,6 +137,12 @@ public abstract class Connection {
        return mState;
    }

    /**
     * @return The features of the call.  These are items for which the InCall UI may wish to
     *         display a visual indicator.
     */
    public final int getFeatures() { return mFeatures; }

    /**
     * @return The audio state of the call, describing how its audio is currently
     *         being routed by the system. This is {@code null} if this Connection
@@ -283,6 +296,22 @@ public abstract class Connection {
        onConference();
    }

    /**
     * Set the features applicable to the connection.  These are items for which the InCall UI may
     * wish to display a visual indicator.
     * Features are defined in {@link android.telecomm.CallFeatures} and are passed in as a
     * bit-mask.
     *
     * @param features The features active.
     */
    public final void setFeatures(int features) {
        Log.d(this, "setFeatures %d", features);
        this.mFeatures = features;
        for (Listener l : mListeners) {
            l.onFeaturesChanged(this, mFeatures);
        }
    }

    /**
     * Inform this Connection that the state of its audio output has been changed externally.
     *
Loading