Adds getTypeLabel to ContactsContract Event
Bug: 16550284 Change-Id: Ie95093a2c9bca2b9ba130dea470c8beef94cd659
This commit is contained in:
@@ -24343,6 +24343,7 @@ package android.provider {
|
||||
}
|
||||
|
||||
public static final class ContactsContract.CommonDataKinds.Event implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins {
|
||||
method public static final java.lang.CharSequence getTypeLabel(android.content.res.Resources, int, java.lang.CharSequence);
|
||||
method public static int getTypeResource(java.lang.Integer);
|
||||
field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_event";
|
||||
field public static final java.lang.String START_DATE = "data1";
|
||||
|
||||
@@ -6802,6 +6802,21 @@ public final class ContactsContract {
|
||||
default: return com.android.internal.R.string.eventTypeCustom;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link CharSequence} that best describes the given type,
|
||||
* possibly substituting the given {@link #LABEL} value
|
||||
* for {@link #TYPE_CUSTOM}.
|
||||
*/
|
||||
public static final CharSequence getTypeLabel(Resources res, int type,
|
||||
CharSequence label) {
|
||||
if (type == TYPE_CUSTOM && !TextUtils.isEmpty(label)) {
|
||||
return label;
|
||||
} else {
|
||||
final int labelRes = getTypeResource(type);
|
||||
return res.getText(labelRes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user