diff --git a/src/com/android/contacts/ContactEntryAdapter.java b/src/com/android/contacts/ContactEntryAdapter.java
index 981b4bc..c5b7ccf 100644
--- a/src/com/android/contacts/ContactEntryAdapter.java
+++ b/src/com/android/contacts/ContactEntryAdapter.java
@@ -40,6 +40,7 @@
         People.STARRED, // 5
         People.CUSTOM_RINGTONE, // 6
         People.SEND_TO_VOICEMAIL, // 7
+        People.PHONETIC_NAME, // 8
     };
     public static final int CONTACT_ID_COLUMN = 0;
     public static final int CONTACT_NAME_COLUMN = 1;
@@ -49,6 +50,7 @@
     public static final int CONTACT_STARRED_COLUMN = 5;
     public static final int CONTACT_CUSTOM_RINGTONE_COLUMN = 6;
     public static final int CONTACT_SEND_TO_VOICEMAIL_COLUMN = 7;
+    public static final int CONTACT_PHONETIC_NAME_COLUMN = 8;
 
     public static final String[] PHONES_PROJECTION = new String[] {
         People.Phones._ID, // 0
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 5e1fd63..5a83090 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -633,7 +633,7 @@
         Intent syncIntent = new Intent(Intent.ACTION_VIEW);
         syncIntent.setClass(this, ContactsGroupSyncSelector.class);
         menu.add(0, 0, 0, R.string.syncGroupPreference)
-                .setIcon(R.drawable.ic_menu_refresh)
+                .setIcon(android.R.drawable.ic_menu_refresh)
                 .setIntent(syncIntent);
         
         // SIM import
@@ -815,7 +815,6 @@
                     .setMessage(R.string.deleteConfirmation)
                     .setNegativeButton(android.R.string.cancel, null)
                     .setPositiveButton(android.R.string.ok, new DeleteClickListener(uri))
-                    .setCancelable(false)
                     .show();
                 return true;
             }
diff --git a/src/com/android/contacts/DialtactsActivity.java b/src/com/android/contacts/DialtactsActivity.java
index 00df1c1..1933c4c 100644
--- a/src/com/android/contacts/DialtactsActivity.java
+++ b/src/com/android/contacts/DialtactsActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.contacts;
 
+import android.app.Activity;
 import android.app.TabActivity;
 import android.content.Intent;
 import android.graphics.drawable.Drawable;
@@ -37,7 +38,7 @@
  * and another tab with recent calls in it. This is the container and the tabs
  * are embedded using intents.
  */
-public class DialtactsActivity extends TabActivity {
+public class DialtactsActivity extends TabActivity implements TabHost.OnTabChangeListener {
     private static final String TAG = "Dailtacts";
 
     public static final String EXTRA_IGNORE_STATE = "ignore-state";
@@ -66,6 +67,7 @@
         setContentView(R.layout.dialer_activity);
 
         mTabHost = getTabHost();
+        mTabHost.setOnTabChangedListener(this);
 
         // Setup the tabs
         setupDialerTab();
@@ -286,4 +288,16 @@
         
         return super.onKeyDown(keyCode, event);
     }
+
+    /** {@inheritDoc} */
+    public void onTabChanged(String tabId) {
+        // Because we're using Activities as our tab children, we trigger
+        // onWindowFocusChanged() to let them know when they're active.  This may
+        // seem to duplicate the purpose of onResume(), but it's needed because
+        // onResume() can't reliably check if a keyguard is active.
+        Activity activity = getLocalActivityManager().getActivity(tabId);
+        if (activity != null) {
+            activity.onWindowFocusChanged(true);
+        }
+    }
 }
diff --git a/src/com/android/contacts/EditContactActivity.java b/src/com/android/contacts/EditContactActivity.java
index 3a7610d..2994ce4 100644
--- a/src/com/android/contacts/EditContactActivity.java
+++ b/src/com/android/contacts/EditContactActivity.java
@@ -23,6 +23,7 @@
 import static com.android.contacts.ContactEntryAdapter.CONTACT_NOTES_COLUMN;
 import static com.android.contacts.ContactEntryAdapter.CONTACT_PROJECTION;
 import static com.android.contacts.ContactEntryAdapter.CONTACT_SEND_TO_VOICEMAIL_COLUMN;
+import static com.android.contacts.ContactEntryAdapter.CONTACT_PHONETIC_NAME_COLUMN;
 import static com.android.contacts.ContactEntryAdapter.METHODS_AUX_DATA_COLUMN;
 import static com.android.contacts.ContactEntryAdapter.METHODS_DATA_COLUMN;
 import static com.android.contacts.ContactEntryAdapter.METHODS_ID_COLUMN;
@@ -101,6 +102,7 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 /**
@@ -172,6 +174,8 @@
     private LayoutInflater mInflater;
     private MenuItem mPhotoMenuItem;
     private boolean mPhotoPresent = false;
+    private EditText mPhoneticNameView;
+    private LinearLayout mPhoneticNameLayout;
 
     // These are accessed by inner classes. They're package scoped to make access more efficient.
     /* package */ ContentResolver mResolver;
@@ -308,8 +312,20 @@
         mPhotoButton = findViewById(R.id.photoButton);
         mPhotoButton.setOnClickListener(this);
         mSendToVoicemailCheckBox = (CheckBox) findViewById(R.id.send_to_voicemail);
+        mPhoneticNameView = (EditText) findViewById(R.id.phonetic_name);
+        mPhoneticNameLayout = (LinearLayout) findViewById(R.id.phonetic_name_layout);
 
-        // Setup the bottom buttons 
+        // Setup phonetic name field.  mPhoneticNameLayout is GONE by default.
+        // TODO: Don't do this here in Java; instead do it purely using
+        // resources, by having mPhoneticNameLayout come from an XML
+        // <include> file that contains the real UI in layout-ja, but is
+        // empty in layout-finger...
+        String language = Locale.getDefault().getLanguage();
+        if (language != null && language.equals("ja")) {
+            mPhoneticNameLayout.setVisibility(View.VISIBLE);
+        }
+
+        // Setup the bottom buttons
         View view = findViewById(R.id.addMore);
         view.setOnClickListener(this);
         view = findViewById(R.id.saveButton);
@@ -378,6 +394,7 @@
         outState.putParcelable("photo", mPhoto);
         outState.putBoolean("photoChanged", mPhotoChanged);
         outState.putBoolean("sendToVoicemail", mSendToVoicemailCheckBox.isChecked());
+        outState.putString("phoneticName", mPhoneticNameView.getText().toString());
     }
 
     @Override
@@ -403,7 +420,8 @@
         }
         mPhotoChanged = inState.getBoolean("photoChanged");
         mSendToVoicemailCheckBox.setChecked(inState.getBoolean("sendToVoicemail"));
-        
+        mPhoneticNameView.setText(inState.getString("phoneticName"));
+
         // Now that everything is restored, build the view
         buildViews();
     }
@@ -547,11 +565,17 @@
         intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_RINGTONE);
         // Don't show 'Silent'
         intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
+        
+        Uri ringtoneUri;
         if (entry.data != null) {
-            Uri ringtoneUri = Uri.parse(entry.data);
-            // Put checkmark next to the current ringtone for this contact
-            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, ringtoneUri);
+            ringtoneUri = Uri.parse(entry.data);
+        } else {
+            // Otherwise pick default ringtone Uri so that something is selected.
+            ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
         }
+        
+        // Put checkmark next to the current ringtone for this contact
+        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, ringtoneUri);
         // Launch!
         startActivityForResult(intent, RINGTONE_PICKED);
     }
@@ -919,6 +943,7 @@
             numValues++;
         }
         values.put(People.NAME, name);
+        values.put(People.PHONETIC_NAME, mPhoneticNameView.getText().toString());
         values.put(People.SEND_TO_VOICEMAIL, mSendToVoicemailCheckBox.isChecked() ? 1 : 0);
         mResolver.update(mUri, values, null, null);
 
@@ -992,6 +1017,7 @@
             numValues++;
         }
         values.put(People.NAME, name);
+        values.put(People.PHONETIC_NAME, mPhoneticNameView.getText().toString());
         values.put(People.SEND_TO_VOICEMAIL, mSendToVoicemailCheckBox.isChecked() ? 1 : 0);
 
         // Add the contact to the My Contacts group
@@ -1129,6 +1155,10 @@
         entry = EditEntry.newRingtoneEntry(this,
                 personCursor.getString(CONTACT_CUSTOM_RINGTONE_COLUMN), mUri);
         mOtherEntries.add(entry);
+
+        // Phonetic name
+        mPhoneticNameView.setText(personCursor.getString(CONTACT_PHONETIC_NAME_COLUMN));
+
         personCursor.close();
 
         // Build up the phone entries
@@ -1279,7 +1309,6 @@
         // Ringtone
         entry = EditEntry.newRingtoneEntry(this, null, mUri);
         mOtherEntries.add(entry);
-        
     }
 
     private void addFromExtras(Bundle extras, Uri phonesUri, Uri methodsUri) {
@@ -1290,14 +1319,20 @@
         if (name != null && TextUtils.isGraphic(name)) {
             mNameView.setText(name);
         }
-        
+
+        // Read the phonetic name from the bundle
+        CharSequence phoneticName = extras.getCharSequence(Insert.PHONETIC_NAME);
+        if (!TextUtils.isEmpty(phoneticName)) {
+            mPhoneticNameView.setText(phoneticName);
+        }
+
         // Postal entries from extras
         CharSequence postal = extras.getCharSequence(Insert.POSTAL);
         int postalType = extras.getInt(Insert.POSTAL_TYPE, INVALID_TYPE);
         if (!TextUtils.isEmpty(postal) && postalType == INVALID_TYPE) {
             postalType = DEFAULT_POSTAL_TYPE;
         }
-        
+
         if (postalType != INVALID_TYPE) {
             entry = EditEntry.newPostalEntry(this, null, postalType, postal.toString(),
                     methodsUri, 0);
@@ -1344,14 +1379,24 @@
     private void addEmailFromExtras(Bundle extras, Uri methodsUri, String emailField,
             String typeField, String primaryField) {
         CharSequence email = extras.getCharSequence(emailField);
-        int emailType = extras.getInt(typeField, INVALID_TYPE);
+        
+        // Correctly handle String in typeField as TYPE_CUSTOM 
+        int emailType = INVALID_TYPE;
+        String customLabel = null;
+        if(extras.get(typeField) instanceof String) {
+            emailType = ContactMethods.TYPE_CUSTOM;
+            customLabel = extras.getString(typeField);
+        } else {
+            emailType = extras.getInt(typeField, INVALID_TYPE);
+        }
+
         if (!TextUtils.isEmpty(email) && emailType == INVALID_TYPE) {
             emailType = DEFAULT_EMAIL_TYPE;
             mPrimaryEmailAdded = true;
         }
 
         if (emailType != INVALID_TYPE) {
-            EditEntry entry = EditEntry.newEmailEntry(this, null, emailType, email.toString(),
+            EditEntry entry = EditEntry.newEmailEntry(this, customLabel, emailType, email.toString(),
                     methodsUri, 0);
             entry.isPrimary = (primaryField == null) ? false : extras.getBoolean(primaryField);
             mEmailEntries.add(entry);
@@ -1366,13 +1411,23 @@
     private void addPhoneFromExtras(Bundle extras, Uri phonesUri, String phoneField,
             String typeField, String primaryField) {
         CharSequence phoneNumber = extras.getCharSequence(phoneField);
-        int phoneType = extras.getInt(typeField, INVALID_TYPE);
+        
+        // Correctly handle String in typeField as TYPE_CUSTOM 
+        int phoneType = INVALID_TYPE;
+        String customLabel = null;
+        if(extras.get(typeField) instanceof String) {
+            phoneType = Phones.TYPE_CUSTOM;
+            customLabel = extras.getString(typeField);
+        } else {
+            phoneType = extras.getInt(typeField, INVALID_TYPE);
+        }
+        
         if (!TextUtils.isEmpty(phoneNumber) && phoneType == INVALID_TYPE) {
             phoneType = DEFAULT_PHONE_TYPE;
         }
 
         if (phoneType != INVALID_TYPE) {
-            EditEntry entry = EditEntry.newPhoneEntry(this, null, phoneType,
+            EditEntry entry = EditEntry.newPhoneEntry(this, customLabel, phoneType,
                     phoneNumber.toString(), phonesUri, 0);
             entry.isPrimary = (primaryField == null) ? false : extras.getBoolean(primaryField);
             mPhoneEntries.add(entry);
diff --git a/src/com/android/contacts/RecentCallsListActivity.java b/src/com/android/contacts/RecentCallsListActivity.java
index 550a385..85099fa 100644
--- a/src/com/android/contacts/RecentCallsListActivity.java
+++ b/src/com/android/contacts/RecentCallsListActivity.java
@@ -271,7 +271,7 @@
                 Cursor phonesCursor =
                     RecentCallsListActivity.this.getContentResolver().query(
                             Uri.withAppendedPath(Phones.CONTENT_FILTER_URL,
-                                    ciq.number),
+                                    Uri.encode(ciq.number)),
                     PHONES_PROJECTION, null, null, null);
                 if (phonesCursor != null) {
                     if (phonesCursor.moveToFirst()) {
@@ -434,7 +434,10 @@
             }
 
             // Set the time and date
-            views.dateView.setText(DateUtils.getRelativeTimeSpanString(date));
+            int flags = DateUtils.FORMAT_ABBREV_RELATIVE | DateUtils.FORMAT_SHOW_DATE
+                    | DateUtils.FORMAT_ABBREV_MONTH;
+            views.dateView.setText(DateUtils.getRelativeDateTimeString(context, date,
+                    DateUtils.MINUTE_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, flags));
 
             // Set the icon
             switch (type) {
@@ -503,7 +506,7 @@
                 .getVoiceMailNumber();
         mQueryHandler = new QueryHandler(this);
     }
-
+    
     @Override
     protected void onResume() {
         // The adapter caches looked up numbers, clear it so they will get
@@ -516,16 +519,7 @@
         resetNewCallsFlag();
 
         super.onResume();
-        try {
-            ITelephony iTelephony = ITelephony.Stub.asInterface(ServiceManager.getService("phone"));
-            if (iTelephony != null) {
-                iTelephony.cancelMissedCallsNotification();
-            } else {
-                Log.w(TAG, "Telephony service is null, can't call cancelMissedCallsNotification");
-            }
-        } catch (RemoteException e) {
-            Log.e(TAG, "Failed to clear missed calls notification due to remote excetpion");
-        }
+
         mAdapter.mPreDrawListener = null; // Let it restart the thread after next draw
     }
 
@@ -547,6 +541,28 @@
         }
     }
 
+    @Override
+    public void onWindowFocusChanged(boolean hasFocus) {
+        super.onWindowFocusChanged(hasFocus);
+        
+        // Clear notifications only when window gains focus.  This activity won't
+        // immediately receive focus if the keyguard screen is above it.
+        if (hasFocus) {
+            try {
+                ITelephony iTelephony =
+                        ITelephony.Stub.asInterface(ServiceManager.getService("phone"));
+                if (iTelephony != null) {
+                    iTelephony.cancelMissedCallsNotification();
+                } else {
+                    Log.w(TAG, "Telephony service is null, can't call " +
+                            "cancelMissedCallsNotification");
+                }
+            } catch (RemoteException e) {
+                Log.e(TAG, "Failed to clear missed calls notification due to remote exception");
+            }
+        }
+    }
+
     private void resetNewCallsFlag() {
         // Mark all "new" missed calls as not new anymore
         StringBuilder where = new StringBuilder("type=");
diff --git a/src/com/android/contacts/TwelveKeyDialer.java b/src/com/android/contacts/TwelveKeyDialer.java
index 41adc5a..1a06026 100644
--- a/src/com/android/contacts/TwelveKeyDialer.java
+++ b/src/com/android/contacts/TwelveKeyDialer.java
@@ -196,18 +196,14 @@
         // Set up the "dialpad chooser" UI; see showDialpadChooser().
         mDialpadChooser = (ListView) findViewById(R.id.dialpadChooser);
         mDialpadChooser.setOnItemClickListener(this);
-        // Add a dummy "footer" view so that the divider under the bottom
-        // item will be visible.
-        // (We set android:footerDividersEnabled="true" on this ListView in XML.)
-        mDialpadChooser.addFooterView(new View(this), null, false);
 
         if (!resolveIntent() && icicle != null) {
             super.onRestoreInstanceState(icicle);
         }
-        
-        // if the mToneGenerator creation fails, just continue without it.  It is 
+
+        // If the mToneGenerator creation fails, just continue without it.  It is
         // a local audio signal, and is not as important as the dtmf tone itself.
-        synchronized(mToneGeneratorLock) {
+        synchronized (mToneGeneratorLock) {
             if (mToneGenerator == null) {
                 try {
                     mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING, 
