diff options
Diffstat (limited to 'core/java/android/provider/CallLog.java')
-rw-r--r-- | core/java/android/provider/CallLog.java | 26 |
1 files changed, 25 insertions, 1 deletions
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)); |