Android Manually press Power key lock, no lock screen beep, unable to restore the "single machine must be present"

Source: Internet
Author: User

Test steps

"Beta version" T0606
"Module Version"
Navi Lock Screen: 5.0.0.ck
"Test Steps"
1, manually press the Power key to lock,
"Test Results"
No lock screen beep, unable to restore "single machine must be present"
"Expected results"
There's a beep.
"Number of occurrences"
Single machine must be present

From log can be found

4321 05-25 16:58:23.779 886 32501 W soundpool:sample 1 not ready
7641 05-25 16:58:33.879 886 32563 W soundpool:sample 1 not ready
10835 05-25 16:58:42.550 886 32619 W soundpool:sample 1 not ready
14300 05-25 16:58:53.021 886 32679 W soundpool:sample 1 not ready
17733 05-25 16:59:02.343 886 32737 W soundpool:sample 1 not ready
21173 05-25 16:59:12.912 886 332 W soundpool:sample 1 not ready
24266 05-25 16:59:19.413 886 397 W soundpool:sample 1 not ready
27374 05-25 16:59:25.650 886 456 W soundpool:sample 1 not ready
30833 05-25 16:59:32.635 886 557 W soundpool:sample 1 not ready
34121 05-25 16:59:41.375 886 616 W soundpool:sample 1 not ready
37447 05-25 16:59:49.593 886 787 W soundpool:sample 1 not ready
40340 05-25 16:59:58.792 886 888 W soundpool:sample 1 not ready
43666 05-25 17:00:05.802 886 1015 W Soundpool:sample 1 not ready
Why the playback failed

Solution:

Modified files: frameworks/av/media/libmedia/soundpool.cpp

int Soundpool::p Lay (int sampleid, float leftvolume, float rightvolume, int priority, int loops, float rate) {ALOG V ("Play sampleid=%d, Leftvolume=%f, rightvolume=%f, priority=%d, loop=%d, rate=%f", SampleID, Leftvolume, right    Volume, priority, loops, rate);    Sp<sample> Sample;    soundchannel* Channel;    int channelid;    Mutex::autolock Lock (&mlock);    if (mquit) {return 0;    }//Is the sample ready?    Sample = Findsample (SampleID);        2015.06.06 Add for BEGIN if (sample! = 0) {int loopcounter = 15; while (loopcounter--> 0 && (sample->state ()! = Sample::ready)) {alogd ("Wait for the sample ready, SLE            EP 150ms ");        Usleep (150 * 1000); }}//2015.06.06 add for End if ((sample = = 0) | | (Sample->state ()! = Sample::ready))        {ALOGW ("Sample%d not Ready", SampleID);    return 0;    } dump ();    Allocate a channel Channel = allocatechannel_l (priority); No ChannEl Allocated-return 0 if (!channel) {ALOGV ("No Channel allocated");    return 0;    } Channelid = ++mnextchannelid;    ALOGV ("Play channel%p state =%d", channel, Channel->state ());    Channel->play (sample, Channelid, Leftvolume, Rightvolume, priority, loops, rate); return channelid;}
If the load thread is not ready sample->state ()! = Sample::ready, wait for 2.25s to play again

Android Manually press Power key lock, no lock screen beep, unable to restore the "single machine must be present"

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.