1,boot铃声,在surfaceflinger.cpp中readyToRun():
/*
* We're now ready to accept clients...
*/
// start boot animation
property_set("ctl.start", "bootanim");
{
char value[PROPERTY_VALUE_MAX];
int ivalue = 0;
property_get("persist.sys.profile.silent", value, "0");
if (atoi(value)== 0){
LOGI("start:persist.sys.profile.silent is soundable");
property_set("ctl.start","startupsound");
}
else {
LOGI("start:persist.sys.profile.silent is silent");
}
}
2,shutdown 动画加在ShutdownThread.java中的beginShutdownSequence()方法的
synchronized (sIsStartedGuard) {
if (sIsStarted) {
Log.d(TAG, "Request to shutdown already running, returning.");
return;
}
sIsStarted = true;
}
后面
代码如下
android.os.SystemProperties.set("ctl.start","shutdownanim");
//chenxiang add to fix the shutdown sound
android.media.AudioManager mAudioManager = (android.media.AudioManager)context.getSystemService(context.AUDIO_SERVICE);
int ringerMode = mAudioManager.getRingerMode();
Log.i(TAG,"ringerMode:" + ringerMode);
if(ringerMode==android.media.AudioManager.RINGER_MODE_SILENT || ringerMode == android.media.AudioManager.RINGER_MODE_VIBRATE){
}else{
android.os.SystemProperties.set("ctl.start","shutdownsound");
}
/*
* We're now ready to accept clients...
*/
// start boot animation
property_set("ctl.start", "bootanim");
{
char value[PROPERTY_VALUE_MAX];
int ivalue = 0;
property_get("persist.sys.profile.silent", value, "0");
if (atoi(value)== 0){
LOGI("start:persist.sys.profile.silent is soundable");
property_set("ctl.start","startupsound");
}
else {
LOGI("start:persist.sys.profile.silent is silent");
}
}
2,shutdown 动画加在ShutdownThread.java中的beginShutdownSequence()方法的
synchronized (sIsStartedGuard) {
if (sIsStarted) {
Log.d(TAG, "Request to shutdown already running, returning.");
return;
}
sIsStarted = true;
}
后面
代码如下
android.os.SystemProperties.set("ctl.start","shutdownanim");
//chenxiang add to fix the shutdown sound
android.media.AudioManager mAudioManager = (android.media.AudioManager)context.getSystemService(context.AUDIO_SERVICE);
int ringerMode = mAudioManager.getRingerMode();
Log.i(TAG,"ringerMode:" + ringerMode);
if(ringerMode==android.media.AudioManager.RINGER_MODE_SILENT || ringerMode == android.media.AudioManager.RINGER_MODE_VIBRATE){
}else{
android.os.SystemProperties.set("ctl.start","shutdownsound");
}
Surface Flanger与Android设备启动和关机声音管理
本文详细介绍了如何在Surface Flanger中配置启动和关机动画及声音,包括启动动画的初始化、启动声音的播放条件判断以及关机声音的触发逻辑。
1082

被折叠的 条评论
为什么被折叠?



