Show favorites in main contact list (1/2)
Change-Id: I1e24c15f33588e6ea33a5d9961aa74236693e981
diff --git a/src/com/android/contacts/activities/ContactSelectionActivity.java b/src/com/android/contacts/activities/ContactSelectionActivity.java
index ba1e0dd..c2951d8 100644
--- a/src/com/android/contacts/activities/ContactSelectionActivity.java
+++ b/src/com/android/contacts/activities/ContactSelectionActivity.java
@@ -291,6 +291,7 @@
case ContactsRequest.ACTION_PICK_CONTACT: {
ContactPickerFragment fragment = new ContactPickerFragment();
fragment.setIncludeProfile(mRequest.shouldIncludeProfile());
+ fragment.setIncludeFavorites(mRequest.shouldIncludeFavorites());
mListFragment = fragment;
break;
}
diff --git a/src/com/android/contacts/list/ContactBrowseListFragment.java b/src/com/android/contacts/list/ContactBrowseListFragment.java
index 923208c..afd2543 100644
--- a/src/com/android/contacts/list/ContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/ContactBrowseListFragment.java
@@ -403,6 +403,9 @@
// Display the user's profile if not in search mode
adapter.setIncludeProfile(!searchMode);
+
+ // Display favorites if not in search mode
+ adapter.setIncludeFavorites(!searchMode);
}
@Override
diff --git a/src/com/android/contacts/list/ContactsRequest.java b/src/com/android/contacts/list/ContactsRequest.java
index 636fe58..f867549 100644
--- a/src/com/android/contacts/list/ContactsRequest.java
+++ b/src/com/android/contacts/list/ContactsRequest.java
@@ -86,6 +86,7 @@
private boolean mSearchMode;
private String mQueryString;
private boolean mIncludeProfile;
+ private boolean mIncludeFavorites;
private boolean mLegacyCompatibilityMode;
private boolean mDirectorySearchEnabled = true;
private Uri mContactUri;
@@ -98,6 +99,7 @@
+ " mSearchMode=" + mSearchMode
+ " mQueryString=" + mQueryString
+ " mIncludeProfile=" + mIncludeProfile
+ + " mIncludeFavorites=" + mIncludeFavorites
+ " mLegacyCompatibilityMode=" + mLegacyCompatibilityMode
+ " mDirectorySearchEnabled=" + mDirectorySearchEnabled
+ " mContactUri=" + mContactUri
@@ -152,6 +154,14 @@
mIncludeProfile = includeProfile;
}
+ public boolean shouldIncludeFavorites() {
+ return mIncludeFavorites;
+ }
+
+ public void setIncludeFavorites(boolean includeFavorites) {
+ mIncludeFavorites = includeFavorites;
+ }
+
public boolean isLegacyCompatibilityMode() {
return mLegacyCompatibilityMode;
}