Target sdk 35 (Android 15)

This commit is contained in:
emanuele-f 2024-12-26 10:58:52 +01:00
parent e5bc37620a
commit 1ebc6271e3
3 changed files with 6 additions and 2 deletions

View File

@ -6,8 +6,8 @@ android {
defaultConfig {
applicationId "com.emanuelef.remote_capture"
minSdkVersion 21
compileSdk 34
targetSdk 34
compileSdk 35
targetSdk 35
versionCode 78
versionName "1.7.5"

View File

@ -1264,7 +1264,9 @@ public class CaptureService extends VpnService implements Runnable {
// NOTE: this is only called on low system memory (e.g. obtained via getMemoryInfo). The app
// may still run out of heap memory, whose monitoring requires polling (see checkAvailableHeap)
@Override
@SuppressWarnings("deprecation")
public void onTrimMemory(int level) {
// NOTE: most trim levels are not available anymore since API 34
String lvlStr = Utils.trimlvl2str(level);
boolean lowMemory = (level != TRIM_MEMORY_UI_HIDDEN) && (level >= TRIM_MEMORY_RUNNING_LOW);
boolean critical = lowMemory && (level >= TRIM_MEMORY_COMPLETE);

View File

@ -1372,7 +1372,9 @@ public class Utils {
return unallocated + runtime.freeMemory();
}
@SuppressWarnings("deprecation")
public static String trimlvl2str(int lvl) {
// NOTE: most trim levels are not available anymore since API 34
switch (lvl) {
case ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN: return "TRIM_MEMORY_UI_HIDDEN";
case ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE: return "TRIM_MEMORY_RUNNING_MODERATE";