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

Commit 9c3f1884 authored by Ihab Awad's avatar Ihab Awad
Browse files

Rename Telecomm "Subscription" to "Account" (1/7)

Change-Id: Ieb29f6ba9dadacb2c7e26969a47141e11a339a40

Conflicts:
	telecomm/java/android/telecomm/InCallCall.java
parent 1e1f2e89
Loading
Loading
Loading
Loading
+26 −26
Original line number Diff line number Diff line
@@ -22886,6 +22886,8 @@ package android.provider {
  public static class CallLog.Calls implements android.provider.BaseColumns {
    ctor public CallLog.Calls();
    method public static java.lang.String getLastOutgoingCall(android.content.Context);
    field public static final java.lang.String ACCOUNT_COMPONENT_NAME = "subscription_component_name";
    field public static final java.lang.String ACCOUNT_ID = "subscription_id";
    field public static final java.lang.String CACHED_FORMATTED_NUMBER = "formatted_number";
    field public static final java.lang.String CACHED_LOOKUP_URI = "lookup_uri";
    field public static final java.lang.String CACHED_MATCHED_NUMBER = "matched_number";
@@ -22917,8 +22919,6 @@ 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_COMPONENT_NAME = "subscription_component_name";
    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";
@@ -27471,6 +27471,7 @@ package android.telecomm {
  public final class CallInfo implements android.os.Parcelable {
    ctor public CallInfo(java.lang.String, android.telecomm.CallState, android.net.Uri);
    method public int describeContents();
    method public android.telecomm.PhoneAccount getAccount();
    method public android.telecomm.CallServiceDescriptor getCurrentCallServiceDescriptor();
    method public android.os.Bundle getExtras();
    method public android.telecomm.GatewayInfo getGatewayInfo();
@@ -27478,7 +27479,6 @@ 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;
  }
@@ -27661,12 +27661,12 @@ package android.telecomm {
  public final class ConnectionRequest implements android.os.Parcelable {
    ctor public ConnectionRequest(android.net.Uri, android.os.Bundle);
    ctor public ConnectionRequest(java.lang.String, android.net.Uri, android.os.Bundle);
    ctor public ConnectionRequest(android.telecomm.Subscription, java.lang.String, android.net.Uri, android.os.Bundle);
    ctor public ConnectionRequest(android.telecomm.PhoneAccount, java.lang.String, android.net.Uri, android.os.Bundle);
    method public int describeContents();
    method public android.telecomm.PhoneAccount getAccount();
    method public java.lang.String getCallId();
    method public android.os.Bundle getExtras();
    method public android.net.Uri getHandle();
    method public android.telecomm.Subscription getSubscription();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
  }
@@ -27680,8 +27680,8 @@ package android.telecomm {
    method public final void disconnect(java.lang.String);
    method public final java.util.Collection<android.telecomm.Connection> getAllConnections();
    method public final void hold(java.lang.String);
    method public final void lookupRemoteSubscriptions(android.net.Uri, android.telecomm.SimpleResponse<android.net.Uri, java.util.List<android.telecomm.Subscription>>);
    method public final void maybeRespondToSubscriptionLookup();
    method public final void lookupRemoteAccounts(android.net.Uri, android.telecomm.SimpleResponse<android.net.Uri, java.util.List<android.telecomm.PhoneAccount>>);
    method public final void maybeRespondToAccountLookup();
    method public final void onAudioStateChanged(java.lang.String, android.telecomm.CallAudioState);
    method protected void onConnectionAdded(android.telecomm.Connection);
    method protected void onConnectionRemoved(android.telecomm.Connection);
@@ -27728,6 +27728,7 @@ package android.telecomm {
  public final class InCallCall implements android.os.Parcelable {
    method public int describeContents();
    method public android.telecomm.PhoneAccount getAccount();
    method public android.telecomm.RemoteCallVideoProvider getCallVideoProvider() throws android.os.RemoteException;
    method public java.util.List<java.lang.String> getCannedSmsResponses();
    method public int getCapabilities();
@@ -27741,7 +27742,6 @@ 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;
  }
@@ -27759,6 +27759,22 @@ package android.telecomm {
    method protected abstract void updateCall(android.telecomm.InCallCall);
  }
  public class PhoneAccount implements android.os.Parcelable {
    ctor public PhoneAccount(android.content.ComponentName, java.lang.String, android.net.Uri, java.lang.String, java.lang.String, boolean, boolean);
    method public int describeContents();
    method public android.content.ComponentName getComponentName();
    method public android.net.Uri getHandle();
    method public android.graphics.drawable.Drawable getIcon(android.content.Context);
    method public android.graphics.drawable.Drawable getIcon(android.content.Context, int);
    method public java.lang.String getId();
    method public java.lang.String getLabel(android.content.Context);
    method public java.lang.String getShortDescription(android.content.Context);
    method public boolean isEnabled();
    method public boolean isSystemDefault();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
  }
  public class RemoteCallVideoClient implements android.os.IBinder.DeathRecipient {
    method public void binderDied();
    method public void handleCallSessionEvent(int) throws android.os.RemoteException;
@@ -27820,22 +27836,6 @@ package android.telecomm {
    method public abstract void onResult(IN, OUT);
  }
  public class Subscription implements android.os.Parcelable {
    ctor public Subscription(android.content.ComponentName, java.lang.String, android.net.Uri, int, int, int, boolean, boolean);
    method public int describeContents();
    method public android.content.ComponentName getComponentName();
    method public android.net.Uri getHandle();
    method public android.graphics.drawable.Drawable getIcon(android.content.Context);
    method public android.graphics.drawable.Drawable getIcon(android.content.Context, int);
    method public java.lang.String getId();
    method public java.lang.String getLabel(android.content.Context);
    method public java.lang.String getShortDescription(android.content.Context);
    method public boolean isEnabled();
    method public boolean isSystemDefault();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
  }
  public final class TelecommConstants {
    ctor public TelecommConstants();
    field public static final java.lang.String ACTION_CALL_SERVICE;
@@ -28287,6 +28287,7 @@ package android.telephony {
  }
  public class TelephonyManager {
    method public java.util.List<android.telecomm.PhoneAccount> getAccounts();
    method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
    method public int getCallState();
    method public android.telephony.CellLocation getCellLocation();
@@ -28310,7 +28311,6 @@ package android.telephony {
    method public java.lang.String getSimSerialNumber();
    method public int getSimState();
    method public java.lang.String getSubscriberId();
    method public java.util.List<android.telecomm.Subscription> getSubscriptions();
    method public java.lang.String getVoiceMailAlphaTag();
    method public java.lang.String getVoiceMailNumber();
    method public boolean hasIccCard();
@@ -28330,12 +28330,12 @@ package android.telephony {
    field public static final int DATA_CONNECTING = 1; // 0x1
    field public static final int DATA_DISCONNECTED = 0; // 0x0
    field public static final int DATA_SUSPENDED = 3; // 0x3
    field public static final java.lang.String EXTRA_ACCOUNT = "account";
    field public static final java.lang.String EXTRA_INCOMING_NUMBER = "incoming_number";
    field public static final java.lang.String EXTRA_STATE = "state";
    field public static final java.lang.String EXTRA_STATE_IDLE;
    field public static final java.lang.String EXTRA_STATE_OFFHOOK;
    field public static final java.lang.String EXTRA_STATE_RINGING;
    field public static final java.lang.String EXTRA_SUBSCRIPTION = "subscription";
    field public static final int NETWORK_TYPE_1xRTT = 7; // 0x7
    field public static final int NETWORK_TYPE_CDMA = 4; // 0x4
    field public static final int NETWORK_TYPE_EDGE = 2; // 0x2
+18 −15
Original line number Diff line number Diff line
@@ -25,7 +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.telecomm.PhoneAccount;
import android.text.TextUtils;

import com.android.internal.telephony.CallerInfo;
@@ -276,17 +276,20 @@ public class CallLog {
         */
        public static final String CACHED_FORMATTED_NUMBER = "formatted_number";

        // Note: PHONE_ACCOUNT_* constant values are "subscription_*" due to a historic naming
        // that was encoded into call log databases.

        /**
         * The component name of the subscription in string form.
         * The component name of the account in string form.
         * <P>Type: TEXT</P>
         */
        public static final String SUBSCRIPTION_COMPONENT_NAME = "subscription_component_name";
        public static final String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name";

        /**
         * The identifier of a subscription that is unique to a specified component.
         * The identifier of a account that is unique to a specified component.
         * <P>Type: TEXT</P>
         */
        public static final String SUBSCRIPTION_ID = "subscription_id";
        public static final String PHONE_ACCOUNT_ID = "subscription_id";

        /**
         * Adds a call to the call log.
@@ -299,14 +302,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 account The account 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, Subscription subscription, long start, int duration) {
                int presentation, int callType, PhoneAccount account, long start, int duration) {
            final ContentResolver resolver = context.getContentResolver();
            int numberPresentation = PRESENTATION_ALLOWED;

@@ -330,12 +333,12 @@ public class CallLog {
                }
            }

            // subscription information
            String subscriptionComponentString = null;
            String subscriptionId = null;
            if (subscription != null) {
                subscriptionComponentString = subscription.getComponentName().flattenToString();
                subscriptionId = subscription.getId();
            // account information
            String accountComponentString = null;
            String accountId = null;
            if (account != null) {
                accountComponentString = account.getComponentName().flattenToString();
                accountId = account.getId();
            }

            ContentValues values = new ContentValues(6);
@@ -345,8 +348,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(PHONE_ACCOUNT_COMPONENT_NAME, accountComponentString);
            values.put(PHONE_ACCOUNT_ID, accountId);
            values.put(NEW, Integer.valueOf(1));
            if (callType == MISSED_TYPE) {
                values.put(IS_READ, Integer.valueOf(0));
+12 −14
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

import java.util.Date;

/**
 * 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.
@@ -52,9 +50,9 @@ public final class CallInfo implements Parcelable {
    private final GatewayInfo mGatewayInfo;

    /**
     * Subscription information for the call.
     * Account information for the call.
     */
    private final Subscription mSubscription;
    private final PhoneAccount mAccount;

    /**
     * Additional information that can be persisted.
@@ -75,7 +73,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 account Account 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.
@@ -87,14 +85,14 @@ public final class CallInfo implements Parcelable {
            CallState state,
            Uri handle,
            GatewayInfo gatewayInfo,
            Subscription subscription,
            PhoneAccount account,
            Bundle extras,
            CallServiceDescriptor currentCallServiceDescriptor) {
        mId = id;
        mState = state;
        mHandle = handle;
        mGatewayInfo = gatewayInfo;
        mSubscription = subscription;
        mAccount = account;
        mExtras = extras;
        mCurrentCallServiceDescriptor = currentCallServiceDescriptor;
    }
@@ -127,8 +125,8 @@ public final class CallInfo implements Parcelable {
        return mGatewayInfo;
    }

    public Subscription getSubscription() {
        return mSubscription;
    public PhoneAccount getAccount() {
        return mAccount;
    }

    public Bundle getExtras() {
@@ -150,12 +148,12 @@ public final class CallInfo implements Parcelable {
            Uri handle = Uri.CREATOR.createFromParcel(source);

            GatewayInfo gatewayInfo = readProviderInfoIfExists(source, GatewayInfo.CREATOR);
            Subscription subscription = readProviderInfoIfExists(source, Subscription.CREATOR);
            PhoneAccount account = readProviderInfoIfExists(source, PhoneAccount.CREATOR);

            ClassLoader classLoader = CallInfo.class.getClassLoader();
            Bundle extras = source.readParcelable(classLoader);
            CallServiceDescriptor descriptor = source.readParcelable(classLoader);
            return new CallInfo(id, state, handle, gatewayInfo, subscription, extras, descriptor);
            return new CallInfo(id, state, handle, gatewayInfo, account, extras, descriptor);
        }

        @Override
@@ -182,14 +180,14 @@ public final class CallInfo implements Parcelable {
        mHandle.writeToParcel(destination, 0);

        writeProviderInfoIfExists(destination, mGatewayInfo);
        writeProviderInfoIfExists(destination, mSubscription);
        writeProviderInfoIfExists(destination, mAccount);

        destination.writeParcelable(mExtras, 0);
        destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
    }

    /**
     * Helper function to write provider information (either GatewayInfo or Subscription) to
     * Helper function to write provider information (either GatewayInfo or Account) to
     * parcel. Will write a false byte if the information does not exist.
     */
    private void writeProviderInfoIfExists(Parcel destination, Parcelable provider) {
@@ -202,7 +200,7 @@ public final class CallInfo implements Parcelable {
    }

    /**
     * Helper function to read provider information (either GatewayInfo or Subscription) from
     * Helper function to read provider information (either GatewayInfo or Account) from
     * parcel.
     */
    private static <T> T readProviderInfoIfExists(Parcel source,
+5 −5
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ public final class ConnectionRequest implements Parcelable {
    private final String mCallId;
    private final Uri mHandle;
    private final Bundle mExtras;
    private final Subscription mSubscription;
    private final PhoneAccount mAccount;

    public ConnectionRequest(Uri handle, Bundle extras) {
        this(null, handle, extras);
@@ -43,17 +43,17 @@ public final class ConnectionRequest implements Parcelable {
        this(null, callId, handle, extras);
    }

    public ConnectionRequest(Subscription subscription, String callId, Uri handle, Bundle extras) {
    public ConnectionRequest(PhoneAccount account, String callId, Uri handle, Bundle extras) {
        mCallId = callId;
        mHandle = handle;
        mExtras = extras;
        mSubscription = subscription;
        mAccount = account;
    }

    /**
     * The subscription which should be used to place the call.
     * The account which should be used to place the call.
     */
    public Subscription getSubscription() { return mSubscription; }
    public PhoneAccount getAccount() { return mAccount; }

    /**
     * An identifier for this call.
+20 −20
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@ public abstract class ConnectionService extends CallService {
    private final RemoteConnectionManager mRemoteConnectionManager = new RemoteConnectionManager();
    private final Handler mHandler = new Handler(Looper.getMainLooper());

    private SimpleResponse<Uri, List<Subscription>> mSubscriptionLookupResponse;
    private Uri mSubscriptionLookupHandle;
    private boolean mAreSubscriptionsInitialized = false;
    private SimpleResponse<Uri, List<PhoneAccount>> mAccountLookupResponse;
    private Uri mAccountLookupHandle;
    private boolean mAreAccountsInitialized = false;

    /**
     * A callback for providing the resuilt of creating a connection.
@@ -382,7 +382,7 @@ public abstract class ConnectionService extends CallService {
     */
    @Override
    protected final void onAdapterAttached(CallServiceAdapter adapter) {
        if (mAreSubscriptionsInitialized) {
        if (mAreAccountsInitialized) {
            // No need to query again if we already did it.
            return;
        }
@@ -399,9 +399,9 @@ public abstract class ConnectionService extends CallService {
                                    componentNames.get(i),
                                    ICallService.Stub.asInterface(callServices.get(i)));
                        }
                        mAreSubscriptionsInitialized = true;
                        mAreAccountsInitialized = true;
                        Log.d(this, "remote call services found: " + callServices);
                        maybeRespondToSubscriptionLookup();
                        maybeRespondToAccountLookup();
                    }
                });
            }
@@ -410,29 +410,29 @@ public abstract class ConnectionService extends CallService {
            public void onError() {
                mHandler.post(new Runnable() {
                    @Override public void run() {
                        mAreSubscriptionsInitialized = true;
                        maybeRespondToSubscriptionLookup();
                        mAreAccountsInitialized = true;
                        maybeRespondToAccountLookup();
                    }
                });
            }
        });
    }

    public final void lookupRemoteSubscriptions(
            Uri handle, SimpleResponse<Uri, List<Subscription>> response) {
        mSubscriptionLookupResponse = response;
        mSubscriptionLookupHandle = handle;
        maybeRespondToSubscriptionLookup();
    public final void lookupRemoteAccounts(
            Uri handle, SimpleResponse<Uri, List<PhoneAccount>> response) {
        mAccountLookupResponse = response;
        mAccountLookupHandle = handle;
        maybeRespondToAccountLookup();
    }

    public final void maybeRespondToSubscriptionLookup() {
        if (mAreSubscriptionsInitialized && mSubscriptionLookupResponse != null) {
            mSubscriptionLookupResponse.onResult(
                    mSubscriptionLookupHandle,
                    mRemoteConnectionManager.getSubscriptions(mSubscriptionLookupHandle));
    public final void maybeRespondToAccountLookup() {
        if (mAreAccountsInitialized && mAccountLookupResponse != null) {
            mAccountLookupResponse.onResult(
                    mAccountLookupHandle,
                    mRemoteConnectionManager.getAccounts(mAccountLookupHandle));

            mSubscriptionLookupHandle = null;
            mSubscriptionLookupResponse = null;
            mAccountLookupHandle = null;
            mAccountLookupResponse = null;
        }
    }

Loading