Split Contacts: cosmetic - cleaning up variable naming
Change-Id: I9e52a1c38b622e0fd426b4b9c98f7495a2ff28a9
diff --git a/src/com/android/contacts/SplitAggregateView.java b/src/com/android/contacts/SplitAggregateView.java
index a7f0774..5ab8ed1 100644
--- a/src/com/android/contacts/SplitAggregateView.java
+++ b/src/com/android/contacts/SplitAggregateView.java
@@ -91,7 +91,7 @@
mSources = Sources.getInstance(context);
- final List<ContactInfo> list = loadData();
+ final List<RawContactInfo> list = loadData();
setAdapter(new SplitAggregateAdapter(context, list));
setOnItemClickListener(new OnItemClickListener() {
@@ -112,7 +112,7 @@
/**
* Contact information loaded from the content provider.
*/
- private static class ContactInfo implements Comparable<ContactInfo> {
+ private static class RawContactInfo implements Comparable<RawContactInfo> {
final long rawContactId;
String accountType;
String name;
@@ -120,7 +120,7 @@
String email;
String nickname;
- public ContactInfo(long rawContactId) {
+ public RawContactInfo(long rawContactId) {
this.rawContactId = rawContactId;
}
@@ -140,7 +140,7 @@
return "";
}
- public int compareTo(ContactInfo another) {
+ public int compareTo(RawContactInfo another) {
String thisAccount = accountType != null ? accountType : "";
String thatAccount = another.accountType != null ? another.accountType : "";
return thisAccount.compareTo(thatAccount);
@@ -148,21 +148,21 @@
}
/**
- * Loads data from the content provider, organizes it into {@link ContactInfo} objects
- * and returns a sorted list of {@link ContactInfo}'s.
+ * Loads data from the content provider, organizes it into {@link RawContactInfo} objects
+ * and returns a sorted list of {@link RawContactInfo}'s.
*/
- private List<ContactInfo> loadData() {
- HashMap<Long, ContactInfo> contactInfos = new HashMap<Long, ContactInfo>();
+ private List<RawContactInfo> loadData() {
+ HashMap<Long, RawContactInfo> rawContactInfos = new HashMap<Long, RawContactInfo>();
Uri dataUri = Uri.withAppendedPath(mAggregateUri, Data.CONTENT_DIRECTORY);
Cursor cursor = getContext().getContentResolver().query(dataUri,
AGGREGATE_DATA_PROJECTION, null, null, null);
try {
while (cursor.moveToNext()) {
- long contactId = cursor.getLong(COL_RAW_CONTACT_ID);
- ContactInfo info = contactInfos.get(contactId);
+ long rawContactId = cursor.getLong(COL_RAW_CONTACT_ID);
+ RawContactInfo info = rawContactInfos.get(rawContactId);
if (info == null) {
- info = new ContactInfo(contactId);
- contactInfos.put(contactId, info);
+ info = new RawContactInfo(rawContactId);
+ rawContactInfos.put(rawContactId, info);
info.accountType = cursor.getString(COL_ACCOUNT_TYPE);
}
@@ -181,12 +181,12 @@
cursor.close();
}
- List<ContactInfo> list = new ArrayList<ContactInfo>(contactInfos.values());
+ List<RawContactInfo> list = new ArrayList<RawContactInfo>(rawContactInfos.values());
Collections.sort(list);
return list;
}
- private void loadStructuredName(Cursor cursor, ContactInfo info) {
+ private void loadStructuredName(Cursor cursor, RawContactInfo info) {
info.name = cursor.getString(COL_DISPLAY_NAME);
if (info.name != null) {
return;
@@ -210,19 +210,19 @@
}
}
- private void loadNickname(Cursor cursor, ContactInfo info) {
+ private void loadNickname(Cursor cursor, RawContactInfo info) {
if (info.nickname == null || cursor.getInt(COL_IS_PRIMARY) != 0) {
info.nickname = cursor.getString(COL_DATA2);
}
}
- private void loadEmail(Cursor cursor, ContactInfo info) {
+ private void loadEmail(Cursor cursor, RawContactInfo info) {
if (info.email == null || cursor.getInt(COL_IS_PRIMARY) != 0) {
info.email = cursor.getString(COL_DATA2);
}
}
- private void loadPhoneNumber(Cursor cursor, ContactInfo info) {
+ private void loadPhoneNumber(Cursor cursor, RawContactInfo info) {
if (info.phone == null || cursor.getInt(COL_IS_PRIMARY) != 0) {
info.phone = cursor.getString(COL_DATA2);
}
@@ -235,13 +235,13 @@
}
/**
- * List adapter for the list of {@link ContactInfo} objects.
+ * List adapter for the list of {@link RawContactInfo} objects.
*/
- private class SplitAggregateAdapter extends ArrayAdapter<ContactInfo> {
+ private class SplitAggregateAdapter extends ArrayAdapter<RawContactInfo> {
private LayoutInflater mInflater;
- public SplitAggregateAdapter(Context context, List<ContactInfo> sources) {
+ public SplitAggregateAdapter(Context context, List<RawContactInfo> sources) {
super(context, 0, sources);
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@@ -261,7 +261,7 @@
convertView.setTag(cache);
}
- final ContactInfo info = getItem(position);
+ final RawContactInfo info = getItem(position);
cache.name.setText(info.name);
cache.additionalData.setText(info.getAdditionalData());