微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 关机流程实现灭屏和振动同步,灭屏即完成关机流程

关机流程实现灭屏和振动同步,灭屏即完成关机流程

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]

关机流程实现灭屏和振动同步,灭屏即完成关机流程
目前默认设计,关机会设置一个灭屏时间,不同运营商有不同需求。设置灭屏时间的主要考虑是用
户体验关机更快,但实际上灭屏后关机流程还会有一些操作。
如果有需要实现真正关机完成才灭屏振动的体验,可以参照如下修改(灭屏时间延长,用户体验的
关机时间延长):

[SOLUTION]

php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks/base/core/java/com/android/internal/app/ShutdownThread.java:
1.去掉触发灭屏的message
private static void beginShutdownSequence(Context context) {
.......
/* set screen brightness off after shutdownThread start */
//sInstance.mHandler.postDelayed(mDelayDim, screen_turn_off_time);
//modify shutdown screen off time
......
}
2.IPO关机振动与灭屏同步
public void running() {
......
if(mShutdownFlow == IPO_SHUTDOWN_FLOW)
{
……
delayForPlayAnimation();
if (sInstance.mScreenWakeLock != null &&
sInstance.mScreenWakeLock.isHeld()) {
sInstance.mScreenWakeLock.release();
sInstance.mScreenWakeLock = null;
}
//modify shutdown screen off time
Log.d(TAG, "setBacklightBrightness: Off");
sInstance.mpowerManager.setBacklightBrightnessOff(true);
//modify shutdown screen off time
//sInstance.mHandler.removeCallbacks(mDelayDim);
stMgr.shutdown(mContext);
......
}
3,正常关机流程振动与灭屏同步
public static void rebootOrShutdown(boolean reboot, String reason) {
......
delayForPlayAnimation();
//modify shutdown screen off time to start
Log.d(TAG, "setBacklightBrightness: Off");
if (sInstance.mScreenWakeLock != null &&
sInstance.mScreenWakeLock.isHeld()) {
sInstance.mScreenWakeLock.release();
sInstance.mScreenWakeLock = null;
}
sInstance.mPowerManager.setBacklightBrightnessOff(true);
//modify shutdown screen off time to end
// Shutdown power
Log.i(TAG, "Performing low-level shutdown...");
......
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top