MTK-onlin上面有关于自定义开机动画铃声的FAQ,介绍的很详细,[FAQ21245]l;
但是横屏播放开机动画没有做介绍;
下面是介绍开机动画旋转的问题:
应为要预置开机铃声,在bootanimation里面压缩开机铃声系统是不支持的;所以要按照P版本开机动画的预制方式,使用Mtkbootanimation;
Mtkbootanimation 是走vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
而控制Rect(dinfo.h, dinfo.w) 播放方向的是在BootAnimation.cpp
status_t BootAnimation::readyToRun() {
默认控制是竖屏播放的,并且宽度和高度也要调整
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
----改为
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
dinfo.h, dinfo.w, PIXEL_FORMAT_RGB_565);
eOrientation270根据实际情况修改,Rect(dinfo.h, dinfo.w)和上面一致
t.setDisplayProjection(dtoken, DisplayState::eOrientation270, Rect(dinfo.h, dinfo.w), Rect(dinfo.h, dinfo.w));
以上便是Mtkbootanimation播放方向的问题;
然后就是开机铃声不同步问题:
网上尝试了很多方法,最后终结下:
frameworks/av/media/libmediaplayerservice/MediaPlayerService.cpp
- BatteryNotifier::getInstance().noteResetVideo();
+ //BatteryNotifier::getInstance().noteResetVideo();
frameworks/av/services/audioflinger/AudioFlinger.cpp
- mSystemReady(false)
+ mSystemReady(true)
frameworks/av/services/audioflinger/Threads.cpp
status_t status = NO_ERROR;
- if (event->mRequiresSystemReady && !mSystemReady) {
+ /* if (event->mRequiresSystemReady && !mSystemReady) {
event->mWaitStatus = false;
mPendingConfigEvents.add(event);
return status;
- }
+ }*/
mConfigEvents.add(event);
ALOGV("sendConfigEvent_l() num events %zu event %d", mConfigEvents.size(), event->mType);
mWaitWorkCV.signal();
@@ -973,7 +973,7 @@ void AudioFlinger::ThreadBase::releaseWakeLock_l()
}
void AudioFlinger::ThreadBase::getPowerManager_l() {
- if (mSystemReady && mPowerManager == 0) {
+ if ( mPowerManager == 0) {
// use checkService() to avoid blocking if power service is not up yet
sp<IBinder> binder =
defaultServiceManager()->checkService(String16("power"));
@@ -2929,6 +2929,9 @@ void AudioFlinger::PlaybackThread::checkSilentMode_l()
// shared by MIXER and DIRECT, overridden by DUPLICATING
ssize_t AudioFlinger::PlaybackThread::threadLoop_write()
{
+ if (mPowerManager == 0)
+ acquireWakeLock();
vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
- status_t err = mCondition.waitRelative(mMyLock, s2ns(4));
+ status_t err = mCondition.waitRelative(mMyLock, s2ns(40));