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

Commit 5da0fd5e authored by Nancy Chen's avatar Nancy Chen
Browse files

API changes to enable account selection for a call

If an account default is not set, the incall ui will display a dialog to
allow the user to select an account for that particular call.

Bug: 16243703

Change-Id: I8faf2f2ce0b2669a141562832f23e8f3ce88f094
parent 45374c9a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28031,6 +28031,7 @@ package android.telecomm {
    method public int getState();
    method public void hold();
    method public void phoneAccountClicked();
    method public void phoneAccountSelected(android.telecomm.PhoneAccount);
    method public void playDtmfTone(char);
    method public void postDialContinue(boolean);
    method public void reject(boolean, java.lang.String);
@@ -28044,6 +28045,7 @@ package android.telecomm {
    field public static final int STATE_DISCONNECTED = 7; // 0x7
    field public static final int STATE_HOLDING = 3; // 0x3
    field public static final int STATE_NEW = 0; // 0x0
    field public static final int STATE_PRE_DIAL_WAIT = 8; // 0x8
    field public static final int STATE_RINGING = 2; // 0x2
  }
@@ -28131,6 +28133,7 @@ package android.telecomm {
    enum_constant public static final android.telecomm.CallState DISCONNECTED;
    enum_constant public static final android.telecomm.CallState NEW;
    enum_constant public static final android.telecomm.CallState ON_HOLD;
    enum_constant public static final android.telecomm.CallState PRE_DIAL_WAIT;
    enum_constant public static final android.telecomm.CallState RINGING;
  }
@@ -28275,6 +28278,7 @@ package android.telecomm {
    method public void holdCall(java.lang.String);
    method public void mute(boolean);
    method public void phoneAccountClicked(java.lang.String);
    method public void phoneAccountSelected(java.lang.String, android.telecomm.PhoneAccount);
    method public void playDtmfTone(java.lang.String, char);
    method public void postDialContinue(java.lang.String, boolean);
    method public void rejectCall(java.lang.String, boolean, java.lang.String);
+16 −0
Original line number Diff line number Diff line
@@ -62,6 +62,11 @@ public final class Call {
     */
    public static final int STATE_DISCONNECTED = 7;

    /**
     * The state of an outgoing {@code Call}, but waiting for user input before proceeding.
     */
    public static final int STATE_PRE_DIAL_WAIT = 8;

    public static class Details {
        private final Uri mHandle;
        private final int mHandlePresentation;
@@ -429,6 +434,15 @@ public final class Call {
        mInCallAdapter.phoneAccountClicked(mTelecommCallId);
    }

    /**
     * Notifies this {@code Call} the a {@code PhoneAccount} has been selected and to proceed
     * with placing an outgoing call.
     */
    public void phoneAccountSelected(PhoneAccount account) {
        mInCallAdapter.phoneAccountSelected(mTelecommCallId, account);

    }

    /**
     * Instructs this {@code Call} to enter a conference.
     */
@@ -703,6 +717,8 @@ public final class Call {
        switch (inCallCallState) {
            case NEW:
                return STATE_NEW;
            case PRE_DIAL_WAIT:
                return STATE_PRE_DIAL_WAIT;
            case DIALING:
                return STATE_DIALING;
            case RINGING:
+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,14 @@ public enum CallState {
     */
    NEW,

    /**
     * Indicates that the call is about to go into the outgoing and dialing state but is waiting for
     * user input before it proceeds. For example, where no default {@link PhoneAccount} is set,
     * this is the state where the InCallUI is waiting for the user to select a {@link PhoneAccount}
     * to call from.
     */
    PRE_DIAL_WAIT,

    /**
     * Indicates that a call is outgoing and in the dialing state. A call transitions to this state
     * once an outgoing call has begun (e.g., user presses the dial button in Dialer). Calls in this
+13 −0
Original line number Diff line number Diff line
@@ -199,6 +199,19 @@ public final class InCallAdapter {
        }
    }

    /**
     * Instructs Telecomm to add a PhoneAccount to the specified call
     *
     * @param callId The identifier of the call
     * @param account The PhoneAccount through which to place the call
     */
    public void phoneAccountSelected(String callId, PhoneAccount account) {
        try {
            mAdapter.phoneAccountSelected(callId, account);
        } catch (RemoteException e) {
        }
    }

    /**
     * Instructs Telecomm to conference the specified call.
     *
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.telecomm;

import android.telecomm.CallAudioState;
import android.telecomm.PhoneAccount;

/**
 * Internal remote callback interface for in-call services.
@@ -48,6 +49,8 @@ oneway interface IInCallAdapter {

    void phoneAccountClicked(String callId);

    void phoneAccountSelected(String callId, in PhoneAccount account);

    void conference(String callId);

    void splitFromConference(String callId);
Loading