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);
|