-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Conversation
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. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
I signed it |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
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)? |
Assigning to @andrewlewis because he may know about what wake locks are held anyway during playback (e.g. by the underlying |
@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. |
Sorry for the late answers.
I am sorry but it is not.
I think that is the idea. |
Added wifiLock, stayAwake method and improved code style
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. |
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). |
Added setWakeMode implementation that follows defalt MediaPlayer setWakeMode method implementation.