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

Commit 298cb0e3 authored by Paul Lawrence's avatar Paul Lawrence Committed by The Android Automerger
Browse files

Fix crash caused by toHex returning exception

toHex was changed to throw an exception in
I4986a8e806d9066129f696ab9f2e80655424e723, but its caller was not adjusted
accordingly, causing a crash whenever an unencrypted device was booted.

Bug: 18886749
Change-Id: If0505f617001cf5e0d99cf14c8b09e6a6a377167
parent 412c5daf
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -2419,9 +2419,16 @@ class MountService extends IMountService.Stub
        final NativeDaemonEvent event;
        final NativeDaemonEvent event;
        try {
        try {
            event = mConnector.execute("cryptfs", "getpw");
            event = mConnector.execute("cryptfs", "getpw");
            if ("-1".equals(event.getMessage())) {
                // -1 equals no password
                return null;
            }
            return fromHex(event.getMessage());
            return fromHex(event.getMessage());
        } catch (NativeDaemonConnectorException e) {
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
            throw e.rethrowAsParcelableException();
        } catch (IllegalArgumentException e) {
            Slog.e(TAG, "Invalid response to getPassword");
            return null;
        }
        }
    }
    }