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

Commit f0afd8c1 authored by Alison Cichowlas's avatar Alison Cichowlas
Browse files

Move ShutdownThread calls to system ui thread.

Test: Manual
Fixes: 63680790

Change-Id: I6e431efb7594ba86311aac857dbf3970d48044ac
parent f98facc3
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;
@@ -472,9 +473,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();