Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bc59b41 authored by Siim Sammul's avatar Siim Sammul Committed by Automerger Merge Worker
Browse files

Merge changes I5dd690b9,I659f927a into main am: 693bf0c2

parents 3962279b 693bf0c2
Loading
Loading
Loading
Loading
+21 −20
Original line number Diff line number Diff line
@@ -153,9 +153,17 @@ public final class NativeTombstoneManager {
            return Optional.empty();
        }

        try (ParcelFileDescriptor pfd = ParcelFileDescriptor.open(path, MODE_READ_WRITE)) {
        ParcelFileDescriptor pfd;
        try {
            pfd = ParcelFileDescriptor.open(path, MODE_READ_WRITE);
        } catch (FileNotFoundException ex) {
            Slog.w(TAG, "failed to open " + path, ex);
            return Optional.empty();
        }

        final Optional<TombstoneFile> parsedTombstone = TombstoneFile.parse(pfd);
        if (!parsedTombstone.isPresent()) {
            IoUtils.closeQuietly(pfd);
            return Optional.empty();
        }

@@ -171,13 +179,6 @@ public final class NativeTombstoneManager {
        }

        return parsedTombstone;
        } catch (FileNotFoundException ex) {
            Slog.w(TAG, "failed to open " + path, ex);
            return Optional.empty();
        } catch (IOException ex) {
            Slog.e(TAG, "IO exception during write to " + path, ex);
            return Optional.empty();
        }
    }

    /**