From 32c65a548c98b153997a6599983fdaa353ba8ce9 Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Mon, 27 Oct 2014 14:57:49 -0700 Subject: Update javadocs for Telecom APIs. Bug: 18142177 Change-Id: I78461f3634d281a6927cec9c555825a1bdab7a24 --- telecomm/java/android/telecom/PhoneAccount.java | 55 ++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'telecomm/java/android/telecom/PhoneAccount.java') diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 062baa5..0531c04 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -32,8 +32,14 @@ import java.util.List; import java.util.MissingResourceException; /** - * Describes a distinct account, line of service or call placement method that the system - * can use to place phone calls. + * Represents a distinct method to place or receive a phone call. Apps which can place calls and + * want those calls to be integrated into the dialer and in-call UI should build an instance of + * this class and register it with the system using {@link TelecomManager#registerPhoneAccount}. + *

+ * {@link TelecomManager} uses registered {@link PhoneAccount}s to present the user with + * alternative options when placing a phone call. When building a {@link PhoneAccount}, the app + * should supply a valid {@link PhoneAccountHandle} that references the {@link ConnectionService} + * implementation Telecom will use to interact with the app. */ public class PhoneAccount implements Parcelable { @@ -56,7 +62,7 @@ public class PhoneAccount implements Parcelable { * 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_CONNECTION_MANAGER} in that it is not allowed to manage - * calls from or use the built-in telephony stack to place its calls. + * or place calls from the built-in telephony stack. *

* See {@link #getCapabilities} *

@@ -114,6 +120,9 @@ public class PhoneAccount implements Parcelable { private final CharSequence mShortDescription; private final List mSupportedUriSchemes; + /** + * Helper class for creating a {@link PhoneAccount}. + */ public static class Builder { private PhoneAccountHandle mAccountHandle; private Uri mAddress; @@ -124,6 +133,9 @@ public class PhoneAccount implements Parcelable { private CharSequence mShortDescription; private List mSupportedUriSchemes = new ArrayList(); + /** + * Creates a builder with the specified {@link PhoneAccountHandle} and label. + */ public Builder(PhoneAccountHandle accountHandle, CharSequence label) { this.mAccountHandle = accountHandle; this.mLabel = label; @@ -146,26 +158,56 @@ public class PhoneAccount implements Parcelable { mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes()); } + /** + * Sets the address. See {@link PhoneAccount#getAddress}. + * + * @param value The address of the phone account. + * @return The builder. + */ public Builder setAddress(Uri value) { this.mAddress = value; return this; } + /** + * Sets the subscription address. See {@link PhoneAccount#getSubscriptionAddress}. + * + * @param value The subscription address. + * @return The builder. + */ public Builder setSubscriptionAddress(Uri value) { this.mSubscriptionAddress = value; return this; } + /** + * Sets the capabilities. See {@link PhoneAccount#getCapabilities}. + * + * @param value The capabilities to set. + * @return The builder. + */ public Builder setCapabilities(int value) { this.mCapabilities = value; return this; } + /** + * Sets the icon resource ID. See {@link PhoneAccount#getIconResId}. + * + * @param value The resource ID of the icon. + * @return The builder. + */ public Builder setIconResId(int value) { this.mIconResId = value; return this; } + /** + * Sets the short description. See {@link PhoneAccount#getShortDescription}. + * + * @param value The short description. + * @return The builder. + */ public Builder setShortDescription(CharSequence value) { this.mShortDescription = value; return this; @@ -175,7 +217,7 @@ public class PhoneAccount implements Parcelable { * Specifies an additional URI scheme supported by the {@link PhoneAccount}. * * @param uriScheme The URI scheme. - * @return The Builder. + * @return The builder. * @hide */ public Builder addSupportedUriScheme(String uriScheme) { @@ -189,7 +231,7 @@ public class PhoneAccount implements Parcelable { * Specifies the URI schemes supported by the {@link PhoneAccount}. * * @param uriSchemes The URI schemes. - * @return The Builder. + * @return The builder. */ public Builder setSupportedUriSchemes(List uriSchemes) { mSupportedUriSchemes.clear(); @@ -362,7 +404,8 @@ public class PhoneAccount implements Parcelable { } /** - * The icon resource ID for the icon of this {@code PhoneAccount}. + * The icon resource ID for the icon of this {@code PhoneAccount}. Telecom will search for the + * icon using the package name specified in the {@link PhoneAccountHandle}. * * @return A resource ID. */ -- cgit v1.1