diff options
author | Scott Lobdell <slobdell@google.com> | 2021-01-26 13:27:13 -0800 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-01-26 23:56:48 -0800 |
commit | e85435d4d9a2f7122bd5c97ad0a25c768d124a0e (patch) | |
tree | 9b769146d5107f796ef2e6099bab631a7d5b2b1a /telecomm/java/android/telecom/ConnectionService.java | |
parent | e92fb723c77ee0204a1ffa431ec23d2416952171 (diff) | |
parent | e1acccdfba2d67c675fb6d915345d0aaa089d75c (diff) |
Merge SP1A.210122.003
Bug: 178561525
Change-Id: Ifb7c4a1c94e1f4cab710826d57282b981a46e990
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rwxr-xr-x | telecomm/java/android/telecom/ConnectionService.java | 129 |
1 files changed, 125 insertions, 4 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 00aea6db9a24..e93ebb06f4f8 100755 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -137,6 +137,8 @@ public abstract class ConnectionService extends Service { private static final String SESSION_HOLD = "CS.h"; private static final String SESSION_UNHOLD = "CS.u"; private static final String SESSION_CALL_AUDIO_SC = "CS.cASC"; + private static final String SESSION_USING_ALTERNATIVE_UI = "CS.uAU"; + private static final String SESSION_TRACKED_BY_NON_UI_SERVICE = "CS.tBNUS"; private static final String SESSION_PLAY_DTMF = "CS.pDT"; private static final String SESSION_STOP_DTMF = "CS.sDT"; private static final String SESSION_CONFERENCE = "CS.c"; @@ -147,6 +149,7 @@ public abstract class ConnectionService extends Service { private static final String SESSION_POST_DIAL_CONT = "CS.oPDC"; private static final String SESSION_PULL_EXTERNAL_CALL = "CS.pEC"; private static final String SESSION_SEND_CALL_EVENT = "CS.sCE"; + private static final String SESSION_CALL_FILTERING_COMPLETED = "CS.oCFC"; private static final String SESSION_HANDOVER_COMPLETE = "CS.hC"; private static final String SESSION_EXTRAS_CHANGED = "CS.oEC"; private static final String SESSION_START_RTT = "CS.+RTT"; @@ -200,6 +203,9 @@ public abstract class ConnectionService extends Service { private static final int MSG_ADD_PARTICIPANT = 39; private static final int MSG_EXPLICIT_CALL_TRANSFER = 40; private static final int MSG_EXPLICIT_CALL_TRANSFER_CONSULTATIVE = 41; + private static final int MSG_ON_CALL_FILTERING_COMPLETED = 42; + private static final int MSG_ON_USING_ALTERNATIVE_UI = 43; + private static final int MSG_ON_TRACKED_BY_NON_UI_SERVICE = 44; private static Connection sNullConnection; @@ -584,6 +590,36 @@ public abstract class ConnectionService extends Service { } @Override + public void onUsingAlternativeUi(String callId, boolean usingAlternativeUiShowing, + Session.Info sessionInfo) { + Log.startSession(sessionInfo, SESSION_USING_ALTERNATIVE_UI); + try { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = usingAlternativeUiShowing; + args.arg3 = Log.createSubsession(); + mHandler.obtainMessage(MSG_ON_USING_ALTERNATIVE_UI, args).sendToTarget(); + } finally { + Log.endSession(); + } + } + + @Override + public void onTrackedByNonUiService(String callId, boolean isTracked, + Session.Info sessionInfo) { + Log.startSession(sessionInfo, SESSION_TRACKED_BY_NON_UI_SERVICE); + try { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = isTracked; + args.arg3 = Log.createSubsession(); + mHandler.obtainMessage(MSG_ON_TRACKED_BY_NON_UI_SERVICE, args).sendToTarget(); + } finally { + Log.endSession(); + } + } + + @Override public void playDtmfTone(String callId, char digit, Session.Info sessionInfo) { Log.startSession(sessionInfo, SESSION_PLAY_DTMF); try { @@ -722,6 +758,22 @@ public abstract class ConnectionService extends Service { } @Override + public void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts, + Session.Info sessionInfo) { + Log.startSession(sessionInfo, SESSION_CALL_FILTERING_COMPLETED); + try { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = isBlocked; + args.arg3 = isInContacts; + args.arg4 = Log.createSubsession(); + mHandler.obtainMessage(MSG_ON_CALL_FILTERING_COMPLETED, args).sendToTarget(); + } finally { + Log.endSession(); + } + } + + @Override public void onExtrasChanged(String callId, Bundle extras, Session.Info sessionInfo) { Log.startSession(sessionInfo, SESSION_EXTRAS_CHANGED); try { @@ -1226,6 +1278,34 @@ public abstract class ConnectionService extends Service { } break; } + case MSG_ON_USING_ALTERNATIVE_UI: { + SomeArgs args = (SomeArgs) msg.obj; + Log.continueSession((Session) args.arg3, + SESSION_HANDLER + SESSION_USING_ALTERNATIVE_UI); + try { + String callId = (String) args.arg1; + boolean isUsingAlternativeUi = (boolean) args.arg2; + onUsingAlternativeUi(callId, isUsingAlternativeUi); + } finally { + args.recycle(); + Log.endSession(); + } + break; + } + case MSG_ON_TRACKED_BY_NON_UI_SERVICE: { + SomeArgs args = (SomeArgs) msg.obj; + Log.continueSession((Session) args.arg3, + SESSION_HANDLER + SESSION_TRACKED_BY_NON_UI_SERVICE); + try { + String callId = (String) args.arg1; + boolean isTracked = (boolean) args.arg2; + onTrackedByNonUiService(callId, isTracked); + } finally { + args.recycle(); + Log.endSession(); + } + break; + } case MSG_PLAY_DTMF_TONE: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -1354,6 +1434,21 @@ public abstract class ConnectionService extends Service { } break; } + case MSG_ON_CALL_FILTERING_COMPLETED: { + SomeArgs args = (SomeArgs) msg.obj; + try { + Log.continueSession((Session) args.arg4, + SESSION_HANDLER + SESSION_CALL_FILTERING_COMPLETED); + String callId = (String) args.arg1; + boolean isBlocked = (boolean) args.arg2; + boolean isInContacts = (boolean) args.arg3; + onCallFilteringCompleted(callId, isBlocked, isInContacts); + } finally { + args.recycle(); + Log.endSession(); + } + break; + } case MSG_HANDOVER_COMPLETE: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -1928,10 +2023,12 @@ public abstract class ConnectionService extends Service { request.getExtras().getBoolean(TelecomManager.EXTRA_IS_HANDOVER, false); boolean isHandover = request.getExtras() != null && request.getExtras().getBoolean( TelecomManager.EXTRA_IS_HANDOVER_CONNECTION, false); - Log.d(this, "createConnection, callManagerAccount: %s, callId: %s, request: %s, " + - "isIncoming: %b, isUnknown: %b, isLegacyHandover: %b, isHandover: %b", - callManagerAccount, callId, request, isIncoming, isUnknown, isLegacyHandover, - isHandover); + boolean addSelfManaged = request.getExtras() != null && request.getExtras().getBoolean( + PhoneAccount.EXTRA_ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE, false); + Log.i(this, "createConnection, callManagerAccount: %s, callId: %s, request: %s, " + + "isIncoming: %b, isUnknown: %b, isLegacyHandover: %b, isHandover: %b, " + + " addSelfManaged: %b", callManagerAccount, callId, request, isIncoming, + isUnknown, isLegacyHandover, isHandover, addSelfManaged); Connection connection = null; if (isHandover) { @@ -2210,6 +2307,22 @@ public abstract class ConnectionService extends Service { } } + private void onUsingAlternativeUi(String callId, boolean isUsingAlternativeUi) { + Log.i(this, "onUsingAlternativeUi %s %s", callId, isUsingAlternativeUi); + if (mConnectionById.containsKey(callId)) { + findConnectionForAction(callId, "onUsingAlternativeUi") + .onUsingAlternativeUi(isUsingAlternativeUi); + } + } + + private void onTrackedByNonUiService(String callId, boolean isTracked) { + Log.i(this, "onTrackedByNonUiService %s %s", callId, isTracked); + if (mConnectionById.containsKey(callId)) { + findConnectionForAction(callId, "onTrackedByNonUiService") + .onTrackedByNonUiService(isTracked); + } + } + private void playDtmfTone(String callId, char digit) { Log.i(this, "playDtmfTone %s %c", callId, digit); if (mConnectionById.containsKey(callId)) { @@ -2349,6 +2462,14 @@ public abstract class ConnectionService extends Service { } } + private void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts) { + Log.i(this, "onCallFilteringCompleted(%s, %b, %b)", isBlocked, isInContacts); + Connection connection = findConnectionForAction(callId, "onCallFilteringCompleted"); + if (connection != null) { + connection.onCallFilteringCompleted(isBlocked, isInContacts); + } + } + /** * Notifies a {@link Connection} that a handover has completed. * |