Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42c15133 authored by Wenyi Wang's avatar Wenyi Wang Committed by android-build-merger
Browse files

Fix helper methods in contacts utils

am: f0f6f3110f

* commit 'f0f6f3110faa155fe36d93fd521e3f94c9624bb9':
  Fix helper methods in contacts utils

Change-Id: Ic675c308f95c8387eb1cdeda23bc62cc2b892077
parents a8231e1c 7256d34a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.contacts.common.model.dataitem.ImDataItem;
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;
@@ -51,7 +52,9 @@ public class ContactsUtils {

    private static int sThumbnailSize = -1;

    public static final boolean FLAG_N_FEATURE = Build.VERSION.SDK_INT > Build.VERSION_CODES.M;
    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")

    // TODO find a proper place for the canonical version of these
    public interface ProviderNames {
+3 −1
Original line number Diff line number Diff line
@@ -176,7 +176,9 @@ public final class CompatUtils {
        // SdkVersionOverride doesn't work here because VERSION.SDK_INT remains 23 (same as M)
        // before N is release

        return Build.VERSION.SDK_INT > Build.VERSION_CODES.M;  // Run time flag
        // 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
    }

    /**