Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an update to the FindMyPhone plugin, attempting to make use of newer APIs to more correctly manage audio playback on newer Android releases. Highlights:
KDE Connect-wide
minSdkVersion
from14
to21
(To access more recent APIs w/o lots of legacy fallback.)WAKE_LOCK
to permissions requested in manifest file.FindMyPhoneActivity
AudioAttributes
to replace deprecatedSetAudioStreamType()
WAKE_LOCK
)MediaPlayer
asynchronously, andrelease()
when doneI'll be honest, I wrote this code working off of API docs and code samples, but I'm not supremely confident that it's all correct. It compiles with no problems, and I built and installed it as an APK on my Android
67 phone, where it worked just the same as the version installed from Google Play. However, running on Android67 means that most of the newer APIs (including Audio Focus) aren't accessed, and I don't have a newer device to test on. (Trying to run the app in an emulator failed, network-connectivity wise... I ended up with GSConnect trying to pair with itself.)So, I'm submitting this in case it might be useful, but I would be surprised if it doesn't need at least some cleanup. It certainly needs testing on newer devices, something I'm unable to do myself.