[AC-6117] Android Audio Media Player Stops from Android Doze Mode
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2019-03-14T17:48:00.000+0000 |
Affected Version/s | Appcelerator Studio 4.3.0 |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | lindsay@radioreference.com |
Assignee | Shak Hossain |
Created | 2019-01-30T17:38:32.000+0000 |
Updated | 2019-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.
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.
Hello, Did you find our last reply helpful for your progress? Let us know the updates from your end.
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...
[~jquick], This issue can be new feature request,not a bug. Any thoughts?
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.
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.
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.
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.