Merge "Add Build.isAtLeastO"
This commit is contained in:
committed by
Android (Google) Code Review
commit
07d5006432
@@ -840,4 +840,16 @@ public class Build {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the device is running on the Android O release or newer.
|
||||
*
|
||||
* @return {@code true} if O APIs are available for use
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static boolean isAtLeastO() {
|
||||
return !"REL".equals(VERSION.CODENAME)
|
||||
&& "O".compareTo(VERSION.CODENAME) <= 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user