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

Fixes playback not resuming on gaining audio focus after a transient loss #222

Merged
merged 2 commits into from
Jul 10, 2020

Conversation

ashutoshgngwr
Copy link
Member

@ashutoshgngwr ashutoshgngwr commented Jul 10, 2020

Changes

  • Remove abandon audio focus call when playback is paused
  • Add a method to stop playback with a delay on indefinite paused
  • Fix Handler#removeCallbacks calls (wasn't working with Kotlin function references)

Testing

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

Others

Instead of abandoning audio focus request when playback is paused,
use two different methods. One simply pauses the playback and the
other schedules a callback to stop playback with one minute delay
in addition to pausing the playback.

resolves #219
calling Handler#removeCallbacks doesn't seem to work with Kotlin's
function references. An additional token can be used to ensure
that callbacks are removed when using function references.
@codecov
Copy link

codecov bot commented Jul 10, 2020

Codecov Report

Merging #222 into master will increase coverage by 0.05%.
The diff coverage is 96.55%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #222      +/-   ##
============================================
+ Coverage     84.40%   84.46%   +0.05%     
============================================
  Files            26       26              
  Lines          1199     1210      +11     
  Branches        142      142              
============================================
+ Hits           1012     1022      +10     
- Misses           91       92       +1     
  Partials         96       96              
Flag Coverage Δ Complexity Δ
#android 84.46% <96.55%> (+0.05%) 0.00 <0.00> (-12.00) ⬆️
#ui_tests 60.99% <41.37%> (-0.32%) 12.00 <0.00> (ø)
#unit_tests 39.14% <89.65%> (+0.48%) 0.00 <0.00> (ø)
Impacted Files Coverage Δ Complexity Δ
.../github/ashutoshgngwr/noice/sound/player/Player.kt 92.10% <87.50%> (-2.19%) 0.00 <0.00> (ø)
.../ashutoshgngwr/noice/sound/player/PlayerManager.kt 82.20% <100.00%> (+0.79%) 0.00 <0.00> (ø)
...ub/ashutoshgngwr/noice/widget/CountdownTextView.kt 83.78% <100.00%> (+0.45%) 0.00 <0.00> (ø)

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 09f0081...784ef10. Read the comment docs.

@ashutoshgngwr ashutoshgngwr merged commit 09d3708 into master Jul 10, 2020
@ashutoshgngwr ashutoshgngwr deleted the fix/issue/219 branch July 10, 2020 21:44
@ashutoshgngwr ashutoshgngwr added this to the 0.9.x milestone Jul 20, 2020
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.

Autoplay continue after interruption
1 participant