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

Use alarm stream to play presets in Wake-up Timers #729

Merged
merged 6 commits into from
Jul 30, 2021

Conversation

ashutoshgngwr
Copy link
Member

@ashutoshgngwr ashutoshgngwr commented Jul 27, 2021

This PR proposes changes for allowing playback to be transferred to different audio streams in general. Wake-up timers are the only use-case where this behaviour is needed as of now.

Changes

  • Add methods to specify and change audio stream in PlayerManager
  • Add intent extra to specify audio stream in play preset action in MediaPlayerService
  • Use alarm stream to play presets in Wake-up timers
  • Revert audio stream to normal when the user stops the preset played by the wake-up timer

Testing

  • Tested on a physical device
  • Added or modified unit test cases

@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #729 (0d1871c) into master (4543fec) will decrease coverage by 0.15%.
The diff coverage is 77.03%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #729      +/-   ##
============================================
- Coverage     79.30%   79.15%   -0.16%     
  Complexity       15       15              
============================================
  Files            51       53       +2     
  Lines          2537     2576      +39     
  Branches        391      396       +5     
============================================
+ Hits           2012     2039      +27     
- Misses          271      285      +14     
+ Partials        254      252       -2     
Flag Coverage Δ
android 78.28% <77.03%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...shutoshgngwr/noice/fragment/WakeUpTimerFragment.kt 67.56% <0.00%> (+8.33%) ⬆️
...wr/noice/playback/strategy/CastPlaybackStrategy.kt 80.00% <0.00%> (-3.34%) ⬇️
...m/github/ashutoshgngwr/noice/MediaPlayerService.kt 84.48% <50.00%> (-0.27%) ⬇️
...thub/ashutoshgngwr/noice/playback/PlayerManager.kt 73.65% <67.85%> (-3.43%) ⬇️
...shutoshgngwr/noice/activity/AlarmRingerActivity.kt 72.22% <72.22%> (ø)
.../com/github/ashutoshgngwr/noice/playback/Player.kt 89.18% <75.00%> (-3.12%) ⬇️
...thub/ashutoshgngwr/noice/ext/SimpleExoPlayerExt.kt 89.65% <89.65%> (ø)
...m/github/ashutoshgngwr/noice/WakeUpTimerManager.kt 78.37% <100.00%> (-3.85%) ⬇️
...ashutoshgngwr/noice/playback/PlaybackController.kt 91.66% <100.00%> (+0.59%) ⬆️
...r/noice/playback/strategy/LocalPlaybackStrategy.kt 100.00% <100.00%> (+3.44%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4543fec...0d1871c. Read the comment docs.

@ashutoshgngwr ashutoshgngwr force-pushed the fix/wake-up-timer/audio-stream branch from d6880fc to f4d0043 Compare July 29, 2021 17:35
@ashutoshgngwr ashutoshgngwr force-pushed the fix/wake-up-timer/audio-stream branch from f4d0043 to 0d1871c Compare July 30, 2021 14:11
@ashutoshgngwr ashutoshgngwr merged commit 5800b1e into master Jul 30, 2021
@ashutoshgngwr ashutoshgngwr deleted the fix/wake-up-timer/audio-stream branch July 30, 2021 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant