Merge "Add color to PhoneAccount objects (1/3)" into lmp-sprout-dev
This commit is contained in:
@@ -113,6 +113,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
private final Uri mSubscriptionAddress;
|
private final Uri mSubscriptionAddress;
|
||||||
private final int mCapabilities;
|
private final int mCapabilities;
|
||||||
private final int mIconResId;
|
private final int mIconResId;
|
||||||
|
private final int mColor;
|
||||||
private final CharSequence mLabel;
|
private final CharSequence mLabel;
|
||||||
private final CharSequence mShortDescription;
|
private final CharSequence mShortDescription;
|
||||||
private final List<String> mSupportedUriSchemes;
|
private final List<String> mSupportedUriSchemes;
|
||||||
@@ -123,6 +124,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
private Uri mSubscriptionAddress;
|
private Uri mSubscriptionAddress;
|
||||||
private int mCapabilities;
|
private int mCapabilities;
|
||||||
private int mIconResId;
|
private int mIconResId;
|
||||||
|
private int mColor;
|
||||||
private CharSequence mLabel;
|
private CharSequence mLabel;
|
||||||
private CharSequence mShortDescription;
|
private CharSequence mShortDescription;
|
||||||
private List<String> mSupportedUriSchemes = new ArrayList<String>();
|
private List<String> mSupportedUriSchemes = new ArrayList<String>();
|
||||||
@@ -144,6 +146,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
mSubscriptionAddress = phoneAccount.getSubscriptionAddress();
|
mSubscriptionAddress = phoneAccount.getSubscriptionAddress();
|
||||||
mCapabilities = phoneAccount.getCapabilities();
|
mCapabilities = phoneAccount.getCapabilities();
|
||||||
mIconResId = phoneAccount.getIconResId();
|
mIconResId = phoneAccount.getIconResId();
|
||||||
|
mColor = phoneAccount.getColor();
|
||||||
mLabel = phoneAccount.getLabel();
|
mLabel = phoneAccount.getLabel();
|
||||||
mShortDescription = phoneAccount.getShortDescription();
|
mShortDescription = phoneAccount.getShortDescription();
|
||||||
mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes());
|
mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes());
|
||||||
@@ -169,6 +172,11 @@ public class PhoneAccount implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder setColor(int value) {
|
||||||
|
this.mColor = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Builder setShortDescription(CharSequence value) {
|
public Builder setShortDescription(CharSequence value) {
|
||||||
this.mShortDescription = value;
|
this.mShortDescription = value;
|
||||||
return this;
|
return this;
|
||||||
@@ -222,6 +230,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
mSubscriptionAddress,
|
mSubscriptionAddress,
|
||||||
mCapabilities,
|
mCapabilities,
|
||||||
mIconResId,
|
mIconResId,
|
||||||
|
mColor,
|
||||||
mLabel,
|
mLabel,
|
||||||
mShortDescription,
|
mShortDescription,
|
||||||
mSupportedUriSchemes);
|
mSupportedUriSchemes);
|
||||||
@@ -234,6 +243,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
Uri subscriptionAddress,
|
Uri subscriptionAddress,
|
||||||
int capabilities,
|
int capabilities,
|
||||||
int iconResId,
|
int iconResId,
|
||||||
|
int color,
|
||||||
CharSequence label,
|
CharSequence label,
|
||||||
CharSequence shortDescription,
|
CharSequence shortDescription,
|
||||||
List<String> supportedUriSchemes) {
|
List<String> supportedUriSchemes) {
|
||||||
@@ -242,6 +252,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
mSubscriptionAddress = subscriptionAddress;
|
mSubscriptionAddress = subscriptionAddress;
|
||||||
mCapabilities = capabilities;
|
mCapabilities = capabilities;
|
||||||
mIconResId = iconResId;
|
mIconResId = iconResId;
|
||||||
|
mColor = color;
|
||||||
mLabel = label;
|
mLabel = label;
|
||||||
mShortDescription = shortDescription;
|
mShortDescription = shortDescription;
|
||||||
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
|
mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes);
|
||||||
@@ -370,6 +381,15 @@ public class PhoneAccount implements Parcelable {
|
|||||||
return mIconResId;
|
return mIconResId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A highlight color to use in displaying information about this {@code PhoneAccount}.
|
||||||
|
*
|
||||||
|
* @return A hexadecimal color value.
|
||||||
|
*/
|
||||||
|
public int getColor() {
|
||||||
|
return mColor;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An icon to represent this {@code PhoneAccount} in a user interface.
|
* An icon to represent this {@code PhoneAccount} in a user interface.
|
||||||
*
|
*
|
||||||
@@ -413,6 +433,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
out.writeParcelable(mSubscriptionAddress, 0);
|
out.writeParcelable(mSubscriptionAddress, 0);
|
||||||
out.writeInt(mCapabilities);
|
out.writeInt(mCapabilities);
|
||||||
out.writeInt(mIconResId);
|
out.writeInt(mIconResId);
|
||||||
|
out.writeInt(mColor);
|
||||||
out.writeCharSequence(mLabel);
|
out.writeCharSequence(mLabel);
|
||||||
out.writeCharSequence(mShortDescription);
|
out.writeCharSequence(mShortDescription);
|
||||||
out.writeList(mSupportedUriSchemes);
|
out.writeList(mSupportedUriSchemes);
|
||||||
@@ -439,6 +460,7 @@ public class PhoneAccount implements Parcelable {
|
|||||||
mSubscriptionAddress = in.readParcelable(getClass().getClassLoader());
|
mSubscriptionAddress = in.readParcelable(getClass().getClassLoader());
|
||||||
mCapabilities = in.readInt();
|
mCapabilities = in.readInt();
|
||||||
mIconResId = in.readInt();
|
mIconResId = in.readInt();
|
||||||
|
mColor = in.readInt();
|
||||||
mLabel = in.readCharSequence();
|
mLabel = in.readCharSequence();
|
||||||
mShortDescription = in.readCharSequence();
|
mShortDescription = in.readCharSequence();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user