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

am: 39a556f1d8

Change-Id: I51580faadf97d828d5b2c4d7adba99cd7d36d4f2
This commit is contained in:
Alison Cichowlas
2017-08-01 18:18:45 +00:00
committed by android-build-merger

View File

@@ -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;
@@ -463,7 +464,20 @@ public final class SystemServer {
}
}
}
ShutdownThread.rebootOrShutdown(null, reboot, reason);
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);
}
}