Add isAtLeastN in OsUtil
am: 0a85b81c9f
* commit '0a85b81c9f15f72e7284a8ff40f1ba73d7469b58':
Add isAtLeastN in OsUtil
Change-Id: I1228ea3876d08e69e438c87809a08bbd9ea60cc9
This commit is contained in:
@@ -22,6 +22,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
|
import android.support.v4.os.BuildCompat;
|
||||||
|
|
||||||
import com.android.messaging.Factory;
|
import com.android.messaging.Factory;
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@ public class OsUtil {
|
|||||||
private static boolean sIsAtLeastL;
|
private static boolean sIsAtLeastL;
|
||||||
private static boolean sIsAtLeastL_MR1;
|
private static boolean sIsAtLeastL_MR1;
|
||||||
private static boolean sIsAtLeastM;
|
private static boolean sIsAtLeastM;
|
||||||
|
private static boolean sIsAtLeastN;
|
||||||
|
|
||||||
private static Boolean sIsSecondaryUser = null;
|
private static Boolean sIsSecondaryUser = null;
|
||||||
|
|
||||||
@@ -54,6 +56,7 @@ public class OsUtil {
|
|||||||
sIsAtLeastL = v >= android.os.Build.VERSION_CODES.LOLLIPOP;
|
sIsAtLeastL = v >= android.os.Build.VERSION_CODES.LOLLIPOP;
|
||||||
sIsAtLeastL_MR1 = v >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1;
|
sIsAtLeastL_MR1 = v >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1;
|
||||||
sIsAtLeastM = v >= android.os.Build.VERSION_CODES.M;
|
sIsAtLeastM = v >= android.os.Build.VERSION_CODES.M;
|
||||||
|
sIsAtLeastN = BuildCompat.isAtLeastN();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,6 +123,14 @@ public class OsUtil {
|
|||||||
return sIsAtLeastM;
|
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.
|
* @return The Android API version of the OS that we're currently running on.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user