Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 028e3650 authored by Thomas Stuart's avatar Thomas Stuart Committed by Android (Google) Code Review
Browse files

Merge "add new APIs for Enriched Calling" into main

parents 981adb15 4fab083a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -35525,6 +35525,7 @@ package android.provider {
    ctor public CallLog.Calls();
    method public static String getLastOutgoingCall(android.content.Context);
    field public static final int ANSWERED_EXTERNALLY_TYPE = 7; // 0x7
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String ASSERTED_DISPLAY_NAME = "asserted_display_name";
    field public static final long AUTO_MISSED_EMERGENCY_CALL = 1L; // 0x1L
    field public static final long AUTO_MISSED_MAXIMUM_DIALING = 4L; // 0x4L
    field public static final long AUTO_MISSED_MAXIMUM_RINGING = 2L; // 0x2L
@@ -35571,6 +35572,7 @@ package android.provider {
    field public static final int FEATURES_WIFI = 8; // 0x8
    field public static final String GEOCODED_LOCATION = "geocoded_location";
    field public static final int INCOMING_TYPE = 1; // 0x1
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String IS_BUSINESS_CALL = "is_business_call";
    field public static final String IS_READ = "is_read";
    field public static final String LAST_MODIFIED = "last_modified";
    field public static final String LIMIT_PARAM_KEY = "limit";
@@ -42048,8 +42050,10 @@ package android.telecom {
    field @Deprecated public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
    field public static final String EVENT_CLEAR_DIAGNOSTIC_MESSAGE = "android.telecom.event.CLEAR_DIAGNOSTIC_MESSAGE";
    field public static final String EVENT_DISPLAY_DIAGNOSTIC_MESSAGE = "android.telecom.event.DISPLAY_DIAGNOSTIC_MESSAGE";
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String EXTRA_ASSERTED_DISPLAY_NAME = "android.telecom.extra.ASSERTED_DISPLAY_NAME";
    field public static final String EXTRA_DIAGNOSTIC_MESSAGE = "android.telecom.extra.DIAGNOSTIC_MESSAGE";
    field public static final String EXTRA_DIAGNOSTIC_MESSAGE_ID = "android.telecom.extra.DIAGNOSTIC_MESSAGE_ID";
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String EXTRA_IS_BUSINESS_CALL = "android.telecom.extra.IS_BUSINESS_CALL";
    field public static final String EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB = "android.telecom.extra.IS_SUPPRESSED_BY_DO_NOT_DISTURB";
    field public static final String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS";
    field public static final String EXTRA_SILENT_RINGING_REQUESTED = "android.telecom.extra.SILENT_RINGING_REQUESTED";
@@ -43677,6 +43681,7 @@ package android.telephony {
    field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool";
    field public static final String KEY_SUBSCRIPTION_GROUP_UUID_STRING = "subscription_group_uuid_string";
    field public static final String KEY_SUPPORTED_PREMIUM_CAPABILITIES_INT_ARRAY = "supported_premium_capabilities_int_array";
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String KEY_SUPPORTS_BUSINESS_CALL_COMPOSER_BOOL = "supports_business_call_composer_bool";
    field public static final String KEY_SUPPORTS_CALL_COMPOSER_BOOL = "supports_call_composer_bool";
    field public static final String KEY_SUPPORTS_DEVICE_TO_DEVICE_COMMUNICATION_USING_DTMF_BOOL = "supports_device_to_device_communication_using_dtmf_bool";
    field public static final String KEY_SUPPORTS_DEVICE_TO_DEVICE_COMMUNICATION_USING_RTP_BOOL = "supports_device_to_device_communication_using_rtp_bool";
@@ -45942,6 +45947,7 @@ package android.telephony {
    field public static final int AUTHTYPE_EAP_SIM = 128; // 0x80
    field public static final int AUTHTYPE_GBA_BOOTSTRAP = 132; // 0x84
    field public static final int AUTHTYPE_GBA_NAF_KEY_EXTERNAL = 133; // 0x85
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final int CALL_COMPOSER_STATUS_BUSINESS_ONLY = 2; // 0x2
    field public static final int CALL_COMPOSER_STATUS_OFF = 0; // 0x0
    field public static final int CALL_COMPOSER_STATUS_ON = 1; // 0x1
    field public static final int CALL_STATE_IDLE = 0; // 0x0
@@ -46978,6 +46984,7 @@ package android.telephony.ims.feature {
  public static class MmTelFeature.MmTelCapabilities {
    method public final boolean isCapable(int);
    field public static final int CAPABILITY_TYPE_CALL_COMPOSER = 16; // 0x10
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final int CAPABILITY_TYPE_CALL_COMPOSER_BUSINESS_ONLY = 32; // 0x20
    field public static final int CAPABILITY_TYPE_SMS = 8; // 0x8
    field public static final int CAPABILITY_TYPE_UT = 4; // 0x4
    field public static final int CAPABILITY_TYPE_VIDEO = 2; // 0x2
+1 −0
Original line number Diff line number Diff line
@@ -16143,6 +16143,7 @@ package android.telephony.ims {
    field public static final int DIALSTRING_USSD = 2; // 0x2
    field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo";
    field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS";
    field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String EXTRA_ASSERTED_DISPLAY_NAME = "android.telephony.ims.extra.ASSERTED_DISPLAY_NAME";
    field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE";
    field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE";
    field @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech";
+96 −8
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.provider;

import android.Manifest;
import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.LongDef;
import android.annotation.NonNull;
@@ -55,6 +56,8 @@ import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;

import com.android.server.telecom.flags.Flags;

import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -427,6 +430,8 @@ public class CallLog {
            private double mLongitude = Double.NaN;
            private Uri mPictureUri;
            private int mIsPhoneAccountMigrationPending;
            private boolean mIsBusinessCall;
            private String mBusinessName;

            /**
             * @param callerInfo the CallerInfo object to get the target contact from.
@@ -644,18 +649,47 @@ public class CallLog {
                return this;
            }

            /**
             * @param isBusinessCall should be set if the caller is a business call
             */
            @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
            public @NonNull AddCallParametersBuilder setIsBusinessCall(boolean isBusinessCall) {
                mIsBusinessCall = isBusinessCall;
                return this;
            }

            /**
             * @param businessName should be set if the caller is a business call
             */
            @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
            public @NonNull AddCallParametersBuilder setBusinessName(String businessName) {
                mBusinessName = businessName;
                return this;
            }

            /**
             * Builds the object
             */
            public @NonNull AddCallParams build() {
                if (Flags.businessCallComposer()) {
                    return new AddCallParams(mCallerInfo, mNumber, mPostDialDigits, mViaNumber,
                            mPresentation, mCallType, mFeatures, mAccountHandle, mStart, mDuration,
                            mDataUsage, mAddForAllUsers, mUserToBeInsertedTo, mIsRead,
                            mCallBlockReason,
                            mCallScreeningAppName, mCallScreeningComponentName, mMissedReason,
                            mPriority, mSubject, mLatitude, mLongitude, mPictureUri,
                            mIsPhoneAccountMigrationPending, mIsBusinessCall, mBusinessName);
                } else {
                    return new AddCallParams(mCallerInfo, mNumber, mPostDialDigits, mViaNumber,
                            mPresentation, mCallType, mFeatures, mAccountHandle, mStart, mDuration,
                        mDataUsage, mAddForAllUsers, mUserToBeInsertedTo, mIsRead, mCallBlockReason,
                            mDataUsage, mAddForAllUsers, mUserToBeInsertedTo, mIsRead,
                            mCallBlockReason,
                            mCallScreeningAppName, mCallScreeningComponentName, mMissedReason,
                            mPriority, mSubject, mLatitude, mLongitude, mPictureUri,
                            mIsPhoneAccountMigrationPending);
                }
            }
        }

        private CallerInfo mCallerInfo;
        private String mNumber;
@@ -681,6 +715,8 @@ public class CallLog {
        private double mLongitude = Double.NaN;
        private Uri mPictureUri;
        private int mIsPhoneAccountMigrationPending;
        private boolean mIsBusinessCall;
        private String mBusinessName;

        private AddCallParams(CallerInfo callerInfo, String number, String postDialDigits,
                String viaNumber, int presentation, int callType, int features,
@@ -717,6 +753,43 @@ public class CallLog {
            mIsPhoneAccountMigrationPending = isPhoneAccountMigrationPending;
        }

        private AddCallParams(CallerInfo callerInfo, String number, String postDialDigits,
                String viaNumber, int presentation, int callType, int features,
                PhoneAccountHandle accountHandle, long start, int duration, long dataUsage,
                boolean addForAllUsers, UserHandle userToBeInsertedTo, boolean isRead,
                int callBlockReason,
                CharSequence callScreeningAppName, String callScreeningComponentName,
                long missedReason,
                int priority, String subject, double latitude, double longitude, Uri pictureUri,
                int isPhoneAccountMigrationPending, boolean isBusinessCall, String businessName) {
            mCallerInfo = callerInfo;
            mNumber = number;
            mPostDialDigits = postDialDigits;
            mViaNumber = viaNumber;
            mPresentation = presentation;
            mCallType = callType;
            mFeatures = features;
            mAccountHandle = accountHandle;
            mStart = start;
            mDuration = duration;
            mDataUsage = dataUsage;
            mAddForAllUsers = addForAllUsers;
            mUserToBeInsertedTo = userToBeInsertedTo;
            mIsRead = isRead;
            mCallBlockReason = callBlockReason;
            mCallScreeningAppName = callScreeningAppName;
            mCallScreeningComponentName = callScreeningComponentName;
            mMissedReason = missedReason;
            mPriority = priority;
            mSubject = subject;
            mLatitude = latitude;
            mLongitude = longitude;
            mPictureUri = pictureUri;
            mIsPhoneAccountMigrationPending = isPhoneAccountMigrationPending;
            mIsBusinessCall = isBusinessCall;
            mBusinessName = businessName;
        }

    }

    /**
@@ -915,6 +988,19 @@ public class CallLog {
         */
        public static final String NUMBER = "number";


        /**
         * Boolean indicating whether the call is a business call.
         */
        @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
        public static final String IS_BUSINESS_CALL = "is_business_call";

        /**
         * String that stores the asserted display name associated with business call.
         */
        @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
        public static final String ASSERTED_DISPLAY_NAME = "asserted_display_name";

        /**
         * The number presenting rules set by the network.
         *
@@ -1713,7 +1799,6 @@ public class CallLog {
            }

            ContentValues values = new ContentValues(14);

            values.put(NUMBER, params.mNumber);
            values.put(POST_DIAL_DIGITS, params.mPostDialDigits);
            values.put(VIA_NUMBER, params.mViaNumber);
@@ -1746,7 +1831,10 @@ public class CallLog {
                values.put(COMPOSER_PHOTO_URI, params.mPictureUri.toString());
            }
            values.put(IS_PHONE_ACCOUNT_MIGRATION_PENDING, params.mIsPhoneAccountMigrationPending);

            if (Flags.businessCallComposer()) {
                values.put(IS_BUSINESS_CALL, Integer.valueOf(params.mIsBusinessCall ? 1 : 0));
                values.put(ASSERTED_DISPLAY_NAME, params.mBusinessName);
            }
            if ((params.mCallerInfo != null) && (params.mCallerInfo.getContactId() > 0)) {
                // Update usage information for the number associated with the contact ID.
                // We need to use both the number and the ID for obtaining a data ID since other
+21 −0
Original line number Diff line number Diff line
@@ -268,6 +268,27 @@ public final class Call {
    public static final String EXTRA_DIAGNOSTIC_MESSAGE =
            "android.telecom.extra.DIAGNOSTIC_MESSAGE";

    /**
     * Boolean indicating that the call is a verified business call.
     *
     * {@link Connection#setExtras(Bundle)} or {@link Connection#putExtras(Bundle)}
     * should be used to notify Telecom this extra has been set.
     */
    @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
    public static final String EXTRA_IS_BUSINESS_CALL =
            "android.telecom.extra.IS_BUSINESS_CALL";

    /**
     * String value indicating the asserted display name reported via
     * ImsCallProfile#EXTRA_ASSERTED_DISPLAY_NAME.
     *
     * {@link Connection#setExtras(Bundle)} or {@link Connection#putExtras(Bundle)}
     * should be used to notify Telecom this extra has been set.
     */
    @FlaggedApi(Flags.FLAG_BUSINESS_CALL_COMPOSER)
    public static final String EXTRA_ASSERTED_DISPLAY_NAME =
            "android.telecom.extra.ASSERTED_DISPLAY_NAME";

    /**
     * Reject reason used with {@link #reject(int)} to indicate that the user is rejecting this
     * call because they have declined to answer it.  This typically means that they are unable
+8 −0
Original line number Diff line number Diff line
@@ -9777,6 +9777,13 @@ public class CarrierConfigManager {
     */
    public static final String KEY_SUPPORTS_CALL_COMPOSER_BOOL = "supports_call_composer_bool";
    /**
     * Indicates if the carrier supports a business call composer.
     */
    @FlaggedApi(com.android.server.telecom.flags.Flags.FLAG_BUSINESS_CALL_COMPOSER)
    public static final String KEY_SUPPORTS_BUSINESS_CALL_COMPOSER_BOOL =
            "supports_business_call_composer_bool";
    /**
     * Indicates the carrier server url that serves the call composer picture.
     */
@@ -10861,6 +10868,7 @@ public class CarrierConfigManager {
        sDefaults.putBoolean(KEY_DISABLE_DUN_APN_WHILE_ROAMING_WITH_PRESET_APN_BOOL, false);
        sDefaults.putString(KEY_DEFAULT_PREFERRED_APN_NAME_STRING, "");
        sDefaults.putBoolean(KEY_SUPPORTS_CALL_COMPOSER_BOOL, false);
        sDefaults.putBoolean(KEY_SUPPORTS_BUSINESS_CALL_COMPOSER_BOOL, false);
        sDefaults.putString(KEY_CALL_COMPOSER_PICTURE_SERVER_URL_STRING, "");
        sDefaults.putBoolean(KEY_USE_ACS_FOR_RCS_BOOL, false);
        sDefaults.putBoolean(KEY_NETWORK_TEMP_NOT_METERED_SUPPORTED_BOOL, true);
Loading