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

Commit f563e7ec authored by Nancy Chen's avatar Nancy Chen Committed by Android (Google) Code Review
Browse files

Merge "Make changes to Connection in Telecomm API (1/4)" into lmp-dev

parents cdea7648 354b2bd0
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -28257,16 +28257,15 @@ package android.telecomm {
    method public final boolean isRequestingRingback();
    method public void onAbort();
    method public void onAnswer();
    method public void onAudioStateChanged(android.telecomm.AudioState);
    method public void onConferenceWith(android.telecomm.Connection);
    method public void onDisconnect();
    method public void onHold();
    method public void onPhoneAccountClicked();
    method public void onPlayDtmfTone(char);
    method public void onPostDialContinue(boolean);
    method public void onReject();
    method public void onSeparate();
    method public void onSetAudioState(android.telecomm.AudioState);
    method public void onSetState(int);
    method public void onStateChanged(int);
    method public void onStopDtmfTone();
    method public void onUnhold();
    method public final void setActive();
@@ -28499,8 +28498,8 @@ package android.telecomm {
    field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecomm.extra.CALL_DISCONNECT_CAUSE";
    field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecomm.extra.CALL_DISCONNECT_MESSAGE";
    field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE";
    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.intent.extra.PHONE_ACCOUNT_HANDLE";
    field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";
    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telecomm.extra.PHONE_ACCOUNT_HANDLE";
    field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecomm.extra.START_CALL_WITH_SPEAKERPHONE";
    field public static final int PRESENTATION_ALLOWED = 1; // 0x1
    field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
    field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
+0 −7
Original line number Diff line number Diff line
@@ -481,13 +481,6 @@ public final class Call {
        mInCallAdapter.postDialContinue(mTelecommCallId, proceed);
    }

    /**
     * Notifies this {@code Call} that the phone account user interface element was touched.
     */
    public void phoneAccountClicked() {
        mInCallAdapter.phoneAccountClicked(mTelecommCallId);
    }

    /**
     * Notifies this {@code Call} that an account has been selected and to proceed with placing
     * an outgoing call.
+4 −9
Original line number Diff line number Diff line
@@ -625,7 +625,7 @@ public abstract class Connection {
    final void setAudioState(AudioState state) {
        Log.d(this, "setAudioState %s", state);
        mAudioState = state;
        onSetAudioState(state);
        onAudioStateChanged(state);
    }

    /**
@@ -946,7 +946,7 @@ public abstract class Connection {
     *
     * @param state The new call audio state.
     */
    public void onSetAudioState(AudioState state) {}
    public void onAudioStateChanged(AudioState state) {}

    /**
     * Notifies this Connection of an internal state change. This method is called after the
@@ -954,7 +954,7 @@ public abstract class Connection {
     *
     * @param state The new state, one of the {@code STATE_*} constants.
     */
    public void onSetState(int state) {}
    public void onStateChanged(int state) {}

    /**
     * Notifies this Connection of a request to play a DTMF tone.
@@ -1021,11 +1021,6 @@ public abstract class Connection {
     */
    public void onPostDialContinue(boolean proceed) {}

    /**
     * Called when the phone account UI was clicked.
     */
    public void onPhoneAccountClicked() {}

    /**
     * Merge this connection and the specified connection into a conference call.  Once the
     * connections are merged, the calls should be added to the an existing or new
@@ -1069,7 +1064,7 @@ public abstract class Connection {
        if (mState != state) {
            Log.d(this, "setState: %s", stateToString(state));
            mState = state;
            onSetState(state);
            onStateChanged(state);
            for (Listener l : mListeners) {
                l.onStateChanged(this, state);
            }
+0 −14
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ public abstract class ConnectionService extends Service {
    private static final int MSG_CONFERENCE = 12;
    private static final int MSG_SPLIT_FROM_CONFERENCE = 13;
    private static final int MSG_ON_POST_DIAL_CONTINUE = 14;
    private static final int MSG_ON_PHONE_ACCOUNT_CLICKED = 15;
    private static final int MSG_REMOVE_CONNECTION_SERVICE_ADAPTER = 16;
    private static final int MSG_ANSWER_VIDEO = 17;
    private static final int MSG_MERGE_CONFERENCE = 18;
@@ -200,11 +199,6 @@ public abstract class ConnectionService extends Service {
            args.argi1 = proceed ? 1 : 0;
            mHandler.obtainMessage(MSG_ON_POST_DIAL_CONTINUE, args).sendToTarget();
        }

        @Override
        public void onPhoneAccountClicked(String callId) {
            mHandler.obtainMessage(MSG_ON_PHONE_ACCOUNT_CLICKED, callId).sendToTarget();
        }
    };

    private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@@ -327,9 +321,6 @@ public abstract class ConnectionService extends Service {
                    }
                    break;
                }
                case MSG_ON_PHONE_ACCOUNT_CLICKED:
                    onPhoneAccountHandleClicked((String) msg.obj);
                    break;
                default:
                    break;
            }
@@ -678,11 +669,6 @@ public abstract class ConnectionService extends Service {
        findConnectionForAction(callId, "stopDtmfTone").onPostDialContinue(proceed);
    }

    private void onPhoneAccountHandleClicked(String callId) {
        Log.d(this, "onPhoneAccountClicked %s", callId);
        findConnectionForAction(callId, "onPhoneAccountClicked").onPhoneAccountClicked();
    }

    private void onAdapterAttached() {
        if (mAreAccountsInitialized) {
            // No need to query again if we already did it.
+0 −12
Original line number Diff line number Diff line
@@ -188,18 +188,6 @@ public final class InCallAdapter {
        }
    }

    /**
     * Instructs Telecomm that the phone account UI was clicked.
     *
     * @param callId The identifier of the call.
     */
    public void phoneAccountClicked(String callId) {
        try {
            mAdapter.phoneAccountClicked(callId);
        } catch (RemoteException e) {
        }
    }

    /**
     * Instructs Telecomm to add a PhoneAccountHandle to the specified call
     *
Loading