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

Commit 7d57b5a1 authored by mik_os's avatar mik_os
Browse files

PackageManager: Fix reconnection logic in Installer.

Change-Id: Id4b352647ed51aaf64bb85dff9030a25e295758f
parent 898206a5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -189,11 +189,6 @@ public final class Installer {


    private String transaction(String cmd) {
        if (!connect()) {
            Slog.e(TAG, "connection failed");
            return "-1";
        }

        int transactionId;
        synchronized (mTransactionIdLock) {
            transactionId = mLastTransactionId++;
@@ -208,6 +203,11 @@ public final class Installer {
                while(mResponses.get(transactionId) == null) {
                    synchronized (mPendingRequests) {
                        if (!mPendingRequests.contains(transactionId)) {
                            if (!connect()) {
                                Slog.e(TAG, "connection failed");
                                return "-1";
                            }

                            if (!writeCommand(cmd, transactionId)) {
                                /*
                                 * If installd died and restarted in the background (unlikely but