summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2014-02-11 22:22:42 -0800
committerSailesh Nepal <sail@google.com>2014-02-11 22:22:42 -0800
commit512b28309d3ee5dd506e62fb14913047b6049236 (patch)
treee0645e94d561dd5ebd04c8abb402a10bf570bb82 /telephony
parent960fe9a5ff2a629d62e3252a37e4ec598af54b6a (diff)
downloadframeworks_base-512b28309d3ee5dd506e62fb14913047b6049236.zip
frameworks_base-512b28309d3ee5dd506e62fb14913047b6049236.tar.gz
frameworks_base-512b28309d3ee5dd506e62fb14913047b6049236.tar.bz2
DO NOT MERGE ThirdPartyCallSendDtmfCallBack API
This API is needed to implement post dial. Change-Id: Iefdeae81d0eae6be86e7ee1e8ab0251ae43ed079
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/ThirdPartyCallProvider.java11
-rw-r--r--telephony/java/android/telephony/ThirdPartyCallSendDtmfCallback.java46
-rw-r--r--telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl3
-rw-r--r--telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl27
4 files changed, 82 insertions, 5 deletions
diff --git a/telephony/java/android/telephony/ThirdPartyCallProvider.java b/telephony/java/android/telephony/ThirdPartyCallProvider.java
index 74b9ae3..5054380 100644
--- a/telephony/java/android/telephony/ThirdPartyCallProvider.java
+++ b/telephony/java/android/telephony/ThirdPartyCallProvider.java
@@ -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;
}
}
diff --git a/telephony/java/android/telephony/ThirdPartyCallSendDtmfCallback.java b/telephony/java/android/telephony/ThirdPartyCallSendDtmfCallback.java
new file mode 100644
index 0000000..5a67cf7
--- /dev/null
+++ b/telephony/java/android/telephony/ThirdPartyCallSendDtmfCallback.java
@@ -0,0 +1,46 @@
+/*
+ * 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) {
+ }
+ }
+}
diff --git a/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl b/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl
index a9d67a4..9d595b0 100644
--- a/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl
+++ b/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl
@@ -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);
}
diff --git a/telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl b/telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl
new file mode 100644
index 0000000..3a02b06
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl
@@ -0,0 +1,27 @@
+/*
+ * 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 com.android.internal.telephony;
+
+/**
+ * Callback interface for when DTMF has been sent.
+ */
+oneway interface IThirdPartyCallSendDtmfCallback {
+ /**
+ * Called when the DTMF code has been sent.
+ */
+ void onSendDtmfCompleted();
+}