Reference BUILD_CODES.M instead of 23.
Bug: 21518334
Change-Id: I653cb80d4d01f6eb4e31a46551e264924dda7d89
diff --git a/src/com/android/ex/chips/ChipsUtil.java b/src/com/android/ex/chips/ChipsUtil.java
index 3509f0e..9c299fa 100644
--- a/src/com/android/ex/chips/ChipsUtil.java
+++ b/src/com/android/ex/chips/ChipsUtil.java
@@ -51,9 +51,8 @@
* <p>This is interesting for us because new permission model is introduced in M and we need to
* check if we have {@link #REQUIRED_PERMISSIONS}.
*/
- public static boolean isRunningMncOrLater() {
- // TODO: Update to use M once it's finalized in VERSION_CODES
- return Build.VERSION.SDK_INT > 22;
+ public static boolean isRunningMOrLater() {
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
}
/**
@@ -61,7 +60,7 @@
* {@link PackageManager#PERMISSION_DENIED} if not.
*/
public static int checkPermission(Context context, String permission) {
- if (isRunningMncOrLater()) {
+ if (isRunningMOrLater()) {
// TODO: Use "context.checkSelfPermission(permission)" once it's safe to move to M sdk
return context.checkPermission(permission, Process.myPid(), Process.myUid());
} else {