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

Commit 512b2830 authored by Sailesh Nepal's avatar Sailesh Nepal
Browse files

DO NOT MERGE ThirdPartyCallSendDtmfCallBack API

This API is needed to implement post dial.

Change-Id: Iefdeae81d0eae6be86e7ee1e8ab0251ae43ed079
parent 960fe9a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -277,6 +277,7 @@ LOCAL_SRC_FILES += \
	telephony/java/com/android/internal/telephony/ITelephony.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallListener.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl \
	telephony/java/com/android/internal/telephony/IThirdPartyCallService.aidl \
	telephony/java/com/android/internal/telephony/ISms.aidl \
	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
+11 −2
Original line number Diff line number Diff line
@@ -24582,7 +24582,12 @@ package android.telephony {
    method public void hangup();
    method public void incomingCallAccept();
    method public void mute(boolean);
    method public void sendDtmf(char);
    method public void sendDtmf(char, android.telephony.ThirdPartyCallSendDtmfCallback);
  }
  public class ThirdPartyCallSendDtmfCallback {
    ctor public ThirdPartyCallSendDtmfCallback(com.android.internal.telephony.IThirdPartyCallSendDtmfCallback);
    method public void onSendDtmfCompleted();
  }
  public class ThirdPartyCallService {
@@ -34081,7 +34086,11 @@ package com.android.internal.telephony {
    method public abstract void hangup() throws android.os.RemoteException;
    method public abstract void incomingCallAccept() throws android.os.RemoteException;
    method public abstract void mute(boolean) throws android.os.RemoteException;
    method public abstract void sendDtmf(char) throws android.os.RemoteException;
    method public abstract void sendDtmf(char, com.android.internal.telephony.IThirdPartyCallSendDtmfCallback) throws android.os.RemoteException;
  }
  public abstract interface IThirdPartyCallSendDtmfCallback implements android.os.IInterface {
    method public abstract void onSendDtmfCompleted() throws android.os.RemoteException;
  }
}
+7 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.os.Handler;
import android.os.Message;

import com.android.internal.telephony.IThirdPartyCallProvider;
import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;

/**
 * Interface sent to {@link android.telephony.ThirdPartyCallListener#onCallProviderAttached
@@ -55,7 +56,7 @@ public class ThirdPartyCallProvider {
    /**
     * Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
     */
    public void sendDtmf(char c) {
    public void sendDtmf(char c, ThirdPartyCallSendDtmfCallback callback) {
        // default implementation empty
    }

@@ -76,8 +77,8 @@ public class ThirdPartyCallProvider {
        }

        @Override
        public void sendDtmf(char c) {
            Message.obtain(mHandler, MSG_SEND_DTMF, (int) c, 0).sendToTarget();
        public void sendDtmf(char c, IThirdPartyCallSendDtmfCallback callback) {
            Message.obtain(mHandler, MSG_SEND_DTMF, (int) c, 0, callback).sendToTarget();
        }
    };

@@ -95,7 +96,9 @@ public class ThirdPartyCallProvider {
                    incomingCallAccept();
                    break;
                case MSG_SEND_DTMF:
                    sendDtmf((char) msg.arg1);
                    ThirdPartyCallSendDtmfCallback callback = new ThirdPartyCallSendDtmfCallback(
                            (IThirdPartyCallSendDtmfCallback) msg.obj);
                    sendDtmf((char) msg.arg1, callback);
                    break;
            }
        }
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2013 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.telephony;

import android.os.RemoteException;

import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;

/**
 * Callback interface for when DTMF has been sent.
 */
public class ThirdPartyCallSendDtmfCallback {
    private final IThirdPartyCallSendDtmfCallback mCallback;

    public ThirdPartyCallSendDtmfCallback(IThirdPartyCallSendDtmfCallback callback) {
        if (callback == null) {
            throw new IllegalArgumentException("Invalid callback");
        }
        mCallback = callback;
    }

    /**
     * Called by the service when a call provider is available to perform the outgoing or incoming
     * call.
     */
    public void onSendDtmfCompleted() {
        try {
            mCallback.onSendDtmfCompleted();
        } catch (RemoteException e) {
        }
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.telephony;

import com.android.internal.telephony.IThirdPartyCallListener;
import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;

/**
 * Interface sent to ThirdPartyCallListener.onCallProviderAttached. This is used to control an
@@ -42,5 +43,5 @@ oneway interface IThirdPartyCallProvider {
    /**
     * Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
     */
    void sendDtmf(char c);
    void sendDtmf(char c, IThirdPartyCallSendDtmfCallback callback);
}
Loading