summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/Connection.java
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-01-26 13:27:13 -0800
committerScott Lobdell <slobdell@google.com>2021-01-26 23:56:48 -0800
commite85435d4d9a2f7122bd5c97ad0a25c768d124a0e (patch)
tree9b769146d5107f796ef2e6099bab631a7d5b2b1a /telecomm/java/android/telecom/Connection.java
parente92fb723c77ee0204a1ffa431ec23d2416952171 (diff)
parente1acccdfba2d67c675fb6d915345d0aaa089d75c (diff)
Merge SP1A.210122.003
Bug: 178561525 Change-Id: Ifb7c4a1c94e1f4cab710826d57282b981a46e990
Diffstat (limited to 'telecomm/java/android/telecom/Connection.java')
-rw-r--r--telecomm/java/android/telecom/Connection.java66
1 files changed, 64 insertions, 2 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index f08cdf6b4c52..e4eb12d8327e 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -18,6 +18,7 @@ package android.telecom;
import static android.Manifest.permission.MODIFY_PHONE_STATE;
+import android.Manifest;
import android.annotation.ElapsedRealtimeLong;
import android.annotation.IntDef;
import android.annotation.IntRange;
@@ -109,6 +110,20 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public abstract class Connection extends Conferenceable {
+ /**@hide*/
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = "STATE_", value = {
+ STATE_INITIALIZING,
+ STATE_NEW,
+ STATE_RINGING,
+ STATE_DIALING,
+ STATE_ACTIVE,
+ STATE_HOLDING,
+ STATE_DISCONNECTED,
+ STATE_PULLING_CALL
+ })
+ public @interface ConnectionState {}
+
/**
* The connection is initializing. This is generally the first state for a {@code Connection}
* returned by a {@link ConnectionService}.
@@ -534,13 +549,22 @@ public abstract class Connection extends Conferenceable {
public static final int PROPERTY_IS_ADHOC_CONFERENCE = 1 << 12;
/**
+ * Connection is using cross sim technology.
+ * <p>
+ * Indicates that the {@link Connection} is using a cross sim technology which would
+ * register IMS over internet APN of default data subscription.
+ * <p>
+ */
+ public static final int PROPERTY_CROSS_SIM = 1 << 13;
+
+ /**
* Set by the framework to indicate that a Connection is participant host, which
* means the conference participant's handle is the same as the conference host's handle.
* <p>
* This property is specific to IMS conference calls originating in Telephony.
* @hide
*/
- public static final int PROPERTY_IS_PARTICIPANT_HOST = 1 << 13;
+ public static final int PROPERTY_IS_PARTICIPANT_HOST = 1 << 14;
//**********************************************************************************************
@@ -3009,6 +3033,26 @@ public abstract class Connection extends Conferenceable {
public void onCallAudioStateChanged(CallAudioState state) {}
/**
+ * Inform this Connection when it will or will not be tracked by an {@link InCallService} which
+ * can provide an InCall UI.
+ * This is primarily intended for use by Connections reported by self-managed
+ * {@link ConnectionService} which typically maintain their own UI.
+ *
+ * @param isUsingAlternativeUi Indicates whether an InCallService that can provide InCall UI is
+ * currently tracking the self-managed call.
+ */
+ public void onUsingAlternativeUi(boolean isUsingAlternativeUi) {}
+
+ /**
+ * Inform this Conenection when it will or will not be tracked by an non-UI
+ * {@link InCallService}.
+ *
+ * @param isTracked Indicates whether an non-UI InCallService is currently tracking the
+ * self-managed call.
+ */
+ public void onTrackedByNonUiService(boolean isTracked) {}
+
+ /**
* Notifies this Connection of an internal state change. This method is called after the
* state is changed.
*
@@ -3295,7 +3339,7 @@ public abstract class Connection extends Conferenceable {
* Intent intent = new Intent(Intent.ACTION_MAIN, null);
* intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK);
* intent.setClass(context, YourIncomingCallActivity.class);
- * PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, 0);
+ * PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED);
*
* // Build the notification as an ongoing high priority item; this ensures it will show as
* // a heads up notification which slides down over top of the current content.
@@ -3353,6 +3397,24 @@ public abstract class Connection extends Conferenceable {
*/
public void handleRttUpgradeResponse(@Nullable RttTextStream rttTextStream) {}
+ /**
+ * Indicates that call filtering in Telecom is complete
+ *
+ * This method is called for a connection created via
+ * {@link ConnectionService#onCreateIncomingConnection} when call filtering completes in
+ * Telecom, including checking the blocked number db, per-contact settings, and custom call
+ * filtering apps.
+ *
+ * @param isBlocked {@code true} if the call was blocked, {@code false} otherwise. If this is
+ * {@code true}, {@link #onDisconnect()} will be called soon after
+ * this is called.
+ * @param isInContacts Indicates whether the caller is in the user's contacts list.
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.READ_CONTACTS)
+ public void onCallFilteringCompleted(boolean isBlocked, boolean isInContacts) { }
+
static String toLogSafePhoneNumber(String number) {
// For unknown number, log empty string.
if (number == null) {