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

Commit 39a556f1 authored by Alison Cichowlas's avatar Alison Cichowlas Committed by Android (Google) Code Review
Browse files

Merge "Move ShutdownThread calls to system ui thread." into oc-dr1-dev

parents ce099ba8 f0afd8c1
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ import android.os.FactoryTest;
import android.os.FileUtils;
import android.os.FileUtils;
import android.os.IIncidentManager;
import android.os.IIncidentManager;
import android.os.Looper;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.Process;
import android.os.Process;
import android.os.RemoteException;
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.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() {
    private void createSystemContext() {
        ActivityThread activityThread = ActivityThread.systemMain();
        ActivityThread activityThread = ActivityThread.systemMain();