Merge "Add setting for default account (2/2)."
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);
- }
-}