diff --git a/api/current.txt b/api/current.txt index 52b03e910c87e..dbdb1e53d22ca 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28292,7 +28292,7 @@ package android.telecomm { method public int getState(); method public void hold(); method public void phoneAccountClicked(); - method public void phoneAccountSelected(android.telecomm.PhoneAccount); + method public void phoneAccountSelected(android.telecomm.PhoneAccountHandle); method public void playDtmfTone(char); method public void postDialContinue(boolean); method public void reject(boolean, java.lang.String); @@ -28311,7 +28311,7 @@ package android.telecomm { } public static class Call.Details { - method public android.telecomm.PhoneAccount getAccount(); + method public android.telecomm.PhoneAccountHandle getAccount(); method public java.lang.String getCallerDisplayName(); method public int getCallerDisplayNamePresentation(); method public int getCapabilities(); @@ -28495,9 +28495,9 @@ package android.telecomm { } public final class ConnectionRequest implements android.os.Parcelable { - ctor public ConnectionRequest(android.telecomm.PhoneAccount, java.lang.String, android.net.Uri, int, android.os.Bundle, int); + ctor public ConnectionRequest(android.telecomm.PhoneAccountHandle, java.lang.String, android.net.Uri, int, android.os.Bundle, int); method public int describeContents(); - method public android.telecomm.PhoneAccount getAccount(); + method public android.telecomm.PhoneAccountHandle getAccount(); method public java.lang.String getCallId(); method public android.os.Bundle getExtras(); method public android.net.Uri getHandle(); @@ -28512,7 +28512,7 @@ package android.telecomm { method public final void createRemoteIncomingConnection(android.telecomm.ConnectionRequest, android.telecomm.ConnectionService.CreateConnectionResponse); method public final void createRemoteOutgoingConnection(android.telecomm.ConnectionRequest, android.telecomm.ConnectionService.CreateConnectionResponse); method public final java.util.Collection getAllConnections(); - method public final void lookupRemoteAccounts(android.net.Uri, android.telecomm.SimpleResponse>); + method public final void lookupRemoteAccounts(android.net.Uri, android.telecomm.SimpleResponse>); method public final void maybeRespondToAccountLookup(); method public final android.os.IBinder onBind(android.content.Intent); method protected void onConnectionAdded(android.telecomm.Connection); @@ -28544,7 +28544,7 @@ package android.telecomm { method public void holdCall(java.lang.String); method public void mute(boolean); method public void phoneAccountClicked(java.lang.String); - method public void phoneAccountSelected(java.lang.String, android.telecomm.PhoneAccount); + method public void phoneAccountSelected(java.lang.String, android.telecomm.PhoneAccountHandle); method public void playDtmfTone(java.lang.String, char); method public void postDialContinue(java.lang.String, boolean); method public void rejectCall(java.lang.String, boolean, java.lang.String); @@ -28556,7 +28556,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.PhoneAccountHandle getAccount(); method public android.telecomm.RemoteCallVideoProvider getCallVideoProvider() throws android.os.RemoteException; method public java.lang.String getCallerDisplayName(); method public int getCallerDisplayNamePresentation(); @@ -28601,8 +28601,8 @@ package android.telecomm { method public void onCallRemoved(android.telecomm.Phone, android.telecomm.Call); } - public class PhoneAccount implements android.os.Parcelable { - ctor public PhoneAccount(android.content.ComponentName, java.lang.String); + public class PhoneAccountHandle implements android.os.Parcelable { + ctor public PhoneAccountHandle(android.content.ComponentName, java.lang.String); method public int describeContents(); method public android.content.ComponentName getComponentName(); method public java.lang.String getId(); @@ -28611,9 +28611,9 @@ package android.telecomm { } public class PhoneAccountMetadata implements android.os.Parcelable { - ctor public PhoneAccountMetadata(android.telecomm.PhoneAccount, android.net.Uri, java.lang.String, int, int, java.lang.String, java.lang.String, boolean); + ctor public PhoneAccountMetadata(android.telecomm.PhoneAccountHandle, android.net.Uri, java.lang.String, int, int, java.lang.String, java.lang.String, boolean); method public int describeContents(); - method public android.telecomm.PhoneAccount getAccount(); + method public android.telecomm.PhoneAccountHandle getAccount(); method public int getCapabilities(); method public android.net.Uri getHandle(); method public android.graphics.drawable.Drawable getIcon(android.content.Context); @@ -28719,11 +28719,11 @@ package android.telecomm { public class TelecommManager { method public void clearAccounts(java.lang.String); - method public android.telecomm.PhoneAccount getDefaultOutgoingPhoneAccount(); - method public java.util.List getEnabledPhoneAccounts(); - method public android.telecomm.PhoneAccountMetadata getPhoneAccountMetadata(android.telecomm.PhoneAccount); + method public android.telecomm.PhoneAccountHandle getDefaultOutgoingPhoneAccount(); + method public java.util.List getEnabledPhoneAccounts(); + method public android.telecomm.PhoneAccountMetadata getPhoneAccountMetadata(android.telecomm.PhoneAccountHandle); method public void registerPhoneAccount(android.telecomm.PhoneAccountMetadata); - method public void unregisterPhoneAccount(android.telecomm.PhoneAccount); + method public void unregisterPhoneAccount(android.telecomm.PhoneAccountHandle); field public static final java.lang.String ACTION_CONNECTION_SERVICE; field public static final java.lang.String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.intent.action.CONNECTION_SERVICE_CONFIGURE"; field public static final java.lang.String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL"; @@ -28734,7 +28734,7 @@ package android.telecomm { field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecomm.extra.CALL_DISCONNECT_MESSAGE"; field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE"; field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS"; - field public static final java.lang.String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT"; + field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.intent.extra.PHONE_ACCOUNT_HANDLE"; field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE"; field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.intent.extra.START_CALL_WITH_VIDEO_STATE"; } diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index c6b6e20735932..023988cb39cdb 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -26,7 +26,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.PhoneAccount; +import android.telecomm.PhoneAccountHandle; import android.text.TextUtils; import com.android.internal.telephony.CallerInfo; @@ -352,8 +352,8 @@ public class CallLog { * {@hide} */ public static Uri addCall(CallerInfo ci, Context context, String number, - int presentation, int callType, int features, PhoneAccount account, long start, - int duration, Long dataUsage) { + int presentation, int callType, int features, PhoneAccountHandle account, + long start, int duration, Long dataUsage) { final ContentResolver resolver = context.getContentResolver(); int numberPresentation = PRESENTATION_ALLOWED; diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index 4cb75be5e9fc5..b1175f21dfa2c 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -73,7 +73,7 @@ public final class Call { private final int mHandlePresentation; private final String mCallerDisplayName; private final int mCallerDisplayNamePresentation; - private final PhoneAccount mAccount; + private final PhoneAccountHandle mAccount; private final int mCapabilities; private final int mDisconnectCauseCode; private final String mDisconnectCauseMsg; @@ -114,9 +114,10 @@ public final class Call { } /** - * @return The {@code PhoneAccount} whereby the {@code Call} is currently being routed. + * @return The {@code PhoneAccountHandle} whereby the {@code Call} is currently being + * routed. */ - public PhoneAccount getAccount() { + public PhoneAccountHandle getAccount() { return mAccount; } @@ -219,7 +220,7 @@ public final class Call { int handlePresentation, String callerDisplayName, int callerDisplayNamePresentation, - PhoneAccount account, + PhoneAccountHandle account, int capabilities, int disconnectCauseCode, String disconnectCauseMsg, @@ -457,10 +458,10 @@ public final class Call { } /** - * Notifies this {@code Call} the a {@code PhoneAccount} has been selected and to proceed + * Notifies this {@code Call} the a {@code PhoneAccountHandle} has been selected and to proceed * with placing an outgoing call. */ - public void phoneAccountSelected(PhoneAccount account) { + public void phoneAccountSelected(PhoneAccountHandle account) { mInCallAdapter.phoneAccountSelected(mTelecommCallId, account); } diff --git a/telecomm/java/android/telecomm/CallState.java b/telecomm/java/android/telecomm/CallState.java index 7abf4abaa419c..e5c1613c3a377 100644 --- a/telecomm/java/android/telecomm/CallState.java +++ b/telecomm/java/android/telecomm/CallState.java @@ -33,9 +33,9 @@ public enum CallState { /** * Indicates that the call is about to go into the outgoing and dialing state but is waiting for - * user input before it proceeds. For example, where no default {@link PhoneAccount} is set, - * this is the state where the InCallUI is waiting for the user to select a {@link PhoneAccount} - * to call from. + * user input before it proceeds. For example, where no default {@link PhoneAccountHandle} is + * set, this is the state where the InCallUI is waiting for the user to select a + * {@link PhoneAccountHandle} to call from. */ PRE_DIAL_WAIT, diff --git a/telecomm/java/android/telecomm/ConnectionRequest.java b/telecomm/java/android/telecomm/ConnectionRequest.java index 5888d6ac2ecb4..7a907fbaefee3 100644 --- a/telecomm/java/android/telecomm/ConnectionRequest.java +++ b/telecomm/java/android/telecomm/ConnectionRequest.java @@ -30,7 +30,7 @@ public final class ConnectionRequest implements Parcelable { // TODO: Token to limit recursive invocations // TODO: Consider upgrading "mHandle" to ordered list of handles, indicating a set of phone // numbers that would satisfy the client's needs, in order of preference - private final PhoneAccount mAccount; + private final PhoneAccountHandle mAccount; private final String mCallId; private final Uri mHandle; private final int mHandlePresentation; @@ -47,7 +47,7 @@ public final class ConnectionRequest implements Parcelable { * @param videoState Determines the video state for the connection. */ public ConnectionRequest( - PhoneAccount account, + PhoneAccountHandle account, String callId, Uri handle, int handlePresentation, @@ -73,7 +73,7 @@ public final class ConnectionRequest implements Parcelable { /** * The account which should be used to place the call. */ - public PhoneAccount getAccount() { return mAccount; } + public PhoneAccountHandle getAccount() { return mAccount; } /** * An identifier for this call. diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 76a826e247221..a6b01a7176721 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -26,7 +26,6 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; -import android.telecomm.CallVideoProvider; import com.android.internal.os.SomeArgs; import com.android.internal.telecomm.IConnectionService; @@ -68,7 +67,7 @@ public abstract class ConnectionService extends Service { private final Map mIdByConnection = new HashMap<>(); private final RemoteConnectionManager mRemoteConnectionManager = new RemoteConnectionManager(); - private SimpleResponse> mAccountLookupResponse; + private SimpleResponse> mAccountLookupResponse; private Uri mAccountLookupHandle; private boolean mAreAccountsInitialized = false; private final ConnectionServiceAdapter mAdapter = new ConnectionServiceAdapter(); @@ -597,7 +596,7 @@ public abstract class ConnectionService extends Service { } public final void lookupRemoteAccounts( - Uri handle, SimpleResponse> response) { + Uri handle, SimpleResponse> response) { mAccountLookupResponse = response; mAccountLookupHandle = handle; maybeRespondToAccountLookup(); diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java index 5153cf40020d5..0b8a75d194a9c 100644 --- a/telecomm/java/android/telecomm/InCallAdapter.java +++ b/telecomm/java/android/telecomm/InCallAdapter.java @@ -201,12 +201,12 @@ public final class InCallAdapter { } /** - * Instructs Telecomm to add a PhoneAccount to the specified call + * Instructs Telecomm to add a PhoneAccountHandle to the specified call * * @param callId The identifier of the call - * @param account The PhoneAccount through which to place the call + * @param account The PhoneAccountHandle through which to place the call */ - public void phoneAccountSelected(String callId, PhoneAccount account) { + public void phoneAccountSelected(String callId, PhoneAccountHandle account) { try { mAdapter.phoneAccountSelected(callId, account); } catch (RemoteException e) { diff --git a/telecomm/java/android/telecomm/InCallCall.java b/telecomm/java/android/telecomm/InCallCall.java index db8395cd162aa..e5269f9e14959 100644 --- a/telecomm/java/android/telecomm/InCallCall.java +++ b/telecomm/java/android/telecomm/InCallCall.java @@ -25,7 +25,6 @@ import android.telephony.DisconnectCause; import com.android.internal.telecomm.ICallVideoProvider; import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** @@ -44,7 +43,7 @@ public final class InCallCall implements Parcelable { private final String mCallerDisplayName; private final int mCallerDisplayNamePresentation; private final GatewayInfo mGatewayInfo; - private final PhoneAccount mAccount; + private final PhoneAccountHandle mAccount; private final ICallVideoProvider mCallVideoProvider; private RemoteCallVideoProvider mRemoteCallVideoProvider; private final String mParentCallId; @@ -66,7 +65,7 @@ public final class InCallCall implements Parcelable { String callerDisplayName, int callerDisplayNamePresentation, GatewayInfo gatewayInfo, - PhoneAccount account, + PhoneAccountHandle account, ICallVideoProvider callVideoProvider, String parentCallId, List childCallIds, @@ -160,8 +159,8 @@ public final class InCallCall implements Parcelable { return mGatewayInfo; } - /** PhoneAccount information for the call. */ - public PhoneAccount getAccount() { + /** PhoneAccountHandle information for the call. */ + public PhoneAccountHandle getAccount() { return mAccount; } @@ -234,7 +233,7 @@ public final class InCallCall implements Parcelable { String callerDisplayName = source.readString(); int callerDisplayNamePresentation = source.readInt(); GatewayInfo gatewayInfo = source.readParcelable(classLoader); - PhoneAccount account = source.readParcelable(classLoader); + PhoneAccountHandle account = source.readParcelable(classLoader); ICallVideoProvider callVideoProvider = ICallVideoProvider.Stub.asInterface(source.readStrongBinder()); String parentCallId = source.readString(); diff --git a/telecomm/java/android/telecomm/PhoneAccount.aidl b/telecomm/java/android/telecomm/PhoneAccountHandle.aidl similarity index 95% rename from telecomm/java/android/telecomm/PhoneAccount.aidl rename to telecomm/java/android/telecomm/PhoneAccountHandle.aidl index b98cf4152efec..3be5a2ed23213 100644 --- a/telecomm/java/android/telecomm/PhoneAccount.aidl +++ b/telecomm/java/android/telecomm/PhoneAccountHandle.aidl @@ -19,4 +19,4 @@ package android.telecomm; /** * {@hide} */ -parcelable PhoneAccount; +parcelable PhoneAccountHandle; diff --git a/telecomm/java/android/telecomm/PhoneAccount.java b/telecomm/java/android/telecomm/PhoneAccountHandle.java similarity index 71% rename from telecomm/java/android/telecomm/PhoneAccount.java rename to telecomm/java/android/telecomm/PhoneAccountHandle.java index 4d7638b1525f1..f14766cb88d2d 100644 --- a/telecomm/java/android/telecomm/PhoneAccount.java +++ b/telecomm/java/android/telecomm/PhoneAccountHandle.java @@ -16,9 +16,6 @@ package android.telecomm; -import org.json.JSONException; -import org.json.JSONObject; - import android.content.ComponentName; import android.os.Parcel; import android.os.Parcelable; @@ -28,15 +25,12 @@ import java.util.Objects; /** * Represents a distinct account, line of service or call placement method that * the system can use to place phone calls. - * - * TODO: Per feedback from API Council, rename to "PhoneAccountHandle". See also comment on class - * PhoneAccountMetadata. */ -public class PhoneAccount implements Parcelable { +public class PhoneAccountHandle implements Parcelable { private ComponentName mComponentName; private String mId; - public PhoneAccount( + public PhoneAccountHandle( ComponentName componentName, String id) { mComponentName = componentName; @@ -45,7 +39,7 @@ public class PhoneAccount implements Parcelable { /** * The {@code ComponentName} of the {@link android.telecomm.ConnectionService} which is - * responsible for making phone calls using this {@code PhoneAccount}. + * responsible for making phone calls using this {@code PhoneAccountHandle}. * * @return A suitable {@code ComponentName}. */ @@ -54,10 +48,10 @@ public class PhoneAccount implements Parcelable { } /** - * A unique identifier for this {@code PhoneAccount}, generated by and meaningful to the + * A unique identifier for this {@code PhoneAccountHandle}, generated by and meaningful to the * {@link android.telecomm.ConnectionService} that created it. * - * @return A unique identifier for this {@code PhoneAccount}. + * @return A unique identifier for this {@code PhoneAccountHandle}. */ public String getId() { return mId; @@ -79,9 +73,10 @@ public class PhoneAccount implements Parcelable { @Override public boolean equals(Object other) { return other != null && - other instanceof PhoneAccount && - Objects.equals(((PhoneAccount) other).getComponentName(), getComponentName()) && - Objects.equals(((PhoneAccount) other).getId(), getId()); + other instanceof PhoneAccountHandle && + Objects.equals(((PhoneAccountHandle) other).getComponentName(), + getComponentName()) && + Objects.equals(((PhoneAccountHandle) other).getId(), getId()); } // @@ -99,19 +94,19 @@ public class PhoneAccount implements Parcelable { out.writeString(mId); } - public static final Creator CREATOR = new Creator() { + public static final Creator CREATOR = new Creator() { @Override - public PhoneAccount createFromParcel(Parcel in) { - return new PhoneAccount(in); + public PhoneAccountHandle createFromParcel(Parcel in) { + return new PhoneAccountHandle(in); } @Override - public PhoneAccount[] newArray(int size) { - return new PhoneAccount[size]; + public PhoneAccountHandle[] newArray(int size) { + return new PhoneAccountHandle[size]; } }; - private PhoneAccount(Parcel in) { + private PhoneAccountHandle(Parcel in) { mComponentName = in.readParcelable(getClass().getClassLoader()); mId = in.readString(); } diff --git a/telecomm/java/android/telecomm/PhoneAccountMetadata.java b/telecomm/java/android/telecomm/PhoneAccountMetadata.java index c52a6fc42d6f6..a81260a1504e3 100644 --- a/telecomm/java/android/telecomm/PhoneAccountMetadata.java +++ b/telecomm/java/android/telecomm/PhoneAccountMetadata.java @@ -26,18 +26,19 @@ import android.os.Parcelable; import java.util.MissingResourceException; /** - * Provides user interface description information for a {@code PhoneAccount}. + * Provides user interface description information for a {@code PhoneAccountHandle}. * - * TODO: Per feedback from API Council, rename to "PhoneAccount". See also comment on class - * PhoneAccount. + * TODO: Per feedback from API Council, rename to "PhoneAccountHandle". See also comment on class + * PhoneAccountHandle. */ public class PhoneAccountMetadata implements Parcelable { /** - * Flag indicating that this {@code PhoneAccount} can act as a call manager for traditional - * SIM-based telephony calls. The {@link ConnectionService} associated with this phone-account - * will be allowed to manage SIM-based phone calls including using its own proprietary - * phone-call implementation (like VoIP calling) to make calls instead of the telephony stack. + * Flag indicating that this {@code PhoneAccountHandle} can act as a call manager for + * traditional SIM-based telephony calls. The {@link ConnectionService} associated with this + * phone-account will be allowed to manage SIM-based phone calls including using its own + * proprietary phone-call implementation (like VoIP calling) to make calls instead of the + * telephony stack. * When a user opts to place a call using the SIM-based telephony stack, the connection-service * associated with this phone-account will be attempted first if the user has explicitly * selected it to be used as the default call-manager. @@ -47,24 +48,25 @@ public class PhoneAccountMetadata implements Parcelable { public static final int CAPABILITY_SIM_CALL_MANAGER = 0x1; /** - * Flag indicating that this {@code PhoneAccount} can make phone calls in place of traditional - * SIM-based telephony calls. This account will be treated as a distinct method for placing - * calls alongside the traditional SIM-based telephony stack. This flag is distinct from - * {@link #CAPABILITY_SIM_CALL_MANAGER} in that it is not allowed to manage calls from or use - * the built-in telephony stack to place its calls. + * Flag indicating that this {@code PhoneAccountHandle} can make phone calls in place of + * traditional SIM-based telephony calls. This account will be treated as a distinct method + * for placing calls alongside the traditional SIM-based telephony stack. This flag is + * distinct from {@link #CAPABILITY_SIM_CALL_MANAGER} in that it is not allowed to manage + * calls from or use the built-in telephony stack to place its calls. *

* See {@link #getCapabilities} */ public static final int CAPABILITY_CALL_PROVIDER = 0x2; /** - * Flag indicating that this {@code PhoneAccount} represents built-in PSTN SIM subscription. + * Flag indicating that this {@code PhoneAccountHandle} represents built-in PSTN SIM + * subscription. *

* Only the android framework can set this capability on a phone account. */ public static final int CAPABILITY_SIM_SUBSCRIPTION = 0x4; - private final PhoneAccount mAccount; + private final PhoneAccountHandle mAccount; private final Uri mHandle; private final String mSubscriptionNumber; private final int mCapabilities; @@ -74,7 +76,7 @@ public class PhoneAccountMetadata implements Parcelable { private boolean mVideoCallingSupported; public PhoneAccountMetadata( - PhoneAccount account, + PhoneAccountHandle account, Uri handle, String subscriptionNumber, int capabilities, @@ -93,19 +95,19 @@ public class PhoneAccountMetadata implements Parcelable { } /** - * The {@code PhoneAccount} to which this metadata pertains. + * The {@code PhoneAccountHandle} to which this metadata pertains. * - * @return A {@code PhoneAccount}. + * @return A {@code PhoneAccountHandle}. */ - public PhoneAccount getAccount() { + public PhoneAccountHandle getAccount() { return mAccount; } /** - * The handle (e.g., a phone number) associated with this {@code PhoneAccount}. This represents - * the destination from which outgoing calls using this {@code PhoneAccount} will appear to - * come, if applicable, and the destination to which incoming calls using this - * {@code PhoneAccount} may be addressed. + * The handle (e.g., a phone number) associated with this {@code PhoneAccountHandle}. This + * represents the destination from which outgoing calls using this {@code PhoneAccountHandle} + * will appear to come, if applicable, and the destination to which incoming calls using this + * {@code PhoneAccountHandle} may be addressed. * * @return A handle expressed as a {@code Uri}, for example, a phone number. */ @@ -125,34 +127,34 @@ public class PhoneAccountMetadata implements Parcelable { } /** - * The capabilities of this {@code PhoneAccount}. + * The capabilities of this {@code PhoneAccountHandle}. * - * @return A bit field of flags describing this {@code PhoneAccount}'s capabilities. + * @return A bit field of flags describing this {@code PhoneAccountHandle}'s capabilities. */ public int getCapabilities() { return mCapabilities; } /** - * A short string label describing a {@code PhoneAccount}. + * A short string label describing a {@code PhoneAccountHandle}. * - * @return A label for this {@code PhoneAccount}. + * @return A label for this {@code PhoneAccountHandle}. */ public String getLabel() { return mLabel; } /** - * A short paragraph describing a {@code PhoneAccount}. + * A short paragraph describing a {@code PhoneAccountHandle}. * - * @return A description for this {@code PhoneAccount}. + * @return A description for this {@code PhoneAccountHandle}. */ public String getShortDescription() { return mShortDescription; } /** - * The icon resource ID for the icon of this {@code PhoneAccount}. + * The icon resource ID for the icon of this {@code PhoneAccountHandle}. * * @return A resource ID. */ @@ -161,9 +163,9 @@ public class PhoneAccountMetadata implements Parcelable { } /** - * An icon to represent this {@code PhoneAccount} in a user interface. + * An icon to represent this {@code PhoneAccountHandle} in a user interface. * - * @return An icon for this {@code PhoneAccount}. + * @return An icon for this {@code PhoneAccountHandle}. */ public Drawable getIcon(Context context) { return getIcon(context, mIconResId); @@ -188,9 +190,9 @@ public class PhoneAccountMetadata implements Parcelable { } /** - * Determines whether this {@code PhoneAccount} supports video calling. + * Determines whether this {@code PhoneAccountHandle} supports video calling. * - * @return {@code true} if this {@code PhoneAccount} supports video calling. + * @return {@code true} if this {@code PhoneAccountHandle} supports video calling. */ public boolean isVideoCallingSupported() { return mVideoCallingSupported; diff --git a/telecomm/java/android/telecomm/RemoteConnectionManager.java b/telecomm/java/android/telecomm/RemoteConnectionManager.java index 0a0b245d45774..eac9200efcbba 100644 --- a/telecomm/java/android/telecomm/RemoteConnectionManager.java +++ b/telecomm/java/android/telecomm/RemoteConnectionManager.java @@ -44,8 +44,8 @@ public class RemoteConnectionManager { } } - List getAccounts(Uri handle) { - List accounts = new LinkedList<>(); + List getAccounts(Uri handle) { + List accounts = new LinkedList<>(); Log.d(this, "Getting accounts: " + mRemoteConnectionServices.keySet()); for (RemoteConnectionService remoteService : mRemoteConnectionServices.values()) { // TODO(santoscordon): Eventually this will be async. @@ -58,7 +58,7 @@ public class RemoteConnectionManager { ConnectionRequest request, ConnectionService.CreateConnectionResponse response, boolean isIncoming) { - PhoneAccount account = request.getAccount(); + PhoneAccountHandle account = request.getAccount(); if (account == null) { throw new IllegalArgumentException("account must be specified."); } diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java index 6c024c6de68c4..9ec39ca4bcc15 100644 --- a/telecomm/java/android/telecomm/RemoteConnectionService.java +++ b/telecomm/java/android/telecomm/RemoteConnectionService.java @@ -439,11 +439,11 @@ final class RemoteConnectionService implements DeathRecipient { } } - final List lookupAccounts(Uri handle) { + final List lookupAccounts(Uri handle) { // TODO(santoscordon): Update this so that is actually calls into the RemoteConnection // each time. - List accounts = new LinkedList<>(); - accounts.add(new PhoneAccount( + List accounts = new LinkedList<>(); + accounts.add(new PhoneAccountHandle( mComponentName, null /* id */)); return accounts; diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java index d1526caf810bf..32ef57078c01f 100644 --- a/telecomm/java/android/telecomm/TelecommManager.java +++ b/telecomm/java/android/telecomm/TelecommManager.java @@ -38,7 +38,7 @@ public class TelecommManager { * to find and bind to the appropriate {@link ConnectionService} which * Telecomm will ultimately use to control and get information about the call.

* - *

Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT} contains the component name of the + *

Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT_HANDLE} contains the component name of the * {@link ConnectionService} that Telecomm should bind to. Telecomm will then * ask the connection service for more information about the call prior to showing any UI. * @@ -48,26 +48,28 @@ public class TelecommManager { public static final String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL"; /** - * The service action used to bind to {@link android.telecomm.ConnectionService} implementations. + * The service action used to bind to {@link android.telecomm.ConnectionService} + * implementations. */ public static final String ACTION_CONNECTION_SERVICE = ConnectionService.class.getName(); /** - * The {@link android.content.Intent} action used to configure a {@link android.telecomm.ConnectionService}. + * The {@link android.content.Intent} action used to configure a + * {@link android.telecomm.ConnectionService}. */ public static final String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.intent.action.CONNECTION_SERVICE_CONFIGURE"; /** - * Optional extra for {@link android.content.Intent#ACTION_CALL} containing a boolean that determines whether - * the speakerphone should be automatically turned on for an outgoing call. + * Optional extra for {@link android.content.Intent#ACTION_CALL} containing a boolean that + * determines whether the speakerphone should be automatically turned on for an outgoing call. */ public static final String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE"; /** - * Optional extra for {@link android.content.Intent#ACTION_CALL} containing an integer that determines the - * desired video state for an outgoing call. + * Optional extra for {@link android.content.Intent#ACTION_CALL} containing an integer that + * determines the desired video state for an outgoing call. * Valid options: {@link android.telecomm.VideoCallProfile#VIDEO_STATE_AUDIO_ONLY}, * {@link android.telecomm.VideoCallProfile#VIDEO_STATE_BIDIRECTIONAL}, * {@link android.telecomm.VideoCallProfile#VIDEO_STATE_RX_ENABLED}, @@ -79,39 +81,40 @@ public class TelecommManager { /** * The extra used with an {@link android.content.Intent#ACTION_CALL}, * {@link #ACTION_INCOMING_CALL}, {@link android.content.Intent#ACTION_DIAL} {@code Intent} to - * specify a {@link android.telecomm.PhoneAccount} to use when making the call. + * specify a {@link PhoneAccountHandle} to use when making the call. * *

* Retrieve with * {@link android.content.Intent#getParcelableExtra(String)}. */ - public static final String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT"; + public static final String EXTRA_PHONE_ACCOUNT_HANDLE = + "android.intent.extra.PHONE_ACCOUNT_HANDLE"; /** - * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link android.os.Bundle} which contains - * metadata about the call. This {@link android.os.Bundle} will be returned to the - * {@link android.telecomm.ConnectionService}. + * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link android.os.Bundle} + * which contains metadata about the call. This {@link android.os.Bundle} will be returned to + * the {@link android.telecomm.ConnectionService}. */ public static final String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS"; /** - * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the - * disconnect code. + * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} + * containing the disconnect code. */ public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecomm.extra.CALL_DISCONNECT_CAUSE"; /** - * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the - * disconnect message. + * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} + * containing the disconnect message. */ public static final String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecomm.extra.CALL_DISCONNECT_MESSAGE"; /** - * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the - * component name of the associated connection service. + * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED} + * containing the component name of the associated connection service. */ public static final String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE"; @@ -244,23 +247,23 @@ public class TelecommManager { } /** - * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing - * phone calls. This {@code PhoneAccount} will always be a member of the list which is + * Return the {@link PhoneAccountHandle} which is the user-chosen default for making outgoing + * phone calls. This {@code PhoneAccountHandle} will always be a member of the list which is * returned from calling {@link #getEnabledPhoneAccounts()}. *

* Apps must be prepared for this method to return {@code null}, indicating that there - * currently exists no user-chosen default {@code PhoneAccount}. In this case, apps wishing to - * initiate a phone call must either create their {@link android.content.Intent#ACTION_CALL} or - * {@link android.content.Intent#ACTION_DIAL} {@code Intent} with no - * {@link TelecommManager#EXTRA_PHONE_ACCOUNT}, or present the user with an affordance + * currently exists no user-chosen default {@code PhoneAccountHandle}. In this case, apps + * wishing to initiate a phone call must either create their {@link android.content + * .Intent#ACTION_CALL} or {@link android.content.Intent#ACTION_DIAL} {@code Intent} with no + * {@link TelecommManager#EXTRA_PHONE_ACCOUNT_HANDLE}, or present the user with an affordance * to select one of the elements of {@link #getEnabledPhoneAccounts()}. *

* An {@link android.content.Intent#ACTION_CALL} or {@link android.content.Intent#ACTION_DIAL} - * {@code Intent} with no {@link TelecommManager#EXTRA_PHONE_ACCOUNT} is valid, and subsequent - * steps in the phone call flow are responsible for presenting the user with an affordance, if - * necessary, to choose a {@code PhoneAccount}. + * {@code Intent} with no {@link TelecommManager#EXTRA_PHONE_ACCOUNT_HANDLE} is valid, and + * subsequent steps in the phone call flow are responsible for presenting the user with an + * affordance, if necessary, to choose a {@code PhoneAccountHandle}. */ - public PhoneAccount getDefaultOutgoingPhoneAccount() { + public PhoneAccountHandle getDefaultOutgoingPhoneAccount() { try { if (isServiceConnected()) { return getTelecommService().getDefaultOutgoingPhoneAccount(); @@ -272,12 +275,13 @@ public class TelecommManager { } /** - * Return a list of {@link PhoneAccount}s which can be used to make and receive phone calls. + * Return a list of {@link PhoneAccountHandle}s which can be used to make and receive phone + * calls. * - * @see #EXTRA_PHONE_ACCOUNT - * @return A list of {@code PhoneAccount} objects. + * @see #EXTRA_PHONE_ACCOUNT_HANDLE + * @return A list of {@code PhoneAccountHandle} objects. */ - public List getEnabledPhoneAccounts() { + public List getEnabledPhoneAccounts() { try { if (isServiceConnected()) { return getTelecommService().getEnabledPhoneAccounts(); @@ -289,14 +293,14 @@ public class TelecommManager { } /** - * Return the metadata for a specified {@link PhoneAccount}. Metadata includes resources which - * can be used in a user interface. + * Return the metadata for a specified {@link PhoneAccountHandle}. Metadata includes resources + * which can be used in a user interface. * - * @param account The {@link PhoneAccount}. + * @param account The {@link PhoneAccountHandle}. * * @return The metadata for the account. */ - public PhoneAccountMetadata getPhoneAccountMetadata(PhoneAccount account) { + public PhoneAccountMetadata getPhoneAccountMetadata(PhoneAccountHandle account) { try { if (isServiceConnected()) { return getTelecommService().getPhoneAccountMetadata(account); @@ -308,7 +312,7 @@ public class TelecommManager { } /** - * Register a {@link PhoneAccount} for use by the system. + * Register a {@link PhoneAccountHandle} for use by the system. * * @param metadata The complete {@link PhoneAccountMetadata}. */ @@ -323,11 +327,11 @@ public class TelecommManager { } /** - * Remove a {@link PhoneAccount} registration from the system. + * Remove a {@link PhoneAccountHandle} registration from the system. * * @param account An Account. */ - public void unregisterPhoneAccount(PhoneAccount account) { + public void unregisterPhoneAccount(PhoneAccountHandle account) { try { if (isServiceConnected()) { getTelecommService().unregisterPhoneAccount(account); diff --git a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl index aca8c0ae19465..b014a1008164a 100644 --- a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl @@ -17,7 +17,7 @@ package com.android.internal.telecomm; import android.telecomm.CallAudioState; -import android.telecomm.PhoneAccount; +import android.telecomm.PhoneAccountHandle; /** * Internal remote callback interface for in-call services. @@ -49,7 +49,7 @@ oneway interface IInCallAdapter { void phoneAccountClicked(String callId); - void phoneAccountSelected(String callId, in PhoneAccount account); + void phoneAccountSelected(String callId, in PhoneAccountHandle account); void conference(String callId); diff --git a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl index 59393eda1d955..d407c452aef7a 100644 --- a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl +++ b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl @@ -17,7 +17,7 @@ package com.android.internal.telecomm; import android.content.ComponentName; -import android.telecomm.PhoneAccount; +import android.telecomm.PhoneAccountHandle; import android.telecomm.PhoneAccountMetadata; /** @@ -36,17 +36,17 @@ interface ITelecommService { /** * @see TelecommManager#getDefaultOutgoingPhoneAccount */ - PhoneAccount getDefaultOutgoingPhoneAccount(); + PhoneAccountHandle getDefaultOutgoingPhoneAccount(); /** * @see TelecommManager#getEnabledPhoneAccounts */ - List getEnabledPhoneAccounts(); + List getEnabledPhoneAccounts(); /** * @see TelecommManager#getPhoneAccountMetadata */ - PhoneAccountMetadata getPhoneAccountMetadata(in PhoneAccount account); + PhoneAccountMetadata getPhoneAccountMetadata(in PhoneAccountHandle account); /** * @see TelecommManager#registerPhoneAccount @@ -56,7 +56,7 @@ interface ITelecommService { /** * @see TelecommManager#unregisterPhoneAccount */ - void unregisterPhoneAccount(in PhoneAccount account); + void unregisterPhoneAccount(in PhoneAccountHandle account); /** * @see TelecommManager#clearAccounts