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

Commit 58809669 authored by Alexey Roslyakov's avatar Alexey Roslyakov Committed by Patrick Jacques
Browse files

framework: Fix for race condition in NativeDaemonConnector.

NativeDaemonConnector calls onDaemonConnected() callback function.
In case of MountService callback function calls mConnector.doListCommand,
and exception occurs since mOutputStream is not initialized yet.

Change-Id: I5ecd3980a5e5098bce9bae434ac6e3cab9bf7067
parent 57e7bb29
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -97,11 +97,12 @@ final class NativeDaemonConnector implements Runnable {
                    LocalSocketAddress.Namespace.RESERVED);

            socket.connect(address);
            mCallbacks.onDaemonConnected();

            InputStream inputStream = socket.getInputStream();
            mOutputStream = socket.getOutputStream();

            mCallbacks.onDaemonConnected();

            byte[] buffer = new byte[BUFFER_SIZE];
            int start = 0;