Merge "Hiding the type OTHER"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 02c378a..b39d3f4 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -307,16 +307,6 @@
</intent-filter>
</activity>
- <!-- An activity for selecting multiple phone numbers -->
- <activity android:name="MultiplePhonePickerActivity"
- android:enabled="false">
- <intent-filter>
- <action android:name="com.android.contacts.action.GET_MULTIPLE_PHONES" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:mimeType="vnd.android.cursor.dir/phone_v2" android:host="com.android.contacts" />
- </intent-filter>
- </activity>
-
<!-- Used to set options -->
<activity
android:name=".preference.ContactsPreferenceActivity"
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_1.9.png b/res/drawable-hdpi/appointment_indicator_leftside_1.9.png
deleted file mode 100644
index b72652b..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_1.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_10.9.png b/res/drawable-hdpi/appointment_indicator_leftside_10.9.png
deleted file mode 100644
index ff09049..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_10.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_11.9.png b/res/drawable-hdpi/appointment_indicator_leftside_11.9.png
deleted file mode 100644
index 6a2e4f2..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_11.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_12.9.png b/res/drawable-hdpi/appointment_indicator_leftside_12.9.png
deleted file mode 100644
index 0f19c83..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_12.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_13.9.png b/res/drawable-hdpi/appointment_indicator_leftside_13.9.png
deleted file mode 100644
index 7501e35..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_13.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_14.9.png b/res/drawable-hdpi/appointment_indicator_leftside_14.9.png
deleted file mode 100644
index 53f97a6..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_14.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_15.9.png b/res/drawable-hdpi/appointment_indicator_leftside_15.9.png
deleted file mode 100644
index 846f6f8..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_15.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_16.9.png b/res/drawable-hdpi/appointment_indicator_leftside_16.9.png
deleted file mode 100644
index 1707540..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_16.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_17.9.png b/res/drawable-hdpi/appointment_indicator_leftside_17.9.png
deleted file mode 100644
index 7fd945d..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_17.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_18.9.png b/res/drawable-hdpi/appointment_indicator_leftside_18.9.png
deleted file mode 100644
index 8cf47ae..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_18.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_19.9.png b/res/drawable-hdpi/appointment_indicator_leftside_19.9.png
deleted file mode 100644
index 6831c01..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_19.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_2.9.png b/res/drawable-hdpi/appointment_indicator_leftside_2.9.png
deleted file mode 100644
index b4cee11..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_2.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_20.9.png b/res/drawable-hdpi/appointment_indicator_leftside_20.9.png
deleted file mode 100644
index d07d826..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_20.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_21.9.png b/res/drawable-hdpi/appointment_indicator_leftside_21.9.png
deleted file mode 100644
index f410269..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_21.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_3.9.png b/res/drawable-hdpi/appointment_indicator_leftside_3.9.png
deleted file mode 100644
index 69bd6a9..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_3.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_4.9.png b/res/drawable-hdpi/appointment_indicator_leftside_4.9.png
deleted file mode 100644
index d09ea90..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_4.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_5.9.png b/res/drawable-hdpi/appointment_indicator_leftside_5.9.png
deleted file mode 100644
index d27fc91..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_5.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_6.9.png b/res/drawable-hdpi/appointment_indicator_leftside_6.9.png
deleted file mode 100644
index c014633..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_6.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_7.9.png b/res/drawable-hdpi/appointment_indicator_leftside_7.9.png
deleted file mode 100644
index febb514..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_7.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_8.9.png b/res/drawable-hdpi/appointment_indicator_leftside_8.9.png
deleted file mode 100644
index 1415e44..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_8.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/appointment_indicator_leftside_9.9.png b/res/drawable-hdpi/appointment_indicator_leftside_9.9.png
deleted file mode 100644
index d018fcf..0000000
--- a/res/drawable-hdpi/appointment_indicator_leftside_9.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_1.9.png b/res/drawable-mdpi/appointment_indicator_leftside_1.9.png
deleted file mode 100644
index 5e40235..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_1.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_10.9.png b/res/drawable-mdpi/appointment_indicator_leftside_10.9.png
deleted file mode 100644
index d0cb144..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_10.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_11.9.png b/res/drawable-mdpi/appointment_indicator_leftside_11.9.png
deleted file mode 100644
index 034f496..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_11.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_12.9.png b/res/drawable-mdpi/appointment_indicator_leftside_12.9.png
deleted file mode 100644
index 6371b3a..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_12.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_13.9.png b/res/drawable-mdpi/appointment_indicator_leftside_13.9.png
deleted file mode 100644
index a8b42c6..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_13.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_14.9.png b/res/drawable-mdpi/appointment_indicator_leftside_14.9.png
deleted file mode 100644
index a69e519..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_14.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_15.9.png b/res/drawable-mdpi/appointment_indicator_leftside_15.9.png
deleted file mode 100644
index 5d68470..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_15.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_16.9.png b/res/drawable-mdpi/appointment_indicator_leftside_16.9.png
deleted file mode 100644
index d9420c1..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_16.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_17.9.png b/res/drawable-mdpi/appointment_indicator_leftside_17.9.png
deleted file mode 100644
index d0875c4..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_17.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_18.9.png b/res/drawable-mdpi/appointment_indicator_leftside_18.9.png
deleted file mode 100644
index fc152f7..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_18.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_19.9.png b/res/drawable-mdpi/appointment_indicator_leftside_19.9.png
deleted file mode 100644
index 6506a94..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_19.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_2.9.png b/res/drawable-mdpi/appointment_indicator_leftside_2.9.png
deleted file mode 100644
index 3baf5cc..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_2.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_20.9.png b/res/drawable-mdpi/appointment_indicator_leftside_20.9.png
deleted file mode 100644
index 28340ba..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_20.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_21.9.png b/res/drawable-mdpi/appointment_indicator_leftside_21.9.png
deleted file mode 100644
index 5319f07..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_21.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_3.9.png b/res/drawable-mdpi/appointment_indicator_leftside_3.9.png
deleted file mode 100644
index 9850791..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_3.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_4.9.png b/res/drawable-mdpi/appointment_indicator_leftside_4.9.png
deleted file mode 100644
index e344ccb..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_4.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_5.9.png b/res/drawable-mdpi/appointment_indicator_leftside_5.9.png
deleted file mode 100644
index 11b4dfb..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_5.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_6.9.png b/res/drawable-mdpi/appointment_indicator_leftside_6.9.png
deleted file mode 100644
index 7419d47..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_6.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_7.9.png b/res/drawable-mdpi/appointment_indicator_leftside_7.9.png
deleted file mode 100644
index 0a3a272..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_7.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_8.9.png b/res/drawable-mdpi/appointment_indicator_leftside_8.9.png
deleted file mode 100644
index db18d27..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_8.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/appointment_indicator_leftside_9.9.png b/res/drawable-mdpi/appointment_indicator_leftside_9.9.png
deleted file mode 100644
index 5037de8..0000000
--- a/res/drawable-mdpi/appointment_indicator_leftside_9.9.png
+++ /dev/null
Binary files differ
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 2c1d250..914ebcc 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -110,12 +110,6 @@
<attr name="list_item_header_text_size" format="dimension" />
</declare-styleable>
- <declare-styleable name="MultiplePhonePickerItemView">
- <attr name="list_item_header_chip_width" format="dimension"/>
- <attr name="list_item_header_chip_right_margin" format="dimension"/>
- <attr name="list_item_header_checkbox_margin" format="dimension"/>
- </declare-styleable>
-
<style name="ContactBrowserTheme" parent="@android:Theme">
<item name="pressedBackground">@*android:drawable/list_selector_background</item>
<item name="section_header_background">@drawable/section_header</item>
@@ -151,9 +145,6 @@
<item name="list_item_presence_icon_margin">5dip</item>
<item name="list_item_photo_size">56dip</item>
<item name="list_item_prefix_highlight_color">#729a27</item>
- <item name="list_item_header_chip_width">4dip</item>
- <item name="list_item_header_chip_right_margin">4dip</item>
- <item name="list_item_header_checkbox_margin">5dip</item>
<item name="list_item_header_text_indent">56dip</item>
<item name="list_item_header_text_color">?color/section_header_text_color</item>
<item name="list_item_header_text_size">14sp</item>
diff --git a/src/com/android/contacts/MultiplePhonePickerActivity.java b/src/com/android/contacts/MultiplePhonePickerActivity.java
deleted file mode 100644
index 572b4de..0000000
--- a/src/com/android/contacts/MultiplePhonePickerActivity.java
+++ /dev/null
@@ -1,226 +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;
-
-import com.android.contacts.list.MultiplePhonePickerFragment;
-import com.android.contacts.list.OnMultiplePhoneNumberPickerActionListener;
-
-import android.app.Activity;
-import android.app.FragmentTransaction;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Parcelable;
-import android.provider.ContactsContract.Intents;
-import android.view.Menu;
-import android.view.MenuInflater;
-
-/**
- * Displays of phone numbers and allows selection of multiple numbers.
- */
-public class MultiplePhonePickerActivity extends Activity {
-
- /**
- * Display only selected recipients or not in MODE_PICK_MULTIPLE_PHONES mode
- */
- private boolean mShowSelectedOnly = false;
-
- private MultiplePhonePickerFragment mListFragment;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mListFragment = new MultiplePhonePickerFragment();
- mListFragment.setOnMultiplePhoneNumberPickerActionListener(
- new OnMultiplePhoneNumberPickerActionListener() {
-
- public void onPhoneNumbersSelectedAction(Uri[] dataUris) {
- returnActivityResult(dataUris);
- }
-
- public void onFinishAction() {
- finish();
- }
- });
-
- Parcelable[] extras = getIntent().getParcelableArrayExtra(Intents.EXTRA_PHONE_URIS);
- mListFragment.setSelectedUris(extras);
- FragmentTransaction transaction = getFragmentManager().openTransaction();
- transaction.add(android.R.id.content, mListFragment);
- transaction.commit();
- }
-
- @Override
- public void onBackPressed() {
- returnActivityResult(mListFragment.getSelectedUris());
- super.onBackPressed();
- }
-
- @Override
- protected void onSaveInstanceState(Bundle icicle) {
- super.onSaveInstanceState(icicle);
- mListFragment.onSaveInstanceState(icicle);
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- super.onCreateOptionsMenu(menu);
-
- final MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.pick, menu);
- return true;
- }
-
- /*
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- if (mShowSelectedOnly) {
- menu.findItem(R.id.menu_display_selected).setVisible(false);
- menu.findItem(R.id.menu_display_all).setVisible(true);
- menu.findItem(R.id.menu_select_all).setVisible(false);
- menu.findItem(R.id.menu_select_none).setVisible(false);
- return true;
- }
- menu.findItem(R.id.menu_display_all).setVisible(false);
- menu.findItem(R.id.menu_display_selected).setVisible(true);
- if (mUserSelection.isAllSelected()) {
- menu.findItem(R.id.menu_select_all).setVisible(false);
- menu.findItem(R.id.menu_select_none).setVisible(true);
- } else {
- menu.findItem(R.id.menu_select_all).setVisible(true);
- menu.findItem(R.id.menu_select_none).setVisible(false);
- }
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.menu_select_all: {
- mUserSelection.setAllPhonesSelected(true);
- checkAll(true);
- updateWidgets(true);
- return true;
- }
- case R.id.menu_select_none: {
- mUserSelection.setAllPhonesSelected(false);
- checkAll(false);
- updateWidgets(true);
- return true;
- }
- case R.id.menu_display_selected: {
- mShowSelectedOnly = true;
- startQuery();
- return true;
- }
- case R.id.menu_display_all: {
- mShowSelectedOnly = false;
- startQuery();
- return true;
- }
- }
- return super.onOptionsItemSelected(item);
- }
-*/
- @Override
- public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData,
- boolean globalSearch) {
- // TODO
-// if (mProviderStatus != ProviderStatus.STATUS_NORMAL) {
-// return;
-// }
-//
-// if (globalSearch) {
-// super.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
-// } else {
-// if (!mSearchMode && (mMode & MODE_MASK_NO_FILTER) == 0) {
-// if ((mMode & MODE_MASK_PICKER) != 0) {
-// Bundle extras = getIntent().getExtras();
-// if (extras == null) {
-// extras = new Bundle();
-// }
-// mUserSelection.fillSelectionForSearchMode(extras);
-// ContactsSearchManager.startSearchForResult(this, initialQuery,
-// SUBACTIVITY_FILTER, extras);
-// } else {
-// ContactsSearchManager.startSearch(this, initialQuery);
-// }
-// }
-// }
- }
-
-// @Override
-// protected void startQuery(Uri uri, String[] projection) {
-// // Filter unknown phone numbers first.
-// mPhoneNumberAdapter.doFilter(null, mShowSelectedOnly);
-// if (mShowSelectedOnly) {
-// StringBuilder idSetBuilder = new StringBuilder();
-// Iterator<Long> itr = mUserSelection.getSelectedPhonIds();
-// if (itr.hasNext()) {
-// idSetBuilder.append(Long.toString(itr.next()));
-// }
-// while (itr.hasNext()) {
-// idSetBuilder.append(',');
-// idSetBuilder.append(Long.toString(itr.next()));
-// }
-// String whereClause = Phone._ID + " IN (" + idSetBuilder.toString() + ")";
-// mQueryHandler.startQuery(QUERY_TOKEN, null, uri, projection, whereClause, null,
-// getSortOrder(projection));
-// } else {
-// mQueryHandler.startQuery(QUERY_TOKEN, null, uri,
-// projection, CLAUSE_ONLY_VISIBLE, null, getSortOrder(projection));
-// }
-// }
-
-// @Override
-// public Cursor doFilter(String filter) {
-// String[] projection = getProjectionForQuery();
-// if (mSearchMode && TextUtils.isEmpty(mListFragment.getQueryString())) {
-// return new MatrixCursor(projection);
-// }
-//
-// final ContentResolver resolver = getContentResolver();
-// // Filter phone numbers as well.
-// mPhoneNumberAdapter.doFilter(filter, mShowSelectedOnly);
-//
-// Uri uri = getUriToQuery();
-// if (!TextUtils.isEmpty(filter)) {
-// uri = Uri.withAppendedPath(Phone.CONTENT_FILTER_URI, Uri.encode(filter));
-// }
-// return resolver.query(uri, projection, CLAUSE_ONLY_VISIBLE, null, getSortOrder(projection));
-// }
-
- public void returnActivityResult(Uri[] dataUris) {
- Intent intent = new Intent();
- intent.putExtra(Intents.EXTRA_PHONE_URIS, dataUris);
- setResult(RESULT_OK, intent);
- finish();
- }
-
- private void checkAll(boolean checked) {
- // TODO fix this. It should iterate over the cursor rather than the views in the list.
- /*
- final ListView listView = getListView();
- int childCount = listView.getChildCount();
- for (int i = 0; i < childCount; i++) {
- final ContactListItemView child = (ContactListItemView)listView.getChildAt(i);
- child.getCheckBoxView().setChecked(checked);
- }
- */
- }
-}
diff --git a/src/com/android/contacts/list/MultiplePhonePickerAdapter.java b/src/com/android/contacts/list/MultiplePhonePickerAdapter.java
deleted file mode 100644
index 1eba085..0000000
--- a/src/com/android/contacts/list/MultiplePhonePickerAdapter.java
+++ /dev/null
@@ -1,361 +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.list;
-
-import com.android.contacts.R;
-
-import android.content.ContentUris;
-import android.content.Context;
-import android.database.Cursor;
-import android.net.Uri;
-import android.provider.ContactsContract.CommonDataKinds.Phone;
-import android.text.TextUtils;
-import android.util.SparseIntArray;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.CheckBox;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * List adapter for the multiple phone picker.
- */
-public class MultiplePhonePickerAdapter extends PhoneNumberListAdapter {
-
- public interface OnSelectionChangeListener {
- void onSelectionChange();
- }
-
- private static final int[] CHIP_COLOR_ARRAY = {
- R.drawable.appointment_indicator_leftside_1,
- R.drawable.appointment_indicator_leftside_2,
- R.drawable.appointment_indicator_leftside_3,
- R.drawable.appointment_indicator_leftside_4,
- R.drawable.appointment_indicator_leftside_5,
- R.drawable.appointment_indicator_leftside_6,
- R.drawable.appointment_indicator_leftside_7,
- R.drawable.appointment_indicator_leftside_8,
- R.drawable.appointment_indicator_leftside_9,
- R.drawable.appointment_indicator_leftside_10,
- R.drawable.appointment_indicator_leftside_11,
- R.drawable.appointment_indicator_leftside_12,
- R.drawable.appointment_indicator_leftside_13,
- R.drawable.appointment_indicator_leftside_14,
- R.drawable.appointment_indicator_leftside_15,
- R.drawable.appointment_indicator_leftside_16,
- R.drawable.appointment_indicator_leftside_17,
- R.drawable.appointment_indicator_leftside_18,
- R.drawable.appointment_indicator_leftside_19,
- R.drawable.appointment_indicator_leftside_20,
- R.drawable.appointment_indicator_leftside_21,
- };
-
- public static final long INVALID_PHONE_ID = -1;
-
- /** The phone numbers */
- private ArrayList<String> mPhoneNumbers = new ArrayList<String>();
-
- /** The selected phone numbers in the PhoneNumberAdapter */
- private HashSet<String> mSelectedPhoneNumbers = new HashSet<String>();
-
- /** The phone numbers after the filtering */
- private ArrayList<String> mFilteredPhoneNumbers = new ArrayList<String>();
-
- /** The PHONE_ID of selected number in user contacts*/
- private HashSet<Long> mSelectedPhoneIds = new HashSet<Long>();
-
- private boolean mSelectionChanged;
-
- private OnSelectionChangeListener mSelectionChangeListener;
-
- /**
- * This is a map from contact ID to color index. A colored chip is used to
- * indicate the number of phone numbers belong to one contact
- */
- private SparseIntArray mContactColor = new SparseIntArray();
-
- public MultiplePhonePickerAdapter(Context context) {
- super(context);
- }
-
- public void setOnSelectionChangeListener(OnSelectionChangeListener listener) {
- this.mSelectionChangeListener = listener;
- }
-
- public void setPhoneNumbers(ArrayList<String> phoneNumbers) {
- mPhoneNumbers.clear();
- mPhoneNumbers.addAll(phoneNumbers);
- }
-
- public int getSelectedCount() {
- return mSelectedPhoneNumbers.size() + mSelectedPhoneIds.size();
- }
-
- public Uri[] getSelectedUris() {
- Uri[] uris = new Uri[mSelectedPhoneNumbers.size() + mSelectedPhoneIds.size()];
- int count = mPhoneNumbers.size();
- int index = 0;
- for (int i = 0; i < count; i++) {
- String phoneNumber = mPhoneNumbers.get(i);
- if (isSelected(phoneNumber)) {
- uris[index++] = Uri.parse("tel:" + phoneNumber);
- }
- }
- for (Long contactId : mSelectedPhoneIds) {
- uris[index++] = ContentUris.withAppendedId(Phone.CONTENT_URI, contactId);
- }
- return uris;
- }
-
- public void setSelectedUris(Uri[] uris) {
- mSelectedPhoneNumbers.clear();
- mSelectedPhoneIds.clear();
- if (uris != null) {
- for (Uri uri : uris) {
- String scheme = uri.getScheme();
- if ("tel".equals(scheme)) {
- String phoneNumber = uri.getSchemeSpecificPart();
- if (!mPhoneNumbers.contains(phoneNumber)) {
- mPhoneNumbers.add(phoneNumber);
- }
- mSelectedPhoneNumbers.add(phoneNumber);
- } else if ("content".equals(scheme)) {
- mSelectedPhoneIds.add(ContentUris.parseId(uri));
- }
- }
- }
- mFilteredPhoneNumbers.clear();
- mFilteredPhoneNumbers.addAll(mPhoneNumbers);
- }
-
- public void toggleSelection(int position) {
- if (position < mFilteredPhoneNumbers.size()) {
- String phoneNumber = mPhoneNumbers.get(position);
- setPhoneSelected(phoneNumber, !isSelected(phoneNumber));
- } else {
- Cursor cursor = ((Cursor)getItem(position));
- cursor.moveToPosition(position - mFilteredPhoneNumbers.size());
- long phoneId = cursor.getLong(PHONE_ID_COLUMN_INDEX);
- setPhoneSelected(phoneId, !isSelected(phoneId));
- }
- notifyDataSetChanged();
- }
-
- public boolean isSelectionChanged() {
- return mSelectionChanged;
- }
-
- public void setSelectionChanged(boolean flag) {
- mSelectionChanged = flag;
- if (mSelectionChangeListener != null) {
- mSelectionChangeListener.onSelectionChange();
- }
- }
-
- public void setPhoneSelected(final String phoneNumber, boolean selected) {
- if (!TextUtils.isEmpty(phoneNumber)) {
- if (selected) {
- mSelectedPhoneNumbers.add(phoneNumber);
- } else {
- mSelectedPhoneNumbers.remove(phoneNumber);
- }
- }
- setSelectionChanged(true);
- }
-
- public void setPhoneSelected(long phoneId, boolean selected) {
- if (selected) {
- mSelectedPhoneIds.add(phoneId);
- } else {
- mSelectedPhoneIds.remove(phoneId);
- }
- setSelectionChanged(true);
- }
-
- public boolean isSelected(long phoneId) {
- return mSelectedPhoneIds.contains(phoneId);
- }
-
- public boolean isSelected(final String phoneNumber) {
- return mSelectedPhoneNumbers.contains(phoneNumber);
- }
-
- public void setAllPhonesSelected(boolean selected) {
-// if (selected) {
-// Cursor cursor = this.mMultiplePhoneSelectionActivity.mAdapter.getCursor();
-// if (cursor != null) {
-// int backupPos = cursor.getPosition();
-// cursor.moveToPosition(-1);
-// while (cursor.moveToNext()) {
-// setPhoneSelected(cursor
-// .getLong(MultiplePhonePickerActivity.PHONE_ID_COLUMN_INDEX), true);
-// }
-// cursor.moveToPosition(backupPos);
-// }
-// for (String number : this.mMultiplePhoneSelectionActivity.mPhoneNumberAdapter
-// .getFilteredPhoneNumbers()) {
-// setPhoneSelected(number, true);
-// }
-// } else {
-// mSelectedPhoneIds.clear();
-// mSelectedPhoneNumbers.clear();
-// }
- }
-
- public boolean isAllSelected() {
- return false;
-// return selectedCount() == this.mMultiplePhoneSelectionActivity.mPhoneNumberAdapter
-// .getFilteredPhoneNumbers().size()
-// + this.mMultiplePhoneSelectionActivity.mAdapter.getCount();
- }
-
- public Iterator<Long> getSelectedPhoneIds() {
- return mSelectedPhoneIds.iterator();
- }
-
- @Override
- public int getItemViewTypeCount() {
- return 2;
- }
-
- @Override
- public int getItemViewType(int position) {
- return position < mPhoneNumbers.size() ? 0 : 1;
- }
-
- // TODO redo as two separate partitions
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View view = null;
-// if (convertView == null || convertView.getTag() == null) {
-// view = newView(getContext(), null, parent);
-// } else {
-// view = convertView;
-// }
-//
-// boolean showingSuggestion = false;
-//
-// if (position < mFilteredPhoneNumbers.size()) {
-// bindExtraPhoneView(view, position);
-// } else {
-// Cursor cursor = ((Cursor)getItem(position));
-// cursor.moveToPosition(position - mFilteredPhoneNumbers.size());
-// bindView(view, getContext(), cursor);
-// }
- return view;
- }
-
- @Override
- protected View newView(Context context, int partition, Cursor cursor, int position,
- ViewGroup parent) {
- final MultiplePhonePickerItemView view = new MultiplePhonePickerItemView(context, null);
- view.setUnknownNameText(getUnknownNameText());
- view.setTextWithHighlightingFactory(getTextWithHighlightingFactory());
- return view;
- }
-
- private void bindExtraPhoneView(View itemView, int position) {
- final MultiplePhonePickerItemView view = (MultiplePhonePickerItemView)itemView;
- String phoneNumber = mFilteredPhoneNumbers.get(position);
- view.getNameTextView().setText(phoneNumber);
- CheckBox checkBox = view.getCheckBoxView();
- checkBox.setChecked(isSelected(phoneNumber));
- view.phoneId = INVALID_PHONE_ID;
- view.phoneNumber = phoneNumber;
- }
-
- @Override
- protected void bindView(View itemView, int partition, Cursor cursor, int position) {
- super.bindView(itemView, partition, cursor, position);
-
- final MultiplePhonePickerItemView view = (MultiplePhonePickerItemView)itemView;
- view.phoneId = Long.valueOf(cursor.getLong(PHONE_ID_COLUMN_INDEX));
- CheckBox checkBox = view.getCheckBoxView();
- checkBox.setChecked(isSelected(view.phoneId));
-
- long contactId = cursor.getLong(PHONE_CONTACT_ID_COLUMN_INDEX);
- view.getChipView().setBackgroundResource(getChipColor(contactId));
- }
-
-// @Override
-// protected void prepareEmptyView() {
-// mMultiplePhonePickerActivity.mEmptyView.show(mMultiplePhonePickerActivity.mSearchMode,
-// true, false, false, false, true, mMultiplePhonePickerActivity.mShowSelectedOnly);
-// }
-
- /**
- * Get assigned chip color resource id for a given contact, 0 is returned if there is no mapped
- * resource.
- */
- public int getChipColor(long contactId) {
- return mContactColor.get((int)contactId);
- }
-
- // TODO filtering
-// public void doFilter(final String constraint, boolean selectedOnly) {
-// if (mPhoneNumbers == null) {
-// return;
-// }
-// mFilteredPhoneNumbers.clear();
-// for (String number : mPhoneNumbers) {
-// if (selectedOnly && !mSelection.isSelected(number) ||
-// !TextUtils.isEmpty(constraint) && !number.startsWith(constraint)) {
-// continue;
-// }
-// mFilteredPhoneNumbers.add(number);
-// }
-// }
-
- @Override
- public int getCount() {
- return super.getCount() + mFilteredPhoneNumbers.size();
- }
-
- @Override
- public void changeCursor(Cursor cursor) {
- super.changeCursor(cursor);
- updateChipColor(cursor);
- }
-
- /**
- * Go through the cursor and assign the chip color to contact who has more
- * than one phone numbers. Assume the cursor is clustered by CONTACT_ID.
- */
- public void updateChipColor(Cursor cursor) {
- if (cursor == null || cursor.getCount() == 0) {
- return;
- }
- mContactColor.clear();
- cursor.moveToFirst();
- int colorIndex = 0;
- long prevContactId = cursor.getLong(PHONE_CONTACT_ID_COLUMN_INDEX);
- while (cursor.moveToNext()) {
- long contactId = cursor.getLong(PHONE_CONTACT_ID_COLUMN_INDEX);
- if (prevContactId == contactId) {
- if (mContactColor.indexOfKey((int)contactId) < 0) {
- mContactColor.put((int)contactId, CHIP_COLOR_ARRAY[colorIndex]);
- colorIndex++;
- if (colorIndex >= CHIP_COLOR_ARRAY.length) {
- colorIndex = 0;
- }
- }
- }
- prevContactId = contactId;
- }
- }
-}
diff --git a/src/com/android/contacts/list/MultiplePhonePickerFragment.java b/src/com/android/contacts/list/MultiplePhonePickerFragment.java
deleted file mode 100644
index bf75a9f..0000000
--- a/src/com/android/contacts/list/MultiplePhonePickerFragment.java
+++ /dev/null
@@ -1,181 +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.list;
-
-import com.android.contacts.R;
-import com.android.contacts.list.MultiplePhonePickerAdapter.OnSelectionChangeListener;
-
-import android.app.Activity;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Parcelable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewStub;
-import android.view.View.OnClickListener;
-import android.view.animation.AnimationUtils;
-import android.widget.Button;
-
-/**
- * Fragment for the multiple phone picker.
- */
-public class MultiplePhonePickerFragment
- extends ContactEntryListFragment<MultiplePhonePickerAdapter>
- implements OnClickListener, OnSelectionChangeListener {
-
- private static final String SELECTION_EXTRA_KEY = "selection";
- private static final String SELECTION_CHANGED_EXTRA_KEY = "selectionChanged";
-
- private OnMultiplePhoneNumberPickerActionListener mListener;
-
- /**
- * UI control of action panel in MODE_PICK_MULTIPLE_PHONES mode.
- */
- private View mFooterView;
-
- private Uri[] mSelectedUris;
- private boolean mSelectionChanged;
-
- public MultiplePhonePickerFragment() {
- setSectionHeaderDisplayEnabled(false);
- setPhotoLoaderEnabled(true);
- }
-
- public void setOnMultiplePhoneNumberPickerActionListener(
- OnMultiplePhoneNumberPickerActionListener listener) {
- mListener = listener;
- }
-
- public Uri[] getSelectedUris() {
- return getAdapter().getSelectedUris();
- }
-
- public void setSelectedUris(Parcelable[] extras) {
- Uri[] uris = new Uri[extras == null ? 0 : extras.length];
- if (extras != null) {
- for (int i = 0; i < extras.length; i++) {
- uris[i] = (Uri)extras[i];
- }
- }
- setSelectedUris(uris);
- }
-
- public void setSelectedUris(Uri[] uris) {
- mSelectedUris = uris;
- MultiplePhonePickerAdapter adapter = getAdapter();
- if (adapter != null) {
- adapter.setSelectedUris(uris);
- }
- }
-
- @Override
- protected MultiplePhonePickerAdapter createListAdapter() {
- return new MultiplePhonePickerAdapter(getActivity());
- }
-
- @Override
- protected void configureAdapter() {
- super.configureAdapter();
- MultiplePhonePickerAdapter adapter = getAdapter();
- adapter.setSelectedUris(mSelectedUris);
- adapter.setSelectionChanged(mSelectionChanged);
- adapter.setOnSelectionChangeListener(this);
- }
-
- @Override
- protected View inflateView(LayoutInflater inflater, ViewGroup container) {
- View view = inflater.inflate(R.layout.contacts_list_content, null);
- ViewStub stub = (ViewStub)view.findViewById(R.id.footer_stub);
- if (stub != null) {
- View stubView = stub.inflate();
- mFooterView = stubView.findViewById(R.id.footer);
- mFooterView.setVisibility(View.GONE);
- Button doneButton = (Button) stubView.findViewById(R.id.done);
- doneButton.setOnClickListener(this);
- Button revertButton = (Button) stubView.findViewById(R.id.revert);
- revertButton.setOnClickListener(this);
- }
- return view;
- }
-
- @Override
- protected void onItemClick(int position, long id) {
- getAdapter().toggleSelection(position);
- }
-
- public void onClick(View v) {
- int id = v.getId();
- switch (id) {
- case R.id.done:
- mListener.onPhoneNumbersSelectedAction(getAdapter().getSelectedUris());
- break;
- case R.id.revert:
- mListener.onFinishAction();
- break;
- }
- }
-
- @Override
- public void onCreate(Bundle savedState) {
- super.onCreate(savedState);
- if (savedState != null) {
- setSelectedUris(savedState.getParcelableArray(SELECTION_EXTRA_KEY));
- mSelectionChanged = savedState.getBoolean(SELECTION_CHANGED_EXTRA_KEY, false);
- if (getAdapter() != null) {
- getAdapter().setSelectionChanged(mSelectionChanged);
- }
- }
- }
-
- @Override
- public void onResume() {
- super.onResume();
- updateWidgets();
- }
-
- public void onSelectionChange() {
- updateWidgets();
- }
-
- private void updateWidgets() {
- int selected = getAdapter().getSelectedCount();
-
- Activity context = getActivity();
- if (selected >= 1) {
- final String format = context.getResources().getQuantityString(
- R.plurals.multiple_picker_title, selected);
-
- // TODO: turn this into a callback
- context.setTitle(String.format(format, selected));
- } else {
- // TODO: turn this into a callback
- context.setTitle(context.getString(R.string.contactsList));
- }
-
- if (getAdapter().isSelectionChanged() && mFooterView.getVisibility() == View.GONE) {
- mFooterView.setVisibility(View.VISIBLE);
- mFooterView.startAnimation(AnimationUtils.loadAnimation(context, R.anim.footer_appear));
- }
- }
-
- @Override
- public void onSaveInstanceState(Bundle icicle) {
- super.onSaveInstanceState(icicle);
- icicle.putParcelableArray(SELECTION_EXTRA_KEY, getAdapter().getSelectedUris());
- icicle.putBoolean(SELECTION_CHANGED_EXTRA_KEY, getAdapter().isSelectionChanged());
- }
-}
diff --git a/src/com/android/contacts/list/MultiplePhonePickerItemView.java b/src/com/android/contacts/list/MultiplePhonePickerItemView.java
deleted file mode 100644
index 87f53bf..0000000
--- a/src/com/android/contacts/list/MultiplePhonePickerItemView.java
+++ /dev/null
@@ -1,123 +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.list;
-
-import com.android.contacts.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.CheckBox;
-
-/**
- * A custom view for an item in the phone multi-picker list.
- */
-public class MultiplePhonePickerItemView extends ContactListItemView {
-
- // Used to indicate the sequence of phones belong to the same contact in multi-picker
- private View mChipView;
- // Used to select the phone in multi-picker
- private CheckBox mCheckBox;
-
- private int mChipWidth;
- private int mChipRightMargin;
- private int mCheckBoxMargin;
-
- public long phoneId;
- // phoneNumber only validates when phoneId = INVALID_PHONE_ID
- public String phoneNumber;
-
- public MultiplePhonePickerItemView(Context context, AttributeSet attrs) {
- super(context, attrs);
- TypedArray a = getContext().obtainStyledAttributes(
- attrs, R.styleable.MultiplePhonePickerItemView);
- mChipWidth = a.getDimensionPixelOffset(
- R.styleable.MultiplePhonePickerItemView_list_item_header_chip_width, 0);
- mChipRightMargin = a.getDimensionPixelOffset(
- R.styleable.MultiplePhonePickerItemView_list_item_header_chip_right_margin, 0);
- mCheckBoxMargin = a.getDimensionPixelOffset(
- R.styleable.MultiplePhonePickerItemView_list_item_header_checkbox_margin, 0);
- a.recycle();
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- if (isVisible(mChipView)) {
- mChipView.measure(0, 0);
- }
-
- if (isVisible(mCheckBox)) {
- mCheckBox.measure(0, 0);
- }
-
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- }
-
- @Override
- protected int layoutLeftSide(int height, int topBound, int bottomBound, int leftBound) {
- if (mChipView != null) {
- mChipView.layout(leftBound, topBound, leftBound + mChipWidth, height);
- leftBound += mChipWidth + mChipRightMargin;
- }
-
- return super.layoutLeftSide(height, topBound, bottomBound, leftBound);
- }
-
- @Override
- protected int layoutRightSide(int height, int topBound, int rightBound) {
- rightBound = super.layoutRightSide(height, topBound, rightBound);
-
- if (isVisible(mCheckBox)) {
- int checkBoxWidth = mCheckBox.getMeasuredWidth();
- int checkBoxHight = mCheckBox.getMeasuredHeight();
- rightBound -= mCheckBoxMargin + checkBoxWidth;
- int checkBoxTop = topBound + (height - topBound - checkBoxHight) / 2;
- mCheckBox.layout(
- rightBound,
- checkBoxTop,
- rightBound + checkBoxWidth,
- checkBoxTop + checkBoxHight);
- }
-
- return rightBound;
- }
-
- /**
- * Returns the chip view for the multipicker, creating it if necessary.
- */
- public View getChipView() {
- if (mChipView == null) {
- mChipView = new View(mContext);
- addView(mChipView);
- }
- return mChipView;
- }
-
- /**
- * Returns the CheckBox view for the multipicker, creating it if necessary.
- */
- public CheckBox getCheckBoxView() {
- if (mCheckBox == null) {
- mCheckBox = new CheckBox(mContext);
- mCheckBox.setClickable(false);
- mCheckBox.setFocusable(false);
- addView(mCheckBox);
- }
- return mCheckBox;
- }
-}
diff --git a/tests/res/values/donottranslate_strings.xml b/tests/res/values/donottranslate_strings.xml
index 7530ce7..6891c2f 100644
--- a/tests/res/values/donottranslate_strings.xml
+++ b/tests/res/values/donottranslate_strings.xml
@@ -61,7 +61,6 @@
<item>SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED</item>
<item>SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED</item>
<item>TODO: JOIN_CONTACT</item>
- <item>ACTION_GET_MULTIPLE_PHONES</item>
<!-- Edit Contact -->
<item>EDIT (content uri with only id)</item>
diff --git a/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java b/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
index 3683a80..66079ad 100644
--- a/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
+++ b/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
@@ -60,8 +60,6 @@
private static final String CONTACT_LIST_ACTIVITY_CLASS_NAME =
"com.android.contacts.activities.ContactBrowserActivity";
- private static final String MULTIPLE_PHONE_PICKER_ACTIVITY_CLASS_NAME =
- "com.android.contacts.MultiplePhonePickerActivity";
private static final int LIST_DEFAULT = 0;
private static final int LIST_ALL_CONTACTS_ACTION = 1;
@@ -104,34 +102,33 @@
private static final int SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED = 38;
private static final int SEARCH_SUGGESTION_CREATE_CONTACT_CLICKED = 39;
private static final int JOIN_CONTACT = 40;
- private static final int ACTION_GET_MULTIPLE_PHONES = 41;
- private static final int EDIT_CONTACT = 42;
- private static final int EDIT_CONTACT_LOOKUP = 43;
- private static final int EDIT_CONTACT_LOOKUP_ID = 44;
- private static final int EDIT_RAW_CONTACT = 45;
- private static final int EDIT_LEGACY = 46;
- private static final int EDIT_NEW_CONTACT = 47;
- private static final int EDIT_NEW_CONTACT_WITH_DATA = 48;
- private static final int EDIT_NEW_CONTACT_FOR_ACCOUNT = 49;
- private static final int EDIT_NEW_CONTACT_FOR_ACCOUNT_WITH_DATA = 50;
- private static final int EDIT_NEW_RAW_CONTACT = 51;
- private static final int EDIT_NEW_LEGACY = 52;
+ private static final int EDIT_CONTACT = 41;
+ private static final int EDIT_CONTACT_LOOKUP = 42;
+ private static final int EDIT_CONTACT_LOOKUP_ID = 43;
+ private static final int EDIT_RAW_CONTACT = 44;
+ private static final int EDIT_LEGACY = 45;
+ private static final int EDIT_NEW_CONTACT = 46;
+ private static final int EDIT_NEW_CONTACT_WITH_DATA = 47;
+ private static final int EDIT_NEW_CONTACT_FOR_ACCOUNT = 48;
+ private static final int EDIT_NEW_CONTACT_FOR_ACCOUNT_WITH_DATA = 49;
+ private static final int EDIT_NEW_RAW_CONTACT = 50;
+ private static final int EDIT_NEW_LEGACY = 51;
- private static final int VIEW_CONTACT = 53;
- private static final int VIEW_CONTACT_LOOKUP = 54;
- private static final int VIEW_CONTACT_LOOKUP_ID = 55;
- private static final int VIEW_RAW_CONTACT = 56;
- private static final int VIEW_LEGACY = 57;
+ private static final int VIEW_CONTACT = 52;
+ private static final int VIEW_CONTACT_LOOKUP = 53;
+ private static final int VIEW_CONTACT_LOOKUP_ID = 54;
+ private static final int VIEW_RAW_CONTACT = 55;
+ private static final int VIEW_LEGACY = 56;
- private static final int DIAL = 58;
- private static final int DIAL_phone = 59;
- private static final int DIAL_person = 60;
- private static final int DIAL_voicemail = 61;
- private static final int CALL_BUTTON = 62;
- private static final int DIAL_tel = 63;
- private static final int VIEW_tel = 64;
- private static final int VIEW_calllog = 65;
+ private static final int DIAL = 57;
+ private static final int DIAL_phone = 58;
+ private static final int DIAL_person = 59;
+ private static final int DIAL_voicemail = 60;
+ private static final int CALL_BUTTON = 61;
+ private static final int DIAL_tel = 62;
+ private static final int VIEW_tel = 63;
+ private static final int VIEW_calllog = 64;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -379,15 +376,6 @@
// TODO
break;
}
- case ACTION_GET_MULTIPLE_PHONES: {
- Intent intent = new Intent(Intents.ACTION_GET_MULTIPLE_PHONES);
- intent.setType(Phone.CONTENT_TYPE);
- intent.putExtra(Intents.EXTRA_PHONE_URIS, new Uri[] {
- Uri.parse("tel:555-1212"), Uri.parse("tel:555-2121")
- });
- startMultiplePhoneSelectionActivityForResult(intent);
- break;
- }
case EDIT_CONTACT: {
final long contactId = findArbitraryContactWithPhoneNumber();
final Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);
@@ -580,13 +568,6 @@
startActivity(intent);
}
- private void startMultiplePhoneSelectionActivityForResult(Intent intent) {
- intent.setComponent(
- new ComponentName(ANDROID_CONTACTS_PACKAGE,
- MULTIPLE_PHONE_PICKER_ACTIVITY_CLASS_NAME));
- startActivityForResult(intent, 13);
- }
-
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Intent intent = new Intent(this, ResultActivity.class);