summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenyi Wang <wenyiw@google.com>2016-06-01 23:30:50 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-06-01 23:30:50 +0000
commit09e92d1890393e964fed58f626d3e3aa2c9861f9 (patch)
treea0143dd07025cb69b2556b5167593c40b52acbb5
parent14c051cf82d05ab3d9e83a8c16e7c5a872868cc6 (diff)
parentedbbd6d89137a3addf82d121cb3d785fe3074889 (diff)
downloadpackages_apps_ContactsCommon-09e92d1890393e964fed58f626d3e3aa2c9861f9.tar.gz
packages_apps_ContactsCommon-09e92d1890393e964fed58f626d3e3aa2c9861f9.tar.bz2
packages_apps_ContactsCommon-09e92d1890393e964fed58f626d3e3aa2c9861f9.zip
Get rid of CODENAME and use BuildCompat instead
am: edbbd6d891 * commit 'edbbd6d89137a3addf82d121cb3d785fe3074889': Get rid of CODENAME and use BuildCompat instead Change-Id: If73e1085bfd040e6215a7cf345ad96145900744a
-rw-r--r--src/com/android/contacts/common/ContactsUtils.java5
-rw-r--r--src/com/android/contacts/common/compat/CompatUtils.java10
2 files changed, 4 insertions, 11 deletions
diff --git a/src/com/android/contacts/common/ContactsUtils.java b/src/com/android/contacts/common/ContactsUtils.java
index d05902dc..c3531b10 100644
--- a/src/com/android/contacts/common/ContactsUtils.java
+++ b/src/com/android/contacts/common/ContactsUtils.java
@@ -23,6 +23,7 @@ import android.net.Uri;
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;
@@ -52,9 +53,7 @@ public class ContactsUtils {
private static int sThumbnailSize = -1;
- public static final boolean FLAG_N_FEATURE = SdkSelectionUtils.TARGET_N_SDK // build-time flag
- && (Build.VERSION.SDK_INT > Build.VERSION_CODES.M // runtime flag
- || Build.VERSION.CODENAME.startsWith("N")); // TODO: remove startsWith("N")
+ public static final boolean FLAG_N_FEATURE = BuildCompat.isAtLeastN();
// TODO find a proper place for the canonical version of these
public interface ProviderNames {
diff --git a/src/com/android/contacts/common/compat/CompatUtils.java b/src/com/android/contacts/common/compat/CompatUtils.java
index e9e8300d..c290c59b 100644
--- a/src/com/android/contacts/common/compat/CompatUtils.java
+++ b/src/com/android/contacts/common/compat/CompatUtils.java
@@ -18,6 +18,7 @@ package com.android.contacts.common.compat;
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;
@@ -41,8 +42,6 @@ public final class CompatUtils {
public final static int TYPE_ASSERT = 4;
- private final static Boolean CODENAME_STARTS_WITH_N = VERSION.CODENAME.startsWith("N");
-
/**
* Returns whether the operation in CPOWrapper is of TYPE_INSERT;
*/
@@ -173,12 +172,7 @@ public final class CompatUtils {
* false} otherwise.
*/
public static boolean isNCompatible() {
- // SdkVersionOverride doesn't work here because VERSION.SDK_INT remains 23 (same as M)
- // before N is release
-
- // TODO: remove build time check and use proper runtime check once N is released.
- return SdkSelectionUtils.TARGET_N_SDK // Build time flag
- && CODENAME_STARTS_WITH_N; // Run time flag
+ return BuildCompat.isAtLeastN();
}
/**