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

Commit 2c26e217 authored by Alison Cichowlas's avatar Alison Cichowlas Committed by android-build-merger
Browse files

Merge "Move ShutdownThread calls to system ui thread." into oc-dr1-dev am: 39a556f1

am: 9e7e827d

Change-Id: I4c041cd9b5c62eacde3afea19188f0d4a5ea94a6
parents d30bbfa7 9e7e827d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.os.FactoryTest;
import android.os.FileUtils;
import android.os.IIncidentManager;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
@@ -454,9 +455,22 @@ public final class SystemServer {
                    }
                }
            }
            Runnable runnable = new Runnable() {
                @Override
                public void run() {
                    synchronized (this) {
                        ShutdownThread.rebootOrShutdown(null, reboot, reason);
                    }
                }
            };

            // ShutdownThread must run on a looper capable of displaying the UI.
            Message msg = Message.obtain(UiThread.getHandler(), runnable);
            msg.setAsynchronous(true);
            UiThread.getHandler().sendMessage(msg);

        }
    }

    private void createSystemContext() {
        ActivityThread activityThread = ActivityThread.systemMain();