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

Commit abf226b7 authored by Alex Klyubin's avatar Alex Klyubin Committed by Android (Google) Code Review
Browse files

Merge "Log warning when can't read from HW RNG"

parents ec083812 c78a463e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -196,11 +196,14 @@ public class EntropyMixer extends Binder {
     * Mixes in the output from HW RNG (if present) into the Linux RNG.
     */
    private void addHwRandomEntropy() {
        if (!new File(hwRandomDevice).exists()) {
            // HW RNG not present/exposed -- ignore
            return;
        }

        try {
            RandomBlock.fromFile(hwRandomDevice).toFile(randomDevice, false);
            Slog.i(TAG, "Added HW RNG output to entropy pool");
        } catch (FileNotFoundException ignored) {
            // HW RNG not present/exposed -- ignore
        } catch (IOException e) {
            Slog.w(TAG, "Failed to add HW RNG output to entropy pool", e);
        }