diff --git a/app/src/main/java/org/lineageos/updater/UpdatesListAdapter.java b/app/src/main/java/org/lineageos/updater/UpdatesListAdapter.java index 2a62b630..30144701 100644 --- a/app/src/main/java/org/lineageos/updater/UpdatesListAdapter.java +++ b/app/src/main/java/org/lineageos/updater/UpdatesListAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2023 The LineageOS Project + * Copyright (C) 2017-2024 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,10 +63,13 @@ import org.lineageos.updater.model.UpdateInfo; import org.lineageos.updater.model.UpdateStatus; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.text.DateFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; +import java.util.stream.Stream; public class UpdatesListAdapter extends RecyclerView.Adapter { @@ -475,6 +478,12 @@ public class UpdatesListAdapter extends RecyclerView.Adapter= required; } + + private static boolean isScratchMounted() { + try (Stream lines = Files.lines(Path.of("/proc/mounts"))) { + return lines.anyMatch(x -> x.split(" ")[1].equals("/mnt/scratch")); + } catch (IOException e) { + return false; + } + } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 02dda7fb..b59cea44 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@