1 Introduction
In the 11.0 system rom customization development, in the native system, the startup ringtone and shutdown ringtone are not supported by default. The system supports startup animation and shutdown animation and other functions by default, so about adding startup ringtones and shutdown ringtones. Related functions
, You need to add related shutdown ringtones yourself
2. Add the core class for the shutdown ringtone function
frameworks\base\cmds\bootanimation\BootAnimation.h
frameworks\base\cmds\bootanimation\BootAnimation.cpp
3. Analysis and implementation of the core functions realized by adding the shutdown ringtone function
3.1 Add the variables and methods required to play the shutdown ringtone in BootAnimation.h
class BootAnimation : public Thread, public IBinder::DeathRecipient
{
....
private:
virtual bool threadLoop();
virtual status_t readyToRun();
virtual void onFirstRef();
virtual void binderDied(const wp<IBinder>& who);
bool updateIsTimeAccurate();
class TimeCheckThread : public Thread {
public:
explicit TimeCheckThread(BootAnimation* bootAnimation);
virtual ~TimeCheckThread();
private:
virtual status_t readyToRun();
virtual bool threadLo