FileDocCategorySizeDatePackage
PhoneAccountHandle.javaAPI DocAndroid 5.1 API5339Thu Mar 12 22:22:42 GMT 2015android.telecom

PhoneAccountHandle

public class PhoneAccountHandle extends Object implements android.os.Parcelable
The unique identifier for a {@link PhoneAccount}. A {@code PhoneAccountHandle} is made of two parts:
  • The component name of the associated {@link ConnectionService}.
  • A string identifier that is unique across {@code PhoneAccountHandle}s with the same component name.
See {@link PhoneAccount}, {@link TelecomManager#registerPhoneAccount TelecomManager.registerPhoneAccount}.
hide

Fields Summary
private final android.content.ComponentName
mComponentName
private final String
mId
private final android.os.UserHandle
mUserHandle
public static final Creator
CREATOR
Constructors Summary
public PhoneAccountHandle(android.content.ComponentName componentName, String id)

        this(componentName, id, Process.myUserHandle());
    
private PhoneAccountHandle(android.os.Parcel in)


       
        this(ComponentName.CREATOR.createFromParcel(in),
                in.readString(),
                UserHandle.CREATOR.createFromParcel(in));
    
public PhoneAccountHandle(android.content.ComponentName componentName, String id, android.os.UserHandle userHandle)

hide

        mComponentName = componentName;
        mId = id;
        mUserHandle = userHandle;
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object other)

        return other != null &&
                other instanceof PhoneAccountHandle &&
                Objects.equals(((PhoneAccountHandle) other).getComponentName(),
                        getComponentName()) &&
                Objects.equals(((PhoneAccountHandle) other).getId(), getId()) &&
                Objects.equals(((PhoneAccountHandle) other).getUserHandle(), getUserHandle());
    
public android.content.ComponentNamegetComponentName()
The {@code ComponentName} of the {@link android.telecom.ConnectionService} which is responsible for making phone calls using this {@code PhoneAccountHandle}.

return
A suitable {@code ComponentName}.

        return mComponentName;
    
public java.lang.StringgetId()
A string that uniquely distinguishes this particular {@code PhoneAccountHandle} from all the others supported by the {@link ConnectionService} that created it.

A {@code ConnectionService} must select identifiers that are stable for the lifetime of their users' relationship with their service, across many Android devices. For example, a good set of identifiers might be the email addresses with which with users registered for their accounts with a particular service. Depending on how a service chooses to operate, a bad set of identifiers might be an increasing series of integers ({@code 0}, {@code 1}, {@code 2}, ...) that are generated locally on each phone and could collide with values generated on other phones or after a data wipe of a given phone.

return
A service-specific unique identifier for this {@code PhoneAccountHandle}.

        return mId;
    
public android.os.UserHandlegetUserHandle()

return
the {@link UserHandle} to use when connecting to this PhoneAccount.
hide

        return mUserHandle;
    
public inthashCode()

        return Objects.hash(mComponentName, mId, mUserHandle);
    
public java.lang.StringtoString()

        // Note: Log.pii called for mId as it can contain personally identifying phone account
        // information such as SIP account IDs.
        return new StringBuilder().append(mComponentName)
                    .append(", ")
                    .append(Log.pii(mId))
                    .append(", ")
                    .append(mUserHandle)
                    .toString();
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        mComponentName.writeToParcel(out, flags);
        out.writeString(mId);
        mUserHandle.writeToParcel(out, flags);