private boolean isPostN() { final AndroidVersion hash = AndroidTargetHash.getVersionFromHash(compileSdkVersion); return hash != null && hash.getApiLevel() >= 24; } }
public void setCompileSdkVersion(@NonNull String compileSdkVersion) { // Ensure compileSdkVersion is in platform hash string format (e.g. "android-21"). AndroidVersion androidVersion = AndroidTargetHash.getVersionFromHash(compileSdkVersion); if (androidVersion == null) { this.compileSdkVersion = null; } else { this.compileSdkVersion = AndroidTargetHash.getPlatformHashString(androidVersion); } resolvedSdkVersion = false; }
/** * Retrieve the newest supported version if it is not the specified version is not supported. * * An older NDK may not support the specified compiledSdkVersion. In that case, determine what * is the newest supported version and modify compileSdkVersion. */ @Override @Nullable public String findLatestPlatformVersion(@NonNull String targetPlatformString) { AndroidVersion androidVersion = AndroidTargetHash.getVersionFromHash(targetPlatformString); int targetVersion; if (androidVersion == null) { Logging.getLogger(this.getClass()).warn( "Unable to parse NDK platform version. Try to find the latest instead."); targetVersion = Integer.MAX_VALUE; } else { targetVersion = androidVersion.getFeatureLevel(); } targetVersion = findTargetPlatformVersionOrLower(targetVersion); if (targetVersion == 0) { return null; } return "android-" + targetVersion; }
!properties.containsKey(AVD_INI_ANDROID_CODENAME)) { String targetHash = map.get(AVD_INFO_TARGET); AndroidVersion version = AndroidTargetHash.getVersionFromHash(targetHash); if (version != null) { properties.put(AVD_INI_ANDROID_API, Integer.toString(version.getApiLevel()));
@NonNull ProgressIndicator progress) { Map<RemotePackage, InstallResultType> installResults = new HashMap<>(); AndroidVersion targetVersion = AndroidTargetHash.getVersionFromHash(targetHash); String platformPath = DetailsTypes.getPlatformPath(targetVersion);
final CompileOptions compileOptions, String compileSdkVersion) { final AndroidVersion hash = AndroidTargetHash.getVersionFromHash(compileSdkVersion); Integer compileSdkLevel = (hash == null ? null : hash.getApiLevel());
@NonNull String currentJdkVersion, boolean jackEnabled) { final AndroidVersion hash = AndroidTargetHash.getVersionFromHash(compileSdkVersion); Integer compileSdkLevel = (hash == null ? null : hash.getFeatureLevel());