Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14152] Android: Sound resumes during the phone lock screen in Gingerbread devices

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-10T19:40:50.000+0000
Affected Version/sRelease 3.1.0
Fix Version/s2013 Sprint 12 Core, 2013 Sprint 12, Release 3.2.0
ComponentsAndroid
Labelsn/a
ReporterAllen Yeung
AssigneeAllen Yeung
Created2013-06-07T18:10:31.000+0000
Updated2014-06-19T12:43:24.000+0000

Description

Steps to reproduce: 1. Run the following code:
var win = Titanium.UI.createWindow({  
    title:'Audio Test',
    backgroundColor:'#fff',
    layout: 'vertical'
});

var audioPlayer = Ti.Media.createAudioPlayer({ 
    url: 'cricket.wav',
    allowBackground: false
});           
audioPlayer.start();
win.open();
2. Hit the power button to lock the phone 3. Hit the power button to go to the unlock screen Expected Result: The sound should not resume until you actually unlock the screen Actual Result: Sound resumes as soon as you reach the unlock screen

Attachments

FileDateSize
cricket.wav2013-06-07T18:10:31.000+000080923

Comments

  1. Allen Yeung 2013-06-07

    Another test case using sound instead of audio player:
       var win = Titanium.UI.createWindow({  
           title:'Audio Test',
           backgroundColor:'#fff',
           layout: 'vertical'
       });
       var player = Ti.Media.createSound({url:"cricket.wav"});
       player.play();
       win.open();
       
    The test steps are the same as the original ones mentioned.
  2. Allen Yeung 2013-06-07

    PR: https://github.com/appcelerator/titanium_mobile/pull/4366
  3. Lokesh Choudhary 2013-10-22

    Verified the fix. The sound stops when the phone is locked using the power button & again starts playing when we unlock the phone. Thus closing. Environment: Appcel Studio : 3.2.0.201310221639 Ti SDK : 3.2.0.v20131022050844 Mac OSX : 10.8.5 CLI - 3.2.0 with hash 72f7426b4ee6c2d2883c666d5b7e03906a16012f Device: Samsung Galaxy S4 running android 4.2.2 & Motorola droid running android 2.3.3

JSON Source