summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt4
-rw-r--r--core/java/android/provider/CallLog.java26
-rw-r--r--telecomm/java/android/telecomm/CallInfo.java54
-rw-r--r--telecomm/java/android/telecomm/InCallCall.java17
4 files changed, 85 insertions, 16 deletions
diff --git a/api/current.txt b/api/current.txt
index f5b5107..009655c 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -22870,6 +22870,7 @@ package android.provider {
field public static final java.lang.String CACHED_NUMBER_LABEL = "numberlabel";
field public static final java.lang.String CACHED_NUMBER_TYPE = "numbertype";
field public static final java.lang.String CACHED_PHOTO_ID = "photo_id";
+ field public static final java.lang.String SUBSCRIPTION_COMPONENT_NAME = "component_name";
field public static final android.net.Uri CONTENT_FILTER_URI;
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/calls";
field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/calls";
@@ -22893,6 +22894,7 @@ package android.provider {
field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
field public static final int PRESENTATION_UNKNOWN = 3; // 0x3
+ field public static final java.lang.String SUBSCRIPTION_ID = "subscription_id";
field public static final java.lang.String TYPE = "type";
field public static final int VOICEMAIL_TYPE = 4; // 0x4
field public static final java.lang.String VOICEMAIL_URI = "voicemail_uri";
@@ -27594,6 +27596,7 @@ package android.telecomm {
method public java.lang.String getId();
method public android.net.Uri getOriginalHandle();
method public android.telecomm.CallState getState();
+ method public android.telecomm.Subscription getSubscription();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator CREATOR;
}
@@ -27872,6 +27875,7 @@ package android.telecomm {
method public android.telecomm.CallServiceDescriptor getHandoffCallServiceDescriptor();
method public java.lang.String getId();
method public android.telecomm.CallState getState();
+ method public android.telecomm.Subscription getSubscription();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator CREATOR;
}
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 3b0d7ff..8eefd9c 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -25,6 +25,7 @@ import android.net.Uri;
import android.provider.ContactsContract.CommonDataKinds.Callable;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.DataUsageFeedback;
+import android.telecomm.Subscription;
import android.text.TextUtils;
import com.android.internal.telephony.CallerInfo;
@@ -276,6 +277,18 @@ public class CallLog {
public static final String CACHED_FORMATTED_NUMBER = "formatted_number";
/**
+ * The component name of the subscription in string form.
+ * <P>Type: TEXT</P>
+ */
+ public static final String SUBSCRIPTION_COMPONENT_NAME = "subscription_component_name";
+
+ /**
+ * The identifier of a subscription that is unique to a specified component.
+ * <P>Type: TEXT</P>
+ */
+ public static final String SUBSCRIPTION_ID = "subscription_id";
+
+ /**
* Adds a call to the call log.
*
* @param ci the CallerInfo object to get the target contact from. Can be null
@@ -286,13 +299,14 @@ public class CallLog {
* is set by the network and denotes the number presenting rules for
* "allowed", "payphone", "restricted" or "unknown"
* @param callType enumerated values for "incoming", "outgoing", or "missed"
+ * @param subscription The subscription object describing the provider of the call
* @param start time stamp for the call in milliseconds
* @param duration call duration in seconds
*
* {@hide}
*/
public static Uri addCall(CallerInfo ci, Context context, String number,
- int presentation, int callType, long start, int duration) {
+ int presentation, int callType, Subscription subscription, long start, int duration) {
final ContentResolver resolver = context.getContentResolver();
int numberPresentation = PRESENTATION_ALLOWED;
@@ -316,6 +330,14 @@ public class CallLog {
}
}
+ // subscription information
+ String subscriptionComponentString = null;
+ String subscriptionId = null;
+ if (subscription != null) {
+ subscriptionComponentString = subscription.getComponentName().flattenToString();
+ subscriptionId = subscription.getId();
+ }
+
ContentValues values = new ContentValues(6);
values.put(NUMBER, number);
@@ -323,6 +345,8 @@ public class CallLog {
values.put(TYPE, Integer.valueOf(callType));
values.put(DATE, Long.valueOf(start));
values.put(DURATION, Long.valueOf(duration));
+ values.put(SUBSCRIPTION_COMPONENT_NAME, subscriptionComponentString);
+ values.put(SUBSCRIPTION_ID, subscriptionId);
values.put(NEW, Integer.valueOf(1));
if (callType == MISSED_TYPE) {
values.put(IS_READ, Integer.valueOf(0));
diff --git a/telecomm/java/android/telecomm/CallInfo.java b/telecomm/java/android/telecomm/CallInfo.java
index 4de9373..17efed5 100644
--- a/telecomm/java/android/telecomm/CallInfo.java
+++ b/telecomm/java/android/telecomm/CallInfo.java
@@ -24,7 +24,7 @@ import android.os.Parcelable;
import java.util.Date;
/**
- * A parcelable holder class of Call information data. This class is intended for transfering call
+ * A parcelable holder class of Call information data. This class is intended for transferring call
* information from Telecomm to call services and thus is read-only.
* TODO(santoscordon): Need final public-facing comments in this file.
*/
@@ -52,6 +52,11 @@ public final class CallInfo implements Parcelable {
private final GatewayInfo mGatewayInfo;
/**
+ * Subscription information for the call.
+ */
+ private final Subscription mSubscription;
+
+ /**
* Additional information that can be persisted.
*/
private final Bundle mExtras;
@@ -60,7 +65,7 @@ public final class CallInfo implements Parcelable {
private final CallServiceDescriptor mCurrentCallServiceDescriptor;
public CallInfo(String id, CallState state, Uri handle) {
- this(id, state, handle, null, Bundle.EMPTY, null);
+ this(id, state, handle, null, null, Bundle.EMPTY, null);
}
/**
@@ -70,6 +75,7 @@ public final class CallInfo implements Parcelable {
* @param state The state of the call.
* @param handle The handle to the other party in this call.
* @param gatewayInfo Gateway information pertaining to this call.
+ * @param subscription Subscription information pertaining to this call.
* @param extras Additional information that can be persisted.
* @param currentCallServiceDescriptor The descriptor for the call service currently routing
* this call.
@@ -81,12 +87,14 @@ public final class CallInfo implements Parcelable {
CallState state,
Uri handle,
GatewayInfo gatewayInfo,
+ Subscription subscription,
Bundle extras,
CallServiceDescriptor currentCallServiceDescriptor) {
mId = id;
mState = state;
mHandle = handle;
mGatewayInfo = gatewayInfo;
+ mSubscription = subscription;
mExtras = extras;
mCurrentCallServiceDescriptor = currentCallServiceDescriptor;
}
@@ -119,6 +127,10 @@ public final class CallInfo implements Parcelable {
return mGatewayInfo;
}
+ public Subscription getSubscription() {
+ return mSubscription;
+ }
+
public Bundle getExtras() {
return mExtras;
}
@@ -137,16 +149,13 @@ public final class CallInfo implements Parcelable {
CallState state = CallState.valueOf(source.readString());
Uri handle = Uri.CREATOR.createFromParcel(source);
- boolean gatewayInfoPresent = source.readByte() != 0;
- GatewayInfo gatewayInfo = null;
- if (gatewayInfoPresent) {
- gatewayInfo = GatewayInfo.CREATOR.createFromParcel(source);
- }
+ GatewayInfo gatewayInfo = readProviderInfoIfExists(source, GatewayInfo.CREATOR);
+ Subscription subscription = readProviderInfoIfExists(source, Subscription.CREATOR);
ClassLoader classLoader = CallInfo.class.getClassLoader();
Bundle extras = source.readParcelable(classLoader);
CallServiceDescriptor descriptor = source.readParcelable(classLoader);
- return new CallInfo(id, state, handle, gatewayInfo, extras, descriptor);
+ return new CallInfo(id, state, handle, gatewayInfo, subscription, extras, descriptor);
}
@Override
@@ -172,14 +181,35 @@ public final class CallInfo implements Parcelable {
destination.writeString(mState.name());
mHandle.writeToParcel(destination, 0);
- if (mGatewayInfo != null) {
+ writeProviderInfoIfExists(destination, mGatewayInfo);
+ writeProviderInfoIfExists(destination, mSubscription);
+
+ destination.writeParcelable(mExtras, 0);
+ destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
+ }
+
+ /**
+ * Helper function to write provider information (either GatewayInfo or Subscription) to
+ * parcel. Will write a false byte if the information does not exist.
+ */
+ private void writeProviderInfoIfExists(Parcel destination, Parcelable provider) {
+ if (provider != null) {
destination.writeByte((byte) 1);
- mGatewayInfo.writeToParcel(destination, 0);
+ provider.writeToParcel(destination, 0);
} else {
destination.writeByte((byte) 0);
}
+ }
- destination.writeParcelable(mExtras, 0);
- destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
+ /**
+ * Helper function to read provider information (either GatewayInfo or Subscription) from
+ * parcel.
+ */
+ private static <T> T readProviderInfoIfExists(Parcel source,
+ Parcelable.Creator<T> creator) {
+ if (source.readByte() != 0) {
+ return creator.createFromParcel(source);
+ }
+ return null;
}
}
diff --git a/telecomm/java/android/telecomm/InCallCall.java b/telecomm/java/android/telecomm/InCallCall.java
index 66974f9..8cbe2e6 100644
--- a/telecomm/java/android/telecomm/InCallCall.java
+++ b/telecomm/java/android/telecomm/InCallCall.java
@@ -38,6 +38,7 @@ public final class InCallCall implements Parcelable {
private final long mConnectTimeMillis;
private final Uri mHandle;
private final GatewayInfo mGatewayInfo;
+ private final Subscription mSubscription;
private final CallServiceDescriptor mCurrentCallServiceDescriptor;
private final CallServiceDescriptor mHandoffCallServiceDescriptor;
private final String mParentCallId;
@@ -55,11 +56,12 @@ public final class InCallCall implements Parcelable {
long connectTimeMillis,
Uri handle,
GatewayInfo gatewayInfo,
+ Subscription subscription,
CallServiceDescriptor descriptor,
CallServiceDescriptor handoffDescriptor) {
this(id, state, disconnectCauseCode, disconnectCauseMsg, cannedSmsResponses,
- capabilities, connectTimeMillis, handle, gatewayInfo, descriptor, handoffDescriptor,
- null, Collections.EMPTY_LIST);
+ capabilities, connectTimeMillis, handle, gatewayInfo, subscription, descriptor,
+ handoffDescriptor, null, Collections.EMPTY_LIST);
}
/** @hide */
@@ -73,6 +75,7 @@ public final class InCallCall implements Parcelable {
long connectTimeMillis,
Uri handle,
GatewayInfo gatewayInfo,
+ Subscription subscription,
CallServiceDescriptor descriptor,
CallServiceDescriptor handoffDescriptor,
String parentCallId,
@@ -86,6 +89,7 @@ public final class InCallCall implements Parcelable {
mConnectTimeMillis = connectTimeMillis;
mHandle = handle;
mGatewayInfo = gatewayInfo;
+ mSubscription = subscription;
mCurrentCallServiceDescriptor = descriptor;
mHandoffCallServiceDescriptor = handoffDescriptor;
mParentCallId = parentCallId;
@@ -145,6 +149,11 @@ public final class InCallCall implements Parcelable {
return mGatewayInfo;
}
+ /** Subscription information for the call. */
+ public Subscription getSubscription() {
+ return mSubscription;
+ }
+
/** The descriptor for the call service currently routing this call. */
public CallServiceDescriptor getCurrentCallServiceDescriptor() {
return mCurrentCallServiceDescriptor;
@@ -191,6 +200,7 @@ public final class InCallCall implements Parcelable {
long connectTimeMillis = source.readLong();
Uri handle = source.readParcelable(classLoader);
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
+ Subscription subscription = source.readParcelable(classLoader);
CallServiceDescriptor descriptor = source.readParcelable(classLoader);
CallServiceDescriptor handoffDescriptor = source.readParcelable(classLoader);
String parentCallId = source.readString();
@@ -198,7 +208,7 @@ public final class InCallCall implements Parcelable {
source.readList(childCallIds, classLoader);
return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg,
cannedSmsResponses, capabilities, connectTimeMillis, handle, gatewayInfo,
- descriptor, handoffDescriptor, parentCallId, childCallIds);
+ subscription, descriptor, handoffDescriptor, parentCallId, childCallIds);
}
@Override
@@ -225,6 +235,7 @@ public final class InCallCall implements Parcelable {
destination.writeLong(mConnectTimeMillis);
destination.writeParcelable(mHandle, 0);
destination.writeParcelable(mGatewayInfo, 0);
+ destination.writeParcelable(mSubscription, 0);
destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
destination.writeParcelable(mHandoffCallServiceDescriptor, 0);
destination.writeString(mParentCallId);