Merge 04385785f05c0fe78f8813cd6b0f0fd891ba3a4b on remote branch
Change-Id: I5a3945393e6216758d07e792765f28727ef6059f
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a06cbc2..8865c83 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -19,6 +19,6 @@
package="com.android.contacts.common">
<uses-sdk
android:minSdkVersion="21"
- android:targetSdkVersion="24" />
+ android:targetSdkVersion="25" />
</manifest>
diff --git a/icons/res/mipmap-hdpi/ic_contacts_launcher.png b/icons/res/mipmap-hdpi/ic_contacts_launcher.png
new file mode 100644
index 0000000..86380d1
--- /dev/null
+++ b/icons/res/mipmap-hdpi/ic_contacts_launcher.png
Binary files differ
diff --git a/icons/res/mipmap-mdpi/ic_contacts_launcher.png b/icons/res/mipmap-mdpi/ic_contacts_launcher.png
new file mode 100644
index 0000000..85132c5
--- /dev/null
+++ b/icons/res/mipmap-mdpi/ic_contacts_launcher.png
Binary files differ
diff --git a/icons/res/mipmap-xhdpi/ic_contacts_launcher.png b/icons/res/mipmap-xhdpi/ic_contacts_launcher.png
new file mode 100644
index 0000000..c198749
--- /dev/null
+++ b/icons/res/mipmap-xhdpi/ic_contacts_launcher.png
Binary files differ
diff --git a/icons/res/mipmap-xxhdpi/ic_contacts_launcher.png b/icons/res/mipmap-xxhdpi/ic_contacts_launcher.png
new file mode 100644
index 0000000..4fa10a6
--- /dev/null
+++ b/icons/res/mipmap-xxhdpi/ic_contacts_launcher.png
Binary files differ
diff --git a/icons/res/mipmap-xxxhdpi/ic_contacts_launcher.png b/icons/res/mipmap-xxxhdpi/ic_contacts_launcher.png
new file mode 100644
index 0000000..10bda63
--- /dev/null
+++ b/icons/res/mipmap-xxxhdpi/ic_contacts_launcher.png
Binary files differ
diff --git a/res/drawable/ic_message_24dp.xml b/res/drawable/ic_message_24dp_mirrored.xml
similarity index 100%
rename from res/drawable/ic_message_24dp.xml
rename to res/drawable/ic_message_24dp_mirrored.xml
diff --git a/res/mipmap-hdpi/ic_contacts_launcher.png b/res/mipmap-hdpi/ic_contacts_launcher.png
deleted file mode 100644
index 64eff00..0000000
--- a/res/mipmap-hdpi/ic_contacts_launcher.png
+++ /dev/null
Binary files differ
diff --git a/res/mipmap-mdpi/ic_contacts_launcher.png b/res/mipmap-mdpi/ic_contacts_launcher.png
deleted file mode 100644
index b4ee821..0000000
--- a/res/mipmap-mdpi/ic_contacts_launcher.png
+++ /dev/null
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_contacts_launcher.png b/res/mipmap-xhdpi/ic_contacts_launcher.png
deleted file mode 100644
index 6feeadf..0000000
--- a/res/mipmap-xhdpi/ic_contacts_launcher.png
+++ /dev/null
Binary files differ
diff --git a/res/mipmap-xxhdpi/ic_contacts_launcher.png b/res/mipmap-xxhdpi/ic_contacts_launcher.png
deleted file mode 100644
index 01a3fde..0000000
--- a/res/mipmap-xxhdpi/ic_contacts_launcher.png
+++ /dev/null
Binary files differ
diff --git a/res/mipmap-xxxhdpi/ic_contacts_launcher.png b/res/mipmap-xxxhdpi/ic_contacts_launcher.png
deleted file mode 100644
index 328e067..0000000
--- a/res/mipmap-xxxhdpi/ic_contacts_launcher.png
+++ /dev/null
Binary files differ
diff --git a/res/values-bs-rBA/strings.xml b/res/values-bs-rBA/strings.xml
index 9a17c6d..b83c472 100644
--- a/res/values-bs-rBA/strings.xml
+++ b/res/values-bs-rBA/strings.xml
@@ -271,11 +271,11 @@
<item quantity="other"> <xliff:g id="TITLE_2">%1$s</xliff:g>. <xliff:g id="COUNT_3">%2$d</xliff:g> nepročitanih stavki. </item>
</plurals>
<string name="about_build_version" msgid="4221971683776635130">"Međuverzija aplikacije"</string>
- <string name="about_open_source_licenses" msgid="3224958101863814649">"Open source licence"</string>
+ <string name="about_open_source_licenses" msgid="3224958101863814649">"Licence otvorenog koda"</string>
<string name="about_open_source_licenses_summary" msgid="3009343539281606716">"Detalji o licenci za Open source softver"</string>
<string name="about_privacy_policy" msgid="8458337666582973913">"Pravila o privatnosti"</string>
<string name="about_terms_of_service" msgid="628537491496465267">"Uslovi pružanja usluge"</string>
- <string name="activity_title_licenses" msgid="7812517458691564230">"Open source licence"</string>
+ <string name="activity_title_licenses" msgid="7812517458691564230">"Licence otvorenog koda"</string>
<string name="url_open_error_toast" msgid="7557601281695424805">"Otvaranje URL-a nije uspjelo."</string>
<string name="account_filter_view_checked" msgid="4368757211136754319">"<xliff:g id="ACCOUNT_INFO">%s</xliff:g> je označen"</string>
<string name="account_filter_view_not_checked" msgid="5652044086126815700">"<xliff:g id="ACCOUNT_INFO">%s</xliff:g> nije označen"</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 826ae4f..53fb250 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -172,7 +172,7 @@
<string name="cancel_import_confirmation_message" msgid="7764915400478970495">"وارد کردن <xliff:g id="FILENAME">%s</xliff:g> لغو شود؟"</string>
<string name="cancel_export_confirmation_message" msgid="4063783315931861656">"صادر کردن به <xliff:g id="FILENAME">%s</xliff:g> لغو شود؟"</string>
<string name="cancel_vcard_import_or_export_failed" msgid="7450212880694781527">"وارد/صادرکردن کارت ویزیت لغو نمیشود"</string>
- <string name="fail_reason_unknown" msgid="8541352164960008557">"خطای ناشناخته."</string>
+ <string name="fail_reason_unknown" msgid="8541352164960008557">"خطای ناشناس."</string>
<string name="fail_reason_could_not_open_file" msgid="7041148341788958325">"\"<xliff:g id="FILE_NAME">%s</xliff:g>\" باز نشد: <xliff:g id="EXACT_REASON">%s</xliff:g>."</string>
<string name="fail_reason_could_not_initialize_exporter" msgid="1231982631020480035">"صادر کننده راهاندازی نشد: \"<xliff:g id="EXACT_REASON">%s</xliff:g>\"."</string>
<string name="fail_reason_no_exportable_contact" msgid="3717046989062541369">"هیچ مخاطب قابل صدوری موجود نیست."</string>
diff --git a/res/values-hy-rAM/strings.xml b/res/values-hy-rAM/strings.xml
index 77adf4d..62f7c32 100644
--- a/res/values-hy-rAM/strings.xml
+++ b/res/values-hy-rAM/strings.xml
@@ -230,13 +230,13 @@
<string name="activity_title_settings" msgid="3056389601004689380">"Կարգավորումներ"</string>
<string name="share_visible_contacts" msgid="2150662668080757107">"Փոխանցել տեսանելի կոնտակտները"</string>
<string name="share_visible_contacts_failure" msgid="5895137872238059893">"Չհաջողվեց համօգտագործել տեսանելի կոնտակտները:"</string>
- <string name="share_favorite_contacts" msgid="2838432887118216222">"Տրամադրել նախընտրած կոնտակտները"</string>
+ <string name="share_favorite_contacts" msgid="2838432887118216222">"Ուղարկել կոնտակտների ընտրանին"</string>
<string name="share_contacts" msgid="6404040163340914061">"Տրամադրել բոլոր կոնտակտները"</string>
<string name="share_contacts_failure" msgid="3498837575583860197">"Չհաջողվեց տրամադրել կոնտակտները:"</string>
<string name="dialog_import_export" msgid="1125776851100740858">"Կոնտակտների ներմուծում/արտահանում"</string>
<string name="dialog_import" msgid="5177004290082451296">"Ներմուծել կոնտակտներ"</string>
<string name="share_error" msgid="665756457151793108">"Հնարավոր չէ տարածել կոնտակտը:"</string>
- <string name="no_contact_to_share" msgid="5749367538191552509">"Կոնտակտներ չունեք, որոնցով կարող եք կիսվել:"</string>
+ <string name="no_contact_to_share" msgid="5749367538191552509">"Հասանելի կոնտակտներ չկան։"</string>
<string name="menu_search" msgid="7464453023659824700">"Որոնել"</string>
<string name="menu_contacts_filter" msgid="586356478145511794">"Ցուցադրվող կոնտկատներ"</string>
<string name="activity_title_contacts_filter" msgid="7689519428197855166">"Ցուցադրվող կոնտակտներ"</string>
@@ -258,7 +258,7 @@
<string name="settings_contact_display_options_title" msgid="1020420603072835628">"Կոնտակտի ցուցադրման ընտրանքները"</string>
<string name="select_account_dialog_title" msgid="5509088895267310568">"Հաշիվ"</string>
<string name="set_default_account" msgid="3865970860434642695">"Միշտ օգտագործել սա՝ զանգերի համար"</string>
- <string name="select_phone_account_for_calls" msgid="933905607702811164">"Զանգահարել հետևյալով"</string>
+ <string name="select_phone_account_for_calls" msgid="933905607702811164">"Զանգել հետևյալով"</string>
<string name="call_with_a_note" msgid="8453800473226831257">"Գրառումով զանգ"</string>
<string name="call_subject_hint" msgid="2270115162050853866">"Մուտքագրեք նշում՝ զանգի հետ ուղարկելու համար ..."</string>
<string name="send_and_call_button" msgid="7459507823002185202">"ՈՒՂԱՐԿԵԼ ԵՎ ԶԱՆԳԵԼ"</string>
diff --git a/res/values-my-rMM/strings.xml b/res/values-my-rMM/strings.xml
index 1e3aa1b..69481f3 100644
--- a/res/values-my-rMM/strings.xml
+++ b/res/values-my-rMM/strings.xml
@@ -65,7 +65,7 @@
<string name="sms_by_shortcut" msgid="2675928528835074838">"<xliff:g id="CONTACT_NAME">%s</xliff:g> (မက်ဆေ့ဂ်ျပို့ပါ)"</string>
<string name="description_video_call" msgid="4907306403398614909">"ဗီဒီယို ဖုန်းခေါ်ရန်"</string>
<string name="clearFrequentsConfirmation_title" msgid="1482750234535491083">"အသုံးများသောလိပ်စာများရှင်းပစ်မလား?"</string>
- <string name="clearFrequentsConfirmation" msgid="1117709667923254374">"အသုံးများသော အဆက်အသွယ်စာရင်းအား Contacts နှင့် Phone app များမှ သင် ရှင်းလင်းပစ်မှာဖြစ်ပြီး၊ အီးမေးလ် app များအား သင့်နှစ်သက်ရာ ပြောဆိုဆက်ဆံမှုပုံစံကို အစမှပြန်လည် လေ့လာခိုင်းမည်။"</string>
+ <string name="clearFrequentsConfirmation" msgid="1117709667923254374">"အသုံးများသော အဆက်အသွယ်စာရင်းအား Contacts နှင့် Phone အက်ပ်များမှ သင် ရှင်းလင်းပစ်မှာဖြစ်ပြီး၊ အီးမေးလ် အက်ပ်များအား သင့်နှစ်သက်ရာ ပြောဆိုဆက်ဆံမှုပုံစံကို အစမှပြန်လည် လေ့လာခိုင်းမည်။"</string>
<string name="clearFrequentsProgress_title" msgid="3738406170865048982">"အသုံးများသောလိပ်စာများ ရှင်းလင်းနေစဉ်"</string>
<string name="status_available" msgid="4832569677396634846">"ဆက်သွယ်နိုင်ပါသည်"</string>
<string name="status_away" msgid="6267905184545881094">"အဝေးရောက်နေပါသည်"</string>
@@ -145,7 +145,7 @@
<string name="chat_icq" msgid="7538190395602030726">"ICQ သုံး၍ ချက်တင်ပြုလုပ်ခြင်း"</string>
<string name="chat_jabber" msgid="4525546665986350869">"Jabberသုံး၍ ချက်တင်ပြုလုပ်ခြင်း"</string>
<string name="chat" msgid="6297650784873558837">"ချက်တင်းပြောသည်"</string>
- <string name="description_minus_button" msgid="2142439445814730827">"ဖျက်သည်"</string>
+ <string name="description_minus_button" msgid="2142439445814730827">"ဖျက်ရန်"</string>
<string name="expand_collapse_name_fields_description" msgid="5073419090665464541">"နာမည်အကွက်များအား ဖြန့်ချ သို့မဟုတ် လိပ်တင်ပါ"</string>
<string name="expand_collapse_phonetic_name_fields_description" msgid="5241493357460353777">"အသံထွက်ဆိုင်ရာ အကွက်များကို တိုးချဲ့ သို့မဟုတ် ခေါက်သိမ်းပါ"</string>
<string name="list_filter_all_accounts" msgid="4265359896628915784">"လိပ်စာများအားလုံး"</string>
@@ -160,7 +160,7 @@
<string name="display_warn_remove_ungrouped" msgid="7297678747857509619">"\"<xliff:g id="GROUP">%s</xliff:g>\" အား ထပ်တူပြုလုပ်ခြင်းမှ ဖယ်ထုတ်ခြင်းသည် တခြား အုပ်စုမလုပ်ထားသော အဆက်အသွယ်များအားလည်း ဖယ်ထုတ်ပါလိမ့်မည်။"</string>
<string name="savingDisplayGroups" msgid="6863012138107446030">"ပြသမှု ရွေးချယ်ခြင်းများ သိမ်းဆည်နေစဉ်…"</string>
<string name="menu_done" msgid="32470053723443112">"ပြီးပါပြီ"</string>
- <string name="menu_doNotSave" msgid="6012426160993364871">"မလုပ်တော့ပါ"</string>
+ <string name="menu_doNotSave" msgid="6012426160993364871">"မလုပ်တော့"</string>
<string name="listAllContactsInAccount" msgid="755499980092808715">"<xliff:g id="NAME">%s</xliff:g> ထဲမှ အဆက်အသွယ်များ"</string>
<string name="listCustomView" msgid="1915154113477432033">"မိမိစိတ်ကြိုက် မြင်ကွင်းမှ"</string>
<string name="listSingleContact" msgid="8525131203887307088">"အဆက်အသွယ်တစ်ခုတည်း"</string>
diff --git a/res/values-uz-rUZ/strings.xml b/res/values-uz-rUZ/strings.xml
index ea1c6e1..8d5b261 100644
--- a/res/values-uz-rUZ/strings.xml
+++ b/res/values-uz-rUZ/strings.xml
@@ -64,8 +64,8 @@
<string name="sms_mms" msgid="4887206338311086612">"MMS telefonga sms jo‘natish"</string>
<string name="sms_by_shortcut" msgid="2675928528835074838">"<xliff:g id="CONTACT_NAME">%s</xliff:g> (Xabar yozish)"</string>
<string name="description_video_call" msgid="4907306403398614909">"Videoqo‘ng‘iroq qilish"</string>
- <string name="clearFrequentsConfirmation_title" msgid="1482750234535491083">"Ko‘p gaplashilganlar tozalansinmi?"</string>
- <string name="clearFrequentsConfirmation" msgid="1117709667923254374">"Kontaktlar va Telefon ilovalaridagi tez-tez aloqa qilingan kontaktlar ro‘yxati tozalanadi hamda e-pochta ilovalari sizning shaxsiy sozlamalaringizga moslashadi."</string>
+ <string name="clearFrequentsConfirmation_title" msgid="1482750234535491083">"Bu ro‘yxat tozalansinmi?"</string>
+ <string name="clearFrequentsConfirmation" msgid="1117709667923254374">"Kontaktlar va Telefon ilovalaridagi tez-tez aloqa qilingan kontaktlar ro‘yxati tozalanadi hamda e-pochta ilovalari manzillarni eslab qolishni qaytadan boshlaydi."</string>
<string name="clearFrequentsProgress_title" msgid="3738406170865048982">"Ko‘p gaplashilganlar tozalanmoqda…"</string>
<string name="status_available" msgid="4832569677396634846">"Aloqada"</string>
<string name="status_away" msgid="6267905184545881094">"Tashqarida"</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 77c4677..d5aada5 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -43,7 +43,6 @@
<item name="android:layout_height">wrap_content</item>
<!-- See comments for @dimen/list_section_divider_min_height -->
<item name="android:minHeight">@dimen/list_section_divider_min_height</item>
- <item name="android:background">@drawable/list_section_divider_holo_custom</item>
<item name="android:textAppearance">@style/DirectoryHeaderStyle</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingLeft">8dip</item>
diff --git a/src-N/com/android/contacts/common/compat/BlockedNumberContractCompat.java b/src-N/com/android/contacts/common/compat/BlockedNumberContractCompat.java
deleted file mode 100644
index 0d6da5a..0000000
--- a/src-N/com/android/contacts/common/compat/BlockedNumberContractCompat.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.android.contacts.common.compat;
-
-import android.content.Context;
-import android.provider.BlockedNumberContract;
-
-public class BlockedNumberContractCompat {
- public static boolean canCurrentUserBlockNumbers(Context context) {
- return BlockedNumberContract.canCurrentUserBlockNumbers(context);
- }
-}
\ No newline at end of file
diff --git a/src-N/com/android/contacts/common/compat/CallSdkCompat.java b/src-N/com/android/contacts/common/compat/CallSdkCompat.java
deleted file mode 100644
index 3ad6e52..0000000
--- a/src-N/com/android/contacts/common/compat/CallSdkCompat.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.telecom.Call;
-
-public class CallSdkCompat {
- public static class Details {
- public static final int PROPERTY_ENTERPRISE_CALL = Call.Details.PROPERTY_ENTERPRISE_CALL;
- public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO =
- Call.Details.CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO;
- }
-}
diff --git a/src-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java b/src-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
deleted file mode 100644
index 288e442..0000000
--- a/src-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.content.Context;
-import android.provider.Settings;
-
-public class MetadataSyncEnabledCompat {
- public static boolean isMetadataSyncEnabled(Context context) {
- return android.provider.Settings.Global.getInt(
- context.getContentResolver(),
- Settings.Global.CONTACT_METADATA_SYNC_ENABLED, 0) == 1;
- }
-}
\ No newline at end of file
diff --git a/src-N/com/android/contacts/common/compat/PhoneLookupSdkCompat.java b/src-N/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
deleted file mode 100644
index 5f4abdd..0000000
--- a/src-N/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.net.Uri;
-
-public class PhoneLookupSdkCompat {
- // TODO: We should reference PhoneLookup.CONTACT_ID once we update the SDK.
- public static final String CONTACT_ID = "contact_id";
-}
diff --git a/src-N/com/android/contacts/common/compat/SdkSelectionUtils.java b/src-N/com/android/contacts/common/compat/SdkSelectionUtils.java
deleted file mode 100644
index 609dfb5..0000000
--- a/src-N/com/android/contacts/common/compat/SdkSelectionUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-/**
- * Provides information for the SDK the app is built against.
- * Specifically, information that change when the TARGET_N_SDK build flag is set in the makefile.
- * This is not related to the targetSdkVersion value in AndroidManifest.xml.
- *
- * Usage case will be branching test code in src/, instead of swapping between src-N and src-pre-N.
- */
-public class SdkSelectionUtils {
-
- /**
- * Whether the app is build against N SDK.
- *
- * Since Build.VERSION.SDK_INT remains 23 on N SDK for now, this is currently the only way to
- * check if we are building with N SDK or other.
- */
- public static final boolean TARGET_N_SDK = true;
-}
-
diff --git a/src-pre-N/com/android/contacts/common/compat/BlockedNumberContractCompat.java b/src-pre-N/com/android/contacts/common/compat/BlockedNumberContractCompat.java
deleted file mode 100644
index 170a0c3..0000000
--- a/src-pre-N/com/android/contacts/common/compat/BlockedNumberContractCompat.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.android.contacts.common.compat;
-
-import android.content.Context;
-
-public class BlockedNumberContractCompat {
- public static boolean canCurrentUserBlockNumbers(Context context) {
- return false;
- }
-}
\ No newline at end of file
diff --git a/src-pre-N/com/android/contacts/common/compat/CallSdkCompat.java b/src-pre-N/com/android/contacts/common/compat/CallSdkCompat.java
deleted file mode 100644
index 65e35fc..0000000
--- a/src-pre-N/com/android/contacts/common/compat/CallSdkCompat.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-public class CallSdkCompat {
- public static class Details {
- public static final int PROPERTY_ENTERPRISE_CALL = 0x00000020;
- public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 0x00400000;
- }
-}
diff --git a/src-pre-N/com/android/contacts/common/compat/DirectorySdkCompat.java b/src-pre-N/com/android/contacts/common/compat/DirectorySdkCompat.java
deleted file mode 100644
index d3015fe..0000000
--- a/src-pre-N/com/android/contacts/common/compat/DirectorySdkCompat.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 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.common.compat;
-
-import android.net.Uri;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.Directory;
-import android.util.Log;
-
-public class DirectorySdkCompat {
-
- private static final String TAG = "DirectorySdkCompat";
-
- public static final Uri ENTERPRISE_CONTENT_URI =
- Uri.withAppendedPath(ContactsContract.AUTHORITY_URI, "directories_enterprise");
- public static final long ENTERPRISE_LOCAL_DEFAULT = 1000000000L + Directory.DEFAULT;
- public static final long ENTERPRISE_LOCAL_INVISIBLE = 1000000000L + Directory.LOCAL_INVISIBLE;
-
- public static boolean isRemoteDirectoryId(long directoryId) {
- Log.wtf(TAG, "Not Implemented");
- return false;
- }
-
- public static boolean isEnterpriseDirectoryId(long directoryId) {
- Log.wtf(TAG, "Not Implemented");
- return false;
- }
-}
diff --git a/src-pre-N/com/android/contacts/common/compat/PhoneAccountSdkCompat.java b/src-pre-N/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
deleted file mode 100644
index 3c31e15..0000000
--- a/src-pre-N/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2015 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.common.compat;
-
-import android.os.Bundle;
-import android.telecom.PhoneAccount;
-import android.util.Log;
-
-public class PhoneAccountSdkCompat {
-
- private static final String TAG = "PhoneAccountSdkCompat";
-
- public static final String EXTRA_CALL_SUBJECT_MAX_LENGTH =
- "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH";
-
- public static final String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING =
- "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING";
-
- public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE = 256;
-
- public static Bundle getExtras(PhoneAccount account) {
- return null;
- }
-}
diff --git a/src-pre-N/com/android/contacts/common/compat/SdkSelectionUtils.java b/src-pre-N/com/android/contacts/common/compat/SdkSelectionUtils.java
deleted file mode 100644
index 98d004a..0000000
--- a/src-pre-N/com/android/contacts/common/compat/SdkSelectionUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-/**
- * Provides information for the SDK the app is built against.
- * Specifically, information that change when the TARGET_N_SDK build flag is set in the makefile.
- * This is not related to the targetSdkVersion value in AndroidManifest.xml.
- *
- * Usage case will be branching test code in src/, instead of using src-N/ and src-pre-N/
- */
-public class SdkSelectionUtils {
-
- /**
- * Whether the app is build against N SDK.
- *
- * Since Build.VERSION.SDK_INT remains 23 on N SDK for now, this is currently the only way to
- * check if we are building with N SDK or other.
- */
- public static final boolean TARGET_N_SDK = false;
-}
-
diff --git a/src-pre-N/com/android/contacts/common/compat/TelecomManagerUtil.java b/src-pre-N/com/android/contacts/common/compat/TelecomManagerUtil.java
deleted file mode 100644
index 7b12b93..0000000
--- a/src-pre-N/com/android/contacts/common/compat/TelecomManagerUtil.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.content.Intent;
-import android.telecom.TelecomManager;
-
-/**
- * Utility class for TelecomManager.
- */
-public class TelecomManagerUtil {
- /**
- * No-op implementation.
- */
- public static Intent createManageBlockedNumbersIntent(TelecomManager tm) {
- return null;
- }
-}
diff --git a/src-pre-N/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java b/src-pre-N/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
deleted file mode 100644
index f26850f..0000000
--- a/src-pre-N/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.net.Uri;
-import android.telecom.PhoneAccountHandle;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-
-/**
- * Placeholder class for pre-N.
- */
-public class TelephonyManagerSdkCompat {
-
- private static final String TAG = "TelephonyManagerSdk";
-
- public static Uri getVoicemailRingtoneUri(TelephonyManager telephonyManager,
- PhoneAccountHandle accountHandle) {
- Log.wtf(TAG, "Not implemented.");
- return null;
- }
-
- public static boolean isVoicemailVibrationEnabled(TelephonyManager telephonyManager,
- PhoneAccountHandle accountHandle) {
- Log.wtf(TAG, "Not implemented");
- return false;
- }
-}
diff --git a/src/com/android/contacts/common/ContactsUtils.java b/src/com/android/contacts/common/ContactsUtils.java
index c3531b1..38fdbf2 100644
--- a/src/com/android/contacts/common/ContactsUtils.java
+++ b/src/com/android/contacts/common/ContactsUtils.java
@@ -23,9 +23,7 @@
import android.os.Build;
import android.provider.ContactsContract.CommonDataKinds.Im;
import android.support.annotation.IntDef;
-import android.support.v4.os.BuildCompat;
import android.provider.ContactsContract.DisplayPhoto;
-import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Pair;
@@ -34,7 +32,6 @@
import com.android.contacts.common.testing.NeededForTesting;
import com.android.contacts.common.compat.ContactsCompat;
import com.android.contacts.common.compat.DirectoryCompat;
-import com.android.contacts.common.compat.SdkSelectionUtils;
import com.android.contacts.common.model.AccountTypeManager;
import java.lang.annotation.Retention;
@@ -53,7 +50,7 @@
private static int sThumbnailSize = -1;
- public static final boolean FLAG_N_FEATURE = BuildCompat.isAtLeastN();
+ public static final boolean FLAG_N_FEATURE = Build.VERSION.SDK_INT >= 24;
// TODO find a proper place for the canonical version of these
public interface ProviderNames {
diff --git a/src/com/android/contacts/common/MoreContactUtils.java b/src/com/android/contacts/common/MoreContactUtils.java
index 546b978..7c6201c 100755
--- a/src/com/android/contacts/common/MoreContactUtils.java
+++ b/src/com/android/contacts/common/MoreContactUtils.java
@@ -678,10 +678,6 @@
mValues.put(SimContactsConstants.STR_TAG, name);
if (!TextUtils.isEmpty(number)) {
number = PhoneNumberUtils.stripSeparators(number);
- if (number.length() > MAX_LENGTH_NUMBER_IN_SIM) {
- number = number.substring(0, MAX_LENGTH_NUMBER_IN_SIM);
- }
-
mValues.put(SimContactsConstants.STR_NUMBER, number);
}
if (!TextUtils.isEmpty(emails)) {
diff --git a/src/com/android/contacts/common/compat/CallSdkCompat.java b/src/com/android/contacts/common/compat/CallSdkCompat.java
new file mode 100644
index 0000000..bfc559a
--- /dev/null
+++ b/src/com/android/contacts/common/compat/CallSdkCompat.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2016 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.common.compat;
+
+import android.telecom.Call;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+public class CallSdkCompat {
+ public static class Details {
+ public static final int PROPERTY_IS_EXTERNAL_CALL = Call.Details.PROPERTY_IS_EXTERNAL_CALL;
+ public static final int PROPERTY_ENTERPRISE_CALL = Call.Details.PROPERTY_ENTERPRISE_CALL;
+ public static final int CAPABILITY_CAN_PULL_CALL = Call.Details.CAPABILITY_CAN_PULL_CALL;
+ public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO =
+ Call.Details.CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO;
+ }
+
+ /**
+ * TODO: This API is hidden in the N release; replace the implementation with a call to the
+ * actual once it is made public.
+ */
+ public static void pullExternalCall(Call call) {
+ if (!CompatUtils.isNCompatible()) {
+ return;
+ }
+ Class<?> callClass = Call.class;
+ try {
+ Method pullExternalCallMethod = callClass.getDeclaredMethod("pullExternalCall");
+ pullExternalCallMethod.invoke(call);
+ } catch (NoSuchMethodException e) {
+ // Ignore requests to pull call if there is a problem.
+ } catch (InvocationTargetException e) {
+ // Ignore requests to pull call if there is a problem.
+ } catch (IllegalAccessException e) {
+ // Ignore requests to pull call if there is a problem.
+ }
+ }
+}
diff --git a/src/com/android/contacts/common/compat/CompatUtils.java b/src/com/android/contacts/common/compat/CompatUtils.java
index c290c59..567f183 100644
--- a/src/com/android/contacts/common/compat/CompatUtils.java
+++ b/src/com/android/contacts/common/compat/CompatUtils.java
@@ -18,14 +18,12 @@
import android.os.Build;
import android.os.Build.VERSION;
import android.support.annotation.Nullable;
-import android.support.v4.os.BuildCompat;
import android.text.TextUtils;
import android.util.Log;
import com.android.contacts.common.model.CPOWrapper;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
public final class CompatUtils {
@@ -172,7 +170,7 @@
* false} otherwise.
*/
public static boolean isNCompatible() {
- return BuildCompat.isAtLeastN();
+ return VERSION.SDK_INT >= 24;
}
/**
diff --git a/src-N/com/android/contacts/common/compat/DirectorySdkCompat.java b/src/com/android/contacts/common/compat/DirectorySdkCompat.java
similarity index 86%
rename from src-N/com/android/contacts/common/compat/DirectorySdkCompat.java
rename to src/com/android/contacts/common/compat/DirectorySdkCompat.java
index 57d20a6..b919466 100644
--- a/src-N/com/android/contacts/common/compat/DirectorySdkCompat.java
+++ b/src/com/android/contacts/common/compat/DirectorySdkCompat.java
@@ -17,7 +17,6 @@
package com.android.contacts.common.compat;
import android.net.Uri;
-import android.provider.ContactsContract;
import android.provider.ContactsContract.Directory;
public class DirectorySdkCompat {
@@ -29,10 +28,10 @@
public static final long ENTERPRISE_LOCAL_INVISIBLE = Directory.ENTERPRISE_LOCAL_INVISIBLE;
public static boolean isRemoteDirectoryId(long directoryId) {
- return Directory.isRemoteDirectoryId(directoryId);
+ return CompatUtils.isNCompatible() ? Directory.isRemoteDirectoryId(directoryId) : false;
}
public static boolean isEnterpriseDirectoryId(long directoryId) {
- return Directory.isEnterpriseDirectoryId(directoryId);
+ return CompatUtils.isNCompatible() ? Directory.isEnterpriseDirectoryId(directoryId) : false;
}
}
diff --git a/src-pre-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java b/src/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
similarity index 79%
rename from src-pre-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
rename to src/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
index b7e9fd2..4a9650f 100644
--- a/src-pre-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
+++ b/src/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
@@ -21,6 +21,9 @@
public class MetadataSyncEnabledCompat {
public static boolean isMetadataSyncEnabled(Context context) {
- return false;
+ return CompatUtils.isNCompatible()
+ ? (Settings.Global.getInt(context.getContentResolver(),
+ Settings.Global.CONTACT_METADATA_SYNC_ENABLED, 0) == 1)
+ : false;
}
}
\ No newline at end of file
diff --git a/src-pre-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java b/src/com/android/contacts/common/compat/MultiWindowCompat.java
similarity index 69%
copy from src-pre-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
copy to src/com/android/contacts/common/compat/MultiWindowCompat.java
index b7e9fd2..6641279 100644
--- a/src-pre-N/com/android/contacts/common/compat/MetadataSyncEnabledCompat.java
+++ b/src/com/android/contacts/common/compat/MultiWindowCompat.java
@@ -16,11 +16,13 @@
package com.android.contacts.common.compat;
-import android.content.Context;
-import android.provider.Settings;
+import android.app.Activity;
-public class MetadataSyncEnabledCompat {
- public static boolean isMetadataSyncEnabled(Context context) {
- return false;
+public class MultiWindowCompat {
+ /**
+ * Returns true if the activity is currently in multi-window mode.
+ */
+ public static boolean isInMultiWindowMode(Activity activity) {
+ return CompatUtils.isNCompatible() ? activity.isInMultiWindowMode() : false;
}
}
\ No newline at end of file
diff --git a/src-N/com/android/contacts/common/compat/PhoneAccountSdkCompat.java b/src/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
similarity index 94%
rename from src-N/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
rename to src/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
index a7a1b8f..5cbf617 100644
--- a/src-N/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
+++ b/src/com/android/contacts/common/compat/PhoneAccountSdkCompat.java
@@ -32,6 +32,6 @@
PhoneAccount.CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE;
public static Bundle getExtras(PhoneAccount account) {
- return account.getExtras();
+ return CompatUtils.isNCompatible() ? account.getExtras() : null;
}
}
diff --git a/src-pre-N/com/android/contacts/common/compat/PhoneLookupSdkCompat.java b/src/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
similarity index 84%
rename from src-pre-N/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
rename to src/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
index df31f68..0c0a898 100644
--- a/src-pre-N/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
+++ b/src/com/android/contacts/common/compat/PhoneLookupSdkCompat.java
@@ -16,8 +16,8 @@
package com.android.contacts.common.compat;
-import android.provider.ContactsContract.Data;
+import android.provider.ContactsContract;
public class PhoneLookupSdkCompat {
- public static final String CONTACT_ID = Data.CONTACT_ID;
+ public static final String CONTACT_ID = ContactsContract.PhoneLookup.CONTACT_ID;
}
diff --git a/src-N/com/android/contacts/common/compat/TelecomManagerUtil.java b/src/com/android/contacts/common/compat/TelecomManagerUtil.java
similarity index 91%
rename from src-N/com/android/contacts/common/compat/TelecomManagerUtil.java
rename to src/com/android/contacts/common/compat/TelecomManagerUtil.java
index 5ece783..30c541c 100644
--- a/src-N/com/android/contacts/common/compat/TelecomManagerUtil.java
+++ b/src/com/android/contacts/common/compat/TelecomManagerUtil.java
@@ -26,6 +26,6 @@
* Creates {@link Intent} to launch the activity to manage blocked numbers.
*/
public static Intent createManageBlockedNumbersIntent(TelecomManager tm) {
- return tm.createManageBlockedNumbersIntent();
+ return CompatUtils.isNCompatible() ? tm.createManageBlockedNumbersIntent() : null;
}
}
diff --git a/src-N/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java b/src/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
similarity index 82%
rename from src-N/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
rename to src/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
index e6cbba1..acabfdf 100644
--- a/src-N/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
+++ b/src/com/android/contacts/common/compat/TelephonyManagerSdkCompat.java
@@ -26,11 +26,13 @@
public class TelephonyManagerSdkCompat {
public static Uri getVoicemailRingtoneUri(TelephonyManager telephonyManager,
PhoneAccountHandle accountHandle) {
- return telephonyManager.getVoicemailRingtoneUri(accountHandle);
+ return CompatUtils.isNCompatible()
+ ? telephonyManager.getVoicemailRingtoneUri(accountHandle) : null;
}
public static boolean isVoicemailVibrationEnabled(TelephonyManager telephonyManager,
PhoneAccountHandle accountHandle) {
- return telephonyManager.isVoicemailVibrationEnabled(accountHandle);
+ return CompatUtils.isNCompatible()
+ ? telephonyManager.isVoicemailVibrationEnabled(accountHandle) : false;
}
}
diff --git a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java
index ee5bbbc..880411f 100755
--- a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java
+++ b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java
@@ -624,11 +624,6 @@
for (int j = 1; j < phoneCountInOneSimContact; j++) {
if (arrayNumber.size() > 0 && emptyAnr-- > 0 ) {
String s = arrayNumber.remove(0);
- if (s.length() > MoreContactUtils
- .MAX_LENGTH_NUMBER_IN_SIM) {
- s = s.substring(0,
- MoreContactUtils.MAX_LENGTH_NUMBER_IN_SIM);
- }
anrNum.append(s);
anrNum.append(SimContactsConstants.ANR_SEP);
}
@@ -638,11 +633,6 @@
for (int j = 0; j < emailCountInOneSimContact; j++) {
if (arrayEmail.size() > 0) {
String s = arrayEmail.remove(0);
- if (s.length() > MoreContactUtils
- .MAX_LENGTH_EMAIL_IN_SIM) {
- s = s.substring(0,
- MoreContactUtils.MAX_LENGTH_EMAIL_IN_SIM);
- }
email.append(s);
email.append(SimContactsConstants.EMAIL_SEP);
}
diff --git a/src/com/android/contacts/common/list/ShortcutIntentBuilder.java b/src/com/android/contacts/common/list/ShortcutIntentBuilder.java
index 1f779b4..9a9dcdd 100644
--- a/src/com/android/contacts/common/list/ShortcutIntentBuilder.java
+++ b/src/com/android/contacts/common/list/ShortcutIntentBuilder.java
@@ -346,7 +346,7 @@
} else {
phoneUri = Uri.fromParts(ContactsUtils.SCHEME_SMSTO, phoneNumber, null);
bitmap = generatePhoneNumberIcon(drawable, phoneType, phoneLabel,
- R.drawable.ic_message_24dp);
+ R.drawable.ic_message_24dp_mirrored);
}
Intent shortcutIntent = new Intent(shortcutAction, phoneUri);
diff --git a/src/com/android/contacts/common/model/ValuesDelta.java b/src/com/android/contacts/common/model/ValuesDelta.java
old mode 100644
new mode 100755
index 245e21c..8b45aa3
--- a/src/com/android/contacts/common/model/ValuesDelta.java
+++ b/src/com/android/contacts/common/model/ValuesDelta.java
@@ -24,9 +24,11 @@
import android.provider.BaseColumns;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Data;
+import android.provider.ContactsContract.RawContacts;
import com.android.contacts.common.compat.CompatUtils;
import com.android.contacts.common.model.BuilderWrapper;
+import com.android.contacts.common.model.account.ExchangeAccountType;
import com.android.contacts.common.testing.NeededForTesting;
import com.google.common.collect.Sets;
@@ -64,11 +66,14 @@
final ValuesDelta entry = new ValuesDelta();
entry.mBefore = before;
entry.mAfter = new ContentValues();
+ String account = before.getAsString(RawContacts.ACCOUNT_TYPE);
// init data1 to mAfter map. when no operation edittext of
// sim phone in the UI, the mAfter init have no data1 value,
// it will cause the builddiff data not right.
- if (before.containsKey(Data.DATA1)) {
+ if (before.containsKey(Data.DATA1)
+ && (account == null || account != null
+ && !ExchangeAccountType.isExchangeType(account))) {
String contactInfo = before.getAsString(Data.DATA1);
if (null != contactInfo && !"".equals(contactInfo)) {
entry.mAfter.put(Data.DATA1, contactInfo);
diff --git a/src/com/android/contacts/common/model/account/BaseAccountType.java b/src/com/android/contacts/common/model/account/BaseAccountType.java
old mode 100755
new mode 100644
index 546c115..0c57c9a
--- a/src/com/android/contacts/common/model/account/BaseAccountType.java
+++ b/src/com/android/contacts/common/model/account/BaseAccountType.java
@@ -119,7 +119,7 @@
this.accountType = null;
this.dataSet = null;
this.titleRes = R.string.account_phone;
- this.iconRes = R.mipmap.ic_contacts_launcher;
+ this.iconRes = R.drawable.unknown_source;
}
protected static EditType buildPhoneType(int type) {
@@ -256,7 +256,7 @@
protected DataKind addDataKindPhone(Context context) throws DefinitionException {
DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup,
Weight.PHONE, true));
- kind.iconAltRes = R.drawable.ic_message_24dp;
+ kind.iconAltRes = R.drawable.ic_message_24dp_mirrored;
kind.iconAltDescriptionRes = R.string.sms;
kind.actionHeader = new PhoneActionInflater();
kind.actionAltHeader = new PhoneActionAltInflater();
@@ -1044,7 +1044,7 @@
Phone.CONTENT_ITEM_TYPE, Phone.TYPE, R.string.phoneLabelsGroup, Weight.PHONE,
new PhoneActionInflater(), new SimpleInflater(Phone.NUMBER));
- kind.iconAltRes = R.drawable.ic_message_24dp;
+ kind.iconAltRes = R.drawable.ic_message_24dp_mirrored;
kind.iconAltDescriptionRes = R.string.sms;
kind.actionAltHeader = new PhoneActionAltInflater();
diff --git a/src/com/android/contacts/common/model/account/FallbackAccountType.java b/src/com/android/contacts/common/model/account/FallbackAccountType.java
index 0479c83..872b765 100644
--- a/src/com/android/contacts/common/model/account/FallbackAccountType.java
+++ b/src/com/android/contacts/common/model/account/FallbackAccountType.java
@@ -30,7 +30,7 @@
this.accountType = null;
this.dataSet = null;
this.titleRes = R.string.account_phone;
- this.iconRes = R.mipmap.ic_contacts_launcher;
+ this.iconRes = R.drawable.unknown_source;
// Note those are only set for unit tests.
this.resourcePackageName = resPackageName;
diff --git a/src/com/android/contacts/common/preference/DisplayOptionsPreferenceFragment.java b/src/com/android/contacts/common/preference/DisplayOptionsPreferenceFragment.java
index cbcb7da..a6103b0 100644
--- a/src/com/android/contacts/common/preference/DisplayOptionsPreferenceFragment.java
+++ b/src/com/android/contacts/common/preference/DisplayOptionsPreferenceFragment.java
@@ -25,7 +25,6 @@
import com.android.contacts.common.R;
import com.android.contacts.common.model.AccountTypeManager;
import com.android.contacts.common.model.account.AccountWithDataSet;
-import com.android.contacts.common.model.account.GoogleAccountType;
import com.android.contacts.commonbind.ObjectFactory;
import java.util.List;
@@ -91,4 +90,3 @@
return getActivity();
}
}
-
diff --git a/src/com/android/contacts/common/vcard/NfcImportVCardActivity.java b/src/com/android/contacts/common/vcard/NfcImportVCardActivity.java
index 0634df4..6093405 100644
--- a/src/com/android/contacts/common/vcard/NfcImportVCardActivity.java
+++ b/src/com/android/contacts/common/vcard/NfcImportVCardActivity.java
@@ -17,6 +17,8 @@
package com.android.contacts.common.vcard;
import android.app.Activity;
+import android.app.Notification;
+import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -27,9 +29,11 @@
import android.nfc.NfcAdapter;
import android.os.AsyncTask;
import android.os.Bundle;
+import android.os.Handler;
import android.os.IBinder;
import android.provider.ContactsContract.RawContacts;
import android.util.Log;
+import android.widget.Toast;
import com.android.contacts.common.R;
import com.android.contacts.common.activity.RequestPermissionsActivity;
@@ -59,6 +63,12 @@
private NdefRecord mRecord;
private AccountWithDataSet mAccount;
+ private Handler mHandler = new Handler();
+
+ /**
+ * Notification id used when error happened before sending an import request to VCardServer.
+ */
+ private static final int FAILURE_NOTIFICATION_ID = 1;
/* package */ class ImportTask extends AsyncTask<VCardService, Void, ImportRequest> {
@Override
@@ -81,6 +91,10 @@
@Override
public void onPostExecute(ImportRequest request) {
+ if (request == null) {
+ // Finish the activity in case of error so it doesn't stay in view.
+ finish();
+ }
unbindService(NfcImportVCardActivity.this);
}
}
@@ -111,6 +125,8 @@
parser.addInterpreter(detector);
parser.parse(is);
} catch (VCardVersionException e2) {
+ Log.e(TAG, "vCard with unsupported version.");
+ showFailureNotification(R.string.fail_reason_not_supported);
return null;
}
} finally {
@@ -120,14 +136,16 @@
}
}
} catch (IOException e) {
- Log.e(TAG, "Failed reading vcard data", e);
+ Log.e(TAG, "Failed reading vCard data", e);
+ showFailureNotification(R.string.fail_reason_io_error);
return null;
} catch (VCardNestedException e) {
Log.w(TAG, "Nested Exception is found (it may be false-positive).");
// Go through without throwing the Exception, as we may be able to detect the
// version before it
} catch (VCardException e) {
- Log.e(TAG, "Error parsing vcard", e);
+ Log.e(TAG, "Error parsing vCard", e);
+ showFailureNotification(R.string.fail_reason_not_supported);
return null;
}
@@ -242,7 +260,8 @@
Log.i(TAG, "Late import failure -- ignoring");
return;
}
- // TODO: report failure
+ showFailureNotification(R.string.vcard_import_request_rejected_message);
+ finish();
}
@Override
@@ -269,4 +288,22 @@
public void onComplete() {
// do nothing
}
+
+ /* package */ void showFailureNotification(int reasonId) {
+ final NotificationManager notificationManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ final Notification notification =
+ NotificationImportExportListener.constructImportFailureNotification(
+ this,
+ getString(reasonId));
+ notificationManager.notify(NotificationImportExportListener.FAILURE_NOTIFICATION_TAG,
+ FAILURE_NOTIFICATION_ID, notification);
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ Toast.makeText(NfcImportVCardActivity.this,
+ getString(R.string.vcard_import_failed), Toast.LENGTH_LONG).show();
+ }
+ });
+ }
}
diff --git a/tests/src-N/com/android/contacts/common/compat/SdkSelectionUtilsTest.java b/tests/src-N/com/android/contacts/common/compat/SdkSelectionUtilsTest.java
deleted file mode 100644
index 20c96b7..0000000
--- a/tests/src-N/com/android/contacts/common/compat/SdkSelectionUtilsTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-// @formatter:off
-/**
- * Run test with
- * adb shell am instrument -e class com.android.dialer.SdkSelectionUtilsTest -w com.google.android.dialer.tests/android.test.InstrumentationTestRunner
- */
-// @formatter:on
-@SmallTest
-public class SdkSelectionUtilsTest extends AndroidTestCase {
-
- public void testTargetNSdk_True() {
- assertTrue(SdkSelectionUtils.TARGET_N_SDK);
- }
-}
diff --git a/tests/src-pre-N/com/android/contacts/common/compat/SdkSelectionUtilsTest.java b/tests/src-pre-N/com/android/contacts/common/compat/SdkSelectionUtilsTest.java
deleted file mode 100644
index e7e3f67..0000000
--- a/tests/src-pre-N/com/android/contacts/common/compat/SdkSelectionUtilsTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2016 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.common.compat;
-
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-// @formatter:off
-/**
- * Run test with
- * adb shell am instrument -e class com.android.dialer.SdkSelectionUtilsTest -w com.google.android.dialer.tests/android.test.InstrumentationTestRunner
- */
-// @formatter:on
-@SmallTest
-public class SdkSelectionUtilsTest extends AndroidTestCase {
-
- public void testTargetNSdk_False() {
- assertFalse(SdkSelectionUtils.TARGET_N_SDK);
- }
-}