Merge "Fix isAtLeastN() on builds where the codename is REL" into nyc-dev
am: 55d496764c
* commit '55d496764c8989cdf5da7ef3497b19988eea8f5b':
Fix isAtLeastN() on builds where the codename is REL
Change-Id: I6465397cf50f0a0e32c41312ae37f9a681c58350
diff --git a/v4/donut/android/support/v4/os/BuildCompat.java b/v4/donut/android/support/v4/os/BuildCompat.java
index cf35e7b..9792598 100644
--- a/v4/donut/android/support/v4/os/BuildCompat.java
+++ b/v4/donut/android/support/v4/os/BuildCompat.java
@@ -31,13 +31,13 @@
/**
* Check if the device is running on the Android N release or newer.
* This method is suitable for use with preview SDKs and associated
- * prerelease device builds.
+ * pre-release device builds.
*
- * @return true if N APIs are available for use
+ * @return {@code true} if N APIs are available for use
*/
public static boolean isAtLeastN() {
- if (TextUtils.isEmpty(VERSION.CODENAME)) {
- return false;
+ if (TextUtils.isEmpty(VERSION.CODENAME) || "REL".equals(VERSION.CODENAME)) {
+ return VERSION.SDK_INT > 23;
}
final char prefix = VERSION.CODENAME.charAt(0);
return prefix >= 'N' && prefix <= 'Z';