Support for local profile
Bug: 5121834 Support local profile
5086184 Account name is overlapped by number of contacts
5082317 Text is chopped on the top in contact list
1. New headers were added at the top of the contact list to
present an empty local profile.
2. Clicking the empty local profile opens the editor to allow
the user to create a local profile.
3. Profiles are shown at the top of the contacts list with the
"ME" header and the number of contatcs.
4. "Add to contacts" button and the starred button were removed
from the details view when it is a profile.
5. Fixed a problem with a header view that remained when you had
a profile or was in search mode.
6. Fixed problem with contacts count apearing in search mode
Change-Id: I45615616e03a603759888d9e7169a853b3328b14
diff --git a/src/com/android/contacts/ContactLoader.java b/src/com/android/contacts/ContactLoader.java
index 9daa1e0..8416721 100644
--- a/src/com/android/contacts/ContactLoader.java
+++ b/src/com/android/contacts/ContactLoader.java
@@ -128,6 +128,7 @@
private byte[] mPhotoBinaryData;
private boolean mSendToVoicemail;
private String mCustomRingtone;
+ private boolean mIsUserProfile;
/**
* Constructor for case "no contact found". This must only be used for the
@@ -154,6 +155,8 @@
mInvitableAccountTypes = null;
mSendToVoicemail = false;
mCustomRingtone = null;
+ mIsUserProfile = false;
+
}
/**
@@ -162,7 +165,8 @@
private Result(Uri uri, Uri lookupUri, long directoryId, String lookupKey, long id,
long nameRawContactId, int displayNameSource, long photoId, String photoUri,
String displayName, String altDisplayName, String phoneticName, boolean starred,
- Integer presence, boolean sendToVoicemail, String customRingtone) {
+ Integer presence, boolean sendToVoicemail, String customRingtone,
+ boolean isUserProfile) {
mLookupUri = lookupUri;
mUri = uri;
mDirectoryId = directoryId;
@@ -183,6 +187,7 @@
mInvitableAccountTypes = Lists.newArrayList();
mSendToVoicemail = sendToVoicemail;
mCustomRingtone = customRingtone;
+ mIsUserProfile = isUserProfile;
}
private Result(Result from) {
@@ -217,6 +222,7 @@
mPhotoBinaryData = from.mPhotoBinaryData;
mSendToVoicemail = from.mSendToVoicemail;
mCustomRingtone = from.mCustomRingtone;
+ mIsUserProfile = from.mIsUserProfile;
}
/**
@@ -394,6 +400,10 @@
public String getCustomRingtone() {
return mCustomRingtone;
}
+
+ public boolean isUserProfile() {
+ return mIsUserProfile;
+ }
}
/**
@@ -471,6 +481,7 @@
Contacts.PHOTO_URI,
Contacts.SEND_TO_VOICEMAIL,
Contacts.CUSTOM_RINGTONE,
+ Contacts.IS_USER_PROFILE,
};
public final static int NAME_RAW_CONTACT_ID = 0;
@@ -542,6 +553,7 @@
public final static int PHOTO_URI = 61;
public final static int SEND_TO_VOICEMAIL = 62;
public final static int CUSTOM_RINGTONE = 63;
+ public final static int IS_USER_PROFILE = 64;
}
/**
@@ -808,6 +820,7 @@
: cursor.getInt(ContactQuery.CONTACT_PRESENCE);
final boolean sendToVoicemail = cursor.getInt(ContactQuery.SEND_TO_VOICEMAIL) == 1;
final String customRingtone = cursor.getString(ContactQuery.CUSTOM_RINGTONE);
+ final boolean isUserProfile = cursor.getInt(ContactQuery.IS_USER_PROFILE) == 1;
Uri lookupUri;
if (directoryId == Directory.DEFAULT || directoryId == Directory.LOCAL_INVISIBLE) {
@@ -820,7 +833,7 @@
return new Result(contactUri, lookupUri, directoryId, lookupKey, contactId,
nameRawContactId, displayNameSource, photoId, photoUri, displayName,
altDisplayName, phoneticName, starred, presence, sendToVoicemail,
- customRingtone);
+ customRingtone, isUserProfile);
}
/**