summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-03-26 22:56:13 -0700
committerSteve Kondik <shade@chemlab.org>2015-03-27 08:36:51 +0000
commitf0ac9506c0447e93eb5c2bdea23c06c2e5ca0584 (patch)
tree19c56d5b302e18f26a475b90e6563d6817131708
parentcc75f02f352ca196b3d6f203d7faea3943235ee9 (diff)
downloadandroid_packages_apps_ContactsCommon-f0ac9506c0447e93eb5c2bdea23c06c2e5ca0584.tar.gz
android_packages_apps_ContactsCommon-f0ac9506c0447e93eb5c2bdea23c06c2e5ca0584.tar.bz2
android_packages_apps_ContactsCommon-f0ac9506c0447e93eb5c2bdea23c06c2e5ca0584.zip
contacts: Fix import/exportstaging/cm-12.1
Change-Id: I803311b9d33c4e3024ec3b421d3a7f478e118051
-rw-r--r--src/com/android/contacts/common/interactions/ImportExportDialogFragment.java56
1 files changed, 1 insertions, 55 deletions
diff --git a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java
index 68fb7df4..f9004d96 100644
--- a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java
+++ b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java
@@ -139,7 +139,6 @@ public class ImportExportDialogFragment extends DialogFragment
// only for sim contacts haven't been loaded completely
private static final int TOAST_SIM_CARD_NOT_LOAD_COMPLETE = 6;
private SimContactsOperation mSimContactsOperation;
- private ArrayAdapter<Integer> mAdapter;
private Activity mActivity;
private static boolean isExportingToSIM = false;
public static boolean isExportingToSIM(){
@@ -203,10 +202,6 @@ public class ImportExportDialogFragment extends DialogFragment
}
};
- // Manually call notifyDataSetChanged() to refresh the list.
- adapter.setNotifyOnChange(false);
- loadData(contactsAreAvailable);
-
final TelephonyManager manager =
(TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
@@ -285,59 +280,10 @@ public class ImportExportDialogFragment extends DialogFragment
.setTitle(contactsAreAvailable
? R.string.dialog_import_export
: R.string.dialog_import)
- .setSingleChoiceItems(mAdapter, -1, clickListener)
+ .setSingleChoiceItems(adapter, -1, clickListener)
.create();
}
- /**
- * Loading the menu list data.
- * @param contactsAreAvailable
- */
- private void loadData(boolean contactsAreAvailable) {
- if (null == mActivity && null == mAdapter) {
- return;
- }
-
- mAdapter.clear();
- final Resources res = mActivity.getResources();
- boolean hasIccCard = false;
- if (TelephonyManager.getDefault().isMultiSimEnabled()) {
- for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
- hasIccCard = TelephonyManager.getDefault().hasIccCard(i);
- if (hasIccCard) {
- break;
- }
- }
- } else {
- hasIccCard = TelephonyManager.getDefault().hasIccCard();
- }
-
- if (hasIccCard
- && res.getBoolean(R.bool.config_allow_sim_import)) {
- mAdapter.add(R.string.import_from_sim);
- }
- if (res.getBoolean(R.bool.config_allow_import_from_sdcard)) {
- mAdapter.add(R.string.import_from_sdcard);
- }
-
- if (hasIccCard) {
- mAdapter.add(R.string.export_to_sim);
- }
- if (res.getBoolean(R.bool.config_allow_export_to_sdcard)) {
- // If contacts are available and there is at least one contact in
- // database, show "Export to SD card" menu item. Otherwise hide it
- // because it makes no sense.
- if (contactsAreAvailable) {
- mAdapter.add(R.string.export_to_sdcard);
- }
- }
- if (res.getBoolean(R.bool.config_allow_share_visible_contacts)) {
- if (contactsAreAvailable) {
- mAdapter.add(R.string.share_visible_contacts);
- }
- }
- }
-
private void doShareVisibleContacts() {
Intent intent = new Intent(SimContactsConstants.ACTION_MULTI_PICK);
intent.setType(Contacts.CONTENT_TYPE);