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

Commit d67b2364 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Avoid starting multiple threads in ShutdownThread



The previous code allowed this to happen if a second call to shutdown
happened while the dialog was being displayed.

BUG: 2563243

Change-Id: I93adc4ef316917a79002d580b17eda0dc354704c
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 14bfa398
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -133,6 +133,10 @@ public final class ShutdownThread extends Thread {

    private static void beginShutdownSequence(Context context) {
        synchronized (sIsStartedGuard) {
            if (sIsStarted) {
                Log.d(TAG, "Request to shutdown already running, returning.");
                return;
            }
            sIsStarted = true;
        }