微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 关机闹钟响起后,右滑选择开机,几秒后出现解锁的声音

关机闹钟响起后,右滑选择开机,几秒后出现解锁的声音

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

解释“关机闹钟响起后,右滑选择开机,几秒后出现解锁的声音”的原因及解法

[SOLUTION]

原因:keyguardViewMediator.java中的handleShow()里面调用了playSounds
解法:
1。handleShow()里面:
if (DEBUG) KeyguardUtils.xlogD(TAG, "handleShow query AlARMBoot before");
// Do this at the end to not slow down display of the keyguard.
if (!KeyguardUpdateMonitor.isAlarmBoot() ) {
if (mPlaySound) {//当这个标志位为true 的时候,才能播放解锁的声音。
playSounds(true);
}
} else {
new Handler().postDelayed(new Runnable() {
public void run() {
sendRemoveIPOWinBroADCast();
startAlarm();
}
}, 250);
}
mPlaySound = true; //此处设为true。
2。同样keyguardViewMediator.Java 中,
public static final String IPO_DISABLE =
"android.intent.action.ACTION_BOOT_IPO";
public static boolean mHideNavBar = false;
public static boolean mPlaySound = true; //这个标志位初值为true。
private static final int ALARM_BOOT = 115;
private static final int RESHOW_ANYWHERE = 116;
3。powerOffAlarmView.java中,poweron()中:
// power on the device
private void powerOn() {
enableEventDispatching(false);
stopPlayAlarm();
// start boot animation
SystemProperties.set("service.bootanim.exit", "0");
SystemProperties.set("ctl.start", "bootanim");
Log.d(TAG, "start boot animation");
// send broadcast to power on the phone
KeyguardViewMediator.mPlaySound = false;//此处将这个标志位设为false。只有
poweroffAlarm 点击了dismiss 之后才修改这个标注为的值。
sendBR(NORMAL_BOOT_ACTION);
unregisteVoiceCmd();
}

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

网站地图

Top