diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 68adf0f..69ab231 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -453,14 +453,6 @@
             android:exported="false" />
         <!-- end vCard related -->
 
-        <!-- Pinned header list demo -->
-        <activity android:name=".widget.PinnedHeaderListDemoActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity>
-
         <!-- Intercept Dialer Intents for devices without a phone.
              This activity should have the same intent filters as the DialtactsActivity,
              so that its capturing the same events. Omit android.intent.category.LAUNCHER, because
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 25d3c53..6d3d93c 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -68,7 +68,7 @@
     <string name="contacts_deleted_toast" msgid="286851430992788215">"Persoane de contact șterse"</string>
     <string name="menu_set_ring_tone" msgid="8728345772068064946">"Setaţi ton apel"</string>
     <string name="menu_redirect_calls_to_vm" msgid="4181789196416396656">"Toate apel. către mesag. voc."</string>
-    <string name="readOnlyContactWarning" msgid="7808825687289848259">"Nu puteţi şterge persoane din agendă, din conturi cu permisiuni doar de citire, însă puteţi să le ascundeţi în lista dvs. de persoane din agendă."</string>
+    <string name="readOnlyContactWarning" msgid="7808825687289848259">"Nu puteţi șterge persoane din agendă, din conturi cu permisiuni doar de citire, însă puteţi să le ascundeţi în lista dvs. de persoane din agendă."</string>
     <string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Informaţiile despre această persoană din agendă provin din mai multe conturi. Informaţiile provenite din conturile numai în citire nu vor fi şterse din lista dvs., ci doar ascunse."</string>
     <string name="batch_merge_single_contact_warning" msgid="982585201970392110">"Pentru o îmbinare aveți nevoie de cel puțin două persoane de contact selectate."</string>
     <string name="batch_merge_confirmation" msgid="8551299480317422420">"Persoanele de contact selectate vor fi îmbinate într-o singură persoană de contact."</string>
@@ -226,7 +226,7 @@
     <string name="group_name_hint" msgid="238359485263401293">"Numele grupului"</string>
     <string name="local_profile_title" msgid="2021416826991393684">"Profilul meu local"</string>
     <string name="external_profile_title" msgid="8034998767621359438">"Profilul meu <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g>"</string>
-    <string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Se afişează toată agenda"</string>
+    <string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Se afișează toată agenda"</string>
     <string name="no_account_prompt" msgid="6424883302325061025">"Agenda funcționează mai bine cu un Cont Google.\n\n• O puteți accesa din orice browser web.\n• Creați în siguranță backup pentru persoanele de contact."</string>
     <string name="generic_no_account_prompt" msgid="7218827704367325460">"Păstraţi agenda dvs. în condiţii de siguranţă, chiar dacă pierdeţi telefonul, prin sincronizarea acesteia cu un serviciu online."</string>
     <string name="generic_no_account_prompt_title" msgid="753783911899054860">"Adăugaţi un cont"</string>
diff --git a/src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java b/src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java
deleted file mode 100644
index bc9f07e..0000000
--- a/src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.contacts.widget;
-
-import android.app.ListActivity;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.MatrixCursor;
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-import com.android.contacts.R;
-import com.android.contacts.common.activity.RequestPermissionsActivity;
-import com.android.contacts.common.list.PinnedHeaderListAdapter;
-
-/**
- * An activity that demonstrates various use cases for the {@link com.android.contacts.common.list.PinnedHeaderListView}.
- * If we decide to move PinnedHeaderListView to the framework, this class could go
- * to API demos.
- */
-public class PinnedHeaderListDemoActivity extends ListActivity {
-
-    public final static class TestPinnedHeaderListAdapter extends PinnedHeaderListAdapter {
-
-        public TestPinnedHeaderListAdapter(Context context) {
-            super(context);
-            setPinnedPartitionHeadersEnabled(true);
-        }
-
-        private String[] mHeaders;
-        private int mPinnedHeaderCount;
-
-        public void setHeaders(String[] headers) {
-            this.mHeaders = headers;
-        }
-
-        @Override
-        protected View newHeaderView(Context context, int partition, Cursor cursor,
-                ViewGroup parent) {
-            LayoutInflater inflater = LayoutInflater.from(context);
-            return inflater.inflate(R.layout.list_section, null);
-        }
-
-        @Override
-        protected void bindHeaderView(View view, int parition, Cursor cursor) {
-            TextView headerText = (TextView)view.findViewById(R.id.header_text);
-            headerText.setText(mHeaders[parition]);
-        }
-
-        @Override
-        protected View newView(Context context, int partition, Cursor cursor, int position,
-                ViewGroup parent) {
-            LayoutInflater inflater = LayoutInflater.from(context);
-            return inflater.inflate(android.R.layout.simple_list_item_1, null);
-        }
-
-        @Override
-        protected void bindView(View v, int partition, Cursor cursor, int position) {
-            TextView text = (TextView)v.findViewById(android.R.id.text1);
-            text.setText(cursor.getString(1));
-        }
-
-        @Override
-        public View getPinnedHeaderView(int viewIndex, View convertView, ViewGroup parent) {
-            LayoutInflater inflater = LayoutInflater.from(getContext());
-            View view = inflater.inflate(R.layout.list_section, parent, false);
-            view.setFocusable(false);
-            view.setEnabled(false);
-            bindHeaderView(view, viewIndex, null);
-            return view;
-        }
-
-        @Override
-        public int getPinnedHeaderCount() {
-            return mPinnedHeaderCount;
-        }
-    }
-
-    private Handler mHandler = new Handler();
-
-    @Override
-    protected void onCreate(Bundle bundle) {
-        super.onCreate(bundle);
-        if (RequestPermissionsActivity.startPermissionActivity(this)) {
-            return;
-        }
-
-        setContentView(R.layout.pinned_header_list_demo);
-
-        final TestPinnedHeaderListAdapter adapter = new TestPinnedHeaderListAdapter(this);
-
-        Bundle extras = getIntent().getExtras();
-        int[] counts = extras.getIntArray("counts");
-        String[] names = extras.getStringArray("names");
-        boolean[] showIfEmpty = extras.getBooleanArray("showIfEmpty");
-        boolean[] hasHeader = extras.getBooleanArray("headers");
-        int[] delays = extras.getIntArray("delays");
-
-        if (counts == null || names == null || showIfEmpty == null || delays == null) {
-            throw new IllegalArgumentException("Missing required extras");
-        }
-
-        adapter.setHeaders(names);
-        for (int i = 0; i < counts.length; i++) {
-            adapter.addPartition(showIfEmpty[i], names[i] != null);
-            adapter.mPinnedHeaderCount = names.length;
-        }
-        setListAdapter(adapter);
-        for (int i = 0; i < counts.length; i++) {
-            final int sectionId = i;
-            final Cursor cursor = makeCursor(names[i], counts[i]);
-            mHandler.postDelayed(new Runnable() {
-
-                public void run() {
-                    adapter.changeCursor(sectionId, cursor);
-
-                }
-            }, delays[i]);
-        }
-    }
-
-    private Cursor makeCursor(String name, int count) {
-        MatrixCursor cursor = new MatrixCursor(new String[]{"_id", name});
-        for (int i = 0; i < count; i++) {
-            cursor.addRow(new Object[]{i, name + "[" + i + "]"});
-        }
-        return cursor;
-    }
-}
diff --git a/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java b/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java
deleted file mode 100644
index 46a1f43..0000000
--- a/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.contacts.tests.widget;
-
-import android.app.ListActivity;
-import android.content.ComponentName;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.ArrayAdapter;
-import android.widget.ListView;
-
-import com.android.contacts.tests.R;
-import com.android.contacts.common.list.PinnedHeaderListView;
-
-/**
- * An activity that demonstrates various use cases for the {@link PinnedHeaderListView}.
- */
-public class PinnedHeaderUseCaseActivity extends ListActivity {
-
-    private static final int SINGLE_SHORT_SECTION_NO_HEADERS = 0;
-    private static final int TWO_SHORT_SECTIONS_WITH_HEADERS = 1;
-    private static final int FIVE_SHORT_SECTIONS_WITH_HEADERS = 2;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setListAdapter(new ArrayAdapter<String>(this, R.layout.intent_list_item,
-                getResources().getStringArray(R.array.pinnedHeaderUseCases)));
-    }
-
-    @Override
-    protected void onListItemClick(ListView l, View v, int position, long id) {
-        switch (position) {
-            case SINGLE_SHORT_SECTION_NO_HEADERS:
-                startActivity(
-                        new int[]{5},
-                        new String[]{"Line"},
-                        new boolean[]{false},
-                        new boolean[]{false},
-                        new int[]{0});
-                break;
-            case TWO_SHORT_SECTIONS_WITH_HEADERS:
-                startActivity(
-                        new int[]{2, 30},
-                        new String[]{"First", "Second"},
-                        new boolean[]{true, true},
-                        new boolean[]{false, false},
-                        new int[]{0, 2000});
-                break;
-            case FIVE_SHORT_SECTIONS_WITH_HEADERS:
-                startActivity(
-                        new int[]{1, 5, 5, 5, 5},
-                        new String[]{"First", "Second", "Third", "Fourth", "Fifth"},
-                        new boolean[]{true, true, true, true, true},
-                        new boolean[]{false, false, false, false, false},
-                        new int[]{0, 2000, 3000, 4000, 5000});
-                break;
-        }
-    }
-
-    private void startActivity(int[] counts, String[] names, boolean[] headers,
-            boolean[] showIfEmpty, int[] delays) {
-        Intent intent = new Intent();
-        intent.setComponent(new ComponentName(
-                getResources().getString(R.string.target_package_name),
-                "com.android.contacts.widget.PinnedHeaderListDemoActivity"));
-        intent.putExtra("counts", counts);
-        intent.putExtra("names", names);
-        intent.putExtra("headers", headers);
-        intent.putExtra("showIfEmpty", showIfEmpty);
-        intent.putExtra("delays", delays);
-
-        startActivity(intent);
-    }
-}
