summaryrefslogtreecommitdiffstats
path: root/src/com/android/messaging/util/OsUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/messaging/util/OsUtil.java')
-rw-r--r--src/com/android/messaging/util/OsUtil.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/messaging/util/OsUtil.java b/src/com/android/messaging/util/OsUtil.java
index e45a63c..4890d08 100644
--- a/src/com/android/messaging/util/OsUtil.java
+++ b/src/com/android/messaging/util/OsUtil.java
@@ -22,6 +22,7 @@ import android.content.pm.PackageManager;
import android.os.Build;
import android.os.UserHandle;
import android.os.UserManager;
+import android.support.v4.os.BuildCompat;
import com.android.messaging.Factory;
@@ -41,6 +42,7 @@ public class OsUtil {
private static boolean sIsAtLeastL;
private static boolean sIsAtLeastL_MR1;
private static boolean sIsAtLeastM;
+ private static boolean sIsAtLeastN;
private static Boolean sIsSecondaryUser = null;
@@ -54,6 +56,7 @@ public class OsUtil {
sIsAtLeastL = v >= android.os.Build.VERSION_CODES.LOLLIPOP;
sIsAtLeastL_MR1 = v >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1;
sIsAtLeastM = v >= android.os.Build.VERSION_CODES.M;
+ sIsAtLeastN = BuildCompat.isAtLeastN();
}
/**
@@ -121,6 +124,14 @@ public class OsUtil {
}
/**
+ * @return True if the version of Android that we're running on is at least N
+ * (API level 24).
+ */
+ public static boolean isAtLeastN() {
+ return sIsAtLeastN;
+ }
+
+ /**
* @return The Android API version of the OS that we're currently running on.
*/
public static int getApiVersion() {