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

Unverified Commit e07e9a30 authored by Thomas Makin's avatar Thomas Makin Committed by Michael Bestas
Browse files

pm: actually check fs verity support

The check was there but not employed in ResilientAtomicFile,
causing spam errors in kernels where this is unsupported.

Change-Id: I7e8fcbea20e8f096850ec4b9528ec88446906d9f
parent ccc68b22
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ final class ResilientAtomicFile implements Closeable {
                finalizeOutStream(reserveOutStream);
            }

            if (PackageManagerServiceUtils.isApkVerityEnabled()) {
                // Protect both main and reserve using fs-verity.
                try (ParcelFileDescriptor mainPfd = ParcelFileDescriptor.dup(mainInStream.getFD());
                     ParcelFileDescriptor copyPfd = ParcelFileDescriptor.dup(reserveInStream.getFD())) {
@@ -153,6 +154,7 @@ final class ResilientAtomicFile implements Closeable {
                } catch (IOException e) {
                    Slog.e(LOG_TAG, "Failed to verity-protect " + mDebugName, e);
                }
            }
        } catch (IOException e) {
            Slog.e(LOG_TAG, "Failed to write reserve copy " + mDebugName + ": " + mReserveCopy, e);
        }