Fields Summary |
---|
public static final int | CAPABILITY_CONNECTION_MANAGERFlag indicating that this {@code PhoneAccount} can act as a connection manager for
other connections. The {@link ConnectionService} associated with this {@code PhoneAccount}
will be allowed to manage 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
{@link ConnectionService} associated with this {@code PhoneAccount} will be attempted first
if the user has explicitly selected it to be used as the default connection manager.
See {@link #getCapabilities} |
public static final int | CAPABILITY_CALL_PROVIDERFlag 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_CONNECTION_MANAGER} in that it is not allowed to manage
or place calls from the built-in telephony stack.
See {@link #getCapabilities}
{@hide} |
public static final int | CAPABILITY_SIM_SUBSCRIPTIONFlag indicating that this {@code PhoneAccount} represents a built-in PSTN SIM
subscription.
Only the Android framework can register a {@code PhoneAccount} having this capability.
See {@link #getCapabilities} |
public static final int | CAPABILITY_VIDEO_CALLINGFlag indicating that this {@code PhoneAccount} is capable of placing video calls.
See {@link #getCapabilities} |
public static final int | CAPABILITY_PLACE_EMERGENCY_CALLSFlag indicating that this {@code PhoneAccount} is capable of placing emergency calls.
By default all PSTN {@code PhoneAccount}s are capable of placing emergency calls.
See {@link #getCapabilities} |
public static final int | CAPABILITY_MULTI_USERFlag indicating that this {@code PhoneAccount} is capable of being used by all users. This
should only be used by system apps (and will be ignored for all other apps trying to use it).
See {@link #getCapabilities} |
public static final String | SCHEME_TELURI scheme for telephone number URIs. |
public static final String | SCHEME_VOICEMAILURI scheme for voicemail URIs. |
public static final String | SCHEME_SIPURI scheme for SIP URIs. |
public static final int | NO_ICON_TINTIndicating no icon tint is set. |
public static final int | NO_HIGHLIGHT_COLORIndicating no hightlight color is set. |
public static final int | NO_RESOURCE_IDIndicating no resource ID is set. |
private final PhoneAccountHandle | mAccountHandle |
private final android.net.Uri | mAddress |
private final android.net.Uri | mSubscriptionAddress |
private final int | mCapabilities |
private final int | mIconResId |
private final String | mIconPackageName |
private final android.graphics.Bitmap | mIconBitmap |
private final int | mIconTint |
private final int | mHighlightColor |
private final CharSequence | mLabel |
private final CharSequence | mShortDescription |
private final List | mSupportedUriSchemes |
public static final Creator | CREATOR |
Methods Summary |
---|
public static android.telecom.PhoneAccount$Builder | builder(PhoneAccountHandle accountHandle, java.lang.CharSequence label)
return new Builder(accountHandle, label);
|
public android.graphics.drawable.Drawable | createIconDrawable(android.content.Context context)Builds and returns an icon {@code Drawable} to represent this {@code PhoneAccount} in a user
interface. Uses the properties {@link #getIconResId()}, {@link #getIconPackageName()}, and
{@link #getIconBitmap()} as necessary.
if (mIconBitmap != null) {
return new BitmapDrawable(context.getResources(), mIconBitmap);
}
if (mIconResId != 0) {
try {
Context packageContext = context.createPackageContext(mIconPackageName, 0);
try {
Drawable iconDrawable = packageContext.getDrawable(mIconResId);
if (mIconTint != NO_ICON_TINT) {
iconDrawable.setTint(mIconTint);
}
return iconDrawable;
} catch (NotFoundException | MissingResourceException e) {
Log.e(this, e, "Cannot find icon %d in package %s",
mIconResId, mIconPackageName);
}
} catch (PackageManager.NameNotFoundException e) {
Log.w(this, "Cannot find package %s", mIconPackageName);
}
}
return new ColorDrawable(Color.TRANSPARENT);
|
public int | describeContents()
return 0;
|
public PhoneAccountHandle | getAccountHandle()The unique identifier of this {@code PhoneAccount}.
return mAccountHandle;
|
public android.net.Uri | getAddress()The address (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.
return mAddress;
|
public int | getCapabilities()The capabilities of this {@code PhoneAccount}.
return mCapabilities;
|
public int | getHighlightColor()A highlight color to use in displaying information about this {@code PhoneAccount}.
return mHighlightColor;
|
public android.graphics.Bitmap | getIconBitmap()A literal icon bitmap to represent this {@code PhoneAccount} in a user interface.
If this property is specified, it is to be considered the preferred icon. Otherwise, the
resource specified by {@link #getIconResId()} should be used.
Clients wishing to display a {@code PhoneAccount} should use
{@link #createIconDrawable(Context)}.
return mIconBitmap;
|
public java.lang.String | getIconPackageName()The package name from which to load the icon of this {@code PhoneAccount}.
If this property is {@code null}, the resource {@link #getIconResId()} will be loaded from
the package in the {@link ComponentName} of the {@link #getAccountHandle()}.
Clients wishing to display a {@code PhoneAccount} should use {@link #createIconDrawable(Context)}.
return mIconPackageName;
|
public int | getIconResId()The icon resource ID for the icon of this {@code PhoneAccount}.
Creators of a {@code PhoneAccount} who possess the icon in static resources should prefer
this method of indicating the icon rather than using {@link #getIconBitmap()}, since it
leads to less resource usage.
Clients wishing to display a {@code PhoneAccount} should use {@link #createIconDrawable(Context)}.
return mIconResId;
|
public int | getIconTint()A tint to apply to the icon of this {@code PhoneAccount}.
return mIconTint;
|
public java.lang.CharSequence | getLabel()A short label describing a {@code PhoneAccount}.
return mLabel;
|
public java.lang.CharSequence | getShortDescription()A short paragraph describing this {@code PhoneAccount}.
return mShortDescription;
|
public android.net.Uri | getSubscriptionAddress()The raw callback number used for this {@code PhoneAccount}, as distinct from
{@link #getAddress()}. For the majority of {@code PhoneAccount}s this should be registered
as {@code null}. It is used by the system for SIM-based {@code PhoneAccount} registration
where {@link android.telephony.TelephonyManager#setLine1NumberForDisplay(String, String)}
has been used to alter the callback number.
return mSubscriptionAddress;
|
public java.util.List | getSupportedUriSchemes()The URI schemes supported by this {@code PhoneAccount}.
return mSupportedUriSchemes;
|
public boolean | hasCapabilities(int capability)Determines if this {@code PhoneAccount} has a capabilities specified by the passed in
bit mask.
return (mCapabilities & capability) == capability;
|
public boolean | supportsUriScheme(java.lang.String uriScheme)Determines if the {@link PhoneAccount} supports calls to/from addresses with a specified URI
scheme.
if (mSupportedUriSchemes == null || uriScheme == null) {
return false;
}
for (String scheme : mSupportedUriSchemes) {
if (scheme != null && scheme.equals(uriScheme)) {
return true;
}
}
return false;
|
public android.telecom.PhoneAccount$Builder | toBuilder()Returns a builder initialized with the current {@link PhoneAccount} instance. return new Builder(this);
|
public java.lang.String | toString()
StringBuilder sb = new StringBuilder().append("[PhoneAccount: ")
.append(mAccountHandle)
.append(" Capabilities: ")
.append(mCapabilities)
.append(" Schemes: ");
for (String scheme : mSupportedUriSchemes) {
sb.append(scheme)
.append(" ");
}
sb.append("]");
return sb.toString();
|
public void | writeToParcel(android.os.Parcel out, int flags)
if (mAccountHandle == null) {
out.writeInt(0);
} else {
out.writeInt(1);
mAccountHandle.writeToParcel(out, flags);
}
if (mAddress == null) {
out.writeInt(0);
} else {
out.writeInt(1);
mAddress.writeToParcel(out, flags);
}
if (mSubscriptionAddress == null) {
out.writeInt(0);
} else {
out.writeInt(1);
mSubscriptionAddress.writeToParcel(out, flags);
}
out.writeInt(mCapabilities);
out.writeInt(mIconResId);
out.writeString(mIconPackageName);
if (mIconBitmap == null) {
out.writeInt(0);
} else {
out.writeInt(1);
mIconBitmap.writeToParcel(out, flags);
}
out.writeInt(mIconTint);
out.writeInt(mHighlightColor);
out.writeCharSequence(mLabel);
out.writeCharSequence(mShortDescription);
out.writeStringList(mSupportedUriSchemes);
|