summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2014-02-11 22:18:35 -0800
committerSailesh Nepal <sail@google.com>2014-02-11 22:18:35 -0800
commit960fe9a5ff2a629d62e3252a37e4ec598af54b6a (patch)
treeeab09cc63fa3f5a992ee83db12c1bd8778d40412 /telephony
parentaae9216320328e6b865725219a31a029ea46c1b0 (diff)
downloadframeworks_base-960fe9a5ff2a629d62e3252a37e4ec598af54b6a.zip
frameworks_base-960fe9a5ff2a629d62e3252a37e4ec598af54b6a.tar.gz
frameworks_base-960fe9a5ff2a629d62e3252a37e4ec598af54b6a.tar.bz2
ThirdPartyPhone: DTMF & callerDisplayName API DO NOT MERGE
This CL extends the ThirdPartyCall API to support DTMF and callerDisplayname. Change-Id: Ia3b4730e852a95d0c11fbddfbe1b780aec39dbb5
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java7
-rw-r--r--telephony/java/android/telephony/ThirdPartyCallProvider.java16
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl5
-rw-r--r--telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl5
4 files changed, 30 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 2723118..0e54d0f 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1428,10 +1428,13 @@ public class TelephonyManager {
* @param component the component that should handle the intent.
* @param callId the unique id of the call. This id is passed to the service via {@link
* ThirdPartyCallService#incomingCallAttach incomingCallAttach}.
+ * @param callerDisplayName the name shown to the user. Normally this will be the caller's phone
+ * number.
*/
- public void newIncomingThirdPartyCall(ComponentName component, String callId) {
+ public void newIncomingThirdPartyCall(ComponentName component, String callId,
+ String callerDisplayName) {
try {
- getITelephony().newIncomingThirdPartyCall(component, callId);
+ getITelephony().newIncomingThirdPartyCall(component, callId, callerDisplayName);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
diff --git a/telephony/java/android/telephony/ThirdPartyCallProvider.java b/telephony/java/android/telephony/ThirdPartyCallProvider.java
index 9d3f929..74b9ae3 100644
--- a/telephony/java/android/telephony/ThirdPartyCallProvider.java
+++ b/telephony/java/android/telephony/ThirdPartyCallProvider.java
@@ -29,6 +29,7 @@ public class ThirdPartyCallProvider {
private static final int MSG_MUTE = 1;
private static final int MSG_HANGUP = 2;
private static final int MSG_INCOMING_CALL_ACCEPT = 3;
+ private static final int MSG_SEND_DTMF = 4;
/**
* Mutes or unmutes the call.
@@ -51,6 +52,13 @@ public class ThirdPartyCallProvider {
// default implementation empty
}
+ /**
+ * Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
+ */
+ public void sendDtmf(char c) {
+ // default implementation empty
+ }
+
final IThirdPartyCallProvider callback = new IThirdPartyCallProvider.Stub() {
@Override
public void mute(boolean shouldMute) {
@@ -66,6 +74,11 @@ public class ThirdPartyCallProvider {
public void incomingCallAccept() {
Message.obtain(mHandler, MSG_INCOMING_CALL_ACCEPT).sendToTarget();
}
+
+ @Override
+ public void sendDtmf(char c) {
+ Message.obtain(mHandler, MSG_SEND_DTMF, (int) c, 0).sendToTarget();
+ }
};
private final Handler mHandler = new Handler() {
@@ -81,6 +94,9 @@ public class ThirdPartyCallProvider {
case MSG_INCOMING_CALL_ACCEPT:
incomingCallAccept();
break;
+ case MSG_SEND_DTMF:
+ sendDtmf((char) msg.arg1);
+ break;
}
}
};
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index eb6c66f..a22e6b6 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -420,6 +420,9 @@ interface ITelephony {
* identified by component to handle the call.
* @param component the component that should handle the intent.
* @param callId the unique id of the call.
+ * @param callerDisplayName the name shown to the user. Normally this will be the caller's phone
+ * number.
*/
- void newIncomingThirdPartyCall(in ComponentName component, String callId);
+ void newIncomingThirdPartyCall(in ComponentName component, String callId,
+ String callerDisplayName);
}
diff --git a/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl b/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl
index dcbf877..a9d67a4 100644
--- a/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl
+++ b/telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl
@@ -38,4 +38,9 @@ oneway interface IThirdPartyCallProvider {
* Accepts the incoming call.
*/
void incomingCallAccept();
+
+ /**
+ * Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
+ */
+ void sendDtmf(char c);
}