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

Commit 36b29166 authored by Tetsutoki Shiozawa's avatar Tetsutoki Shiozawa Committed by android-build-merger
Browse files

Merge "Abort connecting to native daemon during shutdown"

am: d763e341

Change-Id: I5b8984d51ff0715b29074cee98197263b5ce1c29
parents e9b31e8e d763e341
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,11 +24,13 @@ import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.LocalLog;
import android.util.Slog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Preconditions;
import com.android.server.power.ShutdownThread;
import com.google.android.collect.Lists;

import java.io.FileDescriptor;
@@ -136,6 +138,12 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
                listenToSocket();
            } catch (Exception e) {
                loge("Error in NativeDaemonConnector: " + e);
                String shutdownAct = SystemProperties.get(
                        ShutdownThread.SHUTDOWN_ACTION_PROPERTY, "");
                if (shutdownAct != null && shutdownAct.length() > 0) {
                    // The device is in middle of shutdown.
                    break;
                }
                SystemClock.sleep(5000);
            }
        }