1.frameworks/base/services/core/java/com/android/server/power/ShutdownThread.java
public static void rebootOrShutdown(final Context context, boolean reboot, String reason) {
+ if (sInstance.mPowerManager != null) {
+ Log.i(TAG, "rebootOrShutdown:goToSleep");
+ sInstance.mPowerManager.goToSleep(SystemClock.uptimeMillis());
+ }
if (reboot) {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException unused) {
+ }
Log.i(TAG, "Rebooting, reason: " + reason);
PowerManagerService.lowLevelReboot(reason);
Log.e(TAG, "Reboot failed, will attempt shutdown instead");
reason = null;
}
2.frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
void SurfaceFlinger::binderDied(const wp& )
{
// the window manager died on us. prepare its eulogy.
+ char shutdown[PROPERTY_VALUE_MAX];
+ property_get("sys.shutdown.requested", shutdown, "");
+ ALOGD("shutdown: %s", shutdown); //添加该log
+ if (strcmp(shutdown, "") != 0) {
+ ALOGD("Abandon initilizeDisplays because system is shuting down !");
+ return;
+ }
+
// restore initial conditions (default device unblank, etc)
initializeDisplays();
动画修改的是 desc.txt
p 1 2 folder1
->
c 1 2 folder1
c 表示要强制播放完整的 folder1文件
具体p/c使用的方式可参考代码中如下文件
frameworks/base/cmds/bootanimation/FORMAT.md



