mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
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:
committed by
José Rebelo
parent
6728e87393
commit
071c7529ba
@@ -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() {
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user