From 5e4dd3e199567efc35aa14219a117020aa67a342 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Mon, 3 Aug 2015 16:59:10 -0700 Subject: Add action for notifying custom components of missed calls. Change-Id: I09797e323dda7a5316f42c2a1c20fadbc60f2c6f --- telecomm/java/android/telecom/TelecomManager.java | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 067e734..232bf0f 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -367,6 +367,32 @@ public class TelecomManager { "android.telecom.intent.extra.TTY_PREFERRED"; /** + * Broadcast intent action for letting custom component know to show the missed call + * notification. + * @hide + */ + @SystemApi + public static final String ACTION_SHOW_MISSED_CALLS_NOTIFICATION = + "android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION"; + + /** + * The number of calls associated with the notification. + * @hide + */ + @SystemApi + public static final String EXTRA_NOTIFICATION_COUNT = + "android.telecom.extra.NOTIFICATION_COUNT"; + + /** + * The number associated with the missed calls. This number is only relevant + * when EXTRA_NOTIFICATION_COUNT is 1. + * @hide + */ + @SystemApi + public static final String EXTRA_NOTIFICATION_PHONE_NUMBER = + "android.telecom.extra.NOTIFICATION_PHONE_NUMBER"; + + /** * The following 4 constants define how properties such as phone numbers and names are * displayed to the user. */ -- cgit v1.1 From 8d41d1d4fdbf070ad391eae820a5e42a326a7771 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Mon, 10 Aug 2015 07:40:42 -0700 Subject: add call back intents for clearing missed calls and calling back. Change-Id: Ib81fecc21c5491f975fa7c44f4e5984a4b3f8e7f --- telecomm/java/android/telecom/TelecomManager.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 232bf0f..8779462 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -393,6 +393,22 @@ public class TelecomManager { "android.telecom.extra.NOTIFICATION_PHONE_NUMBER"; /** + * The intent to clear missed calls. + * @hide + */ + @SystemApi + public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = + "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT"; + + /** + * The intent to call back a missed call. + * @hide + */ + @SystemApi + public static final String EXTRA_CALL_BACK_INTENT = + "android.telecom.extra.CALL_BACK_INTENT"; + + /** * The following 4 constants define how properties such as phone numbers and names are * displayed to the user. */ -- cgit v1.1 From 8190168077aa3ef02a1f5a3a636130d83c4eec1d Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Fri, 28 Aug 2015 16:38:02 -0700 Subject: Add capability for a connection hand rejection text response. Change-Id: Id90417736bed7ab8750144ccaf3c7b449ec832b8 --- telecomm/java/android/telecom/Call.java | 8 +++++++- telecomm/java/android/telecom/Connection.java | 20 ++++++++++++++++++- .../java/android/telecom/ConnectionService.java | 23 ++++++++++++++++++++++ .../internal/telecom/IConnectionService.aidl | 2 ++ 4 files changed, 51 insertions(+), 2 deletions(-) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index f149f24..6511705 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -206,8 +206,14 @@ public final class Call { */ public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000; + /** + * Call sends responses through connection. + * @hide + */ + public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 0x00400000; + //****************************************************************************************** - // Next CAPABILITY value: 0x00004000 + // Next CAPABILITY value: 0x00800000 //****************************************************************************************** /** diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 7b277c5..430760a 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -248,8 +248,15 @@ public abstract class Connection extends Conferenceable { */ public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 0x00200000; + /** + * Indicates that the connection itself wants to handle any sort of reply response, rather than + * relying on SMS. + * @hide + */ + public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 0x00400000; + //********************************************************************************************** - // Next CAPABILITY value: 0x00400000 + // Next CAPABILITY value: 0x00800000 //********************************************************************************************** /** @@ -388,6 +395,10 @@ public abstract class Connection extends Conferenceable { if (can(capabilities, CAPABILITY_CONFERENCE_HAS_NO_CHILDREN)) { builder.append(" CAPABILITY_SINGLE_PARTY_CONFERENCE"); } + if (can(capabilities, CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) { + builder.append(" CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION"); + } + builder.append("]"); return builder.toString(); } @@ -1763,6 +1774,13 @@ public abstract class Connection extends Conferenceable { public void onReject() {} /** + * Notifies ths Connection of a request reject with a message. + * + * @hide + */ + public void onReject(String replyMessage) {} + + /** * Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes. */ public void onPostDialContinue(boolean proceed) {} diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 383e45b..4e330bd 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -101,6 +101,7 @@ public abstract class ConnectionService extends Service { private static final int MSG_ANSWER_VIDEO = 17; private static final int MSG_MERGE_CONFERENCE = 18; private static final int MSG_SWAP_CONFERENCE = 19; + private static final int MSG_REJECT_WITH_MESSAGE = 20; private static Connection sNullConnection; @@ -166,6 +167,14 @@ public abstract class ConnectionService extends Service { } @Override + public void rejectWithMessage(String callId, String message) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = message; + mHandler.obtainMessage(MSG_REJECT_WITH_MESSAGE, args).sendToTarget(); + } + + @Override public void disconnect(String callId) { mHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget(); } @@ -296,6 +305,15 @@ public abstract class ConnectionService extends Service { case MSG_REJECT: reject((String) msg.obj); break; + case MSG_REJECT_WITH_MESSAGE: { + SomeArgs args = (SomeArgs) msg.obj; + try { + reject((String) args.arg1, (String) args.arg2); + } finally { + args.recycle(); + } + break; + } case MSG_DISCONNECT: disconnect((String) msg.obj); break; @@ -681,6 +699,11 @@ public abstract class ConnectionService extends Service { findConnectionForAction(callId, "reject").onReject(); } + private void reject(String callId, String rejectWithMessage) { + Log.d(this, "reject %s with message", callId); + findConnectionForAction(callId, "reject").onReject(rejectWithMessage); + } + private void disconnect(String callId) { Log.d(this, "disconnect %s", callId); if (mConnectionById.containsKey(callId)) { diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl index c2e8530..dd253cf 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl @@ -50,6 +50,8 @@ oneway interface IConnectionService { void reject(String callId); + void rejectWithMessage(String callId, String message); + void disconnect(String callId); void hold(String callId); -- cgit v1.1 From 30b0aa04dc4ca1b7a690cb36524ae7f6be147c12 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Wed, 23 Sep 2015 21:53:53 -0700 Subject: Add additional broadcast for when a phone account is unregistered. Change-Id: Ia14a4206ea50af11c6151e11a95851e5ffa2cd99 --- telecomm/java/android/telecom/TelecomManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 8779462..b07b018 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -116,6 +116,15 @@ public class TelecomManager { "android.telecom.action.PHONE_ACCOUNT_REGISTERED"; /** + * The {@link android.content.Intent} action used indicate that a phone account was + * just unregistered. + * @hide + */ + @SystemApi + public static final String ACTION_PHONE_ACCOUNT_UNREGISTERED = + "android.telecom.action.PHONE_ACCOUNT_UNREGISTERED"; + + /** * Activity action: Shows a dialog asking the user whether or not they want to replace the * current default Dialer with the one specified in * {@link #EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME}. -- cgit v1.1 From b96d89cd342ad5c3a55d620e2f8922e2fed152e7 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Wed, 14 Oct 2015 16:48:40 -0700 Subject: Add capability to identify phone accounts that are emergency only. Bug: 24756957 Change-Id: Id26eaa7f6632674f7122b4cd658cbe2bf9b04594 --- telecomm/java/android/telecom/PhoneAccount.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index cdb0bf2..b64043c 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -121,6 +121,14 @@ public final class PhoneAccount implements Parcelable { public static final int CAPABILITY_CALL_SUBJECT = 0x40; /** + * Flag indicating that this {@code PhoneAccount} should only be used for emergency calls. + *

+ * See {@link #getCapabilities} + * @hide + */ + public static final int CAPABILITY_EMERGENCY_CALLS_ONLY = 0x80; + + /** * URI scheme for telephone number URIs. */ public static final String SCHEME_TEL = "tel"; -- cgit v1.1 From cac50775b2e13c293d224b8d09feb15f9ee40c3f Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 17 Nov 2015 15:13:29 -0800 Subject: Add callback for connections to be notified when the ringer is silenced. Bug: 25644529 Change-Id: Ie7dc9028cf6243d98b2d87ca4c8b3ffcd31e3676 --- telecomm/java/android/telecom/Connection.java | 7 +++++++ telecomm/java/android/telecom/ConnectionService.java | 14 ++++++++++++++ .../com/android/internal/telecom/IConnectionService.aidl | 2 ++ 3 files changed, 23 insertions(+) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 430760a..520a1d7 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -1781,6 +1781,13 @@ public abstract class Connection extends Conferenceable { public void onReject(String replyMessage) {} /** + * Notifies the Connection of a request to silence the ringer. + * + * @hide + */ + public void onSilence() {} + + /** * Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes. */ public void onPostDialContinue(boolean proceed) {} diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 4e330bd..ceaa1bf 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -102,6 +102,7 @@ public abstract class ConnectionService extends Service { private static final int MSG_MERGE_CONFERENCE = 18; private static final int MSG_SWAP_CONFERENCE = 19; private static final int MSG_REJECT_WITH_MESSAGE = 20; + private static final int MSG_SILENCE = 21; private static Connection sNullConnection; @@ -175,6 +176,11 @@ public abstract class ConnectionService extends Service { } @Override + public void silence(String callId) { + mHandler.obtainMessage(MSG_SILENCE, callId).sendToTarget(); + } + + @Override public void disconnect(String callId) { mHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget(); } @@ -317,6 +323,9 @@ public abstract class ConnectionService extends Service { case MSG_DISCONNECT: disconnect((String) msg.obj); break; + case MSG_SILENCE: + silence((String) msg.obj); + break; case MSG_HOLD: hold((String) msg.obj); break; @@ -704,6 +713,11 @@ public abstract class ConnectionService extends Service { findConnectionForAction(callId, "reject").onReject(rejectWithMessage); } + private void silence(String callId) { + Log.d(this, "silence %s", callId); + findConnectionForAction(callId, "silence").onSilence(); + } + private void disconnect(String callId) { Log.d(this, "disconnect %s", callId); if (mConnectionById.containsKey(callId)) { diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl index dd253cf..8a54add 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl @@ -54,6 +54,8 @@ oneway interface IConnectionService { void disconnect(String callId); + void silence(String callId); + void hold(String callId); void unhold(String callId); -- cgit v1.1