diff options
| author | 2017-08-01 18:18:49 +0000 | |
|---|---|---|
| committer | 2017-08-01 18:18:49 +0000 | |
| commit | 9e7e827d0592749f813c65fc168b7b9f477b2253 (patch) | |
| tree | 1ac2e77a45d8dda5c47a3176935569dd90cf1cac /services/java | |
| parent | 9b08d7758bb3ffb6e5cc5c0fd3c4372fe0ba73c7 (diff) | |
| parent | 39a556f1d896273bd0ce5ca56300cdafaa4113be (diff) | |
Merge "Move ShutdownThread calls to system ui thread." into oc-dr1-dev
am: 39a556f1d8
Change-Id: Idd341f7969c40184327428fc27b9f597dab57905
Diffstat (limited to 'services/java')
| -rw-r--r-- | services/java/com/android/server/SystemServer.java | 16 |
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 a6e8ce1ba961..6eb28a4eea59 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; @@ -450,7 +451,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); + } } |