Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added setWakeMode implementation #5628

Closed
wants to merge 3 commits into from

Conversation

JonathanImperato
Copy link

Added setWakeMode implementation that follows defalt MediaPlayer setWakeMode method implementation.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@JonathanImperato
Copy link
Author

I signed it

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@ojw28
Copy link
Contributor

ojw28 commented Mar 14, 2019

I don't think this code does anything, since the lock is never acquired...

I'm also not convinced such a feature is necessary. What would you use it for, and why would you need the ability to pick the mode (even if a lock is necessary, wouldn't there always be a single "correct" mode to be using)?

@ojw28 ojw28 requested a review from andrewlewis March 14, 2019 11:34
@ojw28 ojw28 assigned ojw28 and andrewlewis and unassigned ojw28 Mar 14, 2019
@ojw28
Copy link
Contributor

ojw28 commented Mar 14, 2019

Assigning to @andrewlewis because he may know about what wake locks are held anyway during playback (e.g. by the underlying AudioTrack), and what the possible use cases for MediaPlayer.setWakeMode are.

@andrewlewis
Copy link
Collaborator

@JonathanImperato Is this related to #5536? Perhaps you could share your findings if you discovered a way to stop the process getting killed in the background.

I think #930 is still accurate regarding what wake locks are held by the system. I'll also follow up with the framework team to get more information about the reasoning behind including this in the framework player's API. It may be that it's just provided via the player API so that it can be acquired/released automatically depending on the state.

@JonathanImperato
Copy link
Author

I don't think this code does anything, since the lock is never acquired...

I'm also not convinced such a feature is necessary. What would you use it for, and why would you need the ability to pick the mode (even if a lock is necessary, wouldn't there always be a single "correct" mode to be using)?

Sorry for the late answers.
I thought about adding this feature because it easier for the user to create wakelock if they are managed by the library, also because some do not even know what WakeLocks are.

@JonathanImperato Is this related to #5536? Perhaps you could share your findings if you discovered a way to stop the process getting killed in the background

I am sorry but it is not.

I think #930 is still accurate regarding what wake locks are held by the system. I'll also follow up with the framework team to get more information about the reasoning behind including this in the framework player's API. It may be that it's just provided via the player API so that it can be acquired/released automatically depending on the state.

I think that is the idea.

Added wifiLock, stayAwake method and improved code style
@tonihei
Copy link
Collaborator

tonihei commented May 7, 2019

Based on the discussion above and the linked issues it seems that we are not planning to provide a method to acquire the wake lock because it's either done automatically by the system audio components or needs to be done by the app for very specific purposes.

I'll close for now. If you see a specific issue that needs to be solved, it's probably better to file a bug report or feature request first to simplify discussing independent of a concrete pull request.

@tonihei tonihei closed this May 7, 2019
@andrewlewis
Copy link
Collaborator

I've filed #5846 as I think there's value in handling acquiring/releasing the wake lock based on player state, but it will probably look different to this PR (I'm not sure yet that there is value in specifying a mode for the wake lock, for example).

@google google locked and limited conversation to collaborators Sep 27, 2019
@JonathanImperato JonathanImperato deleted the patch-1 branch January 26, 2021 10:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants