Import translations. DO NOT MERGE am: f94915ecff  -s ours am: 22cbb12e04  -s ours am: d7864dcef8  -s ours am: 9ee7b1f6ee  -s ours
am: 157b11937f  -s ours

Change-Id: I27d0bac9e8fa8854a1e9a8d123ae32af95aef819
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/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/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/list/ShortcutIntentBuilder.java b/src/com/android/contacts/common/list/ShortcutIntentBuilder.java
index ea01caa..f30a176 100644
--- a/src/com/android/contacts/common/list/ShortcutIntentBuilder.java
+++ b/src/com/android/contacts/common/list/ShortcutIntentBuilder.java
@@ -316,7 +316,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/account/BaseAccountType.java b/src/com/android/contacts/common/model/account/BaseAccountType.java
index 214ba77..6481c06 100644
--- a/src/com/android/contacts/common/model/account/BaseAccountType.java
+++ b/src/com/android/contacts/common/model/account/BaseAccountType.java
@@ -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();
@@ -1045,7 +1045,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/dataitem/DataItem.java b/src/com/android/contacts/common/model/dataitem/DataItem.java
index 780f4f5..4e66e32 100644
--- a/src/com/android/contacts/common/model/dataitem/DataItem.java
+++ b/src/com/android/contacts/common/model/dataitem/DataItem.java
@@ -152,7 +152,8 @@
      *      video calling, {@code 0} otherwise.
      */
     public int getCarrierPresence() {
-        return mContentValues.getAsInteger(Data.CARRIER_PRESENCE);
+        final Integer value = mContentValues.getAsInteger(Data.CARRIER_PRESENCE);
+        return value != null ? value.intValue() : 0;
     }
 
     /**
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);
-    }
-}