Add isAtLeastN in OsUtil am: 0a85b81c9f

am: 53103d0433

* commit '53103d043362668e4773ed45cae5777fef24bfbb':
  Add isAtLeastN in OsUtil

Change-Id: I3a2530cdbfa0b34610e6c58a011d89e15e993df9
This commit is contained in:
Victor Chang
2016-05-16 15:47:08 +00:00
committed by android-build-merger

View File

@@ -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();
}
/**
@@ -120,6 +123,14 @@ public class OsUtil {
return sIsAtLeastM;
}
/**
* @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.
*/