Add isAtLeastN in OsUtil am: 0a85b81c9f am: 53103d0433
am: 07ceb80aa7
* commit '07ceb80aa713a5d20acd49fed758daefcbaa8f2a':
Add isAtLeastN in OsUtil
Change-Id: Ia339cbd179e30bae3dcbc315b6771b84f31b8660
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user