Commit e32822e
Fix #13283: restore volume immediately on audio focus gain
Replace the ValueAnimator-based animateAudio() call in onAudioFocusGain()
with a direct player.setVolume(1.0f). The ValueAnimator relies on the
Choreographer/main thread rendering loop, which is throttled or suspended
when the app is backgrounded (especially with battery optimizations on
Android 12+). This left the volume stuck at 0.2f until the user foregrounded
the app. Also remove setWillPauseWhenDucked(true) since the app ducks
volume rather than pausing, aligning the declared intent with actual behavior
so the system reliably delivers AUDIOFOCUS_GAIN on newer Android versions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 9a292e3 commit e32822e
File tree
1 file changed
+1
-32
lines changed- app/src/main/java/org/schabi/newpipe/player/helper
1 file changed
+1
-32
lines changedLines changed: 1 addition & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| |||
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | | - | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
45 | | - | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| |||
100 | 95 | | |
101 | 96 | | |
102 | 97 | | |
103 | | - | |
104 | | - | |
| 98 | + | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
| |||
119 | 113 | | |
120 | 114 | | |
121 | 115 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | 116 | | |
148 | 117 | | |
149 | 118 | | |
| |||
0 commit comments