Merge "Move ShutdownThread calls to system ui thread." into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
39a556f1d8
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user