use Build.VERSION_CODES instead of magic numbers

The available codes only depend on compileSdk.
minSdk and targetSdk are not relevant.
This commit is contained in:
Thomas Kuehne
2025-06-29 16:32:27 +02:00
committed by José Rebelo
parent 6728e87393
commit 071c7529ba
3 changed files with 4 additions and 4 deletions
@@ -473,11 +473,11 @@ public class GBApplication extends Application {
}
public static boolean isRunningTwelveOrLater() {
return VERSION.SDK_INT >= 31; // Build.VERSION_CODES.S, but our target SDK is lower
return VERSION.SDK_INT >= Build.VERSION_CODES.S;
}
public static boolean isRunningTiramisuOrLater() {
return VERSION.SDK_INT >= 33; // Build.VERSION_CODES.TIRAMISU
return VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU;
}
public static boolean isRunningPieOrLater() {
@@ -327,7 +327,7 @@ public class AsynchronousResponse {
// TODO: probably best to send back an error code, though I wouldn't know which
return;
}
if (Build.VERSION.SDK_INT > 28) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
if (volume < audioManager.getStreamMinVolume(AudioManager.STREAM_MUSIC)) {
LOG.warn("Music - Received volume is too low: 0x"
+ Integer.toHexString(volume)
@@ -316,7 +316,7 @@ public class HuaweiP2PScreenshotService extends HuaweiBaseP2PService {
}
private boolean saveBitmap(String filename, Bitmap bitmap) {
if (Build.VERSION.SDK_INT < 29)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
return saveBitmapOld(filename, bitmap);
return saveMediaStore(filename, bitmap);
}