Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6117] Android Audio Media Player Stops from Android Doze Mode

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2019-03-14T17:48:00.000+0000
Affected Version/sAppcelerator Studio 4.3.0
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
Reporterlindsay@radioreference.com
AssigneeShak Hossain
Created2019-01-30T17:38:32.000+0000
Updated2019-03-14T17:48:02.000+0000

Description

The Titanium Android Audio Media player stops streaming in the background when the device is on battery power. This typically happens after about 5 minutes when the Android Doze power management system kills off the player. Adding the affected application as Power Management Exception disables this unwanted functionality. The steps to add the application as an exception are as follows: 1) Open Settings 2) Touch "Apps & Notifications" 3) Touch "Application_Name" 4) Touch "Advanced" 5) Touch "Battery" 6) Touch "Power-saving feature" 7) Touch "OK" at the pop up notification 8) Touch the "Apps" menu item at the top 9) Choose the Application_Name app checkbox to enable a power management exception The Titanium Android Audio Player, by default, needs to not be subject to halting by the Android Doze Mode capabilities.

Comments

  1. Sharif AbuDarda 2019-02-12

    Hello, Since this behavior is a native Android default behavior Titanium apps are supposed to behave like this. The audio player API just mimic a part of the native sound-related functionality. This is more like a request, not a bug. Thanks.
  2. Rakhi Mitro 2019-02-18

    Hello, Did you find our last reply helpful for your progress? Let us know the updates from your end.
  3. lindsay@radioreference.com 2019-02-18

    My understanding is that this is not correct behavior for the Android Media Player. It should be automatically excluded from the power management doze features...
  4. Rakhi Mitro 2019-02-19

    [~jquick], This issue can be new feature request,not a bug. Any thoughts?
  5. Joshua Quick 2019-02-19

    Google wants you to run a "foreground" service in this case, which will show a notification in the top status bar informing the end-user that your app is doing work in the background. As of Android 8.0, Google has made a breaking-change where the OS will throttle particular operations such as audio playback, sensor data collection, etc. while backgrounded unless you enable a foreground service. https://developer.android.com/about/versions/oreo/background As of Titanium 7.3.0, we've added "foreground" service support. Please see the code example below on how to implement it. https://github.com/appcelerator/titanium_mobile/pull/10076 Also note that you need to add the following Android permission in order to use a foreground service. This is required on Android 9.0 devices.
       <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
       
  6. Sharif AbuDarda 2019-02-19

    Hello [~lindsay@radioreference.com], As we said this is an Android native audio player behavior, and we will consider this as a feature request. But first, we need the native Android guide links of how this exception is achieved natively. After that, we will forward this to our engineering for consideration. Thanks.
  7. Rakhi Mitro 2019-03-04

    Hello, We haven't heard back from you since our last response. I am just following up to check the status of this case and if you need further help on it. 
  8. Rakhi Mitro 2019-03-14

    Hello, Did you able to find this issue resolved ? Let us know the current status of your issue and if you need further help on it.

JSON Source