本文整理汇总了Java中com.google.vr.ndk.base.Version.isAtLeast方法的典型用法代码示例。如果您正苦于以下问题:Java Version.isAtLeast方法的具体用法?Java Version.isAtLeast怎么用?Java Version.isAtLeast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.vr.ndk.base.Version
的用法示例。
在下文中一共展示了Version.isAtLeast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isVrCoreCompatible
import com.google.vr.ndk.base.Version; //导入方法依赖的package包/类
@Override
public boolean isVrCoreCompatible() {
try {
String vrCoreSdkLibraryVersionString = VrCoreUtils.getVrCoreSdkLibraryVersion(
ContextUtils.getApplicationContext());
Version vrCoreSdkLibraryVersion = Version.parse(vrCoreSdkLibraryVersionString);
Version targetSdkLibraryVersion =
Version.parse(com.google.vr.ndk.base.BuildConstants.VERSION);
if (!vrCoreSdkLibraryVersion.isAtLeast(targetSdkLibraryVersion)) {
throw new VrCoreNotAvailableException(ConnectionResult.SERVICE_OBSOLETE);
}
return true;
} catch (VrCoreNotAvailableException e) {
Log.i(TAG, "Unable to find a compatible VrCore.");
return false;
}
}
示例2: getVrCoreCompatibility
import com.google.vr.ndk.base.Version; //导入方法依赖的package包/类
@Override
public int getVrCoreCompatibility() {
// Supported Build version is determined by the webvr cardboard support feature.
// Default is KITKAT unless specified via server side finch config.
if (Build.VERSION.SDK_INT < ChromeFeatureList.getFieldTrialParamByFeatureAsInt(
ChromeFeatureList.WEBVR_CARDBOARD_SUPPORT,
MIN_SDK_VERSION_PARAM_NAME,
Build.VERSION_CODES.KITKAT)) {
return VrCoreVersionChecker.VR_NOT_SUPPORTED;
}
try {
String vrCoreSdkLibraryVersionString = VrCoreUtils.getVrCoreSdkLibraryVersion(
ContextUtils.getApplicationContext());
Version vrCoreSdkLibraryVersion = Version.parse(vrCoreSdkLibraryVersionString);
Version targetSdkLibraryVersion =
Version.parse(com.google.vr.ndk.base.BuildConstants.VERSION);
if (!vrCoreSdkLibraryVersion.isAtLeast(targetSdkLibraryVersion)) {
return VrCoreVersionChecker.VR_OUT_OF_DATE;
}
return VrCoreVersionChecker.VR_READY;
} catch (VrCoreNotAvailableException e) {
Log.i(TAG, "Unable to find VrCore.");
// Old versions of VrCore are not integrated with the sdk library version check and will
// trigger this exception even though VrCore is installed.
// Double check package manager to make sure we are not telling user to install
// when it should just be an update.
if (PackageUtils.getPackageVersion(
ContextUtils.getApplicationContext(), VR_CORE_PACKAGE_ID)
!= -1) {
return VrCoreVersionChecker.VR_OUT_OF_DATE;
}
return VrCoreVersionChecker.VR_NOT_AVAILABLE;
}
}