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

Commit 46b7e5b6 authored by Siim Sammul's avatar Siim Sammul Committed by Android (Google) Code Review
Browse files

Merge "Revert "Move the ParcelFileDescritor initializations in both BootReceiver and""

parents 575bd7b6 dd64c1b2
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();
        }
    }

    /**