summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alison Cichowlas <asc@google.com> 2017-08-01 18:06:39 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-08-01 18:06:39 +0000
commit39a556f1d896273bd0ce5ca56300cdafaa4113be (patch)
treeb3118190236131d4dd43cddb0c3c5fd4ec3f30fa
parentce099ba8bcba6d74ebb5d7368662c593c6b74ade (diff)
parentf0afd8c14e193025d8c31d2221b0904035a0d888 (diff)
Merge "Move ShutdownThread calls to system ui thread." into oc-dr1-dev
-rw-r--r--services/java/com/android/server/SystemServer.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index a902a19082f0..35062c17169c 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -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,7 +473,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);
+
}
}