当前位置: 首页 > news >正文

响应式网站开发demo做网站云服务器2m宽带够用吗

响应式网站开发demo,做网站云服务器2m宽带够用吗,做深度的互联网站,系统定制开发需求:在11.0在定制化系统中,默认是没有开机铃声的,有客户提出需要要添加开机铃声,所以为了完成需求,就来实现这一个功能关于开机铃声 都是在bootanimation_main.cpp 这里面负责管理。添加添加开机铃声的核心类framewor…

需求:在11.0在定制化系统中,默认是没有开机铃声的,有客户提出需要要添加开机铃声,所以为了完成需求,就来实现这一个功能关于开机铃声 都是在bootanimation_main.cpp 这里面负责管理。

  1. 添加添加开机铃声的核心类

frameworks\base\cmds\bootanimation\bootanimation_main.cpp
frameworks\base\cmds\bootanimation\BootAnimation.cpp
  1. 添加开机铃声的核心功能分析和实现

2.1 bootanimation_main.cpp开机动画处理分析

frameworks\base\cmds\bootanimation\bootanimation_main.cpp
int main()
{
setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY);
bool noBootAnimation = bootAnimationDisabled();
ALOGI_IF(noBootAnimation,  "boot animation disabled");
if (!noBootAnimation) {sp<ProcessState> proc(ProcessState::self());ProcessState::self()->startThreadPool();// create the boot animation object (may take up to 200ms for 2MB zip)#ifdef BOOTANIMATION_EXT
sp<BootAnimation> boot = new BootAnimation(audioplay::createAnimationCallbacks(),true);
#else
sp<BootAnimation> boot = new BootAnimation(audioplay::createAnimationCallbacks());
#endif
waitForSurfaceFlinger();boot->run("BootAnimation", PRIORITY_DISPLAY);ALOGV("Boot animation set up. Joining pool.");IPCThreadState::self()->joinThreadPool();
}
return 0;}

从代码中可以看到 是由BootAnimation来处理 开机铃声

frameworks\base\cmds\bootanimation\BootAnimation.cpp

static const char OEM_BOOTSOUND_FILE[] = "/oem/media/bootsound.mp3";
static const char PRODUCT_BOOTSOUND_FILE[] = "/product/media/bootsound.mp3";
static const char SYSTEM_BOOTSOUND_FILE[] = "/system/media/bootsound.mp3";
static const char OEM_SHUTDOWNSOUND_FILE[] = "/oem/media/shutdownsound.mp3";
static const char PRODUCT_SHUTDOWNSOUND_FILE[] = "/product/media/shutdownsound.mp3";
static const char SYSTEM_SHUTDOWNSOUND_FILE[] = "/system/media/shutdownsound.mp3";
void BootAnimation::findBootAnimationFile() {
// If the device has encryption turned on or is in process
// of being encrypted we show the encrypted boot animation.
char decrypt[PROPERTY_VALUE_MAX];
property_get("vold.decrypt", decrypt, "");
bool encryptedAnimation = atoi(decrypt) != 0 ||!strcmp("trigger_restart_min_framework", decrypt);if (!mShuttingDown && encryptedAnimation) {static const char* encryptedBootFiles[] ={PRODUCT_ENCRYPTED_BOOTANIMATION_FILE, SYSTEM_ENCRYPTED_BOOTANIMATION_FILE};for (const char* f : encryptedBootFiles) {if (access(f, R_OK) == 0) {mZipFileName = f;return;}}
}const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1;
static const char* bootFiles[] ={APEX_BOOTANIMATION_FILE, playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE,OEM_BOOTANIMATION_FILE, SYSTEM_BOOTANIMATION_FILE};
static const char* shutdownFiles[] ={PRODUCT_SHUTDOWNANIMATION_FILE, OEM_SHUTDOWNANIMATION_FILE, SYSTEM_SHUTDOWNANIMATION_FILE, ""};for (const char* f : (!mShuttingDown ? bootFiles : shutdownFiles)) {if (access(f, R_OK) == 0) {mZipFileName = f;#ifdef BOOTANIMATION_EXT
break;
#else
return;
#endif
}
}
#ifdef BOOTANIMATION_EXT
static const char* bootSoundFiles[] =
{PRODUCT_BOOTSOUND_FILE, OEM_BOOTSOUND_FILE, SYSTEM_BOOTSOUND_FILE};
static const char* shutdownSoundFiles[] =
{PRODUCT_SHUTDOWNSOUND_FILE, OEM_SHUTDOWNSOUND_FILE, SYSTEM_SHUTDOWNSOUND_FILE};
for (const char* f : (!mShuttingDown ? bootSoundFiles : shutdownSoundFiles)) {
if (access(f, R_OK) == 0) {
mSoundFileName = f;
SLOGD("mSoundFileName string is %s,length is %zu",mSoundFileName.string(),mSoundFileName.length());
return;
}
}
SLOGD("set mSoundFileName null");
mSoundFileName = "";
#endif
return;}

获取播放开机音乐路径:PRODUCT_BOOTSOUND_FILE, OEM_BOOTSOUND_FILE, SYSTEM_BOOTSOUND_FILE 中的一个

所以系统默认的路径为SYSTEM_BOOTSOUND_FILE 即为 /system/media/bootsound.mp3

也就是说和开机动画放在同一个目录就可

persist.sys.bootanim.play_sound 属性的设置

static const char PLAY_SOUND_PROP_NAME[] = "persist.sys.bootanim.play_sound";
bool BootAnimation::playSoundsAllowed() {
// Compatible with Android Things
// only system called will play sounds in system/media/
if (!mSystemCalled) {
return false;
}
// Read the system property to see if we should play the sound.
// If it's not present, default to allowed.
if (!property_get_bool(PLAY_SOUND_PROP_NAME, 1)) {return false;
}// Don't play sounds if this is a reboot due to an error.
char bootreason[PROPERTY_VALUE_MAX];
if (property_get(BOOTREASON_PROP_NAME, bootreason, nullptr) > 0) {for (const auto& str : PLAY_SOUND_BOOTREASON_BLACKLIST) {if (strcasecmp(str.c_str(), bootreason) == 0) {return false;}}
}
return true;}

是否允许播放中 会判断persist.sys.bootanim.play_sound 是否为1 如果不能播放 请查看这个值是否为1

开机铃声添加路径为:

路径:device/sprd/common/customer/system/media/bootsound.mp3

和开机动画放在同一个目录下就可以了

http://www.yayakq.cn/news/186623/

相关文章:

  • 那些彩票广告网站怎么做的长安外贸网站建设
  • 30天网站建设 视频教程两个电脑的wordpress
  • 宿迁网站建设推广网站开发的一般步骤
  • 商城网站建设腾讯体育百度竞价怎么开户
  • 求职seo推荐南宁seo计费管理
  • 网站模板设计工具免费写文案神器
  • 济南网站建设 伍际网络wordpress 音乐 插件
  • 如何做一网站百度网盘app
  • 电子商务网站创建过程网页传奇游戏攻略
  • 电商网站开发缓存app教程
  • 网站地址正能量软件it网站建设方案
  • aspnet网站开发技术软件工程属于哪个大类
  • 网站建设莱州哪家强?什么网站合适做流量
  • 彩票网站制作开发广州网站建设484186
  • pc网站生成手机网站wordpress数据库有多大
  • 个人网站样式排名优化哪家好
  • 做展示类网站微信小程序免费制作平台
  • 长春网站建设排名安装wordpress返回404
  • 河北邢台做网站网络运维工程师薪酬
  • 收录软件最多的网站产品介绍网站html
  • 重庆好的推广网站国外社交网站建设
  • 邢台开发区网站企业做网站哪家网站好
  • 求做网站万网域名查询官网
  • 专门做网站的软件把一个网站挂到网上要怎么做
  • html 网站链接海南省建设执业中心网站
  • 国外美容网站做网站都需要具备什么
  • 网站开发怎么自学如何优化网站内容
  • 互动平台网站怎样免费建设个人网站
  • 北京改网站龙华建网站公司
  • 兰州网站建设流程成都百度搜索排名优化