/*
* Copyright (c) 2014 OpenSilk Productions LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.opensilk.common.core.util;
import android.os.Build;
/**
* Created by drew on 10/30/14.
*/
public class VersionUtils {
public static boolean hasIceCreamSandwich() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
}
public static boolean hasIceCreamSandwichMR1() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1;
}
public static boolean hasJellyBean() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
}
public static boolean hasJellyBeanMR1() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
}
public static boolean hasJellyBeanMR2() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
}
public static boolean hasKitkat() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
}
public static boolean hasLollipop() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
}
public static boolean hasLollipopMR1() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1;
}
public static boolean hasMarshmallow() {
return Build.VERSION.SDK_INT >= 23;
}
public static boolean hasApi14() {
return hasIceCreamSandwich();
}
public static boolean hasApi15() {
return hasIceCreamSandwichMR1();
}
public static boolean hasApi16() {
return hasJellyBean();
}
public static boolean hasApi17() {
return hasJellyBeanMR1();
}
public static boolean hasApi18() {
return hasJellyBeanMR2();
}
public static boolean hasApi19() {
return hasKitkat();
}
public static boolean hasApi21() {
return hasLollipop();
}
public static boolean hasApi22() {
return hasLollipopMR1();
}
public static boolean hasApi23() {
return hasMarshmallow();
}
public static boolean isEmulator() {
return Build.FINGERPRINT.contains("sdk");
}
}