[Issue 2174171] Fixing Join Contact UI title.
The title should read: "Select the contact you want to join with John Doe"
Change-Id: Iec1f41ce97e251635048f91020410cc1981cffbb
diff --git a/res/layout-finger/contacts_list_content_join.xml b/res/layout-finger/contacts_list_content_join.xml
index 95f9c20..b59c1b7 100644
--- a/res/layout-finger/contacts_list_content_join.xml
+++ b/res/layout-finger/contacts_list_content_join.xml
@@ -47,6 +47,8 @@
android:layout_height="wrap_content"
android:text="@string/titleJoinContactDataWith"
android:textAppearance="?android:attr/textAppearanceMedium"
+ android:shadowColor="#BB000000"
+ android:shadowRadius="2.75"
/>
<TextView
android:id="@+id/join_contact_blurb"
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index c1fba67..c549c9d 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -166,15 +166,16 @@
*/
public static final String EXTRA_AGGREGATE_ID =
"com.android.contacts.action.AGGREGATE_ID";
+
/**
* Used with {@link #JOIN_AGGREGATE} to give it the name of the aggregation target.
* <p>
* Type: STRING
*/
+ @Deprecated
public static final String EXTRA_AGGREGATE_NAME =
"com.android.contacts.action.AGGREGATE_NAME";
-
public static final String AUTHORITIES_FILTER_KEY = "authorities";
/** Mask for picker mode */
@@ -592,12 +593,9 @@
if (mMode == MODE_JOIN_CONTACT) {
setContentView(R.layout.contacts_list_content_join);
TextView blurbView = (TextView)findViewById(R.id.join_contact_blurb);
- String contactName = intent.getStringExtra(EXTRA_AGGREGATE_NAME);
- if (contactName == null) {
- contactName = "";
- }
- String blurb = getString(R.string.blurbJoinContactDataWith, contactName);
+ String blurb = getString(R.string.blurbJoinContactDataWith,
+ getContactDisplayName(mQueryAggregateId));
blurbView.setText(blurb);
mJoinModeShowAllContacts = true;
} else {
@@ -657,6 +655,28 @@
// }
}
+ private String getContactDisplayName(long contactId) {
+ String contactName = null;
+ Cursor c = getContentResolver().query(
+ ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId),
+ new String[] {Contacts.DISPLAY_NAME}, null, null, null);
+ try {
+ if (c != null && c.moveToFirst()) {
+ contactName = c.getString(0);
+ }
+ } finally {
+ if (c != null) {
+ c.close();
+ }
+ }
+
+ if (contactName == null) {
+ contactName = "";
+ }
+
+ return contactName;
+ }
+
private int[] mLocation = new int[2];
private Rect mRect = new Rect();