The shutdown ringtone cannot be output from the speaker when the Android phone is switched on

Source: Internet
Author: User

In the Startoutput method of AudioMTKPolicyManager.cpp, it is added after Newdevic gets:
if (stream==audiosystem::boot) Newdevice|=audio_device_out_speaker;

status_t audiomtkpolicymanager::startoutput (audio_io_handle_t output,
Audiosystem::stream_type Stream,
int session)
{
ALOGD ("startoutput () output%d, stream%d, session%d", output, stream, session);
......
if (outputdesc->mrefcount[stream] = = 1) {
audio_devices_t newdevice = Getnewdevice (output, false/*fromcache*/);
Routing_strategy strategy = Getstrategy (stream);
BOOL Shouldwait = (strategy = = strategy_sonification) | |
(strategy = = strategy_sonification_respectful);
uint32_t WAITMS = 0;
BOOL force = FALSE;
if (stream==audiosystem::boot) Newdevice|=audio_device_out_speaker;
for (size_t i = 0; i < moutputs.size (); i++) {
Audiooutputdescriptor *desc = Moutputs.valueat (i);
if (desc! = Outputdesc) {
Force a device change if any other output are managed by the same HW
module and have a current device selection this differs from selected device.
The audio HAL must receive the new device selection so it can
Change the device currently selected by the other active output.
if (Outputdesc->shareshwmodulewith (DESC) &&
Desc->device ()! = Newdevice) {
force = true;
}
Wait for audio on other active outputs to is presented when starting
A notification so that audio focus effect can propagate.
uint32_t latency = desc->latency ();
if (shouldwait && desc->isactive (Latency * 2) && (Waitms < latency)) {
Waitms = latency;
}
}
}
......
}
return no_error;
}

The shutdown ringtone cannot be output from the speaker when the Android phone is switched on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.